Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

The most expensive part of my agent stack wasn’t tokens — it was the invoice roulette

说明与用途

在生产代理堆栈中,成本由工作流行为(重试、回退、后台任务和缓存)驱动,而不仅仅是令牌计数。了解这一点可实现批处理 API 和提示缓存的战略使用,以控制费用。

问题

Agent stacks that run 24/7 incur unpredictable and often higher costs than token‑based forecasts suggest, because workflow behaviors such as retries, fallbacks, background jobs, and caching significantly affect billing.

结果

Recognizing that billing volatility stems from workflow design rather than token count led to a shift in cost‑management strategy: use OpenAI Batch for offline jobs, apply Anthropic caching only when prompts are stable, and separate async work for Gemini batch. This reduces unexpected spikes and aligns cost with architectural choices.

工作流

  • 1. Receive event (e.g., support ticket webhook).
  • 2. AI Agent classifies urgency via LLM call.
  • 3. Agent calls CRM tool.
  • 4. Agent calls knowledge base tool.
  • 5. Agent drafts reply via LLM call.
  • 6. If a tool call times out, retry the step.
  • 7. On retry, earlier steps may run again, increasing token usage.
  • 8. Background jobs (nightly summarization, cache refresh) run independently of user events.

证据

If you run agents 24/7, especially across n8n, Make, Zapier, OpenClaw, or custom workflows, this matters more than most pricing pages admit.

来源

OpenAI Batch is a solid option for offline work. 50% lower cost than synchronous API usage.

来源

Anthropic caching looks fantastic on paper. It can be a huge win if your prompt prefixes are stable and requests arrive inside the cache window.

来源

  • 记录日期: 2026-09-21T16:30:21.223Z