# Agent 的成本主要在每輪重讀 context,不在輸出
直覺會以為貴在 output,實際上絕大部分錢付在 cache read——也就是每一輪重新讀一次整個 context。
把 2026 年 10 月的 ccusage 數字按 Opus 5 定價拆開(input 25/cache read 0.1× = 6.25 per MTok):
| 項目 | 占比 |
|---|---|
| Cache Read | ~76% |
| Cache Create | ~15% |
| Output | ~9% |
| Input | ~0% |
機制是這樣:
成本 ≈ 請求次數 × 平均 context 大小 × cache read 單價
API 是 stateless 的,每次請求都要把整個對話重送一遍。已經 cache 的部分雖然打到 0.1 折,但基數是整個 context。實測平均每次請求的 context 約 210k token,所以每一次 tool call(讀檔、grep、跑測試)在還沒做任何事之前,就先付掉約 $0.11。
推論:要省錢,該減的是來回的輪數和context 的大小,不是叫 agent 少講話。限制 output 長度對帳單幾乎沒有影響。