Anthropic: Claude Sonnet 4.6
Chatanthropic/claude-sonnet-4.6Sonnet 4.6 是 Anthropic 高能力 Sonnet 级模型,覆盖编码、代理和专业工作场景。它适合迭代开发、复杂代码库导航、带记忆的项目管理、文档生成以及 Web QA 和流程自动化。
1M context window
128K max output tokens
Released: 2026-02-17
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.6",
max_tokens=1024,
messages=[
{"role": "user", "content": "Hello!"}
],
)
print(message.content[0].text)