简短答案
Base URL 要跟工具协议匹配。Claude Code 通常使用 Anthropic-compatible 根地址;Codex、Cursor、Cline、OpenCode、OpenClaw 等外部工具通常使用 OpenAI-compatible/v1 地址。
在 LLMEasy 中:
| 使用场景 | Base URL |
|---|---|
| Claude Code / Anthropic-compatible | https://www.llmeasy.ru |
| Codex / OpenAI-compatible | https://www.llmeasy.ru/v1 |
| Cursor、Cline、OpenCode、OpenClaw | https://www.llmeasy.ru/v1 |
为什么会有不同 Base URL
不同 SDK 对路径拼接方式不同。| 协议或工具类型 | 常见行为 |
|---|---|
| OpenAI-compatible SDK | 通常基于 /v1 访问 chat completions、responses 等资源 |
| Anthropic-compatible SDK | 通常由 SDK 拼接消息接口路径,不应重复添加 /v1 |
| 工具内置 provider | 可能自动补路径,也可能要求你填写完整 Base URL |
推荐速查
| 工具 | 推荐配置 |
|---|---|
| Claude Code | https://www.llmeasy.ru,使用 Claude 分组 API Key |
| Claude Desktop Gateway | 按 Gateway 页面说明填写,注意 auth scheme |
| Codex CLI | https://www.llmeasy.ru/v1,使用 GPT 分组 API Key |
| Cursor | https://www.llmeasy.ru/v1,使用 GPT 分组 API Key |
| Cline | https://www.llmeasy.ru/v1,选择 OpenAI Compatible provider |
| OpenCode / OpenClaw | https://www.llmeasy.ru/v1,使用 GPT 分组 API Key |
常见错误
| 报错或现象 | 可能原因 |
|---|---|
404 Not Found | Base URL 路径和 SDK 期望不一致 |
model not found | Model ID 不属于当前 Key group 或 provider |
invalid_api_key | API Key 和 Base URL 不属于同一服务 |
| 认证通过但模型不可用 | Key group 和 Model ID 不匹配 |
| 请求一直失败 | 把 Anthropic-compatible 地址填进 OpenAI-compatible 工具,或反过来 |
推荐排查顺序
- 先确认工具要求 OpenAI-compatible 还是 Anthropic-compatible。
- 检查 Base URL 是否和工具协议匹配。
- 检查 API Key 是否来自同一个服务。
- 检查 Model ID 是否来自模型广场,并属于当前 Key group。
- 发送一个最小请求测试,例如只问一句
hello。
代码示例
OpenAI-compatible 工具通常使用/v1 地址:
关于 LLMEasy
LLMEasy 同时提供 Anthropic-compatible 和 OpenAI-compatible 的接入方式。你可以在同一个 dashboard 管理 API Key、余额和用量记录,但每个客户端仍然要填写它实际支持的协议地址。 简单记法:Claude Code 看https://www.llmeasy.ru;Codex、Cursor、Cline、OpenCode、OpenClaw 看 https://www.llmeasy.ru/v1。

