Quickstart
Choose your development tool or SDK and integrate in minutes.
Use Codex Desktop
Run the setup command, restart the app, and get started.
Use Codex CLI
Configure with one command and continue working in the terminal.
Use Claude Code
Install Claude Code and start it in your project directory.
API/SDK calls
Integrate your application with the OpenAI or Anthropic SDK.
Quick integration with CC Switch
First pick a region and a route
The region owns your account, balance, and console — the two regions share nothing. The route is only a network path into that region, and you can switch it at any time without affecting your account or billing.
| Region | Console | Route | API base | When to use it |
|---|---|---|---|---|
| Global | https://ai.inf.space | International | https://ai.inf.space | Everything on a Global-region account |
| China | https://cn.inf.space | China-accelerated (default) | https://cn.inf.space | Callers in mainland China that also download generated images / video there |
| China | https://cn.inf.space | International | https://global.inf.space | China-region accounts whose servers sit outside mainland China |
When in doubt, take your region's default. Examples below use the Global region https://ai.inf.space; to use another route, change the base URL and nothing else. The Regions and network routes page covers the full endpoint reference.
Prepare an API key
Open your region's console (https://ai.inf.space for Global, https://cn.inf.space for China) and create a key on the API key management page. Keys start with gk_ and are shown in full only once, so save the key immediately. Do not screenshot, share, or commit it to a repository. If you suspect a leak, revoke it in the console and generate a new key immediately.
A key is valid only in the region that issued it. A China-region key returns 401 against https://ai.inf.space, and vice versa.
Use Codex Desktop
Codex Desktop supports macOS and Windows only. On Linux, use Codex CLI in the next section.
- Follow the official Codex Desktop installation guide, or download the appropriate installer directly:
- Open Codex Desktop, replace
gk_YOUR_KEYwith the key you just created, and run the setup command below:
curl -fsSL https://docs.inf.space/install/codex.sh | bash -s -- --key gk_YOUR_KEYiwr https://docs.inf.space/install/codex.ps1 -OutFile setup-codex.ps1
.\setup-codex.ps1 -Key gk_YOUR_KEYThe installers write the China-accelerated route https://cn.inf.space by default. To change it, pass --route global (Global region) or --route cn-global (China region, international route) to the shell script, or -Route global / -Route cn-global to the PowerShell script. Re-running updates the config in place instead of duplicating it.
When finished, restart Codex Desktop, then open or create a workspace to start chatting and coding.
Use Codex CLI
If Codex CLI is not installed, first install Node.js from the official download page and verify that these commands are available:
node --version
npm --versionThen run:
npm install -g @openai/codexThen replace gk_YOUR_KEY with the key you just created:
curl -fsSL https://docs.inf.space/install/codex.sh | bash -s -- --key gk_YOUR_KEYiwr https://docs.inf.space/install/codex.ps1 -OutFile setup-codex.ps1
.\setup-codex.ps1 -Key gk_YOUR_KEYThe installers write the China-accelerated route https://cn.inf.space by default. To change it, pass --route global (Global region) or --route cn-global (China region, international route) to the shell script, or -Route global / -Route cn-global to the PowerShell script. Re-running updates the config in place instead of duplicating it.
Reopen the terminal and run this in your project directory:
codexUse Claude Code
If Claude Code is not installed, first install Node.js from the official download page and verify that these commands are available:
node --version
npm --versionThen run:
npm install -g @anthropic-ai/claude-codeThen replace gk_YOUR_KEY with the key you just created:
curl -fsSL https://docs.inf.space/install/claude.sh | bash -s -- --key gk_YOUR_KEYiwr https://docs.inf.space/install/claude.ps1 -OutFile setup-claude.ps1
.\setup-claude.ps1 -Key gk_YOUR_KEYThe installers write the China-accelerated route https://cn.inf.space by default. To change it, pass --route global (Global region) or --route cn-global (China region, international route) to the shell script, or -Route global / -Route cn-global to the PowerShell script. Re-running updates the config in place instead of duplicating it.
Reopen the terminal and run this in your project directory:
claudeQuick integration with CC Switch
- Install and open CC Switch from the CC Switch website or the latest release.
- Select Codex or Claude Code, click
+to add a connection, then selectCustom. - Enter the
Endpoint,API Key, andModel:
Endpoint:https://ai.inf.space/v1(Global region; China region useshttps://cn.inf.space/v1orhttps://global.inf.space/v1)API Key: yourgk_keyModel:gpt-5.6-sol
Endpoint:https://ai.inf.space(Global region; China region useshttps://cn.inf.spaceorhttps://global.inf.space)API Key: yourgk_keyModel:claude-sonnet-4-6
- Save and enable the connection, then verify it with the selected tool:
Codex: restart the terminal and run:
codexClaude Code: run directly:
claudeAPI/SDK calls
Store the key in an environment variable on the server:
export INFERENCE_SPACE_API_KEY="gk_YOUR_KEY"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,
});
const response = await client.responses.create({
model: "gpt-5.6-sol",
input: "Introduce yourself in one sentence.",
});
console.log(response.output_text);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,
});
const message = await client.messages.create({
model: "claude-sonnet-4-6",
max_tokens: 1024,
messages: [{ role: "user", content: "Introduce yourself in one sentence." }],
});
console.log(message.content);In production, store API keys only on the server. Do not put them in browser code or commit them to a repository.
Inference Space Overview
Inference Space product positioning, unified API capabilities (LLM / images / audio / OCR / vision segmentation), and how to choose a region and route.
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.