Aflim Broohm

AI agents & payments

AI Agents, Stablecoins and x402: How Do Autonomous Payments Work?

Can a software agent purchase data, call an API or pay for computing power without a human payment flow? x402 offers one emerging answer, built around the Web and programmable payments.

Professional supervising a software agent purchasing access to a digital service
Original visual created for Aflim Broohm.

Artificial-intelligence assistants can already research information, summarise a document or suggest an action. AI agents add another step: they can use tools and execute certain tasks within a defined framework.

This development raises a practical question. If software needs to purchase data, access an API, rent computing power or activate a digital service, how can it settle the transaction without a form, manually entered card details or a subscription arranged in advance?

The x402 protocol explores this situation using the HTTP 402 “Payment Required” status code and programmable payments. Stablecoins play an important role in its first implementations, but they are neither the only possible infrastructure nor a guarantee of adoption.

The subject still sits at the boundary between available tools, experiments and future use cases. The aim is therefore to understand the mechanism without turning a technical innovation into a promised revolution.

An AI agent is more than an assistant

An assistant responds to a request. It helps a user understand, write or choose, but the person generally retains responsibility for the final execution.

An agent receives an objective, builds a sequence of steps, calls tools and can act within the permissions it has been granted. It might consult a database, compare offers, reserve computing capacity and then report the outcome.

The word “autonomous” needs to be used carefully. A software agent is not an independent economic actor. It acts on behalf of a person or organisation, using permissions, data and payment methods that must remain under control.

Why would software need to make a payment?

Purchasing a single piece of data

An application may need a precise weather record, a market price, an image, a document or a specialised search result. A per-request payment could charge only for the information actually used.

Accessing an API

An API provides a function to another piece of software: translation, analysis, verification, content generation or computation. An agent could discover the price when it makes the call, pay it and receive the answer without manually creating an account with every provider.

Renting computing power

Some tasks need temporary access to a model, graphics processor, storage or bandwidth. Pay-per-use may fit a short task better than a monthly subscription.

Activating a digital service

An agent might need to unlock content, start a verification, acquire a temporary licence or pay for another software service. In this machine-to-machine scenario, purchasing becomes part of the technical flow itself.

Why are accounts, subscriptions and API keys not always enough?

Customer accounts, subscriptions and API keys remain effective for a recurring relationship with a known provider. They organise identity, billing, quotas and support.

They become less convenient when an agent needs to use many services occasionally, discover a new provider or purchase a resource whose price changes with each request. Account creation, prepaid credits and the management of multiple keys then add extra steps.

Embedding payment in the request does not replace every one of these models. It adds a pay-per-use option that can be useful when the resource is standardised and the cost can be understood before execution.

The possible role of stablecoins

A stablecoin is a digital asset designed to track a reference currency, usually the dollar or euro. It can move across a blockchain and be transferred by software when a valid authorisation is available.

This infrastructure has several characteristics suited to machine-to-machine payments:

  • continuous availability
  • programmable settlement
  • the ability to pay small amounts
  • integration with the same environment as the application
  • a transaction record that the service can process.

A stablecoin does not remove risk. It depends on an issuer, network, wallet and sometimes a conversion provider. Compliance, accounting and error management are still required.

x402: bringing payment into the Web protocol

HTTP is the language a browser or software application uses to request a resource from a server. The 402 “Payment Required” status code exists to signal that payment is needed, but by itself it did not impose a complete, interoperable mechanism.

x402 standardises an exchange in which the server states its payment terms and the client supplies proof with a new request. Payment becomes part of the HTTP conversation.

The five-step flow

  1. The agent requests data or a service
  2. The server responds with a 402 status and the payment requirements in a PAYMENT-REQUIRED header
  3. The authorised wallet prepares the payment for the requested amount, asset and network
  4. The agent resubmits the request with proof in the PAYMENT-SIGNATURE header
  5. The server verifies and settles the payment, directly or through a facilitator, then returns the resource with an HTTP 200 response.

The server can also return settlement information in PAYMENT-RESPONSE. When used, the facilitator handles verification and settlement on the selected network. It does not relieve the seller of responsibility for pricing, access rules and incident management.

What is already real in 2026

x402 has an open specification, documentation, libraries and implementations that can protect APIs or content. Coinbase launched the protocol, and in July 2026 the Linux Foundation announced the operational launch of the x402 Foundation to provide open governance.

Documented uses include APIs billed per request, paywalled content, agent-to-agent services, microservices and certain computing resources. Developers can already build and test these flows.

