你的卡片上有 3 个值Your card has 3 values Endpoint · Key · Model
配置任何工具都只做一件事:把这 3 个值填进去。下面每一页都是照抄就能用的完整步骤。Setting up any tool means one thing: entering these 3 values. Every page below is a copy-and-paste walkthrough.
gpt-4o 这类名字,会直接报 403 model_not_allowed。唯一的例外是 Claude 系工具(
/anthropic 接口):那里填 claude-* 也可以,网关会自动指向你卡片上的模型。Copy the model name exactly as printed. Do not substitute names like gpt-4o — they return 403 model_not_allowed.The one exception is Claude-family tools (the
/anthropic surface): a claude-* name works there too, and the gateway points it at the model on your card.找到你要用的工具Find your tool
左边点对应的一项,照着做即可。只需要配一个,不用全配 —— 所有工具共用同一把 Key、同一份余额。Pick the matching item in the left sidebar and follow it. You only need one — every tool shares the same key and the same balance.
| 你用的工具Your tool | 难度Effort | 配置里填的接入地址(Base URL)Base URL to enter |
|---|---|---|
| Chatbox 聊天软件chat app |
最简单easiest | https://api.thetoken.biz/openai 软件会自动补 /v1/chat/completionsthe app appends /v1/chat/completions |
| Cherry Studio 聊天软件chat app |
最简单easiest | https://api.thetoken.biz/openai 软件会自动补 /v1/chat/completionsthe app appends /v1/chat/completions |
| Claude Cowork 需开开发者模式needs Developer Mode |
中等medium | https://api.thetoken.biz/anthropic ⚠ 结尾没有 /v1⚠ no /v1 at the end |
| Claude Code · Claude SDK | 中等medium | https://api.thetoken.biz/anthropic ⚠ 结尾没有 /v1,多写会 404⚠ no /v1 — adding it causes a 404 |
| Codex CLI · opencode · OpenAI SDK | 中等medium | https://api.thetoken.biz/openai/v1 这里结尾要有 /v1the /v1 is required here |
| ChatGPT 官方 Appofficial app | 用不了not usable | 官方 App 不能改接入地址 → 请看左边「ChatGPT App」页的替代方案The official app cannot use a custom endpoint → see the "ChatGPT App" page for alternatives |
用之前先知道两件事Two things to know
opencode CLI openai/v1
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"thetoken": {
"npm": "@ai-sdk/openai-compatible",
"name": "The Token",
"options": {
"baseURL": "https://api.thetoken.biz/openai/v1",
"apiKey": "YOUR_KEY"
},
"models": {
"YOUR_MODEL": { "name": "YOUR_MODEL", "tool_call": true }
}
}
}
}
- 把
YOUR_KEY换成卡片上的 Key。ReplaceYOUR_KEYwith the key on your card. - 把 全部 3 处
YOUR_MODEL换成卡片上的模型名。Replace all 3 occurrences ofYOUR_MODELwith the model name on your card.
opencode run --model thetoken/YOUR_MODEL "What is 2+2?"
Codex CLI openai/v1
model = "YOUR_MODEL" model_provider = "thetoken" [model_providers.thetoken] name = "The Token" base_url = "https://api.thetoken.biz/openai/v1" wire_api = "chat" http_headers = { "api-key" = "YOUR_KEY" }
- 把
YOUR_MODEL换成卡片上的模型名。ReplaceYOUR_MODELwith the model name on your card. - 把
YOUR_KEY换成卡片上的 Key。ReplaceYOUR_KEYwith the key on your card.
codex exec --skip-git-repo-check "What is 2+2?"
wire_api 请保持 "chat"。改成 "responses" 也能跑,但多轮对话偶尔会断。Keep wire_api set to "chat". "responses" also works but can drop multi-turn sessions.Claude Code anthropic
全部配置只改一个文件。不要登录 Anthropic 账号,不需要官方订阅,不需要安装任何代理软件。The entire setup is one file. Do not log in to an Anthropic account, no subscription is needed, and no proxy software is required.
.claude 文件夹不存在,自己新建即可。用记事本 / VS Code 打开就行。If the file or the .claude folder does not exist, just create it. Any text editor works.{
"env": {
"ANTHROPIC_BASE_URL": "https://api.thetoken.biz/anthropic",
"ANTHROPIC_AUTH_TOKEN": "YOUR_KEY",
"ANTHROPIC_MODEL": "YOUR_MODEL",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "YOUR_MODEL",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "YOUR_MODEL",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "YOUR_MODEL",
"ANTHROPIC_SMALL_FAST_MODEL": "YOUR_MODEL",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
}
}
"env": { … } 这一整块加到最外层大括号里,其余原样保留(注意上一项末尾要补一个英文逗号)。If the file already has content: do not overwrite it. Add the whole "env": { … } block inside the outermost braces and keep the rest (remember the comma after the previous entry).- 把
YOUR_KEY换成卡片上的 Key。ReplaceYOUR_KEYwith the key on your card. - 把 全部 5 处
YOUR_MODEL都换成卡片上的同一个模型名(用编辑器的「全部替换」最快)。Replace all 5 occurrences ofYOUR_MODELwith the same model name from your card (use "Replace all"). - 保存。检查引号和逗号都是英文半角。Save. Make sure all quotes and commas are plain ASCII.
claude -p "What is 2+2?"
最容易踩的 3 个坑The 3 usual mistakes
/v1。必须是 …/anthropic。Claude Code 会自己补 /v1/messages,多写就变成 /v1/v1/messages → 404。Adding /v1 to the URL. It must be …/anthropic. Claude Code appends /v1/messages itself; with the extra segment you get /v1/v1/messages → 404.ANTHROPIC_API_KEY。必须用 ANTHROPIC_AUTH_TOKEN,否则会触发 Claude Code 自己的账号校验流程。Using ANTHROPIC_API_KEY. Use ANTHROPIC_AUTH_TOKEN instead, otherwise Claude Code runs its own account validation flow.ANTHROPIC_MODEL。Claude Code 还会用「小模型」跑起标题、命令建议等后台任务。5 个模型变量必须全部填成同一个值,否则聊天正常但状态栏一直报 403。Only setting ANTHROPIC_MODEL. Claude Code also uses a "small" model for titles and suggestions. All 5 model variables must be the same value, or chat works while the status line keeps showing 403.其他说明Also worth knowing
.claude/settings.json。This file stores your key in plain text. Fine on a personal machine, but keep it out of git — especially a project-level .claude/settings.json.thinking(扩展思考)不生效,会被忽略;其余功能包括工具调用都正常。thinking (extended thinking) is ignored; everything else, including tool use, works normally.Claude Cowork anthropic
Cowork 是 Claude 桌面应用里的办公助手模式。它自带一个「开发者模式」,可以把它接到我们这里 —— 全程点鼠标填表格,不用写任何配置文件。Cowork is the assistant mode inside the Claude desktop app. Its Developer Mode lets you point it here — all clicking and form-filling, no config files.
Developer 菜单。Fully quit and reopen the app — only then does a Developer menu appear.auth scheme 选 x-api-key 也能用,但建议先用 bearer。Leave Gateway extra headers empty. x-api-key also works as the auth scheme, but start with bearer.claude-sonnet-4-5。如果它坚持要你填,就填
claude-sonnet-4-5。You do not need to list models. The app asks us and shows claude-sonnet-4-5 in the picker.If it insists on a value, enter
claude-sonnet-4-5.你会注意到的几件事Things you will notice
claude-sonnet-4-5 是正常的。Cowork 只认 Anthropic 自家的模型名,所以我们对它统一报这个名字。实际跑的、计费的都是你卡片上的模型。Seeing claude-sonnet-4-5 in the picker is expected. Cowork only accepts Anthropic's own model names, so that is the name we advertise. What actually runs — and what gets billed — is the model on your card./v1。必须是 …/anthropic,应用会自己补后面的路径。多写会全部 404。No /v1 at the end. It must be …/anthropic; the app appends the rest. The extra segment makes everything 404.ChatGPT App N/A
| 替代软件Alternative | 适合谁Who it suits |
|---|---|
| Chatbox | 界面最像 ChatGPT,安装完填 3 个框就能聊。推荐一般办公用户从这个开始。Closest to ChatGPT's feel; install, fill 3 fields, start chatting. Best starting point for most people. |
| Cherry Studio | 功能更多(知识库、翻译、多模型切换),愿意多点几下就选它。More features (knowledge base, translation, multiple providers) if you don't mind a few more clicks. |
| Codex CLI | OpenAI 官方的命令行工具,支持自定义接入地址。适合写代码的人。OpenAI's own command-line tool — it does support a custom endpoint. For people who write code. |
Chatbox openai
最省事的一个:装好软件,填 3 个框,就能像用 ChatGPT 一样聊天。The easiest option: install, fill in 3 fields, chat like you would in ChatGPT.
/v1。Chatbox 会自己在后面接上 /v1/chat/completions。如果软件里有单独的「API 路径」框,保持默认的 /v1/chat/completions 不要改。Do not add /v1 to the API host. Chatbox appends /v1/chat/completions itself. If there is a separate "API Path" field, leave its default /v1/chat/completions alone.- 点「获取模型列表 / 刷新」,列表里应该出现你卡片上的模型 —— 选中它。Click "fetch / refresh model list" — the model on your card should appear. Select it.
- 列表拉不出来也没关系:直接手动输入模型名,原样照抄卡片,一个字符都不要改。If the list does not load, just type the model name manually, copied exactly from your card.
配不通时先看这里If it does not connect
https://api.thetoken.biz/openai/v1/chat/completions —— 出现 /v1/v1 就是「API 域名」里多写了 /v1。404. Almost always a doubled path. The final request URL must be exactly https://api.thetoken.biz/openai/v1/chat/completions — a /v1/v1 means you added /v1 to the host.gpt-4o 之类。403 model_not_allowed. Wrong model name — copy it exactly from your card; names like gpt-4o will not work.Cherry Studio openai
功能比 Chatbox 多(知识库、翻译、画图入口等),配置也只是填两个框 + 手动加一个模型。More features than Chatbox (knowledge base, translation and more); setup is still two fields plus adding one model.
The Token),提供商类型必须选 OpenAI。Name it anything (e.g. The Token). The provider type must be OpenAI./v1,也不要以斜杠结尾。Cherry Studio 会自己接上 /v1/chat/completions。No /v1 and no trailing slash. Cherry Studio appends /v1/chat/completions itself.- 点页面左下角的「管理」按钮,会自动列出你的 Key 能用的模型。Click Manage at the bottom left — it lists the models your key can reach.
- 点模型右边的 + 把它加进模型列表。不点 + 的话,聊天时的模型下拉框里是找不到它的。Click the + next to the model to add it to the list. Without this it will not appear in the chat model picker.
- 列表拉不出来就手动添加:模型 ID 原样照抄卡片。If the list does not load, add it by hand: the model ID is copied exactly from your card.
配不通时先看这里If it does not connect
/v1/v1。「API 地址」里多写了 /v1。删掉即可。如果删掉还是 404,改填完整地址并在结尾加一个
#:https://api.thetoken.biz/openai/v1/chat/completions# —— # 是 Cherry Studio 的约定,表示「就用这个地址,别再自动拼接」。404, or you see /v1/v1. You added /v1 to the host — remove it.If it still 404s, enter the full path and end it with
#: https://api.thetoken.biz/openai/v1/chat/completions# — in Cherry Studio the # means "use this URL as-is, do not append anything".OpenAI SDK openai/v1
已有的 OpenAI 代码一行都不用改逻辑,只把 base_url 和 api_key 换掉即可。Existing OpenAI code needs no logic changes — only swap base_url and api_key.
pip install openai # Python npm install openai # Node.js
from openai import OpenAI client = OpenAI( base_url="https://api.thetoken.biz/openai/v1", api_key="YOUR_KEY", ) r = client.chat.completions.create( model="YOUR_MODEL", messages=[{"role": "user", "content": "hi"}], ) print(r.choices[0].message.content)
curl https://api.thetoken.biz/openai/v1/chat/completions \ -H "Authorization: Bearer YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"YOUR_MODEL","messages":[{"role":"user","content":"hi"}]}'
Anthropic SDK / REST anthropic
/v1(SDK 自己会补 /v1/messages);curl 直连时才写完整路径。另外 max_tokens 是必填项,不填会 400。Do not put /v1 in the SDK base_url (the SDK appends /v1/messages); only curl uses the full path. Also, max_tokens is required — omitting it returns 400.from anthropic import Anthropic client = Anthropic( base_url="https://api.thetoken.biz/anthropic", api_key="YOUR_KEY", ) r = client.messages.create( model="YOUR_MODEL", max_tokens=1024, messages=[{"role": "user", "content": "hi"}], ) print(r.content[0].text)
curl https://api.thetoken.biz/anthropic/v1/messages \ -H "x-api-key: YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"YOUR_MODEL","max_tokens":1024,"messages":[{"role":"user","content":"hi"}]}'
@anthropic-ai/sdk 一样:new Anthropic({ baseURL: "https://api.thetoken.biz/anthropic", apiKey: "YOUR_KEY" })。TypeScript @anthropic-ai/sdk is the same: new Anthropic({ baseURL: "https://api.thetoken.biz/anthropic", apiKey: "YOUR_KEY" }).出错了怎么办Troubleshooting
| 你看到的提示What you see | 怎么办What to do |
|---|---|
404 或「找不到」/ "not found" | 地址写错了。Claude Code 用 …/anthropic(不带 /v1),其他工具用 …/openai/v1(要带 /v1)Wrong URL. Claude Code uses …/anthropic (no /v1); everything else uses …/openai/v1 (with /v1) |
401 missing_api_key | Key 没填上,或填错了位置。回到对应页面重新核对The key is missing or in the wrong field — recheck against your tool's page |
403 model_not_allowed | 模型名不对,必须原样照抄卡片。(仅 Claude 系工具可以填 claude-*)Wrong model name — copy it exactly from your card. (Only Claude-family tools may use a claude-* name.) |
400 model_alias_ambiguous | 你的 Key 可用多个模型,claude-* 无从判断该用哪个 → 改填卡片上的真实模型名Your key can reach several models, so a claude-* name cannot pick one → use the real model name from your card |
| Claude Code 能聊天,但一直闪 403Claude Code chats fine but keeps flashing 403 | 5 个模型变量没填全,回到 Claude Code 页第 ③ 步Not all 5 model variables are set — see step ③ on the Claude Code page |
| Claude Code / cowork 报“不是 Anthropic 模型”Claude Code / cowork says "not an Anthropic model" | 这类工具只认 Anthropic 自己的模型名 → 模型格填 claude-sonnet-4-5,网关会自动指向你卡片上的模型These tools only accept Anthropic's own model names → enter claude-sonnet-4-5 and the gateway points it at the model on your card |
403 quota_exhausted403 insufficient_credit | 额度用完了 → 联系管理员充值Out of quota → ask the admin to top up |
403 key_expired | Key 到期 → 联系管理员续期Key expired → ask the admin to renew |
400 (自己写代码时)(when writing your own code) | Anthropic 接口漏了 max_tokens,它是必填的The Anthropic endpoint is missing max_tokens — it is required |
| 长任务做到一半断了A long task stops halfway | 超出单次 30 秒 / 2 MB 上限。把任务拆小再试It exceeded the 30 s / 2 MB per-request limit — split the task up |
| 回答不是一个字一个字出来的The answer is not typed out word by word | 正常现象。为了准确计费,内容会等模型答完后一次性返回Expected. For accurate metering the text is released only after the model finishes |
| 改了配置没生效Config change had no effect | 关掉终端 / 客户端重新打开。配置只在启动时读一次Close and reopen the terminal / app — config is read only at startup |