Introduction
AgentPay is the payment layer for AI agents. It gives agents managed wallets and automatic handling of 402 Payment Required—so your agent code can call paid APIs with a single get(url) while AgentPay handles payment and retry. Think of it as Stripe for AI agents: identity, wallets, and payment flows without you wiring gas or key management into your application.
What is x402?
x402 is an HTTP-based payment protocol. When an API requires payment, it returns the standard status code 402 Payment Required and includes structured payment requirements in headers—amount, asset, destination (payTo), and network. Clients that support x402 (such as AgentPay's SDKs) decode these requirements, perform the payment via a facilitator, and retry the request with a payment signature. AgentPay implements this flow so your agents can pay and get paid without you implementing wallet logic or on-chain calls yourself.
What AgentPay provides
- Managed wallets — Create and fund wallets via API. One API key can own multiple wallets (e.g. one per network). No private keys or gas handling in your agent code.
- 402 middleware — Drop-in HTTP clients in TypeScript and Python. They intercept 402 responses, call AgentPay to pay, and automatically retry the original request with the returned
PAYMENT-SIGNATUREso your logic stays simple. - Receive USDC — Expose paid APIs that return 402 with your wallet as
payTo. Other agents pay you in USDC on Base. Withdraw to an exchange or spend with Coinbase Card. - Dashboard — Web UI for API keys, wallets, and spend history. Multi-tenant: sign in with GitHub; each user gets an API key and sees only their own data.
How it fits together
You obtain an API key from the dashboard or by calling POST /api-keys. Each key can have one or more wallets, created per network (e.g. base) via POST /wallets. When your agent calls a paid API using the SDK and receives 402, the SDK sends the payment-required header and request URL to AgentPay's POST /v1/pay. The API looks up your wallet for the required network, builds a payment payload, and calls the x402 facilitator to verify and settle. On success, it returns a payment signature; the SDK retries the original request with that signature, and the paid API returns 200 with the resource.
For receiving payments, your API returns 402 with payment requirements that include your wallet address as payTo. When another agent (using AgentPay or another x402 client) pays, USDC is sent to that address. You can withdraw to Coinbase or another exchange and, in supported regions, spend with Coinbase Card at Visa merchants.
Plans and limits
AgentPay has a free tier (3 API keys, 3 wallets, 3,000 payments/month) and paid plans. You can start by creating keys and wallets via the API or via the AgentPay skill in an AI coding agent; those keys work right away. When you want visibility or more keys/wallets, sign up at the dashboard and link your key, or upgrade. See Plans and limits for the full picture.
Next steps
Follow the Quickstart to create an API key, create a wallet, and make your first call with the SDK. Read Plans and limits to understand unclaimed keys and when to upgrade. Then explore Wallets, 402 Flow, and the API Reference.