BEGINNER SETUP CENTER

第一次使用 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

1
APIGate AccountEmail · Password · Balance

账户:查看余额、用量和管理 Key。Account: view balance, usage, and keys.

2
ats_••••••••API Key

API Key:像专门给软件使用的密码。API key: a password used by software.

3
AI Agent / API ClientOpenClaw · Codex · Claude Code · Cursor · Cline · More

智能体或客户端:你输入任务、AI执行工作的应用;不限于某两个品牌。Agent or client: the app where you give the AI tasks; it is not limited to two brands.

使用范围与隐私:Use and privacy: 用于个人学习、编程练习和研究。不要上传身份证件、银行卡资料、密码、私钥、客户资料、医疗记录、未公开商业文件或其他敏感信息;让智能体读取本地文件前先检查并脱敏。For personal learning, coding practice, and research. Do not upload identity documents, payment data, passwords, private keys, customer data, medical records, confidential files, or other sensitive information. Review and redact local files first.

注册、验证、充值、保存 KeyRegister, verify, add credit, and save your key

  1. 打开首页,点击“免费注册”。
  2. 填写姓名、邮箱和至少8位密码。
  3. 立即复制以 ats_ 开头的API Key,并保存到密码管理器。页面关闭后不会再次完整显示。
  4. 到邮箱点击验证链接,再点击页面上的“确认验证邮箱”。验证成功后会自动返回控制台。
  5. 登录控制台,选择¥20首次体验、¥50轻量、¥100标准或¥1,000高频使用。所有档位只有预存余额不同,模型、价格、功能和调用限制相同。
退款规则:仅未使用余额可申请退款,已消耗的模型用量不退。控制台提交原因后由人工审核;批准后原路退回,通常需要5–10个工作日,实际以发卡银行为准。
付款提示:Link或Apple Pay等钱包会先检查设备与账户资格,显示速度可能比银行卡慢。Apple Pay需要兼容的Apple设备、Safari、Wallet内有效银行卡及支持地区;如二维码或钱包不可用,请直接改用银行卡或Link。
安全提醒:不要把完整Key发到聊天群、截图、工单或公开代码仓库。教程中的ats_your_key_here必须替换成你自己的Key。
  1. Open the home page and click “Sign up free.”
  2. Enter your name, email, and a password of at least 8 characters.
  3. Immediately copy the API key beginning with ats_ and store it in a password manager. It will not be shown in full again.
  4. Open the verification email, then click “Confirm email” on the page. You will return to the console automatically.
  5. 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.
Payment note: Link and Apple Pay can load after card fields because Stripe checks device and account eligibility. Apple Pay requires a compatible Apple device, Safari, a valid Wallet card, and a supported region. If a QR code or wallet is unavailable, use a bank card or Link.
Security: Never post the complete key in a chat group, screenshot, support ticket, or public repository. Replace 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

● ● ●CodexOpen a project folder

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.

PS C:\MyProject>claudeHow can I help?

Claude Code

在 macOS 终端、Windows PowerShell/WSL 或 Linux 中使用,适合逐步学习命令行。Runs in macOS Terminal, Windows PowerShell/WSL, or Linux and is suitable for learning command-line workflows.

MobileCustom API client required

手机和平板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.

供应商ProviderModel ID名称Name适合Best for
Loading…

Codex

macOS / Windows · Responses API
● ● ●CodexOpen folder → Settings → Model provider

画面路线:打开项目文件夹 → 设置 APIGate → 新建任务 → 输入最小测试。Visual route: open a project → configure APIGate → create a task → run the minimum test.

适合希望让 AI 读取、修改和测试本地项目的学习者。

  1. OpenAI Developers 下载适合系统的 Codex;完成安装后先打开一次,再完全退出。
  2. macOS 打开“终端”。先安全地把 Key 放入当前登录会话;输入时屏幕不会显示 Key。
  3. 备份并编辑~/.codex/config.toml,把下面配置合并进去。若文件已有其他设置,不要整份覆盖。
  4. 重新打开 Codex,选择一个练习项目文件夹,在模型中使用gpt-5.4-mini。不要选择 nano;客户端工具可能不受该模型支持。
  5. 新建任务并输入:Reply only: APIGATE_OK。看到APIGATE_OK即成功。

