AI agent payments and x402· 1 of 4

Why an AI agent pays

Agents call paid web services. x402 lets them pay per request, with no account.

4 minEasy

Key points

  • An AI agent is a program that does tasks for you online.
  • x402 turns the unused HTTP 402 code into a way to pay.
  • The x402 Foundation runs the standard under the Linux Foundation.

The lesson

  1. An is a program that does tasks for you. It uses an AI model to decide what to do next. To get work done, it calls web services. Think of a weather feed or a search tool.

  2. Some of those services cost money. A person pays the old way. Sign up. Add a card. Buy credits. Keep a secret API key safe.

  3. An agent is a program, not a person. Filling out a form does not fit.

  4. is an open standard that puts the payment inside the web request itself.

    • The agent asks for the data.
    • The server answers with a price.
    • The agent pays and asks again.
    • The server sends the data.
  5. No account and no API key. A payment for each request, even a tiny one.

  6. The name comes from the web's own code, HTTP 402: "Payment Required".

Check yourself3 questions
1. What does an AI agent need before x402 to use a paid service?
2. What did HTTP say about the 402 code before x402?
3. Who runs the x402 standard today?
Next lessonThe 402 handshake