市面上充斥着用 Cursor、Copilot 接口冒充官方的服务,我们只做一件事
仅替换 base_url,现有代码零修改
import anthropic
client = anthropic.Anthropic(
api_key="sk-cr-your-key",
base_url="https://yuann.ai"
)
message = client.messages.create(
model="claude-opus-4-7",
max_tokens=1024,
messages=[{
"role": "user",
"content": "Hello!"
}]
)
print(message.content)
所有倍率公开,按实际 Anthropic 官方价格乘以倍率计费
| 模型 ID | 输入倍率 | 输出倍率 | 缓存读取 | 缓存写入 | 上下文 |
|---|---|---|---|---|---|
| claude-opus-4-7 | 1.2× | 1.2× | 1.1× | 1.1× | 200K |
| claude-sonnet-4-6 | 1.1× | 1.1× | 1.0× | 1.0× | 200K |
| claude-haiku-4-5 | 1.0× | 1.0× | 1.0× | 1.0× | 200K |