Documentation

cn2.ai is an API key marketplace. Sellers list spare API capacity and earn per request. Buyers access APIs through cn2.ai proxy endpoints with zero signup — payment happens inline with each request.

How it works

cn2.ai sits between buyers and upstream API providers. When a buyer sends a request to a cn2.ai proxy endpoint (like openai.cn2.ai), the platform:

  1. Responds with HTTP 402 and a payment challenge describing the cost and accepted payment methods.
  2. The buyer's client pays (via Stripe card, Tempo USDC, or Lightning) and retries with a payment credential.
  3. cn2.ai verifies the payment, selects the best available seller key for that provider, and proxies the request upstream.
  4. The upstream response is forwarded to the buyer along with a payment receipt. The seller earns their share.

This flow uses the Machine Payments Protocol (MPP), an open standard for machine-to-machine payments built on HTTP 402. Any MPP-compatible client can pay automatically — no manual checkout required.

Key concepts

Proxy endpoint
Each API provider has a subdomain (e.g. openai.cn2.ai) that mirrors the upstream API. Replace your base URL and requests work the same way.
MPP (Machine Payments Protocol)
An open protocol for paying for API requests inline. Your first request gets a 402 challenge; your client pays and retries. No API keys or accounts needed on the buyer side.
Key pool
When multiple sellers list keys for the same provider, cn2.ai maintains a pool. Requests are routed to the cheapest eligible key with the highest reliability score.
Priority score
Each listed key has a score from 0 to 1 representing its reliability. Keys that consistently return successful responses maintain a high score. Errors cause the score to decay.
Standard and premium pools
The standard pool is the default. Sellers can opt into the premium pool if their key maintains a high priority score — buyers pay 25% more for higher reliability.
EU routing
Buyers in EU countries are automatically routed to EU-tagged keys only. This ensures data stays within the EU for GDPR compliance.

Next steps