Live data from Hacker News

Ask HN: How are people forecasting AI API costs for agent workflows?

news.ycombinator.com

11–20 of 28 posts

Re: Ask HN: How are people forecasting AI API costs for agent workflows?

#15
this is exactly the problem we keep running into. the cost isn't just "how many tokens did this call use," its "how many tokens did this entire user action consume across all the agent loops, retries, tool calls, and embeddings."

most observability tools show you the LLM call as one flat span. you can see it cost X tokens but you cant correlate it with the API request that triggered it, or see that the agent looped 4 times because the first 3 outputs failed validation. so you end up building custom logging and hoping the numbers add up.

we've been building an APM (immersivefusion.com) where cost is a first-class dimension on every trace. so you can see one request flow from the UI through your backend through the agent workflow, and each span carries its token cost. the idea is you should be able to answer "what does a checkout cost when the recommendation agent is in the loop" without stitching together 3 different tools.

for the forecasting question specifically, i think the answer is you need a few weeks of production data with good instrumentation and then you can build a distribution. the variance is real but its not random, its usually a few specific flows that blow up (retries on bad structured output like @hkonte mentioned, or RAG queries that hit the wrong chunk size). once you can see which flows are expensive the guardrails become obvious.

also wrote a longer piece on this if anyone's interested: immersivefusion.com/blog/end-to-end-observability-from-ui-to-ai-agent-to-invoice

Re: Ask HN: How are people forecasting AI API costs for agent workflows?

#16

this is exactly the problem we keep running into. the cost isn't just "how many tokens did this call use," its "how many tokens did this entire user action consume across all the agent loops, retries, tool calls, and embeddings." most observability tools show you the LLM call as one flat span. you can see it cost X tokens but you cant correlate it with the API request that triggered it, or see that the agent looped 4…

Agreed. The real cost unit becomes the whole agent workflow, not a single LLM call. One user action can trigger dozens of calls.

We ran into the same issue and ended up building https://oxlo.ai to make the cost side more predictable for agent workloads.

Re: Ask HN: How are people forecasting AI API costs for agent workflows?

#17
post #13

[dead]

One underlooked source of variance is retries from formatting failures. In many agent systems the loops dominate the cost, not the raw token length.

We ran into the same issue building agent workflows, which is why we started building https://oxlo.ai — experimenting with a flat subscription model where we absorb the token variance so builders don’t have to constantly model token risk.

Re: Ask HN: How are people forecasting AI API costs for agent workflows?

#18

I love the idea. @Edgee.ai we are tracking cost in real time by tag, LLM, ...but not yet on forecast, and indeed it will be very useful. Something to explore; thanks for the feedback.

That’s great. Real-time tracking is a big step already. The tricky part we kept running into was the variance itself, especially with retries and agent loops. That’s partly why we started experimenting with Oxlo.ai (https://oxlo.ai) where the pricing model absorbs that variance so builders don’t have to constantly model token risk.

Re: Ask HN: How are people forecasting AI API costs for agent workflows?

#19

[flagged]

Local models help remove token cost uncertainty, but they shift the problem to infrastructure and ops. GPUs, scaling, maintenance, and latency can add up quickly depending on the workload. For many builders it ends up being a tradeoff between predictable infra cost and flexible API usage.

Re: Ask HN: How are people forecasting AI API costs for agent workflows?

#20
post #12

It feels like the traditional fixed SaaS pricing model is slowly shifting toward more consumption-based pricing.

That’s true, but AI is interesting because consumption-based pricing introduces a lot more variance than typical SaaS infrastructure. One user action can trigger dozens of model calls in an agent workflow. That’s partly why we started experimenting with models like https://oxlo.ai where the pricing flips back to a fixed subscription and we absorb the usage spikes.
Post reply on HN