问 HN:大家如何预测 Agent 工作流的 AI API 成本?

3作者: Barathkanna5 个月前
我一直在尝试基于 Agent 的功能,让我感到惊讶的是,估算 API 成本竟然如此之难。<p>一个用户操作可以触发从几个到几十个 LLM 调用(工具使用、重试、推理步骤),而基于 token 的定价方式使得成本变化很大。<p>这里的开发者们在为 SaaS 定价时是如何规划的呢?<p>你们是简单地提高利润率、限制使用量,还是构建内部成本跟踪系统? 另外,我也很好奇,对于构建 Agent 工作流程的人来说,提供可预测的 AI API 定价服务(例如固定订阅费用)真的有用吗?
查看原文
I’ve been experimenting with agent-based features and one thing that surprised me is how hard it is to estimate API costs.<p>A single user action can trigger anywhere from a few to dozens of LLM calls (tool use, retries, reasoning steps), and with token-based pricing the cost can vary a lot.<p>How are builders here planning for this when pricing their SaaS?<p>Are you just padding margins, limiting usage, or building internal cost tracking? Also curious, would a service that offers predictable pricing for AI APIs (like a fixed subscription cost) actually be useful for people building agentic workflows?