Claude API 中国大陆怎么调用?完整教程

Anthropic 的 Claude 是目前最强的长文写作和代码模型之一。Claude 3.5 Sonnet 在多项基准上超过 GPT-4o。但中国大陆用户面临和 OpenAI 一样的问题:官网被墙、注册要海外手机号、付款要外币卡。

3 种方案

方案 1:API 中转站(推荐)

最简单的方案,中国大陆直连,无需代理:

from openai import OpenAI

client = OpenAI(

api_key="你的 openllmapi Key",

base_url="https://api.openllmapi.com"

)

response = client.chat.completions.create(

model="claude-3-5-sonnet-20241022",

messages=[{"role": "user", "content": "写一篇 2000 字的产品分析报告"}]

)

print(response.choices[0].message.content)

通过 openllmapi.com 中转,用 OpenAI SDK 格式调用 Claude,价格比官方便宜 30%。

方案 2:官方注册

1. 代理访问 console.anthropic.com

2. 邮箱注册(需海外手机号验证)

3. 绑定外币信用卡

4. 获取 API Key

5. 注册送 $5 免费额度

import anthropic

client = anthropic.Anthropic(api_key="你的 Anthropic Key")

message = client.messages.create(

model="claude-3-5-sonnet-20241022",

max_tokens=1024,

messages=[{"role": "user", "content": "Hello"}]

)

print(message.content[0].text)

注意:中国大陆直接调用 api.anthropic.com 需要代理。

方案 3:国产替代

如果主要做长文写作和代码,这些国产模型是不错的替代:

  • DeepSeek — 代码能力接近 Claude,价格低 100 倍
  • Kimi — 128K 上下文,长文档分析
  • 通义千问 — 中文写作能力强

Claude 免费额度

👉 Claude 详情 · Anthropic API 详情

Claude vs ChatGPT vs DeepSeek

产品免费额度
Claude 网页版有限次数/天(免费用户)
Claude Pro$20/月,无限制
Anthropic API注册送 $5
ClaudeChatGPTDeepSeek
长文写作⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
代码⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
中文⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
价格极便宜
中国大陆直连

总结

中国大陆用 Claude API 最省心的方案是 API 中转站。如果预算有限,DeepSeek 在大多数场景下是 Claude 的高性价比替代。

👉 42 家 AI 免费额度汇总 · openllmapi.com 中转服务

---

更新于 2026 年 4 月。