Available models
—
Detailed guides to help you connect and use AI tools (Claude Code, Cursor, Codex CLI, OpenCode...) directly with our high-performance Gateway at undefined.
1. API Key
Create at Manage API Keys, format sk-xxxxxxxx. Shows only once — save immediately.
2. Base URL
Use exact /v1. Use the URL shown in each tool's example. SubPool also tolerates a duplicated /v1 prefix, but omitting it is recommended when the tool appends /v1 itself.
3. Model ID
Get exact ID (e.g. claude-sonnet-4-6) at Pricing page — click copy icon next to any model.
Terminal coding agent, Anthropic standard
Claude desktop app, configured via inference gateway
OpenAI coding agent, Responses API standard
The Codex tab built into OpenAI's official ChatGPT Desktop App
Open-source multi-provider terminal coding agent
AI-native IDE based on VS Code
VS Code extension coding agent
Continue
Autocomplete & chat extension for VS Code / JetBrains
TOML configured CLI, OpenAI standard
Terminal coding agent, Anthropic standard
This configuration works for both Claude Code CLI and Claude Code in Visual Studio Code. Install either the CLI (npm install -g @anthropic-ai/claude-code) or the Claude Code extension from the Visual Studio Code Marketplace. Node.js >= 18 is required either way.
npm install -g @anthropic-ai/claude-code
Step 1 — Open Terminal: press Cmd + Space, type Terminal, press Enter.
Step 2 — In the window that just opened, paste the command below and press Enter:
curl -fsSL /setup/claude-code/claude-code.sh | bash
Step 1 — Open PowerShell: press the Windows key, type powershell, press Enter.
Step 2 — In the window that just opened, paste the command below and press Enter:
irm /setup/claude-code/claude-code.ps1 | iex
The script asks for your SubPool API key, then lets you pick a model for each of the 4 roles Claude Code uses — FABLE, OPUS, SONNET, HAIKU (press Enter on any of them to use Model Switch, so you can change the model later from the website without rerunning the script). If a settings.json already exists, it is renamed to settings_backup_<timestamp>.json right next to it before the new one is written — nothing is ever deleted.
Claude Code reads ANTHROPIC_BASE_URL / ANTHROPIC_AUTH_TOKEN from the settings JSON file — writing them directly to settings.json is more reliable than exporting them temporarily in a shell. Use the URL exactly as shown below, ending in /v1.
{
"hasCompletedOnboarding": true,
"env": {
"ANTHROPIC_BASE_URL": "/v1",
"ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx",
"ANTHROPIC_DEFAULT_FABLE_MODEL": "gpt-5-6-sol",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "gpt-5-6-terra",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-5-6-terra",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "gpt-5-6-luna"
}
}
{
"hasCompletedOnboarding": true,
"env": {
"ANTHROPIC_BASE_URL": "/v1",
"ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx",
"ANTHROPIC_DEFAULT_FABLE_MODEL": "gpt-5-6-sol",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "gpt-5-6-terra",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-5-6-terra",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "gpt-5-6-luna"
}
}
Note
Claude Code only reads settings.json on startup — open a new session after editing. SubPool also tolerates a duplicated /v1 prefix if you accidentally add one, but the URL shown above (ending in /v1) is the recommended configuration.
Run claude in any folder and send a prompt. Response without 401 error confirms setup.
Claude desktop app, configured via inference gateway
On macOS there's nothing elaborate to do: on the app's opening screen (Get Started), just click Or sign in with Gateway.
This step is required on Windows for both paths in Step 3 below. A normal claude.ai sign-in does NOT create this config — it's a separate, hidden feature.
undefined for Gateway base URL, and enter any temporary value for API Key (it will be overwritten in Step 3 below), then click Apply Changes.Paste the single line below into a command window and press Enter. The script asks for your API key and model, then writes the config for you. You never have to find a hidden folder or edit JSON, and any existing file is backed up before it is replaced.
The script lists the Claude models active on your account for you to pick from (Model Switch and other providers' models don't work here).
Step 1 — Open Terminal: press Cmd + Space, type Terminal, press Enter.
Step 2 — In the window that just opened, paste the command below and press Enter:
curl -fsSL /setup/claude-app/claude-app.sh | bash
Step 1 — Open PowerShell: press the Windows key, type powershell, press Enter.
Step 2 — In the window that just opened, paste the command below and press Enter:
irm /setup/claude-app/claude-app.ps1 | iex
Note
Three things differ from the other tools here: (1) inferenceGatewayBaseUrl must be the bare domain, with NO trailing /v1 — the app appends /v1/messages and /v1/models itself, so adding /v1 makes it call /v1/v1/... and show "organization's model list hasn't loaded". (2) Every entry in inferenceModels[] must be a real Anthropic model id (like the models in the example below) — the Model Switch alias (switch-default) doesn't work here, showing "not an Anthropic model". (3) Add inferenceGatewayAuthScheme: "bearer" and modelDiscoveryEnabled: true as shown. Get the exact id of an active model on the pricing page.
~/Library/Application Support/Claude-3p/configLibrary/ and hit Enter. Find the <appliedId>.json file for the profile you use — with a single profile there is exactly one .json in there.sk-xxx... with your real API key.{
"inferenceProvider": "gateway",
"inferenceGatewayBaseUrl": "",
"inferenceGatewayApiKey": "sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx",
"inferenceGatewayAuthScheme": "bearer",
"modelDiscoveryEnabled": true,
"inferenceModels": [
{ "name": "claude-fable-5" },
{ "name": "claude-opus-5" },
{ "name": "claude-sonnet-5" },
{ "name": "claude-haiku-4-5-20251001" }
]
}
%APPDATA% and press Enter — Explorer opens at C:\Users\<your-name>\AppData\Roaming. Look for a folder whose name starts with "Claude" (e.g. Claude-3p), open it, then go into the configLibrary subfolder.Can't find the folder?
If Explorer says "Location is not available", or you see no Claude folder at all, open PowerShell (press Windows, type PowerShell, Enter) and paste the command below. It prints the exact path on your machine:
Get-ChildItem "$env:APPDATA","$env:LOCALAPPDATA" -Recurse -Directory -Filter configLibrary -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName
If the command prints nothing, the folder was never created — go back to Step 2 above and complete all 5 Enable Developer Mode steps, then run the command again. This is not about forgetting to sign in.
<appliedId>.json files; if there are several, pick the one with the most recent Date modified. Right-click → Open with → Visual Studio Code (or Notepad++). Do not use Word or WordPad — they corrupt the file format.sk-xxx... with your real API key.{
"inferenceProvider": "gateway",
"inferenceGatewayBaseUrl": "",
"inferenceGatewayApiKey": "sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx",
"inferenceGatewayAuthScheme": "bearer",
"modelDiscoveryEnabled": true,
"inferenceModels": [
{ "name": "claude-fable-5" },
{ "name": "claude-opus-5" },
{ "name": "claude-sonnet-5" },
{ "name": "claude-haiku-4-5-20251001" }
]
}
Note
If configLibrary holds several .json files (several profiles), editing the wrong one has no effect. The reliable way: open _meta.json in the same folder — its appliedId field names the active profile's .json file. No _meta.json? Check each file's last modified time, or open the app first to see which profile is active before quitting to edit.
Reopen Claude. If it shows a sign-in screen, choose Continue with Gateway (do not sign in with a claude.ai account). If that screen shows “Your provider setup needs a fix”, your inferenceModels field is still wrong — see the note above. Once past that screen, start a new session and send a short prompt to confirm the gateway points at SubPool.
OpenAI coding agent, Responses API standard
Paste the single line below into a command window and press Enter. The script asks for your API key and model, then writes the config for you. You never have to find a hidden folder or edit JSON, and any existing file is backed up before it is replaced.
Step 1 — Open Terminal: press Cmd + Space, type Terminal, press Enter.
Step 2 — In the window that just opened, paste the command below and press Enter:
curl -fsSL /setup/codex/codex.sh | bash
Step 1 — Open PowerShell: press the Windows key, type powershell, press Enter.
Step 2 — In the window that just opened, paste the command below and press Enter:
irm /setup/codex/codex.ps1 | iex
Step 1 — create/edit ~/.codex/auth.json:
{
"auth_mode": "apikey",
"OPENAI_API_KEY": "sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx"
}
Step 2 — create/edit ~/.codex/config.toml. The name field is required — Codex errors on startup without it. env_key and requires_openai_auth = false are also required — without them, a machine that has ever done `codex login` with a ChatGPT account gets a 401 missing API key error even with the right key:
model = "switch-default" model_provider = "subpool" [model_providers.subpool] name = "SubPool" base_url = "/v1" wire_api = "responses" env_key = "SUBPOOL_API_KEY" requires_openai_auth = false
Step 3 — set the SUBPOOL_API_KEY environment variable (Codex reads the key via env_key from step 2, not directly from auth.json, for a custom provider):
echo 'export SUBPOOL_API_KEY="sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx"' >> ~/.zshrc launchctl setenv SUBPOOL_API_KEY "sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx"
Step 4 — open a new Terminal window (to pick up the env var you just set), then restart Codex CLI completely.
Step 1 — create/edit %USERPROFILE%\.codex\auth.json:
{
"auth_mode": "apikey",
"OPENAI_API_KEY": "sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx"
}
Step 2 — create/edit %USERPROFILE%\.codex\config.toml. env_key and requires_openai_auth = false are required — without them, a machine that has ever done `codex login` with a ChatGPT account gets a 401 missing API key error even with the right key:
model = "switch-default" model_provider = "subpool" [model_providers.subpool] name = "SubPool" base_url = "/v1" wire_api = "responses" env_key = "SUBPOOL_API_KEY" requires_openai_auth = false
Step 3 — set the SUBPOOL_API_KEY environment variable (run in PowerShell, no admin rights needed):
[Environment]::SetEnvironmentVariable('SUBPOOL_API_KEY', 'sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx', 'User')
Step 4 — open a new PowerShell window, then restart Codex CLI completely.
401 missing API key even with the right key
If this machine has ever done `codex login` with a ChatGPT account, Codex prefers that login state and won't attach Authorization to requests for a custom provider based on auth.json alone — even with the correct key entered. The surest fix is to log out before configuring: run codex logout. The Quick install script above already prompts for this and handles the config side (sets env_key plus the environment variable); doing it manually, make sure you have both the env_key/requires_openai_auth lines in config.toml AND the environment variable step above — missing either one still causes the error.
Codex CLI Specific Error
Error 'provider name must not be empty' means name = "SubPool" is missing under [model_providers.subpool].
Check the model after opening Codex
After configuring and opening Codex, if the model shown is Custom, that's correct — use it as-is. Do NOT switch to a different model from Codex's built-in list — switching makes Codex fall back to OpenAI's default provider (no longer going through SubPool), which won't work.
Open Codex, start a new chat session, and send a short message. A normal reply (no 401 or invalid api key error) confirms it's talking to SubPool.
The Codex tab built into OpenAI's official ChatGPT Desktop App
Note
Quit ChatGPT (Desktop App) completely before running the script — if it's still running, it can overwrite what you just wrote when you later quit it.
Paste the single line below into a command window and press Enter. The script asks for your API key and model, then writes the config for you. You never have to find a hidden folder or edit JSON, and any existing file is backed up before it is replaced.
Step 1 — Open Terminal: press Cmd + Space, type Terminal, press Enter.
Step 2 — In the window that just opened, paste the command below and press Enter:
curl -fsSL /setup/chatgpt-app/chatgpt-app.sh | bash
Step 1 — Open PowerShell: press the Windows key, type powershell, press Enter.
Step 2 — In the window that just opened, paste the command below and press Enter:
irm /setup/chatgpt-app/chatgpt-app.ps1 | iex
Step 1 — create/edit ~/.codex/auth.json:
{
"auth_mode": "apikey",
"OPENAI_API_KEY": "sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx"
}
Step 2 — create/edit ~/.codex/config.toml (name field is required). env_key and requires_openai_auth = false are also required — without them, a machine that has ever done `codex login` with a ChatGPT account gets a 401 missing API key error even with the right key:
model = "switch-default" model_provider = "subpool" [model_providers.subpool] name = "SubPool" base_url = "/v1" wire_api = "responses" env_key = "SUBPOOL_API_KEY" requires_openai_auth = false
Step 3 — set the SUBPOOL_API_KEY environment variable for GUI apps (the app reads the key via env_key from step 2, not directly from auth.json, for a custom provider):
launchctl setenv SUBPOOL_API_KEY "sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx"
Step 4 — quit ChatGPT (Desktop App) completely (not just the window), reopen it, and go to the Codex tab.
Step 1 — create/edit %USERPROFILE%\.codex\auth.json:
{
"auth_mode": "apikey",
"OPENAI_API_KEY": "sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx"
}
Step 2 — create/edit %USERPROFILE%\.codex\config.toml. env_key and requires_openai_auth = false are required — without them, a machine that has ever done `codex login` with a ChatGPT account gets a 401 missing API key error even with the right key:
model = "switch-default" model_provider = "subpool" [model_providers.subpool] name = "SubPool" base_url = "/v1" wire_api = "responses" env_key = "SUBPOOL_API_KEY" requires_openai_auth = false
Step 3 — set the SUBPOOL_API_KEY environment variable (run in PowerShell, no admin rights needed):
[Environment]::SetEnvironmentVariable('SUBPOOL_API_KEY', 'sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx', 'User')
Step 4 — quit ChatGPT (Desktop App) completely and reopen it to apply the new config.
401 missing API key even with the right key
If this machine has ever done `codex login` with a ChatGPT account, the app prefers that login state and won't attach Authorization to requests for a custom provider based on auth.json alone — even with the correct key entered. The surest fix is to sign out before configuring: run codex logout (if Codex CLI is installed) or sign out directly in the app. The Quick install script above already prompts for this and handles the config side; doing it manually, make sure you have both the env_key/requires_openai_auth lines in config.toml AND the environment variable step above — missing either one still causes the error.
Why it shares config with Codex CLI
Per OpenAI's official docs (learn.chatgpt.com): the desktop app, CLI, and VS Code extension all use the same cached login mechanism and config file — editing it once applies to all three, no need to repeat this per tool.
Check the model after opening the Codex tab
After configuring and opening the Codex tab, if the model shown is Custom, that's correct — use it as-is. Do NOT switch to a different model from the built-in list — switching makes the app fall back to OpenAI's default provider (no longer going through SubPool), which won't work.
Open the Codex tab in ChatGPT (Desktop App), start a new session, and send a short message. A normal reply (no auth error) confirms it's talking to SubPool.
Open-source multi-provider terminal coding agent
Paste the single line below into a command window and press Enter. The script asks for your API key and model, then writes the config for you. You never have to find a hidden folder or edit JSON, and any existing file is backed up before it is replaced.
Step 1 — Open Terminal: press Cmd + Space, type Terminal, press Enter.
Step 2 — In the window that just opened, paste the command below and press Enter:
curl -fsSL /setup/opencode/opencode.sh | bash
Step 1 — Open PowerShell: press the Windows key, type powershell, press Enter.
Step 2 — In the window that just opened, paste the command below and press Enter:
irm /setup/opencode/opencode.ps1 | iex
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"subpool": {
"npm": "@ai-sdk/openai-compatible",
"name": "SubPool",
"options": {
"baseURL": "/v1",
"apiKey": "sk-xxxxxxxxxxxxxxxxxxxxxxx"
},
"models": {
"gpt-5-6-sol": {
"name": "GPT-5.6 Sol"
},
"gpt-5-6-terra": {
"name": "GPT-5.6 Terra"
},
"gpt-5-6-luna": {
"name": "GPT-5.6 Luna"
},
"claude-sonnet-5": {
"name": "Claude Sonnet 5"
},
"gemini-3-6-flash-high": {
"name": "Gemini 3.6 Flash High"
}
}
}
}
}
Run opencode models subpool or use /models in the TUI. If the provider is missing, check provider.subpool and the models section in opencode.json.
AI-native IDE based on VS Code
OpenAI Base URL: /v1 OpenAI API Key: sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx
Open chat panel, send a test prompt. Normal response confirms active connection.
Note
Cursor caches verified models — if you change Base URL or key, delete old model entries and re-add them.
VS Code extension coding agent
{
"actModeApiProvider": "openai",
"planModeApiProvider": "openai",
"openAiBaseUrl": "",
"openAiModelId": "switch-default",
"planModeOpenAiModelId": "switch-default"
}
{
"openAiApiKey": "sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx"
}
Send a prompt in Cline panel. Response with tool execution indicates success.
Note
openAiBaseUrl here must NOT include /v1 suffix — Cline appends it automatically.
Autocomplete & chat extension for VS Code / JetBrains
{
"models": [
{
"title": "SubPool",
"provider": "openai",
"model": "switch-default",
"apiBase": "/v1",
"apiKey": "sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx"
}
]
}
Send a chat prompt in Continue. Streaming response confirms success.
YAML + .env configured coding agent
model: default: "switch-default" provider: "custom" base_url: "/v1"
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx
Run Hermes Agent and send a prompt. No auth errors confirms connection.
Multi-agent framework configured via JSON
{
"agents": {
"defaults": {
"model": {
"primary": "subpool/custom"
}
}
},
"models": {
"providers": {
"subpool": {
"baseUrl": "/v1",
"apiKey": "sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx",
"apiType": "openai",
"models": [{ "id": "switch-default", "name": "switch-default" }]
}
}
}
}
Run default agent and verify subpool provider log activity.
Alibaba terminal coding agent, OpenAI standard
{
"security": {
"auth": {
"selectedType": "openai",
"openaiApiKey": "sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx"
}
},
"model": {
"openaiBaseUrl": "/v1",
"name": "switch-default"
}
}
Run qwen and send a prompt. Normal response confirms connection.
TOML configured CLI, OpenAI standard
[providers.openai] base_url = "/v1" api_key = "sk-xxxxxxxxxxxxxxxx-xxxxxx-xxxxxxxx" model = "switch-default"
Open new CLI session after saving configuration.
All tools listed above authenticate through the same SubPool gateway, so the errors below present identically whether you use Cursor, Codex, or any other tool. Read the error message to identify the root cause instantly.
| Error Message | HTTP Code | Root Cause | Fix / Solution |
|---|---|---|---|
| missing API key: provide Authorization: Bearer <key> or x-api-key: <key> | 401 | Request missing authentication header — key not configured or empty. | Check tool configuration file and paste key into correct field. |
| invalid api key | 401 | Key header present but not matching any active key — invalid or revoked key. | Create new key at Manage API Keys page and paste. |
| api key expired | 403 | Quota/prepaid key has expired. | Create new key or switch to pay-as-you-go credit key. |
| api key quota exhausted | 403 | Quota key token allowance exhausted. | Create new quota key or top up credit balance. |
| insufficient balance | 402 | Valid key but account balance insufficient for request. | Top up account balance at Topup page. |
Quick Error Isolation Tip
Before inspecting tool settings, make a direct curl call to the endpoint with your key. If curl succeeds but the tool fails, the issue is strictly inside local tool configuration, not your SubPool account.