Anthropic
Claude Sonnet 4.5
Anthropic 2025 旗舰模型,在代码生成、分析、写作等任务上表现卓越
上下文长度200K tokens
模型类型大语言模型 (LLM)
多模态支持文本、图像输入
定价与规格
💰 定价
输入$3 / M tokens
输出$15 / M tokens
⚙️ 规格
上下文长度200K tokens
模型类型大语言模型 (LLM)
多模态支持文本、图像输入
训练截止日期2025年9月
API 调用示例
Python
import anthropic
client = anthropic.Anthropic(
api_key="your-api-key"
)
message = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=1024,
messages=[
{"role": "user", "content": "Hello, Claude!"}
]
)
print(message.content[0].text)cURL
curl https://api.xairouter.com/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "claude-sonnet-4-5-20250929",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Hello, Claude!"}
]
}'