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

  1. Change the base URL. Replace your provider's base URL with the cn2.ai equivalent. For example, change api.openai.com to openai.cn2.ai. The rest of the API path and request body stays the same.
  2. First request returns 402. cn2.ai responds with HTTP 402 (Payment Required) and a WWW-Authenticate header containing a payment challenge with the price and accepted payment methods.
  3. 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 Authorization header.
  4. Get the response. cn2.ai verifies payment, routes your request through a seller's key, and returns the upstream response along with a Payment-Receipt header.

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