Brave x402 Removes API Keys for Agent Search and Puts Spend Control on Your Side
OpenAI and Brave shipped two opposite answers to agent payments within 24 hours. On November 12, Brave added x402 micropayments to its Search API so agents can buy web results for $0.005 in USDC on Base with no account o
OpenAI and Brave shipped two opposite answers to agent payments within 24 hours. On November 12, Brave added x402 micropayments to its Search API so agents can buy web results for $0.005 in USDC on Base with no account or API key. On November 13, OpenAI launched ChatGPT Wallet with American Express, Mastercard, and Visa, keeping tokenized card numbers and requiring Face ID or a fingerprint scan before every purchase.
If you wire web search into coding or research agents, Brave's release forces a concrete choice. Should you drop API keys for per-request x402 wallets, or keep static keys behind your own proxy?
How Brave's x402 search proxy runs
The endpoint lives at https://search.agent.s.brave.app, documented in Brave's agent payments guide and llms.txt.
Every call runs a stateless HTTP 402 handshake:
- Send a plain
GETorHEADrequest without credentials. - Brave returns
402 Payment Requiredwith an empty body and a base64 JSON offer in thePayment-Requiredheader (valid for 300 seconds). - Your client signs the exact USDC offer on Base (
eip155:8453) and retries the same URL with aPayment-Signatureheader. - Brave's facilitator verifies the signature first, runs the search, and settles the transfer. Upstream failures (
502) are not charged, and successful calls return a receipt inPayment-Response.
Sending an Authorization header next to Payment-Signature returns a 400, and legacy x402 v1 X-Payment headers are ignored.
Brave's docs point to Stripe's purl CLI wallet for a quick test:
purl --max-amount 5000 'https://search.agent.s.brave.app/res/v1/web/search?q=rust'
Because USDC uses six decimals, 5000 base units is $0.005 ($5 per 1,000 queries) across eight endpoints, including web search, LLM Context, news, video, images, and local search. Brave covers Base gas fees for a limited time.
Three protocol limits documented in llms.txt
Brave's llms.txt lists three Search API endpoints that cannot run on search.agent.s.brave.app yet, and those exclusions show where x402 runs into practical limits.
Answers (/res/v1/chat/completions) bills per query plus per output token. A static 402 challenge has to quote an exact price upfront before running the request, so variable token billing does not fit.
Autosuggest and Spellcheck cost less per query than the facilitator's on-chain settlement fee. Sub-cent calls have to wait until clients and facilitators batch multiple queries into one settlement.
There is also no session state or prepaid credit balance. Each request carries its own payment and each receipt covers one response. Even purl omits the Payment-Response header in stdout, so verifying transfers falls back to checking Base on-chain unless you build a custom client wrapper.
Moving the spend boundary into the agent
API keys keep authentication and spend limits in the vendor's dashboard. When a key leaks, you revoke it. When an agent loops on a broken search call overnight, a server-side rate limit or monthly budget stops the charge.
With x402, the signed payment is the credential. Passing --max-amount 5000 to purl caps a single HTTP call, yet an autonomous retry loop can still execute thousands of valid $0.005 requests back to back. Put an unlocked Base wallet in the same environment as an untrusted prompt or buggy tool wrapper, and runaway loops turn directly into settled USDC transfers. Once Brave's temporary gas subsidy expires, transaction fees also return to the per-query math.
When to use x402 vs. an API key proxy
Pick search.agent.s.brave.app for disposable CLI scripts or standalone developer utilities where forcing users to sign up for a vendor account and export an API key breaks onboarding. Keep the blast radius bounded by funding a dedicated hot wallet with $2 in USDC for that run and enforcing a hard call counter in your tool wrapper outside the model's context.
Stick with static API keys behind an internal proxy for production agent fleets. You keep variable-token and sub-cent endpoints, avoid 402 challenge round-trips, get clean per-tenant spend logs, and keep one server-side kill switch when a loop goes sideways.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.