Learn / Buyers

How an AI agent pays with x402

An agent that can pay can use any x402 API it finds, without waiting for a human to sign up. Here is what it needs.

What the agent needs

The loop

  1. Call the endpoint.
  2. On 402, read the PAYMENT-REQUIRED header and choose an entry the wallet can pay.
  3. Check the price against the budget.
  4. Sign and retry with PAYMENT-SIGNATURE.
  5. Keep the PAYMENT-RESPONSE receipt with the result.

Before paying a stranger

Check what you are paying for. A listing's probe-pass grade shows whether a current v2 client can actually pay it, and SolvScore gives agents a credit file you can read for free.

Common questions

Can an AI agent pay for an API by itself?

Yes, with x402. It reads the price from the 402 response, signs a USDC payment from its own wallet and retries.

How much USDC should an agent wallet hold?

Only what you are willing to let it spend. A small, capped balance is the simplest spend limit.

What if the agent pays and gets no answer?

On facilitators that settle after delivery, including ours, a failed response is not charged.

Keep reading

x402 vs API keys and subscriptionsx402 payment refusal codes and fixesx402 on BaseAll x402 guides
See what our facilitator supports
LearnDocsSettlement policyEndpoint report