Server Integration
Adding payment requirements to your API
Client Integration
Paying for x402-protected APIs
Agent Self-Provisioning
An AI agent that needs a facilitator endpoint
Base URL
All requests go through:Path prefixes
The path prefix determines authentication and tier routing:| Prefix | Auth | Network | Use case |
|---|---|---|---|
/sandbox/... | None (IP-limited) | Base Sepolia, Solana Devnet | Development and testing |
/v1/<key>/... | API key | Base + Sepolia, Solana | Production |
/v1/<key>/flash/... | API key | Base + Sepolia, Solana | ~200ms settlement (Growth+). On Base, uses Flashblocks for ~200ms finality. Solana achieves comparable speed natively. |
Facilitator URL in your server config
Your server needs a facilitator URL. This is what you pass toHTTPFacilitatorClient:
POST /settle— settle a payment on-chainPOST /verify— verify a payment signature without settling
@x402/express middleware calls these automatically.