Quickstart
From a new account to a paid test request in about ten minutes, on a free test network.
- Create a site. In the dashboard, add a site with your domain and the wallet address that should receive payments.
- Start in test mode. Under tokens, select Base Sepolia EURC (or USDC). A site with only test tokens is in test mode: settlements are free and need no credits.
- Set a price. Add a price rule, for example
/premium/**at0.01. Paths without a rule use the site's default price; set it to0to keep them free. - Create an API key. On the site page, create a key and copy it together with the site ID. The key is shown once.
- Connect your server. Install the integration for your stack:
npm install @pennipay/x402
pip install flask requests # then copy the example from docs/python
# no package: copy penni.php from docs/php and require it
# no package: copy the Penni middleware from docs/go (standard library only)
# Plugins → Add New → Upload Plugin → penni.zip, then Settings → PenniThen set the two values as environment variables on your server:
.env
PENNI_SITE_ID=site_... PENNI_API_KEY=x402_sk_...
Check it
Request a priced path without paying. You get a 402 with a PAYMENT-REQUIRED header that holds the price:
Terminal
curl -si https://your-site.example/premium/report | grep -i -E '^HTTP|^payment-required'
Now pay it. On the site page in the dashboard, press Pay with test tokens to pay the path from a browser wallet (MetaMask, Phantom, Lace) exactly as an agent would. Test EURC and USDC come free from Circle's faucet. The paid request returns 200 with a PAYMENT-RESPONSE header, and the payment shows up on the Test tab of the site's analytics.
Ready for real money? Selecting mainnet tokens and topping up credits is all it takes; your code stays the same. See going live.