Skip to navigation

Agent payments

Understand how AI agents complete payments before your API delivers a paid product, service or action.
View as Markdown

How agent payments work

When an AI agent uses a paid operation, Mitu handles the payment before your API is asked to fulfil the request.

Sequence diagram with three participants: AI Agent, Mitu and Your API. The agent calls a paid tool. Mitu replies with 402 Payment Required and the accepted methods. The agent completes the payment. Mitu processes and confirms it, then sends the request with the payment confirmation to Your API. Your API verifies Mitu, processes the request, and returns the result through Mitu to the agent.
Mitu completes the payment before your API is asked to do any work.

The agent first attempts the paid operation and receives a payment requirement describing what must be paid and the methods available. The agent completes the payment using one of those methods, and Mitu confirms the payment before sending the request to your API.

Once payment is confirmed, your API receives the request together with payment context and a verification signature. Verify that the request came through Mitu before delivering the product, service or action, then process it using your existing business logic and return your normal API response.

See Request verification for the verification process.

An Agent Wallet is not required

An AI agent does not need a Mitu Agent Wallet to pay your business. Agent Wallets are a separate capability for businesses that want to give their own customers wallets their AI agents can spend from.

Payment methods

Mitu supports agent payments through x402 and MPP. These protocols determine how the agent satisfies the payment requirement, while your API continues to work with the same paid operation regardless of which supported method the agent uses.

x402 supports USDC payments on Base. MPP supports crypto and card-backed agent payment flows, depending on the payment method available to the payer.

You choose which supported payment methods are available for the paid operation. The agent can then use a method it supports without your backend implementing a separate payment integration for each protocol.

Pricing

Pricing belongs to the operation being called rather than the agent making the payment. You can configure an operation with the pricing model appropriate for the product or service you provide.

For a fixed-price operation, the amount is known before the agent attempts to pay. For dynamic pricing, your API determines the amount from the request before payment takes place. Other pricing models can support different usage patterns where appropriate.

See Pricing for supported pricing models and the complete pricing flow.

Requests after payment

Payment confirmation and fulfilment are separate parts of the transaction. A successful payment means the agent has satisfied the payment requirement, but your API still needs to process the request and deliver the expected result.

When Mitu sends the paid request to your API, verify the request before doing any paid work. After verification succeeds, process it using the same business logic your application already uses and return the normal result.

For operations that create orders, bookings or other side effects, handle requests idempotently so a repeated delivery does not create the same result twice.

See Request verification for verifying requests from Mitu.

Paying with an Agent Wallet

An Agent Wallet can be one source of funds an AI agent uses when making a payment. Agent Wallets belong to customers and let their AI agents make permitted payments on their behalf, subject to the controls configured for the wallet.

When an agent receives a supported payment URL, it can pass that URL to Mitu’s pay tool and use an Agent Wallet available to the connected customer. Mitu checks the wallet, applies the configured controls and completes the payment when it is permitted.

The agent does not receive wallet keys, withdraw funds or take ownership of the wallet. It only uses the wallet for supported payments on behalf of the customer.

See Wallet tools for the current pay tool schema and Build agents that can pay for the complete agent-side journey.

A payment can complete successfully even if your API is unable to fulfil the request afterwards. Treat payment state and fulfilment state separately so your system can distinguish between money received and work successfully delivered.

If fulfilment fails after payment, do not ask the agent to make the same payment again. Use the original paid request to determine the appropriate next action, such as retrying fulfilment, resolving the failure or refunding the payer where necessary.

Design paid operations so fulfilment is reliable and repeated requests can be handled safely.

Settlement

Payments you receive from AI agents are added to your Mitu balance. How the agent completed the payment does not change how your business receives or settles the resulting funds.

From your balance, you can settle funds to a supported bank account or withdraw them to an onchain address.

Learn more about Settlement.