Claude Sonnet 5.5
Claude Sonnet 5.5 API 僅需 Anthropic 定價的一半:每 100 萬 token 輸入 $1、輸出 $5。深入了解相較於 Sonnet 5 的更新、基準測試、破壞性變更及可用程式碼。
A codebase you don't know is a risk, not a hurdle. The plan should burn down that risk in order: understand, run, trace, spike, then make the change small enough that "production-ready" is a property you can demonstrate, not a hope.
Here are the first five steps, with the evidence you collect at each.
Step 1 — Get it building and the baseline green (half day)
Read the README, the manifest(s), the CI config, and any architecture docs. Boot the app locally, run the full test suite, run the linter/typechecker.
Evidence: The exact commands that reproduce a clean build and a passing test suite from a fresh checkout (recorded output, not memory of it). A one-page map you wrote yourself: where the entry points are, the layers, the build/test toolchain, and the main risks to your feature (e.g. "this touches cron jobs and payments").
Step 2 — Trace the smallest end-to-end slice that resembles your feature (half day)
Don't start with your feature. Pick a neighboring one that already works and follow it from entry to persistence. Note the conventions along the way: how errors surface, how config is injected, how logging is done, how tests are written.
Evidence: An annotated trace — file → function → what it does — for that slice. A written list of "conventions I must follow" (not intuitions; things you observed in real code). A named shortlist of the 3–5 files you will actually touch. If you can't produce this trace, you're not ready to write code.
Step 3 — Spike the core path (day 2)
Build the ugly version: hardcoded values, no error handling, no tests. The purpose is to confirm the path you traced in step 2 is real and to surface what you didn't know you didn't know.
Evidence: A working spike demonstrating the feature's central data path, alongside a list of every assumption the spike broke and what you corrected. That correction list is the most valuable document in this whole plan.
Step 4 — Write the contract before the code (half of day 2 / day 3)
Once the spike proves the path, pin down what production needs: the inputs/outputs, the error cases, where it sits in the conventions from step 2. Then write the tests — they'll be red, but they're the specification.
Evidence: A one-to-two-page design doc, an agreed interface/API shape (with the team if there is one), and a red test suite that encodes intended behavior. If you can't write the contract without consulting the code, you haven't finished step 2.
Step 5 — Implement in small, verified increments (days 3–4)
Replace the spike with the real thing in small commits, each one keeping the suite green, leaning on the existing patterns. Run lint/tests/typecheck per commit — CI, not just locally — and exercise the actual path against a real instance (staging or a local environment that isn't stubbed).
Evidence: A branch with progressive commits, each green in CI; coverage on the new code; something that proves it works against reality (a test result, a log trace, a screenshot); and a review by at least one person who knows the codebase. The review counts as evidence — an unfamiliar codebase has tribal knowledge you cannot extract from the files alone.
Steps 6+ would be the things that actually make it "shipped": a migration plan and its rollback, feature flagging, observability, the release and post-release verification. But the first five get you to a reviewed, green, working slice in staging — which is the point at which you can say "this will work in production" with evidence behind it, instead of a guess.
執行會以這段提示開啟 AI Chat。需要登入與點數。
模型詳情
在 Playground、API 請求與內部工作流程中使用相同的模型鍵。
- 模型 ID
- claude-sonnet-5-5
- 供應商
- Anthropic
- 協定
- Anthropic Messages
- 上下文視窗
- 1,000,000 Token
- 最大輸出
- 128,000 Token
- 輸入 Token
- 100 credits / 1M Token
- 輸出 Token
- 500 credits / 1M Token
- 快取讀取
- 10 credits / 1M Token
- 快取寫入
- 125 credits / 1M Token
Claude Sonnet 5.5 有何新變化
Anthropic 於 2026 年 9 月 28 日推出 Claude Sonnet 5.5,作為 Sonnet 5 的直接升級版本。官方標價維持不變,但它能完成的工作量以及執行時消耗的 token 數量均有顯著改進。
Anthropic 報告指出 Sonnet 5.5 的 GDPval-AA 得分為 1844,僅落後 Opus 5.5 (1846) 兩分,並領先 Sonnet 5 (1449) 約 400 分。Anthropic 也表示,在需要持續判斷的開放式工作上,Opus 5.5 依然具有明顯優勢。
在 CursorBench 4.0 上,Anthropic 報告 Sonnet 5.5 得分為 55.5%,而 Sonnet 5 為 34.1%,Opus 5.5 為 57.8%。Anthropic 將其定位於範圍明確的日常工作:建構功能、修復 Bug,以及製作文件、簡報和試算表。
早期客戶在各自的實際工作負載中反饋了節省效果:Slack 在未修改 Prompt 的情況下減少了約 14% 的輸出 token;Balyasny Asset Management 在 2,441 項金融任務中測得每個回答約需 121K token,而 Sonnet 5 則需 497K。
Anthropic 表示其輸出速度比 Sonnet 5 快 30% 以上;Artificial Analysis 測得每秒約輸出 139 個 token。Tokenizer 保持不變,因此相同文字在兩個模型上計算出的 token 數量完全相同。
Claude Sonnet 5.5 vs Sonnet 5 vs Opus 5.5
三者均使用同一個 AIReiter key。簡而言之:一旦您的請求通過下方的遷移檢查,即可停止使用 Sonnet 5,並將 Opus 5.5 保留用於最具挑戰性的開放式工作。
Sonnet 5.5 與 Sonnet 5:同等價格,更高產出
兩者的官方定價均為每 100 萬 token 輸入 $2、輸出 $10。Sonnet 5.5 在上述編程與知識工作基準測試中得分更高,且通常消耗更少的 token 即可完成,因此完成相同工作的實際成本往往更低。
Sonnet 5.5 與 Opus 5.5:價格僅需一半
在此處,Sonnet 5.5 的價格為每 100 萬 token 輸入 $1.00、輸出 $5.00;Opus 5.5 為 $2.00 和 $10.00。兩者均具備 1M token 上下文窗口和 128K 最大輸出,因此切換時只需更改 model 欄位即可。
何時仍然值得選用 Opus 5.5
適用於冗長且需求模糊的任務——此時模型需要自主規劃、自我除錯並持續執行。Base44 報告指出,在構建應用程式時,Sonnet 5.5 平均每次構建需要 3.6 次迭代,而 Opus 5 為 7.7 次;因此建議優先嘗試 Sonnet 5.5,僅在任務失敗時才升級至更高階模型。
何時應暫時停留在 Sonnet 5
若您的程式碼停用了思考模式(thinking)、強制指定特定工具或設定了 temperature,這些請求在 Sonnet 5.5 上將會失敗,直到您進行修改。安全性工具可能也會遇到更多拒絕回應的情況。請先修正這些問題,再進行遷移。
從 Sonnet 5 遷移:現在會回傳錯誤的項目
僅將模型字串更改為 claude-sonnet-5-5 並不總是足夠的。以下請求格式在 Sonnet 5 上可正常運作,但在 Sonnet 5.5 上會被拒絕。
thinking: disabled 將返回 400 錯誤
自適應思考(Adaptive thinking)預設一律開啟。請將 {"type": "disabled"} 替換為最低設定 {"type": "between_tools"},這會在首次回應前跳過思考。between_tools 僅適用於 low、medium 或 high effort;若為 xhigh 或 max,請省略 thinking 或傳送 {"type": "adaptive"}。
手動設定思考預算(thinking budget)將返回 400 錯誤
thinking: {"type": "enabled", "budget_tokens": N} 將被拒絕。請改用 effort 等級來控制思考深度。思考 token 仍會計入 max_tokens 並按輸出計費,因此如果回答開始遭到截斷,請調高 max_tokens。
強制指定工具(Forced tool choice)將被拒絕
強制指定單一特定工具的 tool_choice 現在會報錯。請使用自動工具選擇(automatic tool choice)並搭配嚴格的工具定義,讓模型自行決定呼叫時機。
自訂 temperature、top_p 與 top_k 將返回 400 錯誤
系統僅接受預設取樣參數。請直接從請求中移除這些欄位,而非將其設為固定值。另外有一項對您有利的變更:最小可快取 prompt 長度從 1,024 token 降至 512 token。
在正式上線前選擇合適的 effort 等級
Effort 現在是調節成本與延遲的主要設定。共有五個等級:low、medium、high、xhigh 與 max。
API 預設為 high
若未指定 effort,API 會以 high 執行。Claude Code 和 Claude 應用程式預設為 medium。請明確設定 output_config.effort,以避免帳單費用受預設值影響。
max 費用昂貴
在 max effort 下,Artificial Analysis 測得每項任務的牌價成本為 $7.60,在其索引中產生了 410M 輸出 Token(中位數為 88M)。Anthropic 所宣稱的高效率是針對較低的等級,而非 max。
先從 medium 開始,評估後再調整
在 medium 下執行實際任務並檢查品質,僅在品質不足時才調高層級。對於延遲敏感的工具循環,使用 low 或搭配 between_tools 思考的 medium 能保持快速的首次回應。
AIReiter 上的 Claude Sonnet 5.5 API 定價
管理 API 金鑰 →每個項目均按 Anthropic 牌價的 50% 計費。相同的模型、相同的 Messages 協議。
輸入 $1.00(牌價 $2.00)。輸出 $5.00(牌價 $10.00)。快取讀取 $0.10(牌價 $0.20)。快取寫入 $1.25(牌價 $2.50)。以上均為每百萬 Token 計價。
100 萬個輸入 Token 加上 10 萬個輸出 Token 在此僅需 $1.50,而 Anthropic 牌價為 $3.00。同樣的調用在 Opus 5.5 上在此需 $3.00。
調用開始時會先預扣預估費用,待回應完成後依實際 Token 數量結算並退還差額。費率從第 1 個 Token 到第 100 萬個 Token 均保持一致,沒有長上下文階梯定價。
用 3 個步驟試用 Claude Sonnet 5.5
- 01
取得金鑰並將客戶端指向 AIReiter
在您的 AIReiter 控制面板建立 API 金鑰。在官方 Anthropic SDK 中將 base URL 設定為 https://aireiter.com/api — SDK 會自行附加 /v1/messages。
- 02
使用 curl 發送請求
curl https://aireiter.com/api/v1/messages \ -H "x-api-key: $AIREITER_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "content-type: application/json" \ -d '{ "model": "claude-sonnet-5-5", "max_tokens": 4096, "output_config": {"effort": "medium"}, "messages": [{"role": "user", "content": "Hello"}] }'
- 03
或使用 Python SDK
from anthropic import Anthropic client = Anthropic(api_key="YOUR_AIREITER_KEY", base_url="https://aireiter.com/api") msg = client.messages.create( model="claude-sonnet-5-5", max_tokens=4096, messages=[{"role": "user", "content": "Hello"}], ) print(msg.content[0].text)
常見問題
01Claude Sonnet 5.5 何時發布?其模型 ID 為何?
Anthropic 於 2026 年 9 月 28 日發布。API 模型 ID 為 claude-sonnet-5-5,其知識截止日期為 2026 年 6 月。
02上下文視窗和最大輸出長度為何?
具備 1M Token 的上下文視窗,每次請求最多可輸出 128K Token。支援文字與圖片輸入,並回傳文字。
03Claude Sonnet 5.5 API 的費用是多少?
Anthropic 的定價為每百萬 tokens 輸入 $2、輸出 $10,與 Sonnet 5 相同。AIReiter 僅收取半價:輸入 $1、輸出 $5、快取讀取(cache reads)$0.10 以及快取寫入(cache writes)$1.25。
04我可以關閉思考功能嗎?
並非完全如此。停用 thinking(thinking disabled)會傳回 400 錯誤。最低設定為 between_tools,可在 low、medium 和 high effort 下運作。
05Sonnet 5.5 比 Sonnet 5 更好嗎?
根據 Anthropic 公布的程式碼編寫與知識工作基準測試,答案是肯定的,且以大幅優勢領先,同時定價相同。在切換之前,請先查看上方的遷移變更,因為某些 Sonnet 5 的請求格式(request shapes)現在可能會失敗。
06為什麼我的安全相關問題被拒絕,或是由 Sonnet 5 回答?
Sonnet 5.5 是首款具備 Anthropic 最強模型所使用之網路安全防護機制的 Sonnet。某些較高風險的請求會退回由 Sonnet 5 處理,且良性的安全任務也可能會遇到更多拒絕。這是上游系統的行為。
07我需要 Anthropic 帳號嗎?
不需要。AIReiter 金鑰適用於 AIReiter 端點,而且在編寫任何程式碼之前,您可以在此頁面的 playground 中試用該模型。
08支援哪些 API?
/api/v1/messages 的 Anthropic Messages 是主要的協定規格,並支援串流(streaming)。同時也提供 OpenAI 風格的 Chat Completions 與 Responses API,而 /api/v1/models 則會列出您的金鑰可使用的模型。