Appearance
在 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 Format | Anthropic Messages |
| Opus 系列 Custom Request URL | https://agentrouter.org |
| Opus 系列 Model ID 示例 | claude-opus-4-6、claude-opus-4-7、claude-opus-4-8 |
| GPT 与其他兼容系列模型 API Format | OpenAI Completions |
| GPT 与其他兼容系列模型 Custom Request URL | https://agentrouter.org(Full URL 关闭时由 Trae 自动拼接路径,不要加 /v1) |
| GPT 与其他兼容系列模型 Model ID 示例 | gpt-5.5、glm-5.2 |
| API Key | 你的 AgentRouter API Key |
安装与配置步骤
- 下载安装 Trae:从 Trae 官网下载对应系统安装包并完成安装。
- 登录 Trae:首次启动后选择个人用户登录。登录后才能进入可用的模型配置入口。
- 打开模型设置:进入 Settings,左侧选择 Models。
- 添加模型:点击 Add Model,并切换到 Custom Config。
- 选择 API Format:如果接入
claude-opus系列,API Format 选择 Anthropic Messages;如果接入gpt-5.5、glm-5.2,API Format 选择 OpenAI Completions。 - 填写 Custom Request URL:填写
https://agentrouter.org。不要在末尾加斜杠。 - 填写 Model ID:Opus 系列可填
claude-opus-4-6、claude-opus-4-7和claude-opus-4-8;OpenAI Completions 类可填gpt-5.5和glm-5.2。 - 填写 API Key 并保存:填写你的 AgentRouter Key,然后点击 Add Model 保存。
- 验证连通性:在 Trae 对话中发送"只回复 OK"。如果返回 OK,说明模型接入成功。