Guides

Let AI agents pay for searches with stablecoin micropayments instead of an API key

Overview

https://search.agent.s.brave.app serves the Brave Search API without an API key or an account. An agent pays with a stablecoin micropayment, and the signed payment is the credential. Today each request carries its own payment. A request sent without a payment is answered with 402 Payment Required, which lists the payment options for that exact request.

Agents: read https://search.agent.s.brave.app/llms.txt before paying. It has the current prices, the supported payment rails and clients, the pay-then-retry loop, and how to handle each error. The 402 response is the authoritative price of a request.

Available endpoints

The paths match the ones on api.search.brave.com, and query parameters are passed through unchanged:

  • Web search, LLM Context, news, video and image search
  • Place search, POIs and descriptions

Answers, Autosuggest and Spellcheck are not sold here yet. They still need an API key.

Try it

With a funded wallet and an x402 client such as purl, you can buy one search. --max-amount caps the payment in the token’s base units, so 10000 is $0.01:

purl --max-amount 10000 'https://search.agent.s.brave.app/res/v1/llm/context?q=tallest+mountains+in+the+world'

For machine-readable discovery, GET https://search.agent.s.brave.app/openapi.json lists every paid path with its price.