Learn / updated 2026-10-03
What is x402? HTTP 402 payments for APIs and AI agents
x402 is an open protocol that uses the HTTP status code 402 Payment Required to let a client pay for a single API call. There is no sign-up, no subscription and no API key: the server answers with a price, the client pays, and the server delivers the result.
How a call works
- The client sends a normal request, for example
GET /v1/iban-validate?iban=…. - Without payment, the server answers 402 and describes what it accepts: the amount, the asset (USDC), the network and the receiving address.
- The client signs a payment for exactly that amount and sends the request again with the payment attached.
- The server checks the payment, runs the call and returns the result.
On networks such as Base and Polygon the client signs an authorisation and a payment service (a facilitator) submits it, so the client does not need a gas token. Solana is supported as well.
Why it matters for AI agents
An agent that needs one answer once does not want to open an account, store a key and pick a plan. With x402 the price is part of the response, so the agent can decide to pay, compare prices or skip the call. For data providers it means no billing system: a call is paid when it is made.
What to look for as a buyer
- Failed calls: a good x402 API does not charge when the call fails. Ambolt never charges for a failed call.
- A free try: you can see the protocol without paying. Add
free=1to an Ambolt endpoint for one free call per tool and IP address per day. - Clear prices: the price is in the 402 response and in the OpenAPI description of the API.
Frequently asked questions
Is x402 a cryptocurrency? No. It is a protocol. Payments are made in a stablecoin such as USDC, but the protocol itself only defines how the price and the payment travel over HTTP.
Do I need a wallet? To pay, yes: the client signs a payment from a wallet that holds a little USDC. To look at prices and try a call, no.
Which libraries support it? Client libraries exist for JavaScript and Python; the Ambolt SDKs work with any x402-capable fetch.
See how it looks in practice in how an agent pays per call, or try an IBAN check for free.
Related
- IBAN Validator: API reference
- CPV codes and OCDS explained: how public tenders are described
- How EU VAT number validation works (VIES explained)
- What is an LEI (Legal Entity Identifier)? Format, use and lookup
- What is KYB (Know Your Business)? Checks, data and limits
- All tools and prices
Informational only, not financial, legal or tax advice.