Network Routes and Endpoints
How to choose the Inference Space mainland China and international routes, console, and SDK Base URLs.
Inference Space supports mainland China and international deployments with the same English public host. The protocol, model IDs, and authentication method are identical; use ai.inf.space for the console and API calls.
Route Overview
| Route | Console | OpenAI-Compatible Base | Anthropic-Compatible Base | Image / Audio Base |
|---|---|---|---|---|
| Mainland China route | https://ai.inf.space | https://ai.inf.space/v1 | https://ai.inf.space | https://ai.inf.space |
| International route | https://ai.inf.space | https://ai.inf.space/v1 | https://ai.inf.space | https://ai.inf.space |
The public console and API paths share ai.inf.space; the URL path determines whether a request is a browser management operation or a data-plane API call.
If most of your users, servers, or upstream dependencies are outside mainland China, prefer the international route https://ai.inf.space. If your business is primarily in mainland China, prefer the mainland China route https://ai.inf.space.
Common SDK Configuration
Mainland China route:
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://ai.inf.space/v1",
apiKey: process.env.TOS_API_KEY,
});International route:
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://ai.inf.space/v1",
apiKey: process.env.TOS_API_KEY,
});Mainland China route:
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://ai.inf.space",
authToken: process.env.TOS_API_KEY,
});International route:
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://ai.inf.space",
authToken: process.env.TOS_API_KEY,
});Mainland China route:
curl "https://ai.inf.space/v1/chat/completions?provider=dashscope" \
-H "Authorization: Bearer $TOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-plus","messages":[{"role":"user","content":"Hello"}]}'International route:
curl "https://ai.inf.space/v1/chat/completions?provider=dashscope" \
-H "Authorization: Bearer $TOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-plus","messages":[{"role":"user","content":"Hello"}]}'Endpoint Selection
| Capability | Mainland China route | International route |
|---|---|---|
| OpenAI Chat Completions | POST https://ai.inf.space/v1/chat/completions | POST https://ai.inf.space/v1/chat/completions |
| OpenAI Responses | POST https://ai.inf.space/v1/responses | POST https://ai.inf.space/v1/responses |
| Anthropic Messages | POST https://ai.inf.space/v1/messages | POST https://ai.inf.space/v1/messages |
| Image generation | POST https://ai.inf.space/v1/images/generations | POST https://ai.inf.space/v1/images/generations |
| Image editing | POST https://ai.inf.space/v1/images/edits | POST https://ai.inf.space/v1/images/edits |
| Speech recognition | POST https://ai.inf.space/v1/audio/transcriptions | POST https://ai.inf.space/v1/audio/transcriptions |
| Speech synthesis | POST https://ai.inf.space/v1/audio/speech | POST https://ai.inf.space/v1/audio/speech |
Notes
- All API Keys use
Authorization: Bearer gk_...; see Authentication and API Keys. - Use
https://ai.inf.space/v1for OpenAI-compatible APIs andhttps://ai.inf.spacefor Anthropic-compatible APIs. - The English public entry point does not use a separate
api.*domain. - If the same Key returns
401on one route, confirm that the organization and API Key have been enabled for that route.