How are you attributing agent cost per successful task, not just per token?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2026 07:02 PM - edited 10-03-2026 07:09 PM
Hi everyone, I hope this helps start a useful comparison of notes for those running agents on Databricks in production.
Token cost per endpoint is easy to get. Tag the serving endpoints, and the custom tags propagate to system.billing.usage, where usage_metadata.endpoint_name lets you aggregate by team or app (the model serving cost docs and the example cost attribution dashboard cover this). What I have found much harder is the number the business actually asks about: what does one successful task cost?
Where it gets awkward:
- A single user request can fan out into several model calls, tool calls and retries, so billing rows (hourly or per endpoint) do not map cleanly to one request. MLflow traces do map to one request, but they do not carry dollars.
- "Successful" needs a definition outside billing. Thumbs up, a downstream action completing, or an LLM judge score all give different denominators, and the cost per success can swing a lot depending on which you pick.
- Retries and long tool loops quietly dominate spend on the bad days, and they are invisible in a per-token average.
The approach I am considering: log token counts per call into the trace, price them with a small rate table, join to the outcome signal by trace or request id, and use the billing system table only as a reconciliation check on the total. I have not got this running end to end yet, so I would like to hear what others do.
Questions for the community:
- Are you computing cost per task from traces and token counts, from billing tables, or something else?
- What are you using as the success signal?
- Has anyone found a clean way to attribute shared endpoint spend back to individual agents when several agents call the same model endpoint?