Claude API Key 获取与使用指南

Claude API Key 是使用 Anthropic Claude 模型的凭证。本文介绍如何获取、配置和使用 Claude API Key。

获取 Claude API Key

官方渠道

  1. 访问 Anthropic Console
  2. 注册账户并完成验证
  3. 进入 API Keys 页面
  4. 点击 "Create Key" 创建新的 API Key

通过中转站

如果无法直接注册 Anthropic 账户,可以使用 AI API 中转站:

  1. 注册中转站账户
  2. 充值后获取 API Key
  3. 配置 base_url 为中转站地址

API Key 格式

定价说明

Claude API 按 token 用量计费:

配置 Base URL

# Python
import anthropic

client = anthropic.Anthropic(
    api_key="your-api-key",
    base_url="https://claude4u.com/v1"  # 中转站地址
)

message = client.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello, Claude!"}]
)

免费额度

Anthropic 为新用户提供有限的免费额度。用完后需要绑定信用卡充值。

提示:中转站通常提供更灵活的充值方式和更低的起充金额,适合个人开发者和小团队。

安全注意事项

Start Using 轻舟 AI

Stable, fast AI API relay — supports Claude, OpenAI, Gemini and more

Sign Up Now