How x402 works
When your agent calls a DocketLayer endpoint, the flow is:- Your agent makes a GET request to
/v1/casewith no payment header - DocketLayer responds with HTTP 402 Payment Required containing machine-readable payment details — the price, recipient wallet address, and accepted currency
- Your x402 client library reads this response, constructs a $0.99 USDC transaction on Solana, signs it with your wallet’s private key, and retries the request with cryptographic proof of payment attached
- DocketLayer verifies the payment on-chain and returns the docket data
What you need
Solana wallet
A programmatic wallet with a private key stored as an environment variable
USDC balance
Enough USDC on Solana to cover your expected query volume at $0.99 per query
x402 library
The x402 client library for Python or JavaScript, configured with your wallet
No API key
There are no API keys to request, manage, or rotate
x402 client setup
Security
- Use a dedicated wallet for your agent — not a personal wallet holding significant funds
- Fund it with only what the agent needs to operate
- Monitor your wallet balance — a depleted wallet causes all queries to fail
- If your private key is ever exposed, generate a new wallet immediately and transfer remaining USDC
Free endpoint
The/v1/status endpoint requires no payment and can be used to check coverage and connectivity without consuming any USDC.
Further reading
- Wallet setup guide — creating a Solana wallet and funding it with USDC
- x402 protocol documentation — the open payment standard DocketLayer uses
- x402scan — x402 ecosystem explorer