Payments for AI Agents: How They Work

Payments for AI agents are the protocols and infrastructure that let autonomous software spend money on API calls without human intervention. The agent holds a funded balance, discovers a paid API, reads its price, signs a payment, and receives the data, all in one HTTP cycle.

What it actually means

The defining trait is that the agent is the payer, not a person. This is not the same as pre-purchased credits. The agent authorizes the spend at call time, inside caps you set, which lets it call a service it never signed up for. One HTTP cycle covers discovery, pricing, payment, and delivery.

Why agents need their own rails in 2026

Today's APIs use keys tied to a human account and a credit card. Autonomous agents discover services at runtime and call them thousands of times per task, and monthly subscription tiers are a poor fit for that spiky, variable usage. Stablecoin settlement on Layer 2 chains like Base costs under $0.001 per transfer, which finally makes per-call payments practical.

How x402 turns HTTP into a payment channel

x402 revives the HTTP 402 status code as a real handshake. The server responds with a 402 and a JSON body naming the price, the currency (USDC), a destination address, and the chain. The agent's wallet signs a USDC transfer and retries with an X-Payment header. The server verifies, settles on-chain, and returns the response in one extra round-trip. No OAuth, redirects, or invoices are involved, and any HTTP client can be extended to support it.

Wallet-based vs managed-credit

In a wallet-based model, the agent's runtime holds a cryptographic wallet funded with stablecoins and signs payments directly, settling on-chain with transparent accounting. In a managed-credit model, a third party holds the balance and makes calls on the agent's behalf, which simplifies onboarding but centralizes trust. AgentCash uses the wallet-based model: you create a wallet, fund it with USDC, and the agent pays providers directly.

What AgentCash indexes today

AgentCash currently indexes one payment-protected origin spanning one API category, with 30 priced endpoints across it. The median price is $0.028 per call, ranging from $0.002 to $0.440 as of April 2026. The index is expected to grow as more providers adopt 402.

Getting started

Install the CLI with npx agentcash. It creates a local wallet and shows a funding address. Send USDC on Base, Solana, or Tempo. Once the balance confirms, every x402-protected API is callable with no further signup. For coding agents, install the MCP server into your agent config (Claude, Cursor, Claude Code) and it handles the full handshake. Set spending caps per session or task to bound autonomous spend.

Tradeoffs and limits

On-chain settlement adds a little latency, and each paid call adds one extra HTTP round-trip, which is negligible for most agent workloads. You hold USDC exposure, a different risk profile than a credit card. And the x402 ecosystem is early, so an agent that needs a non-x402 API still uses a traditional key for that one.

Reference: the x402 protocol site.

Frequently asked questions

Do these payments require the agent to hold a private key?

In a wallet-based system like AgentCash, yes: the runtime holds a key and signs payments directly, which keeps custody and accounting with you. Managed-credit platforms avoid the key by holding your balance for you, but that centralizes trust, so it is a tradeoff rather than a strict improvement.

What if an API does not support x402?

AgentCash only handles x402-compatible endpoints, so for an API that does not speak the protocol you still provision a traditional key separately. The x402 ecosystem is early and growing, and the index is expected to expand as more providers return 402 responses to the agents that call them.

How much does a typical call cost?

Across the 30 endpoints AgentCash indexes today, the median is $0.028 per call, with prices ranging from $0.002 to $0.440 as of April 2026. You always see the exact price in the 402 response before paying, so the agent can reject a call that exceeds your cap.

Put it into practice

AgentCash gives your AI agent a wallet to pay for any payment-protected API — no keys, USDC on Base.