Language
Inference Space Docs

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

RouteConsoleOpenAI-Compatible BaseAnthropic-Compatible BaseImage / Audio Base
Mainland China routehttps://ai.inf.spacehttps://ai.inf.space/v1https://ai.inf.spacehttps://ai.inf.space
International routehttps://ai.inf.spacehttps://ai.inf.space/v1https://ai.inf.spacehttps://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

CapabilityMainland China routeInternational route
OpenAI Chat CompletionsPOST https://ai.inf.space/v1/chat/completionsPOST https://ai.inf.space/v1/chat/completions
OpenAI ResponsesPOST https://ai.inf.space/v1/responsesPOST https://ai.inf.space/v1/responses
Anthropic MessagesPOST https://ai.inf.space/v1/messagesPOST https://ai.inf.space/v1/messages
Image generationPOST https://ai.inf.space/v1/images/generationsPOST https://ai.inf.space/v1/images/generations
Image editingPOST https://ai.inf.space/v1/images/editsPOST https://ai.inf.space/v1/images/edits
Speech recognitionPOST https://ai.inf.space/v1/audio/transcriptionsPOST https://ai.inf.space/v1/audio/transcriptions
Speech synthesisPOST https://ai.inf.space/v1/audio/speechPOST 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/v1 for OpenAI-compatible APIs and https://ai.inf.space for Anthropic-compatible APIs.
  • The English public entry point does not use a separate api.* domain.
  • If the same Key returns 401 on one route, confirm that the organization and API Key have been enabled for that route.

On this page