账户:查看余额、用量和管理 Key。Account: view balance, usage, and keys.
第一次使用 AI 智能体Your first AI coding agent
不需要编程基础。先认识账户、API Key 和客户端,再按画面示意完成第一次连接。
No coding background is required. Learn what an account, API key, and client are, then follow the visual steps for your first connection.
先认识三个概念Learn three basics first
API Key:像专门给软件使用的密码。API key: a password used by software.
智能体或客户端:你输入任务、AI执行工作的应用;不限于某两个品牌。Agent or client: the app where you give the AI tasks; it is not limited to two brands.
注册、验证、充值、保存 KeyRegister, verify, add credit, and save your key
- 打开首页,点击“免费注册”。
- 填写姓名、邮箱和至少8位密码。
- 立即复制以
ats_开头的API Key,并保存到密码管理器。页面关闭后不会再次完整显示。 - 到邮箱点击验证链接,再点击页面上的“确认验证邮箱”。验证成功后会自动返回控制台。
- 登录控制台,选择¥20首次体验、¥50轻量、¥100标准或¥1,000高频使用。所有档位只有预存余额不同,模型、价格、功能和调用限制相同。
ats_your_key_here必须替换成你自己的Key。- Open the home page and click “Sign up free.”
- Enter your name, email, and a password of at least 8 characters.
- Immediately copy the API key beginning with
ats_and store it in a password manager. It will not be shown in full again. - Open the verification email, then click “Confirm email” on the page. You will return to the console automatically.
- Choose ¥20 one-time trial, ¥50 light use, ¥100 standard use, or ¥1,000 high usage. All amounts have identical model access, pricing, features, and request limits; only prepaid balance differs.
ats_your_key_here with your own key.已有账户?Already registered?
连接测试、Key 丢失处理和 API Key 管理的逐步说明仅在登录后控制台显示。Connection tests, lost-key recovery, and step-by-step API key management are available only in the signed-in console.
登录后查看补充教程Open the signed-in guide选择适合你的客户端Choose the right client
Codex
适合想让 AI 查看项目、修改文件和运行测试的学习者。macOS 使用桌面端;Windows 可先使用命令行方式。For learners who want AI to inspect projects, edit files, and run tests. Use the desktop app on macOS or start with the CLI on Windows.
Claude Code
在 macOS 终端、Windows PowerShell/WSL 或 Linux 中使用,适合逐步学习命令行。Runs in macOS Terminal, Windows PowerShell/WSL, or Linux and is suitable for learning command-line workflows.
手机和平板Phone and tablet
必须使用明确支持自定义 API 地址的客户端;官方聊天 App 不能当作 APIGate 设置入口。Use a client that explicitly supports a custom API endpoint. Official chat apps are not APIGate configuration screens.
画面为步骤示意,按钮名称可能随软件版本略有变化。Illustrations are representative; labels may change between app versions.
选择可用的 Model IDChoose an available Model ID
Model ID 是软件识别模型的准确名称,必须从下表复制,不能凭显示名称猜测。
A Model ID is the exact name software uses. Copy it from the live list below instead of guessing from a display name.
| 供应商Provider | Model ID | 名称Name | 适合Best for |
|---|---|---|---|
| Loading… | |||
Codex
画面路线:打开项目文件夹 → 设置 APIGate → 新建任务 → 输入最小测试。Visual route: open a project → configure APIGate → create a task → run the minimum test.
适合希望让 AI 读取、修改和测试本地项目的学习者。
- 从 OpenAI Developers 下载适合系统的 Codex;完成安装后先打开一次,再完全退出。
- macOS 打开“终端”。先安全地把 Key 放入当前登录会话;输入时屏幕不会显示 Key。
- 备份并编辑
~/.codex/config.toml,把下面配置合并进去。若文件已有其他设置,不要整份覆盖。 - 重新打开 Codex,选择一个练习项目文件夹,在模型中使用
gpt-5.4-mini。不要选择 nano;客户端工具可能不受该模型支持。 - 新建任务并输入:
Reply only: APIGATE_OK。看到APIGATE_OK即成功。
For learners who want an AI agent to read, edit, and test local projects.
- Download Codex for your system from OpenAI Developers. Open it once after installation, then quit it completely.
- On macOS, open Terminal and place the key into the current login session without displaying it.
- Back up and edit
~/.codex/config.toml. Merge the block below without overwriting unrelated settings. - Reopen Codex, choose a practice project folder, and use
gpt-5.4-mini. Avoid nano because some client tools may not be supported. - Create a task and enter
Reply only: APIGATE_OK. SeeingAPIGATE_OKmeans success.
read -s "APIGATE_API_KEY?Paste your ats_ key: "
export APIGATE_API_KEY
launchctl setenv APIGATE_API_KEY "$APIGATE_API_KEY"
unset APIGATE_API_KEYmodel = "gpt-5.4-mini"
model_provider = "apigate"
[model_providers.apigate]
name = "APIGate"
base_url = "https://api.apigate.biz/v1"
env_key = "APIGATE_API_KEY"
wire_api = "responses"
requires_openai_auth = false如果只测试命令行:codex exec "Reply only: APIGATE_OK"。注销macOS后需要重新设置环境变量。
CLI-only test: codex exec "Reply only: APIGATE_OK". Set the environment variable again after logging out of macOS.
Windows
Windows 先使用 Codex CLI:在 PowerShell 设置当前窗口的 Key,然后使用同一份 config.toml 配置。桌面界面若没有“自定义供应商”入口,不要把 Key 填入普通 ChatGPT 登录框。
On Windows, begin with the Codex CLI: set the key in PowerShell and use the same config.toml. If the desktop interface has no custom-provider option, never paste the key into a normal ChatGPT sign-in screen.
$secure = Read-Host "Paste your ats_ key" -AsSecureString
$ptr = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($secure)
$env:APIGATE_API_KEY = [Runtime.InteropServices.Marshal]::PtrToStringBSTR($ptr)
[Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ptr)
codex exec "Reply only: APIGATE_OK"Claude Code
画面路线:安装 Claude Code → 打开项目文件夹 → 设置两个变量 → 先做单次测试。Visual route: install Claude Code → open a project → set two variables → run a one-shot test.
- 按照 Claude Code 官方安装说明完成安装。Windows 请选择官方支持的 PowerShell、WSL 或 Git for Windows 路线。
- 打开终端并进入一个不含敏感资料的练习项目文件夹。
- 执行下面的安全输入命令,把
ats_Key 作为令牌,并把 Base URL 指向 APIGate。 - 先执行单次测试。看到
APIGATE_OK后,再运行claude进入交互模式。
- Install Claude Code using the official setup guide. On Windows, use the supported PowerShell, WSL, or Git for Windows route.
- Open Terminal and enter a practice project folder that contains no sensitive data.
- Run the secure input commands below. They use your
ats_key as the token and point the Base URL to APIGate. - Run the one-shot test first. After seeing
APIGATE_OK, runclaudefor interactive mode.
read -s "APIGATE_KEY?Paste your ats_ key: "
export ANTHROPIC_AUTH_TOKEN="$APIGATE_KEY"
unset APIGATE_KEY
export ANTHROPIC_BASE_URL="https://api.apigate.biz"
claude -p --model claude-haiku-4-5 "Reply only: APIGATE_OK"Windows PowerShell
Windows用户不要执行上面的read/export命令,请复制下面整段到PowerShell。看到APIGATE_OK后,使用同一个PowerShell窗口运行claude --model claude-sonnet-4-6。不要先执行/login。
Windows users must use the PowerShell block below instead of the read/export commands. After APIGATE_OK, run claude --model claude-sonnet-4-6 in the same window. Do not run /login first.
$secure = Read-Host "Paste your ats_ key" -AsSecureString
$ptr = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($secure)
$env:ANTHROPIC_AUTH_TOKEN = [Runtime.InteropServices.Marshal]::PtrToStringBSTR($ptr)
[Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ptr)
Remove-Item Env:ANTHROPIC_API_KEY -ErrorAction SilentlyContinue
$env:ANTHROPIC_BASE_URL = "https://api.apigate.biz"
claude -p --model claude-haiku-4-5 "Reply only: APIGATE_OK"cc switch等第三方工具不属于APIGate支持范围,可能无法自动读取模型。请从本页Model ID表复制名称,并通过claude --model MODEL_ID选择。出现“Please run /login · 403”通常表示当前PowerShell没有正确设置上述环境变量。Third-party tools such as cc switch are not an APIGate-supported selection method and may not discover models. Copy a name from this page and use claude --model MODEL_ID. “Please run /login · 403” usually means the environment variables were not set in the current PowerShell window.这些变量只对当前终端窗口有效,关闭后Key不会写进配置文件。Claude Code的提示缓存会按官方缓存倍率计费,并显示在APIGate用量记录中。
These variables apply only to the current Terminal window, so the key is not written to a config file. Claude Code prompt caching is billed using the official cache multipliers and recorded in APIGate usage.
OpenClaw
- 先执行
openclaw --version确认已安装。 - 设置当前终端的
APIGATE_API_KEY。 - 打开
~/.openclaw/openclaw.json,将下面内容合并到现有配置;不要删除原来的渠道、工具或代理设置。 - 运行
openclaw config validate和openclaw models status。 - 重启Gateway,再发送单次测试。
- Run
openclaw --versionto confirm installation. - Set
APIGATE_API_KEYin the current shell. - Open
~/.openclaw/openclaw.jsonand merge the block below. Keep existing channels, tools, and agent settings. - Run
openclaw config validateandopenclaw models status. - Restart the Gateway and run a one-shot test.
{
models: {
mode: "merge",
providers: {
apigate: {
baseUrl: "https://api.apigate.biz/v1",
apiKey: "${APIGATE_API_KEY}",
api: "openai-completions",
models: [{
id: "gpt-5.4-mini",
name: "GPT-5.4 mini via APIGate",
reasoning: true,
input: ["text", "image"],
contextWindow: 400000,
maxTokens: 128000
}]
}
}
},
agents: {
defaults: {
model: { primary: "apigate/gpt-5.4-mini" }
}
}
}read -s "APIGATE_API_KEY?Paste your ats_ key: "
export APIGATE_API_KEY
openclaw config validate
openclaw doctor
openclaw gateway restart
openclaw agent --local --message "Reply only: APIGATE_OK"通用API与最小测试Generic API and minimum test
如果你使用Python、JavaScript、Cherry Studio或其他支持自定义OpenAI地址的软件,Base URL使用https://api.apigate.biz/v1,Key使用你的ats_ Key。
For Python, JavaScript, Cherry Studio, or any client supporting a custom OpenAI endpoint, use https://api.apigate.biz/v1 as the Base URL and your ats_ key.
curl https://api.apigate.biz/v1/chat/completions \
-H "Authorization: Bearer ats_your_key_here" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.4-nano","messages":[{"role":"user","content":"Reply only: APIGATE_OK"}]}'APIGATE_OK · 控制台出现一笔新用量a new usage row appears in the console.iPhone、iPad 与 AndroidiPhone, iPad, and Android
确认客户端明确提供“自定义供应商”或“自定义 API”。Confirm the client explicitly supports a custom provider or API.
填写 Base URL、自己的 ats_ Key 和控制台列出的 Model ID。Enter the Base URL, your ats_ key, and a listed Model ID.
发送最小测试,确认回复后再用于个人学习。Send the minimum test before using it for personal learning.
常见问题与排错Common problems and fixes
| 现象Symptom | 含义Meaning | 处理Fix |
|---|---|---|
| 401 | Key缺失、错误或已停用Missing, invalid, or disabled key | 重新复制Key;确认没有空格;必要时在控制台轮换Copy again, remove spaces, or rotate it in the console |
| 402 | 余额不足或达到月度预算Insufficient balance or monthly budget reached | 充值或调整预算Add credit or change the budget |
| 400 unsupported_model | 模型名不在当前价格表Model is not in the active price list | 使用本页列出的完整模型名Use an exact model name shown on this page |
| 429 | 请求过快Too many requests | 等待一分钟后重试Wait one minute and retry |
| 连接超时Timeout | 客户端当前无法完成连接The client cannot complete the connection | 登录控制台打开补充教程进行连接测试;联系支持时只提供时间、系统和错误信息,不要发送完整 KeySign in and follow the supplementary connection test. Give support only the time, OS, and error—never the complete key |