Language
TensorFusion Docs

Network Routes and Endpoints

How to choose the Inference Space mainland China and international routes, console, and SDK Base URLs.

Inference Space provides mainland China and international public routes. The protocol, model IDs, and authentication method are identical; choose the route closest to your users and servers.

Route Overview

RouteConsoleOpenAI-Compatible BaseAnthropic-Compatible BaseImage / Audio Base
Mainland China routehttps://ai.tos.runhttps://api.tos.run/v1https://api.tos.runhttps://api.tos.run
International routehttps://ai.inf.spacehttps://ai.inf.space/v1https://ai.inf.spacehttps://ai.inf.space

The mainland China console uses ai.tos.run, while its API requests use api.tos.run. The international console and API use ai.inf.space.

If most of your users or servers are outside mainland China, prefer https://ai.inf.space. If your business is primarily in mainland China, prefer https://api.tos.run for API calls.

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" \
  -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" \
  -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