For learners who want an AI agent to read, edit, and test local projects.

  1. Download Codex for your system from OpenAI Developers. Open it once after installation, then quit it completely.
  2. On macOS, open Terminal and place the key into the current login session without displaying it.
  3. Back up and edit ~/.codex/config.toml. Merge the block below without overwriting unrelated settings.
  4. Reopen Codex, choose a practice project folder, and use gpt-5.4-mini. Avoid nano because some client tools may not be supported.
  5. Create a task and enter Reply only: APIGATE_OK. Seeing APIGATE_OK means 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_KEY
model = "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

Windows / macOS / Linux · Anthropic Messages API
2026年9月3日恢复公告:Service restored on 3 September 2026: 此前的Anthropic上游余额问题已经解决,APIGate已对全部5个密钥槽完成真实生成验证。请关闭旧终端、打开新窗口,再按本节命令重新测试。The earlier Anthropic upstream credit issue has been resolved. APIGate completed real-generation checks across all five key slots. Close the old terminal, open a fresh window, and retest with the commands below.
PS C:\MyFirstProject>claudeReply only: APIGATE_OK

画面路线:安装 Claude Code → 打开项目文件夹 → 设置两个变量 → 先做单次测试。Visual route: install Claude Code → open a project → set two variables → run a one-shot test.

  1. 按照 Claude Code 官方安装说明完成安装。Windows 请选择官方支持的 PowerShell、WSL 或 Git for Windows 路线。
  2. 打开终端并进入一个不含敏感资料的练习项目文件夹。
  3. 执行下面的安全输入命令,把ats_ Key 作为令牌,并把 Base URL 指向 APIGate。
  4. 先执行单次测试。看到APIGATE_OK后,再运行claude进入交互模式。
  1. Install Claude Code using the official setup guide. On Windows, use the supported PowerShell, WSL, or Git for Windows route.
  2. Open Terminal and enter a practice project folder that contains no sensitive data.
  3. Run the secure input commands below. They use your ats_ key as the token and point the Base URL to APIGate.
  4. Run the one-shot test first. After seeing APIGATE_OK, run claude for 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"
选模说明:Model selection: 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

Local Gateway · OpenAI-compatible
  1. 先执行openclaw --version确认已安装。
  2. 设置当前终端的APIGATE_API_KEY
  3. 打开~/.openclaw/openclaw.json,将下面内容合并到现有配置;不要删除原来的渠道、工具或代理设置。
  4. 运行openclaw config validateopenclaw models status
  5. 重启Gateway,再发送单次测试。
  1. Run openclaw --version to confirm installation.
  2. Set APIGATE_API_KEY in the current shell.
  3. Open ~/.openclaw/openclaw.json and merge the block below. Keep existing channels, tools, and agent settings.
  4. Run openclaw config validate and openclaw models status.
  5. 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"}]}'
成功标准:Success criteria: HTTP 200 · APIGATE_OK · 控制台出现一笔新用量a new usage row appears in the console.

iPhone、iPad 与 AndroidiPhone, iPad, and Android

1
SettingsCustom provider / API

确认客户端明确提供“自定义供应商”或“自定义 API”。Confirm the client explicitly supports a custom provider or API.

2
Base URLhttps://api.apigate.biz/v1

填写 Base URL、自己的 ats_ Key 和控制台列出的 Model ID。Enter the Base URL, your ats_ key, and a listed Model ID.

3
New chatReply only: APIGATE_OK

发送最小测试,确认回复后再用于个人学习。Send the minimum test before using it for personal learning.

重要:Important: 官方 ChatGPT 和 Claude 手机 App 的普通聊天登录页不是自定义 API Key 设置页。没有 Base URL 选项时不要粘贴 Key。我们会在完成实际设备测试后公布经过验证的手机客户端名单。The normal sign-in screens in the official ChatGPT and Claude mobile apps are not custom API-key setup screens. Never paste a key if there is no Base URL field. A tested mobile-client list will be published after device verification.

常见问题与排错Common problems and fixes

现象Symptom含义Meaning处理Fix
401Key缺失、错误或已停用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