Source: https://aiprimetech.io/zh/docs/guides/api-key-configuration/ [首页](/zh/) / [文档](/zh/docs/) / 各工具的 API 密钥配置 # 各工具的 API 密钥配置 选择正确的密钥分组,然后使用客户端所需的密钥和基础 URL。 复制页面 [ 以 Markdown 查看](/zh/docs/guides/api-key-configuration.md) [ 向 ChatGPT 提问](https://chatgpt.com/?q=Read%20https%3A//aiprimetech.io/docs/guides/api-key-configuration.md%20and%20answer%20questions%20about%20it.%20Start%20with%20a%20short%20summary.) [ 在 Claude 中提问](https://claude.ai/new?q=Read%20https%3A//aiprimetech.io/docs/guides/api-key-configuration.md%20and%20answer%20questions%20about%20it.%20Start%20with%20a%20short%20summary.) ## 先选择访问组 - 确认所需套餐或按余额使用的访问权限已在您的账户中生效。 - 对于限时 Claude 套餐,请使用以下组中的密钥: Claude Unlimited。Codex 组的密钥使用独立的 GPT/Codex 路由。 - 检查 [可用模型](/zh/docs/getting-started/models/) ,在配置客户端之前使用同一密钥进行检查。 然后使用下面的客户端设置。请妥善保管密钥,并在开始较大任务之前测试一个简短请求。 一份统一参考,让您无需为了记住一个后缀而打开五份指南。 | 工具 | 密钥填写位置 | 基础 URL | Claude Code | ANTHROPIC_AUTH_TOKEN | https://aiprimetech.io | Anthropic SDK(Python/TS) | api_key= 或 ANTHROPIC_API_KEY | https://aiprimetech.io | OpenAI SDK(Python/TS) | api_key= 或 OPENAI_API_KEY | https://aiprimetech.io/v1 | Cursor | 设置 → 模型 → OpenAI 密钥 | https://aiprimetech.io/v1 | Cline | 扩展设置中的 Anthropic 提供商 | https://aiprimetech.io | Continue | apiKey 在 config.json | https://aiprimetech.io (anthropic)/ https://aiprimetech.io/v1 (openai) | Aider | ANTHROPIC_API_KEY / OPENAI_API_KEY | ANTHROPIC_API_BASE / OPENAI_API_BASE | Codex CLI | OPENAI_API_KEY | https://aiprimetech.io/v1 | Zed | 助手提供商设置 | https://aiprimetech.io/v1 | LangChain / LiteLLM | OPENAI_API_KEY | https://aiprimetech.io/v1 | curl (Messages) | x-api-key 请求头 | https://aiprimetech.io/v1/messages | curl (Chat Completions) | Authorization: Bearer | https://aiprimetech.io/v1/chat/completions | OpenCode (provider/npm configuration) | provider..options.apiKey | https://aiprimetech.io/v1 替换为 @ai-sdk/anthropic | Hermes 具名自定义提供商 | key_env 在提供商配置中 | https://aiprimetech.io/v1; transport: anthropic_messages | OpenClaw 自定义 Claude 提供商 | 提供商 apiKey; api: anthropic-messages | https://aiprimetech.io 请按您所用客户端对应的行配置。Claude Code 和 Anthropic SDK 使用不带路径的源地址;OpenCode 的 Anthropic 提供商示例和 Hermes 自定义提供商使用 /v1。仅凭 API 格式无法确定客户端如何追加路径。 [身份验证请求头参考](/zh/docs/getting-started/authentication/)[基础 URL后缀为何不同](/zh/docs/getting-started/base-urls/)[故障排查按症状查找的索引](/zh/docs/guides/troubleshooting/) [智能体配置选择工具并发起首次请求](/zh/agents/)[模型与分组查看所选密钥可用的 ID](/zh/docs/getting-started/models/) [上一页适用于 Claude Code 的 MCP 服务器](/zh/docs/guides/mcp-servers/)[下一页费用控制](/zh/docs/guides/cost-control/)