Payment mandates for SaaS: how AI agents pay recurring bills without asking permission every time
You run a SaaS that charges API usage in USDC. An AI agent calls your endpoint every hour. The first payment goes through fine. The second time, the agent asks the human "can I pay $0.03 for another 1000 tokens?" and the human has to click approve. Day two, same question. Day three, the user stops responding and your SaaS stops getting paid.
This is the problem CAI payment mandates solve. One setup. No per-charge confirmations. The agent pays within the limits you define and the user sets.
How a payment mandate changes the flow
Without a mandate, every agent payment is a two-step conversation. The x402 prepare shows requires_user_confirm: true, the agent asks the human, the human says yes, x402 execute goes through with user_confirmed: true. That works for one-off purchases. It breaks for recurring SaaS billing.
With a mandate, the user creates a payment mandate once at cai.com/app or through the API. They set:
- The merchant domain (your SaaS host)
- A daily cap in USD (say $200/day)
- A max per-payment limit (say $20 per charge)
- An expiry time (say 30 days)
After the user approves it through a hosted verification page, the mandate status becomes active. From that point, the agent calls x402 payment prepare, the platform sees an active mandate covering the merchant domain and amount, and requires_user_confirm returns false. The agent calls x402 payment execute with user_confirmed: false, and the payment goes through. No human in the loop.
The API calls end to end
Step one. The user creates the mandate:
POST https://api.cai.com/functions/v1/payment-mandate-create Content-Type: application/json Authorization: Bearer *** The body defines the guardrails:
{ "merchant_domain": "api.your-saas.com", "daily_cap_usd": 200, "max_amount_per_payment_usd": 20, "allowed_resource_patterns": ["/v1/chat/completions"], "expires_in_hours": 720 } Step two. The user approves the mandate through the hosted verification page. The agent polls GET /payment-mandate-status to confirm the status is active.
Step three. When the SaaS sends an x402 challenge, the agent calls:
POST /x402-payment-prepare Content-Type: application/json Authorization: Bearer *** { "resource_url": "https://api.your-saas.com/v1/chat/completions", "merchant_domain": "api.your-saas.com", "recipient_address": "0xYourSaaSAddress", "amount": "5", "chain": "ETH", "token": "USDC" } The response skips the confirm step. requires_user_confirm is false because the active mandate covers this merchant, domain, and amount.
Step four. The agent executes:
POST /x402-payment-execute Content-Type: application/json Authorization: Bearer *** { "attempt_id": "the_attempt_id_from_prepare", "user_confirmed": false } The custodial transfer goes through. The SaaS gets paid. No one had to click anything.
What the mandate protects
Two safety mechanisms stop runaway spending. The daily cap limits total spending per day across all payments on that mandate. If the agent hits the $200/day cap, x402 payment prepare returns requires_user_confirm: true again, and the agent must ask the human. The max per-payment limit prevents a single large charge from draining the wallet.
New recipients also trigger a confirmation. If the merchant domain changes or the recipient address is new, the mandate does not cover it and the human sees the payment details before approving.
The mandate system is CAI-native, not a full W3C/AP2 credential implementation. The gap ID is GAP_PAYMENT_MANDATE_V1 and the status is partial live. For card or PSP checkout flows, use hosted actions instead of x402.
Why this matters for SaaS products
A SaaS that needs human approval on every microtransaction loses conversions. The user stops approving after the third notification. The agent stalls. Revenue drops. Payment mandates flip this. The human sets the guardrails once, the agent operates within them, and the SaaS gets paid reliably.
The same mandate covers multiple SaaS products. A user running three AI agents can have one mandate per service, each with its own daily cap. The agents route through x402 without the user ever seeing a payment prompt until a mandate limit is reached.
Setting up your SaaS as a mandate merchant
Your SaaS needs to implement the x402 challenge. When an agent calls your paid endpoint, return HTTP 402 with a JSON body containing the payment challenge fields: recipient_address, amount, chain, and token. The agent's x402 payment prepare parses this and routes through CAI.
That is the entire server-side change. You do not need a merchant account, you do not need a payment processor redirect, and you do not need to handle chargebacks. The custodial transfer delivers USDC to your address on the same chain.
The CAI skill at https://cai.com/skill.md documents every endpoint and parameter. The capabilities page at https://cai.com/capabilities.html shows the live, partial live, and planned status of every feature.