Coinbase AgentKit: Paying x402 APIs in 2026

Coinbase’s AgentKit and CdpX402Client let AI agents pay x402 APIs with CDP‑managed wallets. Test on Base Sepolia; protect CDP API keys and set spend limits before mainnet.

Coinbase provides two buyer paths for AI agents to pay x402‑protected APIs: CdpX402Client from the CDP SDK for server‑side wallets and AgentKit for agents that must discover and pay services dynamically. Both paths use CDP‑managed wallets to sign USDC payments and retry requests until the protected endpoint returns HTTP 200.

Developers using CdpX402Client instantiate the client with environment set to “development” to target Base Sepolia, call getAddresses() to obtain a CDP‑managed evmAddress, fund that address with test USDC, wrap the global fetch with wrapFetchWithPayment, and retry a protected endpoint until the server returns HTTP 200, indicating payment verification and settlement. Coinbase’s buyer quickstart requires Node.js 22 or later and a set of npm packages including @coinbase/cdp-sdk and @x402/fetch. A Python option exists but does not include the CdpX402Client helper, so signers and schemes must be assembled manually in Python.

AgentKit exposes x402 actions for LLM‑driven agents that must find and pay services. The actions include discover_x402_services to list endpoints within a USDC cap, make_http_request which returns payment details on HTTP 402 responses, retry_http_request_with_x402 to perform a payment retry, and make_http_request_with_x402 to combine request and payment in one call.

There are distinct buyer and seller patterns. CdpX402Client fits backends or agents that already know the paid URL. AgentKit is designed for agents that must discover services and select payment tools at runtime. Embedded Wallets are for flows where end users must hold private keys and pay directly. On the seller side, CDP Facilitators and integrations such as Stripe x402 and Circle nanopayments handle verification and settlement. Coinbase lists supported networks including Base, Base Sepolia, Polygon, Arbitrum, World, World Sepolia, Solana and Solana Devnet.

Operational requirements include three secrets that must be kept on a secured backend: CDP_API_KEY_ID, CDP_API_KEY_SECRET and CDP_WALLET_SECRET. Documentation instructs teams to rotate these credentials, never expose them to a browser, and implement spend limits. CDP Facilitator pricing in Coinbase documentation shows the first 1,000 onchain Facilitator transactions per month are free and additional onchain transactions cost $0.001 each. Coinbase documentation also states that OFAC and Know‑Your‑Transaction screening apply on supported networks and can block settlement to sanctioned or high‑risk addresses.

Practical steps in the buyer quickstart are to export the three CDP secrets as environment variables, install the required packages on Node.js 22+, run CdpX402Client with environment: “development”, fund the printed CDP evmAddress via a Base Sepolia faucet, then wrap fetch with wrapFetchWithPayment and retry the protected request until HTTP 200 is returned. Documentation notes that testnet success does not guarantee mainnet settlement if transactions are declined by KYT screening.

Coinbase’s launch materials from February 2026 state more than 50 million x402 transactions and facilitator volumes exceeding 100 million transactions and $28 million on Base and Solana. The developer guides advise using Embedded Wallets when end users must self‑custody funds and using per‑agent or per‑session spend caps when allowing agents to discover paid APIs.

Articles by this author