请问HN:人们是如何预测代理工作流程中AI API成本的?
我一直在尝试基于代理的功能,其中一件让我感到惊讶的事情是,估算API成本是多么困难。<p>单个用户操作可能会触发从几个到几十个大型语言模型(LLM)调用(工具使用、重试、推理步骤),而基于令牌的定价使得成本差异很大。<p>在定价他们的SaaS时,这里的开发者是如何考虑这些因素的?<p>你们是通过提高利润空间、限制使用,还是建立内部成本跟踪来应对的?<p>我也很好奇,提供可预测定价的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?