Independent AI intelligence Two editions daily · ET
Fervor AI

Analysis · November 13, 2026 · concept

Brave Search APIx402purlagent-paymentsagent-infrastructureagent-security

Your AI Agent Can Now Pay for Its Own Search, One Query at a Time

Brave dropped the API key for a $0.005 payment. Here is how the 402 loop works, how to cap the spend, and what the docs still leave out.

Almost every tool an AI agent touches still starts with a human filling out a form. Someone signs up, adds a card, copies an API key into an environment variable, and hopes nobody pastes it into a public repo. That ritual made sense when one developer called one API. It fits badly when a single coding agent spins up a dozen subagents that each want to search the web.

On November 12, Brave removed the form. Its Search API now answers agents that pay per request with no account and no API key. The price is $0.005 a query, paid in USDC (a stablecoin pegged to the US dollar) on Base (a low-fee blockchain network run by Coinbase), so every payment lands on a public ledger anyone can read, which is what "on-chain" means.

The result is a different kind of credential. The thing that gets your agent through the door is no longer a secret string tied to your account. It is a signed payment for exactly one search. That changes what you need to protect, and it changes how you set limits. Put simply, your agent's permission is now the size of its wallet.

What Brave shipped

Brave runs a separate front door for agents at search.agent.s.brave.app. According to the agent payments guide, it serves the regular Brave Search API "without an API key or an account," and its paths match the ones on the normal API host.

The launch post puts LLM Context, Brave's endpoint built to feed search results into a model's prompt, at $0.005 per request, or $5 per 1,000. Web, news, image, video and local search cost the same. A few pieces are left out: Brave's llms.txt, the plain-text guide it publishes for agents, says Answers, Autosuggest and Spellcheck are not sold this way. Autosuggest and Spellcheck cost less than the fee for settling one payment, so they would lose money.

The payment method is x402, an open protocol that revives an HTTP status code most developers have never seen in the wild: 402, Payment Required. It sat mostly unused for decades. Now it has a job.

How the 402 loop works, in plain terms

Think of a parking garage that prints the price on the gate. You pull up, the gate shows the price, you tap your card, and the gate lifts. You never opened an account with the garage.

x402 works the same way, over HTTP. Brave's llms.txt describes four steps:

  1. The agent sends a normal search request with no payment attached.
  2. Brave answers with a 402 and an empty body. The price and payment details sit in a response header called Payment-Required.
  3. The agent signs a USDC payment for that exact amount and retries the identical request, with the signed payment in a Payment-Signature header.
  4. Brave runs the search, settles the payment, and returns results with a receipt in a Payment-Response header.

Two details matter more than they look.

First, the order of events protects you. Per llms.txt, Brave verifies the payment (which moves no money), then runs the search, then settles. In its words, "A failed search is never charged, and a result you receive always means the payment settled." If Brave's side errors out, you retry for free.

Second, there is no session. llms.txt says plainly: "There is no session, no credit balance, and no top-up." Each request carries its own payment, and a price offer stays valid for 300 seconds. Nothing accumulates on Brave's side for an attacker to drain. The money sits in your agent's wallet until the moment a search actually runs.

The real shift: your boundary moves from identity to budget

With a normal API key, the question a provider asks is "who are you?" Your key maps to your account, your account has a plan, and the plan has a quota. If the key leaks, whoever holds it spends from your account until you notice and rotate it.

With x402, the question becomes "can you pay for this one thing?" Brave does not need to know who you are, only that the payment is valid. That is good for privacy and good for agents that come and go. It also means Brave has no account-level brake to pull on your behalf. Your brakes live in the wallet.

So the security work moves. You stop worrying about a leaked key that can be replayed forever, because each payment is good for one request and a used payment is refused. You start worrying about the wallet's private key and its balance, because anyone holding that key can pay for anything, at Brave or anywhere else that accepts USDC on Base.

That is the mental model worth keeping: a pay-per-call agent's real permission is the size of its wallet. If you would not hand the agent $500 in cash, do not put $500 in its wallet.

It also makes budgets easy to reason about. At $0.005 a search, a research agent that runs 40 searches per task spends $0.20 per task. Run that 1,000 times in a month and you have spent $200. You can fund the wallet with exactly that, and the agent stops when the money does.

Put this into practice

Brave's own examples use purl, a command-line tool from Stripe that works like curl but handles payment requests. The purl README describes it as "Designed for humans and agents alike." Here is the shortest path to a first paid search.

