다시는 API 키를 얻을 필요가 없다면 어떻게 될까요?

hackernews | | 💼 비즈니스
#api 키 #openai #val town #개발자 경험 #개발자 플랫폼 #팁
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

개발 플랫폼 Val Town의 설립자는 코드 작성보다 API 키를 발급받고 결제 수단을 등록하는 데 더 많은 시간이 소요되는 문제를 지적하며, 이를 해결하기 위해 코인베이스가 2025년 5월에 공개한 'x402' 프로토콜을 주목했습니다. 기존 HTTP 상태 코드 402(결제 필요)를 확장한 이 프로토콜은 사용자가 웹사이트에 가입하거나 API 키를 발급받을 필요 없이, 블록체인을 통해 1회성 암호화폐 결제(예: 0.001달러)만으로 유료 API를 즉시 사용할 수 있게 해줍니다. 지갑 생성 및 USDC 충전에 약 10~20분이 소요되는 불편함은 여전하지만, 단 한 번의 지갑 설정으로 전 세계 모든 API를 자동으로 결제하며 사용할 수 있는 'API용 직불카드'처럼 작동한다는 점에서 AI 코딩 에이전트 시대에 매우 이상적인 해결책으로 평가받고 있습니다.

본문

I care a lot about developer experience, so it kills my soul to watch someone get an API key. I'm the founder of Val Town, a developer platform, so I spend a lot of time watching people run into this. In the age of vibe coding, getting API keys is particularly egregious. It takes your agent 5 minutes to write the code, but takes you 30 minutes to get the key. Most of the time of making an app is getting API keys! The worst part is that before you can try an API, you usually have no idea: You're at the mercy of the provider, and you just pray they care about developer experience. This problem has bothered me enough that we've tried our best to route around it at Val Town. The easiest workaround is to push users towards free APIs that don't require keys, like open-meteo for weather. For premium APIs, we've created a series of hosted proxies that give users a taste of the API without needing a key. We call this our "Standard Library", and it includes sending emails, OpenAI, Blob Storage, and SQLite. We're also experimenting with a proxy for Clay (for enrichments), and in the past had a Twitter proxy. But that puts Val Town in the unenviable position of rate-limiting, fighting abuse, etc, in an ad-hoc way. It's annoying and doesn't scale. The dream is: Think "OpenRouter for everything. But as a protocol". Surprise! It already exists. It's called x402. And yes, unfortunately, this is the part where I tell you it has to do with crypto. I regret to inform you that we may have found a real use-case for crypto. x402 is a new protocol created by Coinbase in May 2025 for making paid HTTP requests. It's built on top of the pre-existing 402 HTTP status code, Payment Required . Any HTTP API server can now optionally support x402 by returning 402 Payment Required , explaining the price, and what crypto wallet to send payment to. The client can then make a payment on the blockchain, and retry the request with the proof of payment. The server verifies the payment, and release the premium API response. sequenceDiagram participant Client participant Server participant Blockchain Client->>Server: HTTP Request Server->>Client: 402 Payment Required Client->>Blockchain: Payment Blockchain->>Client: Payment Confirmed Client->>Server: HTTP Request (with proof of payment) Server->>Client: HTTP Response The code is elegant. You add your wallet's private key to your env vars, and then wrap your fetch with the x402 client. The SDK takes care of the payment flow for you. const signer = privateKeyToAccount(process.env.PRIVATE_KEY); const client = new x402Client(); registerExactEvmScheme(client, { signer }); const paidFetch = wrapFetchWithPayment(fetch, client); const res = await paidFetch( "https://x402.browserbase.com/browser/session/create", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ duration: 5 }), }, ); You can think of it as attaching a wallet to fetch for it to autopay for premium requests. This is the dream. We can make a paid a API request without ever going to that API's website, signing up, getting an API key, attaching a credit card, etc. In the above example, we're just showing up to Browserbase with a penny, and they are giving us a websocket URL to a 5-minute browser session. Once I was able to make paid requests, I wanted to see how hard it was to accept payments. In theory, because it's a protocol, not an app store, it should just be a couple lines of code to hang my shingle, and accept payments into the same wallet I created to make payments. So I made the world's most expensive Math.random() . If you show up with a tenth of a penny, I will give you a random number. const seller = privateKeyToAccount(process.env.PRIVATE_KEY); const payTo = seller.address; app.use( paymentMiddleware( { "GET /api/random": { accepts: { scheme: "exact", price: "$0.001", network: "eip155:8453", // Base payTo, }, description: "A premium random number", mimeType: "application/json", }, }, resourceServer, ), ); app.get("/api/random", (c) => c.json({ random: Math.random() })); If you want the full walkthrough, including the wallet setup and all the rough edges, I made a video version. Now, to be clear, the getting a wallet and adding USDC is still not great. It took me an annoying 20 minutes the first time, and even the second time, when I knew what I was doing, it still took 10 minutes. But the shape of this feels right. And, importantly, this is a one-time cost and it should unlock all the world's APIs from this single private key. It's like I got a debit card for APIs and now I can walk into any API store and swipe it immediately without first pre-registering. I think the end state looks something like this: The beauty is you don't even have to know about which APIs are being used anymore, because you don't have to click around in a web browser to get API keys. Your agent can just start making paid requests to prototype with any API that supports x402. We need more sellers on x402. I'm honestly co

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →