Anthropic: Claude Sonnet 4.5
Chatanthropic/claude-sonnet-4.5Anthropic 的均衡型 Sonnet 模型,在 SWE-bench Verified 等任务上表现优秀,适合编码、分析和通用任务,在能力、速度和成本之间取得较好平衡。
1M context window
64K max output tokens
Released: 2025-09-29
Protocols:OpenAIAnthropic
Capabilities:VisionFunction CallingReasoningPrompt CachingPDF Input
PricingRate 0.15x
| Type | HaoAI Price | Official Reference | Rate |
|---|---|---|---|
| Input | $0.45/M | $3/M | 0.15x · 85% savings |
| Output | $2.25/M | $15/M | 0.15x · 85% savings |
| Cache read | $0.045/M | $0.3/M | 0.15x · 85% savings |
| Cache write | $0.563/M | $3.75/M | 0.15x · 85% savings |
| Cache write 5m | $0.563/M | $3.75/M | 0.15x · 85% savings |
| Cache write 1h | $0.9/M | $6/M | 0.15x · 85% savings |
Code Examples
import anthropic
client = anthropic.Anthropic(
base_url="https://api.hao.ai/anthropic",
api_key="YOUR_HAOAI_API_KEY",
)
message = client.messages.create(
model="anthropic/claude-sonnet-4.5",
max_tokens=1024,
messages=[
{"role": "user", "content": "Hello!"}
],
)
print(message.content[0].text)