Regions and Network Routes
How to pick a region (China / Global) and, within it, the right route domain — cn.inf.space, global.inf.space, or ai.inf.space.
Onboarding involves two independent choices:
- Pick a region — where your account lives. The region determines your console, account, balance, and API keys. The two regions are fully independent and do not share credentials.
- Pick a route — which domain your code calls. A route is just a network path to the same region, so you can switch routes at any time without affecting your account or billing.
Step 1: Pick a region
| Region | Console | Best for |
|---|---|---|
| China | https://cn.inf.space | Teams based in mainland China |
| Global | https://ai.inf.space | Teams based outside mainland China |
Consoles, accounts, balances, and API keys are entirely separate between the two regions. A gk_ key issued in the China region returns 401 on the Global region and vice versa. Open an account in one region — do not open one in each and call across.
Step 2: Pick a route
| Region | Route | Console and API base | When to use it |
|---|---|---|---|
| China | China-accelerated (default) | https://cn.inf.space | Callers in mainland China that also download generated images / video there |
| China | International | https://global.inf.space | China-region accounts whose servers are in Europe, the Americas, or APAC |
| Global | International | https://ai.inf.space | Everything on a Global-region account |
Both China-region routes reach the same service: same model catalog, same key, same balance and invoices. Switching domains requires no other change. Only the network path differs:
cn.inf.spaceis the China-accelerated route. Large responses — image and video generation, and pulling finished files afterwards — are more stable on it from inside mainland China.global.inf.spaceis the international route. It is faster when your servers are outside mainland China, and is not the right default for mainland clients.
When in doubt, take the default: https://cn.inf.space in the China region, https://ai.inf.space in the Global region. You can change it later at any time.
Console and API share one domain
Each route domain serves both the browser console and the API. Sign in, create keys, check usage and top up on the same host your SDK calls — https://cn.inf.space or https://global.inf.space in the China region, https://ai.inf.space in the Global region.
Common SDK configuration
import OpenAI from "openai";
// Global region (default below)
// China region, accelerated route: https://cn.inf.space/v1
// China region, international route: https://global.inf.space/v1
const client = new OpenAI({
baseURL: "https://ai.inf.space/v1",
apiKey: process.env.INFERENCE_SPACE_API_KEY,
});import Anthropic from "@anthropic-ai/sdk";
// Global region (default below)
// China region, accelerated route: https://cn.inf.space
// China region, international route: https://global.inf.space
const client = new Anthropic({
baseURL: "https://ai.inf.space",
authToken: process.env.INFERENCE_SPACE_API_KEY,
});# Global region (default below)
# China region, accelerated route: https://cn.inf.space
# China region, international route: https://global.inf.space
curl "https://ai.inf.space/v1/chat/completions" \
-H "Authorization: Bearer $INFERENCE_SPACE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-sol","messages":[{"role":"user","content":"Hello"}]}'Endpoint reference
Replace {BASE} with the domain of the route you picked. Paths are identical on all three routes.
| Capability | Endpoint |
|---|---|
| OpenAI Chat Completions | POST {BASE}/v1/chat/completions |
| OpenAI Responses | POST {BASE}/v1/responses |
| Anthropic Messages | POST {BASE}/v1/messages |
| Image generation | POST {BASE}/v1/images/generations |
| Image edits | POST {BASE}/v1/images/edits |
| Async jobs | POST {BASE}/api/jobs |
| Speech to text | POST {BASE}/v1/audio/transcriptions |
| Text to speech | POST {BASE}/v1/audio/speech |
| OCR | POST {BASE}/v1/recognize |
| Vision segmentation | POST {BASE}/v1/vision-segment/predictions |
| Price lookup | GET {BASE}/v1/pricing/lookup |
{BASE} is one of https://ai.inf.space (Global region), https://cn.inf.space or https://global.inf.space (China region).
Switching routes for CLI tools
The one-line installers for Codex CLI and Claude Code write the China-accelerated route by default. Pass --route to change it:
# China region, international route
curl -fsSL https://docs.inf.space/install/codex.sh | bash -s -- --key gk_YOUR_KEY --route cn-global
# Global region
curl -fsSL https://docs.inf.space/install/claude.sh | bash -s -- --key gk_YOUR_KEY --route global--route accepts cn-accel (default), cn-global, and global. The Windows PowerShell scripts use -Route with the same values.
FAQ
- Does switching routes require code changes? Only the base URL.
- Does switching routes affect billing? No. Within a region all routes share one balance, usage record, and invoice stream.
- The same key returns
401on one route. That key belongs to the other region. Check whether it was created oncn.inf.spaceorai.inf.space. - Can I use two routes at once? Yes. Within a region they are not exclusive — for example, run China-based services on
cn.inf.spaceand overseas services onglobal.inf.spacewith the same key.