This does not mean AI agents are making purchases at scale across the real economy. Most visible use cases remain concentrated on digital resources, pilots and young technical ecosystems.

Traditional payment networks are working on the same subject

Autonomous payments are not limited to Blockchain infrastructure. Visa distinguishes “macro commerce”, where an agent buys on behalf of a person, from “micro commerce”, where software pays for an API or computing resource.

In June 2026, Mastercard announced Agent Pay for Machines, an approach to machine-to-machine payments featuring authorisation rules, spending limits and several settlement methods, including cards, accounts and stablecoins. Mastercard also describes these use cases as being at an early stage.

Card networks provide widely deployed infrastructure for compliance, identity, disputes and protection. Stablecoins may suit certain programmable micropayments and continuous settlement. Multiple infrastructures can therefore coexist depending on the amount, country, service and expected level of protection.

The main risks to control

Payment authorisation and spending limits

An agent should never have an unlimited budget. Policies need to specify maximum amounts, frequency, approved suppliers, accepted assets and the situations that require human approval.

Fraud and manipulation

Malicious content may try to influence the agent or trigger an unjustified purchase. The agent needs to separate trusted instructions from external data and verify the destination, price and nature of the resource.

Errors and repeated payments

A network delay or incomplete response can trigger another attempt. The system must prevent duplicate payments, keep logs and provide a way to handle refunds or disputes.

Wallet security

The key or signing mechanism must not be exposed to the model. A wallet governed by policies, isolated keys and limited permissions reduces the impact of an error or compromise.

Responsibility and human control

It must be clear who is responsible for an incorrect purchase: the user, the business, the agent provider or the service seller. Sensitive decisions should remain explainable and reversible whenever possible.

Compliance and accounting

Technical convenience does not remove identity requirements where regulation demands them, sanctions controls, tax obligations or record-keeping. A business must be able to associate each payment with a purpose and an accountable owner.

What are the prospects for businesses?

The first useful model is unlikely to be an agent free to buy anything. More credible cases are narrower: an agent authorised to acquire certain data, use a catalogue of approved APIs or temporarily increase computing capacity.

A robust experiment can follow five steps:

  1. Select a precise digital service with measurable value
  2. Define the budget, approved suppliers and stopping conditions
  3. Test in an isolated environment with small amounts
  4. Log every request, decision, payment and outcome
  5. Compare the total cost with a subscription, conventional invoice or existing API integration.

The technology is useful only if it removes a real friction without creating disproportionate risk. For some businesses, payment automation may simplify access to digital resources. For others, a conventional contract and API key will remain simpler.

What to remember

x402 shows how a payment requirement can be embedded directly in a Web request. Stablecoins currently offer one programmable route for settling certain services, while traditional payment networks are developing their own authorisation models for machines and agents.

The infrastructure is progressing, but adoption remains emerging. Agents should not be mistaken for independent buyers, and payment should never be separated from authorisation, security and accountability.

The value of autonomous payments will depend less on automation itself than on system security, user control, the usefulness of the services purchased and real adoption by businesses and providers.

Assess an autonomous-payment use case

Would you like to understand x402, stablecoins or the controls required for a software agent? A course or workshop can connect the protocol with a practical requirement without confusing an experiment with a deployment.

Take the next step

Automate only what can be controlled

A practical learning format that separates protocol, payment and governance.

Discuss a use case

Frequently asked questions

Is x402 a blockchain?

No. x402 is a payment protocol built into HTTP. It can use different settlement infrastructures and is designed not to depend on one particular blockchain.

Must an x402 payment use a stablecoin?

Early implementations make extensive use of stablecoins, but the architecture is designed to be extensible. The x402 Foundation describes support ranging from card networks to stablecoins.

Can an AI agent directly control a wallet?

It can trigger a payment through an authorised wallet, but keys and spending policies should remain isolated from the model. Limits and human approval remain essential.

Does x402 replace subscriptions and API keys?

No. It adds a per-request payment option. A subscription or API key is often better suited to a stable, recurring relationship.

Are autonomous payments ready for every business?

No. Tools and pilots exist, but adoption remains emerging. Deployment should begin with a limited scope, clear policies, logs and responsibilities.

Sources and verification

  1. x402: official protocol website
  2. x402 Docs: introduction and use cases
  3. Coinbase Developer Platform: how x402 works
  4. Linux Foundation: operational launch of the x402 Foundation
  5. Visa: agentic payments from the ground up
  6. Mastercard: launch of Agent Pay for Machines