Integrations with Agents
This page explains how to connect common agents and developer tools to the Site URL, including API BaseURL, API keys, model IDs, and practical client configuration.
Unified rules:
- API BaseURL: use the value from the “API BaseURL” section on the Overview page, for example
https://cn-api.tokenfor.mefor the CN2 region - OpenAI / xAI-compatible endpoints: usually use
<API BaseURL>/v1 - Anthropic / Claude Code: usually use
<API BaseURL>and let the client append/v1/messages - Gemini-compatible endpoints: usually use
<API BaseURL>/v1beta - API key / token: the key created in the Site URL console
- One key is bound to one vendor group. Use separate keys for GPT, Claude, Gemini, and Grok groups when they are configured separately
Default models used in this page:
- GPT:
gpt-5.6-sol - Claude:
claude-opus-5 - Gemini:
gemini-3-pro-preview
Generic HTTP template
If a tool supports OpenAI-compatible APIs, first verify the route with a simple request:
POST <API BaseURL>/v1/chat/completions
Authorization: Bearer <Your_API_Key>
Content-Type: application/json
{
"model": "gpt-5.6-sol",
"messages": [
{ "role": "user", "content": "Hello, test whether the Site URL is working." }
]
}For the CN2 region, the full request URL is:
https://cn-api.tokenfor.me/v1/chat/completionsCodex (ChatGPT) Configuration
Codex reads model provider settings from ~/.codex/config.toml. For TokenFor, use the OpenAI Responses wire API.
macOS
Edit the config file:
nano ~/.codex/config.tomlAdd or update:
model_provider = "tokenforme"
model = "gpt-5.6-sol"
model_reasoning_effort = "high"
disable_response_storage = true
[model_providers.tokenforme]
name = "tokenfor.me"
base_url = "https://cn-api.tokenfor.me/v1"
wire_api = "responses"
requires_openai_auth = false
env_key = "Tokenforme_KEY"Then put the key in your shell environment:
nano ~/.zshrcexport Tokenforme_KEY="sk-your-key"Reload the shell config and start Codex:
source ~/.zshrc
codexIf you are not using the CN2 region, replace https://cn-api.tokenfor.me in base_url with the API BaseURL from the Overview page.
Windows
Edit:
%USERPROFILE%\.codex\config.tomlUse the same TOML config:
model_provider = "tokenforme"
model = "gpt-5.6-sol"
model_reasoning_effort = "high"
disable_response_storage = true
[model_providers.tokenforme]
name = "tokenfor.me"
base_url = "https://cn-api.tokenfor.me/v1"
wire_api = "responses"
requires_openai_auth = false
env_key = "Tokenforme_KEY"Set the user environment variable in PowerShell:
[Environment]::SetEnvironmentVariable("Tokenforme_KEY", "sk-your-key", "User")
$env:Tokenforme_KEY = "sk-your-key"
codexAfter changing persistent environment variables, reopen the terminal so Codex can read them.
Claude Code Configuration
Claude Code uses an Anthropic Messages-style endpoint. Use the API BaseURL without /v1, for example https://cn-api.tokenfor.me, so the client does not accidentally call /v1/v1/messages.
macOS
Option 1: use shell environment variables.
nano ~/.zshrcexport ANTHROPIC_BASE_URL="https://cn-api.tokenfor.me"
export ANTHROPIC_AUTH_TOKEN="sk-your-key"
export ANTHROPIC_MODEL="claude-opus-5"source ~/.zshrc
claudeOption 2: use Claude Code settings.
mkdir -p ~/.claude
nano ~/.claude/settings.json{
"env": {
"ANTHROPIC_BASE_URL": "https://cn-api.tokenfor.me",
"ANTHROPIC_AUTH_TOKEN": "sk-your-key",
"ANTHROPIC_MODEL": "claude-opus-5"
}
}Windows
Set user environment variables in PowerShell:
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://cn-api.tokenfor.me", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "sk-your-key", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", "claude-opus-5", "User")
$env:ANTHROPIC_BASE_URL = "https://cn-api.tokenfor.me"
$env:ANTHROPIC_AUTH_TOKEN = "sk-your-key"
$env:ANTHROPIC_MODEL = "claude-opus-5"
claudeYou can also edit:
%USERPROFILE%\.claude\settings.json{
"env": {
"ANTHROPIC_BASE_URL": "https://cn-api.tokenfor.me",
"ANTHROPIC_AUTH_TOKEN": "sk-your-key",
"ANTHROPIC_MODEL": "claude-opus-5"
}
}If your Claude Code version only reads ANTHROPIC_API_KEY, put the same key there instead of ANTHROPIC_AUTH_TOKEN. Avoid mixing different Claude keys on the same machine.
CC Switch Configuration
CC Switch is useful when you want one place to manage providers for Claude Code, Codex, Gemini CLI, OpenClaw, Hermes, and similar tools. Get one target tool working first, then move the route into CC Switch.
To add a TokenFor provider in CC Switch:
- Open CC Switch and click
+ - Prefer
App-specific provider - Choose a custom provider for the current target app
- Enter the API key and endpoint
- Fetch models or enter the model ID manually
- Save and switch to the provider
- Reopen the terminal used by the target tool
Common values:
| Target tool | Endpoint | Model | API format |
|---|---|---|---|
| Codex | https://cn-api.tokenfor.me/v1 | gpt-5.6-sol | OpenAI Responses |
| Claude Code | https://cn-api.tokenfor.me | claude-opus-5 | Anthropic Messages |
| Gemini | https://cn-api.tokenfor.me/v1beta | gemini-3-pro-preview | Gemini |
For Codex custom format, confirm that the generated ~/.codex/config.toml contains:
model_provider = "tokenforme"
model = "gpt-5.6-sol"
[model_providers.tokenforme]
base_url = "https://cn-api.tokenfor.me/v1"
wire_api = "responses"
requires_openai_auth = false
env_key = "Tokenforme_KEY"For Claude custom format, confirm that the generated environment block contains:
{
"env": {
"ANTHROPIC_BASE_URL": "https://cn-api.tokenfor.me",
"ANTHROPIC_AUTH_TOKEN": "sk-your-key",
"ANTHROPIC_MODEL": "claude-opus-5"
}
}Hermes Configuration
Hermes stores its main config in ~/.hermes/config.yaml. Put secrets in ~/.hermes/.env. For a first working GPT route, configure it as an OpenAI-compatible Responses endpoint.
Edit the secret file:
nano ~/.hermes/.envOPENAI_API_KEY=sk-your-keyEdit the model config:
nano ~/.hermes/config.yamlmodel:
provider: openai
default: gpt-5.6-sol
base_url: "https://cn-api.tokenfor.me/v1"
api_mode: responsesYou can also switch models inside a Hermes session:
/model gpt-5.6-solFor Claude or Gemini models in Hermes, choose the matching provider type in Hermes model settings and use:
- Claude:
claude-opus-5 - Gemini:
gemini-3-pro-preview
Config changes usually apply to new sessions. Restart Hermes or switch models inside the session if an existing chat keeps using the old model.
Cherry Studio Configuration
Cherry Studio supports custom model providers. The usual path is:
Settings -> Model Services -> AddOpenAI-compatible / GPT
Add a custom provider:
| Field | Value |
|---|---|
| Provider type | OpenAI or OpenAI Compatible |
| API address | https://cn-api.tokenfor.me |
| API Key | sk-your-key |
| Model | gpt-5.6-sol |
Some Cherry Studio versions append /v1/chat/completions automatically. If the full URL or an extra /v1 fails, check whether the actual request became /v1/v1/chat/completions.
Claude
Add an Anthropic provider:
| Field | Value |
|---|---|
| Provider type | Anthropic |
| API address | https://cn-api.tokenfor.me |
| API Key | sk-your-key |
| Model | claude-opus-5 |
Gemini
Add a Gemini provider:
| Field | Value |
|---|---|
| Provider type | Gemini |
| API address | https://cn-api.tokenfor.me/v1beta |
| API Key | sk-your-key |
| Model | gemini-3-pro-preview |
After saving, run Check/Test Connection. If models are not fetched automatically, add the model IDs manually.
OpenClaw Configuration
OpenClaw can use separate providers for GPT, Claude, Gemini, and Grok. One key is bound to one vendor group, so use the matching key for each group.
GPT
{
"models": {
"providers": {
"tokenforme-gpt": {
"baseUrl": "<API BaseURL>/v1",
"apiKey": "sk-your-key",
"models": [
{
"id": "gpt-5.6-sol",
"name": "gpt-5.6-sol",
"api": "openai-responses",
"reasoning": true,
"input": ["text"]
}
]
}
}
}
}Claude
{
"models": {
"providers": {
"tokenforme-claude": {
"baseUrl": "<API BaseURL>/v1",
"apiKey": "sk-your-key",
"models": [
{
"id": "claude-opus-5",
"name": "claude-opus-5",
"api": "anthropic-messages",
"reasoning": true,
"input": ["text"]
}
]
}
}
}
}Gemini
{
"models": {
"providers": {
"tokenforme-gemini": {
"baseUrl": "<API BaseURL>/v1beta",
"apiKey": "sk-your-key",
"api": "google-generative-ai",
"models": [
{
"id": "gemini-3-pro-preview",
"name": "gemini-3-pro-preview",
"api": "google-generative-ai",
"reasoning": false,
"input": ["text", "image"]
}
],
"authHeader": true,
"request": {
"headers": {
"Authorization": "Bearer ${models.providers.tokenforme-gemini.apiKey}"
}
}
}
}
}
}Grok
{
"models": {
"providers": {
"tokenforme-grok": {
"baseUrl": "<API BaseURL>/v1",
"apiKey": "sk-your-key",
"models": [
{
"id": "grok-4.5",
"name": "grok-4.5",
"api": "openai",
"reasoning": true,
"input": ["text", "image"]
}
]
}
}
}
}Continue Plugin
Example Continue config for VS Code:
name: TokenFor Models
version: 0.0.1
schema: v1
models:
- name: gpt-5.6-sol
provider: openai
model: gpt-5.6-sol
apiKey: "sk-your-key"
apiBase: "<API BaseURL>/v1"
- name: claude-opus-5
provider: anthropic
model: claude-opus-5
apiKey: "sk-your-key"
apiBase: "<API BaseURL>"
- name: gemini-3-pro-preview
provider: gemini
model: gemini-3-pro-preview
apiKey: "sk-your-key"
apiBase: "<API BaseURL>/v1beta"If your Continue version does not support one of these provider types, switch that model to a provider type supported by your local version and verify it with a short test request.
Other Tools
For Qoder, Cursor, and other tools that support custom model APIs, the usual flow is:
- Find the Model, Provider, API, or Endpoint settings
- Use
<API BaseURL>/v1for OpenAI-compatible tools - Use
<API BaseURL>for Anthropic-compatible tools - Use
<API BaseURL>/v1betafor Gemini-compatible tools - Paste the API key created in the Site URL console
- Select or enter a model ID, such as
gpt-5.6-sol,claude-opus-5, orgemini-3-pro-preview - Save and send a short test message
If the tool has Test Connection, Check, or Fetch Models, use it before running long tasks.
Debugging & Troubleshooting
- Authentication failure: check whether the key is correct, enabled, and belongs to the vendor group for the selected model
- Connection failure: make sure the BaseURL is the API BaseURL from the Overview page, not a website URL
- Path failure: check whether
/v1was appended twice, especially in Cherry Studio and Claude Code - Model not found: confirm the model is enabled in the console and use the exact model ID
- CC Switch change not applied: reopen the target CLI terminal and confirm it reads the same config directory
- Codex still uses official OpenAI: confirm
requires_openai_auth = false,env_key, and the environment variable name match exactly