Skip to content

在 Trae 中使用 AgentRouter

Trae 是 IDE / 桌面端型 Harness,通过 Settings → Models → Add Model → Custom Config 接入 AgentRouter。

WARNING

Trae 下载并安装后需要先登录;直接选择个人用户登录即可。登录本身不影响 AgentRouter 接入,但不登录时 Model 设置和 Add Model 入口不可用。

配置参数

配置项填写内容 / 说明
入口Settings → Models → Add Model → Custom Config
Opus 系列 API FormatAnthropic Messages
Opus 系列 Custom Request URLhttps://agentrouter.org
Opus 系列 Model ID 示例claude-opus-4-6claude-opus-4-7claude-opus-4-8
GPT 与其他兼容系列模型 API FormatOpenAI Completions
GPT 与其他兼容系列模型 Custom Request URLhttps://agentrouter.org(Full URL 关闭时由 Trae 自动拼接路径,不要加 /v1
GPT 与其他兼容系列模型 Model ID 示例gpt-5.5glm-5.2
API Key你的 AgentRouter API Key

安装与配置步骤

  1. 下载安装 Trae:从 Trae 官网下载对应系统安装包并完成安装。
  2. 登录 Trae:首次启动后选择个人用户登录。登录后才能进入可用的模型配置入口。
  3. 打开模型设置:进入 Settings,左侧选择 Models。
  4. 添加模型:点击 Add Model,并切换到 Custom Config。
  5. 选择 API Format:如果接入 claude-opus 系列,API Format 选择 Anthropic Messages;如果接入 gpt-5.5glm-5.2,API Format 选择 OpenAI Completions。
  6. 填写 Custom Request URL:填写 https://agentrouter.org。不要在末尾加斜杠。
  7. 填写 Model ID:Opus 系列可填 claude-opus-4-6claude-opus-4-7claude-opus-4-8;OpenAI Completions 类可填 gpt-5.5glm-5.2
  8. 填写 API Key 并保存:填写你的 AgentRouter Key,然后点击 Add Model 保存。
  9. 验证连通性:在 Trae 对话中发送"只回复 OK"。如果返回 OK,说明模型接入成功。