Documentation Index
Fetch the complete documentation index at: https://docs.credpay.ai/llms.txt
Use this file to discover all available pages before exploring further.
What is x402?
x402 is an open payment protocol built on HTTP. When a server requires payment, it returns an HTTP402 Payment Required response with a signed payment specification. The client signs a USDC TransferWithAuthorization and retries the request with the signature in the X-PAYMENT header.
No API keys. No accounts. No redirects.
How it works with the checkout API
authorization_required and the agent calls POST /v1/checkout/{id}/authorize — which also triggers a 402 / sign / retry cycle.
Using the SDK
The simplest way to handle x402 is with the official SDK:signer must implement the ClientEvmSigner interface:
Manual implementation
If you prefer to implement the payment flow manually:- Make the initial request to
/v1/checkout - On a
402response, parse the payment requirements from the response - Sign a
TransferWithAuthorizationfor USDC on Base (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913, chain ID8453) - Retry the request with the
X-PAYMENTheader set to the encoded payment payload
The SDK handles expiry, nonce generation, and encoding automatically. Manual implementation is only recommended if you have a specific reason not to use it.