模型名稱 | Claude Opus 4 | Claude Sonnet 4 | Claude Sonnet 3.7 | Claude Sonnet 3.5 | Claude Haiku 3.5 | Claude Opus 3 | Claude Haiku 3 |
---|---|---|---|---|---|---|---|
是否支持擴展思考 | 是 | 是 | 是 | 否 | 否 | 否 | 否 |
上下文窗口大小 | 200K | 200K | 200K | 200K | 200K | 200K | 200K |
最長輸出長度 | 32000 tokens | 64000 tokens | 64000 tokens | 8192 tokens | 8192 tokens | 4096 tokens | 4096 tokens |
訓練數據截止時間 | 2025年3月 | 2025年3月 | 2024年11月 | 2024年4月 | 2024年7月 | 2023年8月 | 2023年8月 |
最長輸出長度
。extra_headers={"anthropic-beta": "output-128k-2025-02-19"}
來把最大輸出從 64K 擴展到 128K,見下方「流式 128K」呼叫,或者參考 Claude 官方的Beta headers 說明。refusal
停止原因,用於處理模型因安全原因拒絕生成的內容:
refusal
停止原因。
interleaved-thinking-2025-05-14
:
POST
/v1/messages
名稱 | 位置 | 類型 | 必選 | 說明 |
---|---|---|---|---|
x-api-key | header | string | 否 | Bearer AIHUBMIX_API_KEY |
Content-Type | header | string | 否 | none |
body | body | object | 否 | none |
» model | body | string | 是 | none |
» messages | body | [object] | 是 | none |
»» role | body | string | 否 | none |
»» content | body | string | 是 | none |
» max_tokens | body | number | 是 | none |
狀態碼 | 狀態碼含義 | 說明 | 數據模型 |
---|---|---|---|
200 | OK | none | Inline |
refusal
停止原因:
output-128k-2025-02-19
測試頭僅在 Claude Sonnet 3.7 中可用claude-opus-4-20250514
, claude-sonnet-4-20250514
): text_editor_20250429
claude-3-7-sonnet-20250219
): text_editor_20250124
claude-3-5-sonnet-20241022
): text_editor_20241022
模型版本 | 工具類型 | 工具名稱 | 支持的功能 |
---|---|---|---|
Claude 4 (Opus/Sonnet) | text_editor_20250429 | str_replace_based_edit_tool | view, str_replace, create |
Claude 3.7 Sonnet | text_editor_20250124 | str_replace_editor | view, str_replace, create, undo_edit |
Claude 3.5 Sonnet | text_editor_20241022 | str_replace_editor | view, str_replace, create, undo_edit |
undo_edit
命令,請在代碼中移除對此功能的依賴。str_replace_editor
):
需要安裝 anthropic
包:
undo_edit
命令:Claude 4 模型不再支持撤銷編輯功能undo_edit
的邏輯