Coinbase x402 SDK
The reference implementation for x402. TypeScript SDK for building clients and servers that handle per-request USDC payments.
Using USDC on Coinbase x402 SDK
The Coinbase x402 SDK is the official reference implementation of the x402 protocol. It provides TypeScript libraries for both the client side (making payments) and the server side (requiring payments). The SDK handles the full x402 flow: responding with HTTP 402, specifying payment details, verifying on-chain USDC transfers, and delivering content after confirmation. It includes middleware for Express and Next.js, making it straightforward to add payment gates to existing Node.js applications. The SDK supports Base, Ethereum, and Solana, with Base as the recommended default for its speed and low fees.
Supported networks
Key features
- Official reference implementation
- TypeScript client and server libraries
- Express and Next.js middleware
- Multi-chain support
- Open source (Apache 2.0)
Other x402
thirdweb x402
x402 middleware from thirdweb that integrates with their smart contract and wallet tooling.
SDKx402 Python SDK
Python library for building x402 clients and servers. Ideal for AI agents and data services.
SDKx402 Go SDK
Go implementation of the x402 protocol for high-performance servers and infrastructure.
Ready to get started with USDC?
Check out our guides or explore more of the USDC ecosystem.