API key security
Your x402Go API key lets your server call the facilitator. Treat it like a password.- Send it only from your server, in the
x-api-keyheader. - Never put it in browser code, mobile apps, public examples, or client-side environment variables (such as
NEXT_PUBLIC_variables). - Store it in a secret manager or in server environment variables.
- Rotate it right away if it may have been exposed.
- Don’t log request headers or payment payloads.
Payment address and payout wallet
Three values are easy to confuse. Each has a single job:
When a payment settles, the contracts split it in the same transaction. Your earnings go to your payout wallet and the fee goes to x402Go. The contracts never hold your funds. Set and check your payout wallet before you accept payments.
How settlement is protected
x402 checks every payment twice: first it verifies the payment, then it settles it.- Only deliver your content after settlement succeeds.
- Use the official x402 middleware, which does this for you. Don’t write custom code that ignores a failed verification or settlement.
- Each token uses one of two transfer methods (
eip3009orpermit2). Use only the method thatGET /supportedlists for your network and token.
Contracts
x402Go uses two contracts:- Payment relayer factory. Creates each merchant’s payment address and handles the fee and payout split.
- Payment relayer implementation. The shared code that every payment address runs.
Celo Mainnet
Explorer: Celoscan
Celo Sepolia (testnet)
Explorer: Celo Sepolia Celoscan
The addresses are identical on both networks, and so is your own payment address. You can read the contracts’ verified source code on the Contract tab of each Celoscan page.
Check your payment address on-chain
You can confirm that yourpayTo came from the x402Go factory:
- Open the factory on Celoscan (or the testnet page).
- Go to Contract, then Read Contract.
- Open
vaultOfand enter the wallet address you use to sign in to the dashboard. - Compare the result with the payment address in your dashboard and your server’s
PAY_TO. They must match exactly.
Operational checklist
- Your API key stays on your server and is rotated if exposed.
-
payTomatches the payment address in your dashboard, andvaultOfreturns the same address. - Your payout wallet is set and checked.
- Your network and token are listed by
GET /supported. - Unpaid requests get a
402 Payment Requiredresponse. - Failed verification or settlement never unlocks your content.
- You’ve made one small real payment and checked it on Celoscan.