For buyers
Access 50+ APIs through cn2.ai without signing up, managing API keys, or setting up billing accounts. Pay per request using the Machine Payments Protocol.
How it works
- Change the base URL. Replace your provider's base URL with the cn2.ai equivalent. For example, change
api.openai.comtoopenai.cn2.ai. The rest of the API path and request body stays the same. - First request returns 402. cn2.ai responds with HTTP 402 (Payment Required) and a
WWW-Authenticateheader containing a payment challenge with the price and accepted payment methods. - Pay and retry. Your client pays the challenge amount (via Stripe card, Tempo USDC, or Lightning) and retries the request with a payment credential in the
Authorizationheader. - Get the response. cn2.ai verifies payment, routes your request through a seller's key, and returns the upstream response along with a
Payment-Receiptheader.
No account required
Anonymous access works natively. You do not need to create an account, generate an API key, or set up billing. MPP handles authentication and payment in a single HTTP round-trip.
Optionally, you can create an account to get: 30-day request history, receipt archive, monthly spend caps, and a default payment method.
Automatic failover
If the seller key that your request is routed to fails (rate limited, revoked, or upstream error), cn2.ai automatically retries on another seller's key. You never see the error — from your perspective, the request simply succeeds. If all available keys fail, you receive a 502 response.
Premium routing
For lower latency and higher reliability, add the header X-CN2-Pool: premium to your request. Premium pool keys have a verified track record of high uptime and low error rates. Premium requests cost 25% more.
Guides
- Quickstart → Make your first paid API call
- Disputes → What to do if you were charged incorrectly
- How payments work → Deep dive into the MPP payment flow