Agent Cost-Control Engineering: Most of the Bill Isn't the Model
A Juejin AI deep dive argues that AI agent spending is structural rather than simply price times usage, framing a fourth discipline — cost-control engineering — alongside harness, context and loop engineering. It opens with a reported Claude Code case in which a user's daily usage jumped from 161 million to 1.306 billion tokens ($41 to $493) because server errors triggered automatic retries that Anthropic customer service said count against billing without compensation. The piece then surveys caching hit rates, tool-definition bloat, Code Mode, context clearing, sub-agent isolation and budget circuit breakers, drawing on figures from Anthropic, Manus and ProjectDiscovery plus third-party harness benchmarks showing 7x to 70x cost differences. It concludes that a shorter correct path, not a cheaper model, is the real target.
The report packages concrete, verifiable levers for cutting agent bills — cache breakpoints, turn-end clearing, tool-count reduction, Code Mode and retry budgets — alongside a documented retry-driven bill spike, giving practitioners an actionable checklist rather than generic cost advice.
一位 Claude Code 用户的当日用量从日均 1.61 亿 token 跳到 13.06 亿,等效 API 成本从 41 美元跳到 493 美元。他没改代码,没换模型,没加需求。多出来的是服务端报错触发的自动重试,而 Anthropic 客服确认:重试消耗的额度计入账单,且不补偿。 这件事说明一个被忽略的事实:Agent 的成本不是"单价 × 用量"的乘法题,而是结构性复利。你调的是提示词,账单涨的是重试;你以为在为大上下文付费,其实在为一个每轮都要重付的常量付费。 Harness 工程解决了"怎么让模型跑起来",Context 工程解决了"喂什么给它",Loop 工程解决了"怎么让它转下去"。三件事都让 Agent 更强,也让它更贵。现在缺的是第四件事:在变强的同时,把账单按住。这篇就叫它"省钱工程"。
一、先把账算清:钱到底花在哪一层
1.1 三种 token,三种价格,差一个数量级
Agent 的计费不是一个数,是一张阶梯表。同一个模型,同一个 token,位置不同,价格差 5 到 10 倍:
#Anthropic#Claude Code#Manus#ProjectDiscovery#Composio#Aider#OpenRouter#Cloudflare Workers AI#Vercel AI Gateway#DeepSeek#Particle-1#Aridio Silva