1. Install purl. On a Mac with Homebrew:

brew install stripe/purl/purl

From source, it needs Rust: git clone https://github.com/stripe/purl, then cargo install --locked --path cli.

2. Create a wallet just for this. The purl README recommends "a wallet dedicated for usage with purl." Do that. Never point an agent at a wallet that holds anything else.

purl wallet add
purl balance

3. Fund it with a small amount of USDC on Base. The launch post says to "transfer USDC stablecoin to your agent's wallet via the Base network." Start with a few dollars. A dollar buys 200 searches.

4. See the price before you pay. purl's inspect command and --dry-run flag show what a request will cost without paying:

purl inspect 'https://search.agent.s.brave.app/res/v1/web/search?q=rust'
purl --dry-run 'https://search.agent.s.brave.app/res/v1/web/search?q=rust'

You can also read every paid path and its price from https://search.agent.s.brave.app/openapi.json, which the guide says "lists every paid path with its price." Treat that list as a menu, not a contract: the guide says the 402 response itself is the authoritative price for each request.

5. Run one search with a hard cap. Brave's llms.txt gives this command:

purl --max-amount 5000 'https://search.agent.s.brave.app/res/v1/web/search?q=rust'

Prices are in base units of a six-decimal token, so 5000 is $0.005, the price of exactly one search. If Brave ever asked for more, purl would refuse to pay. One catch: purl's README does not mention --max-amount, though its CLI source defines it, so run purl help to confirm your installed version has it. purl also has --confirm, which asks you before every payment. Use that while you are testing.

6. Check the receipt on-chain. llms.txt notes that purl "Does not print the Payment-Response receipt; look the transfer up on the chain." Your bookkeeping now lives on a public ledger, not in a dashboard.

Once that works by hand, wiring it into an agent is mostly plumbing. Give the agent a tool that shells out to purl with a fixed cap, and keep the wallet small. A minimal Python version looks like this:

import subprocess, urllib.parse

MAX_PER_CALL = "5000"  # base units, $0.005: one search, never more

def brave_search(query: str) -> str:
    url = ("https://search.agent.s.brave.app/res/v1/llm/context?q="
           + urllib.parse.quote_plus(query))
    result = subprocess.run(
        ["purl", "--max-amount", MAX_PER_CALL, url],
        capture_output=True, text=True, timeout=60,
    )
    if result.returncode != 0:
        return f"search failed: {result.stderr.strip()[:200]}"
    return result.stdout

Notice what the agent never sees: a key, a wallet secret, or a price it can raise. The model asks for a query. Your code decides the ceiling. If the agent loops, the wallet empties at a rate you picked, not one the model picked.

The cap per call and the balance per wallet are your two limits. Set both before you set anything else.

Honest limitations

This is a first version, and the docs say so in places.

One rail only. Today it is USDC on Base. The launch post says other networks and stablecoins are "incoming soon," with no date.

Gas is free for now. Brave says Base transaction fees "will be covered for a limited time." It does not say how long, or what the cost will be after.

Rate limits are undocumented. Brave's rate-limiting guide covers plan-based limits for API-key accounts only. Neither it nor the agent docs say what limits apply to wallet-paid calls. Do not assume the plan numbers carry over.

Privacy terms are thin. "No account" means Brave does not ask for a name or a signup. That alone does not make your requests anonymous. The docs do not say what request data Brave keeps, and every payment is visible on a public blockchain.

You are now holding crypto. For some teams that is a non-starter, for reasons that have nothing to do with code: finance approval, custody rules, tax handling. A $5 test wallet is easy. A fleet of agent wallets is an operations project.

Not every endpoint is for sale. If your agent depends on Answers or Autosuggest, you still need an API key for those.

Where this leaves you

Brave is one search provider, and x402 is one protocol. The pattern is bigger than either. Tools are starting to treat the agent itself as the customer, priced per call, with no human signup in the loop.

You get to decide how much rope your agents get. A wallet with $5 in it and a one-search cap per call is about as safe as an agent tool gets right now. Try that first. Then decide, with real numbers from your own runs, whether the per-query price beats the monthly plan you already have.

Sources: Brave launch post, Nov 12, 2026; Brave agent payments guide; Brave x402 proxy llms.txt; Brave rate-limiting guide; stripe/purl README. All read November 13, 2026.