简短答案
在 Claude Code 中配置第三方 API 时,要先确认你使用的是 Anthropic-compatible endpoint。对于本仓库的接入方式,Claude Code 的 Base URL 使用https://www.llmeasy.ru,不要添加 /v1。
API Key 是你的认证凭证,Base URL 是 Claude Code 把模型请求发往的 API 地址。两者必须属于同一个 provider 和同一种协议。
如果你使用 LLMEasy 的 Claude 分组 API Key,通常只需要配置 ANTHROPIC_BASE_URL 和 ANTHROPIC_AUTH_TOKEN。如果使用 GPT 分组,还需要按接入文档配置 Claude Code 的模型映射。
什么时候需要配置它
- 你想让 Claude Code 使用自定义 API gateway
- 你拿到了 API Key,但不知道 Base URL 应该填什么
- 你在 Claude Code 里看到认证失败或 endpoint 不匹配
- 你不确定
https://www.llmeasy.ru和https://www.llmeasy.ru/v1的区别 - 你需要在 Claude 分组和 GPT 分组之间选择
核心概念
| 字段 | 含义 |
|---|---|
| API Key | 用于认证模型 API 请求的密钥 |
| Base URL | 模型请求发送到的 API 地址 |
| Anthropic-compatible API | 兼容 Anthropic / Claude 请求格式的 endpoint |
| OpenAI-compatible API | 兼容 OpenAI 请求格式的 endpoint,常用于 Codex、Cursor、Cline 等工具 |
| Model ID | 工具实际请求的模型名称或模型映射值 |
推荐配置
在 Claude Code 中接入 LLMEasy 时,先按 API Key 分组选择路径。 Claude 分组:https://www.llmeasy.ru/v1。
常见误区
- 给 Claude Code 的 Base URL 添加
/v1。Claude Code 的 Anthropic-compatible 配置不使用这个地址。 - 只换 API Key,不换 Base URL,导致请求仍走默认 endpoint。
- 把 GPT 分组模型 ID 当作 Claude 分组模型来用。
- 把 OpenAI-compatible endpoint 填进 Claude Code 的 Anthropic-compatible 字段。
- 在多个 shell profile、系统环境变量和配置文件里重复设置,导致旧变量覆盖新配置。
关于 LLMEasy
LLMEasy 提供两类 endpoint:Claude Code 使用的 Anthropic-compatiblehttps://www.llmeasy.ru,以及 Codex / 外部工具使用的 OpenAI-compatible https://www.llmeasy.ru/v1。
这能让你在同一个 dashboard 中管理 API Key、余额和用量记录,但不会改变 Claude Code 对 Anthropic-compatible 请求格式的要求。
Related docs
- Claude Code 接入 LLMEasy 指南
- Claude Code 是用 Claude.ai 账号还是 API Key?
- OpenAI-compatible API 和 Anthropic-compatible API 有什么区别?
- Claude Code token 为什么消耗很多?如何降低成本?

