Attributes used to calculate cost
The estimated total cost (io.honeycomb.gen_ai.cost.estimated_total_cost) is calculated from:
- Input (prompt) and output (completion) tokens
- Cached token reads and writes (when applicable)
- AI model and provider
Honeycomb reads a fallback name only when the preferred name is absent or empty.
The two cache counts are subsets of
gen_ai.usage.input_tokens, not additions to it.
Honeycomb prices them out of that same input total at their own rates, so a cache read is never double-counted.
How LLM span cost is calculated
A span’s cost is calculated only when all of the following are true. The following checks run in order, and the first failure stops the calculation.1
The span names a model.
gen_ai.response.model, or else gen_ai.request.model.2
The span does not already carry a cost.
3
The operation accounts for tokens.
One of
chat, text_completion, generate_content, embeddings, or retrieval. Aliases resolve first, so chat_completion counts as chat.Operations such invoke_agent, create_agent, execute_tool, or invoke_workflow are not priced, because their cost is already captured by the inference spans beneath them.4
The provider is supported.
openai, anthropic, or aws.bedrock. The comparison is case-insensitive and ignores surrounding whitespace. More providers are planned.5
The span reports token counts.
At least one of
gen_ai.usage.input_tokens or gen_ai.usage.output_tokens.6
The model appears in the pricing catalog.
New model releases can take a short time to appear.
Honeycomb searches the catalog for your reported provider first, then the whole catalog.
That second pass prices a Bedrock-hosted Anthropic model, whose rates are published by Anthropic rather than AWS.
On those spans,
gen_ai.provider.name is aws.bedrock while io.honeycomb.gen_ai.cost.pricing_provider is anthropic.
The two fields are expected to be different. This is not a bug.LLM cost fields Honeycomb adds
Honeycomb writes seven fields in theio.honeycomb.gen_ai.cost namespace.
double
Estimated cost of the input tokens in US dollars.
double
Estimated cost of the output tokens in US dollars.
double
Estimated cost of the whole LLM call in US dollars.
string
The provider whose rates were applied.
string
The pricing library that performed the calculation.
string
The source of the rate data.
string
The version of the price table applied.
pricing_* fields record what produced the estimate, so you can trace any cost estimate back to the price table used to calculate it.
The pricing_* fields are written as a set of four, or not at all.
Honeycomb reports three cost figures only.
There is no separate cost field for cache reads, cache writes, or reasoning tokens, even though those counts feed the calculation.
To see where a rate difference shows up, group by model and provider.
About the io.honeycomb.* namespace
The io.honeycomb.* namespace is an incubating space for attributes Honeycomb is also pursuing upstream in the OpenTelemetry semantic conventions.
Honeycomb defines an allowlist of io.honeycomb.* keys and what each key means. Undeclared io.honeycomb.* keys are dropped at ingest. If you provide your own values, they are never overwritten.
Reporting your own LLM costs
Honeycomb never overwrites a cost your instrumentation reported. If any one of the three cost fields is present on the span, Honeycomb writes none of the seven. This matters when your provider reports an authoritative per-call cost a catalog cannot reproduce. For example, an OpenRouter call may route to a different upstream provider on every request, so only the response knows what it cost. Send that figure and Honeycomb leaves it alone.
Honeycomb never deletes a key you sent. To summarize the table above:
- Honeycomb does not complete a partial set. A total assembled from your two figures and Honeycomb’s arithmetic would be neither yours nor ours, and no consumer of the field could tell which. Send all three, or send none.
- A cost of
0counts as a reported cost. The check tests whether the field is present, not its value. To have Honeycomb price a call, omit the field rather than sending zero. pricing_*fields are the overwrite exception. They name what computed the estimate, so leaving yours in place would credit Honeycomb’s number to a source that did not produce it. One edge case: if you send apricing_*field and the span cannot be priced, it stays with no cost field to explain it.
Where cost appears in Honeycomb
The seven fields are ordinary public fields on your dataset, and are available regardless of whether any LLM cost-specific UI is enabled for your team. They appear in the field picker, are queryable by name, and work withSUM, AVG, HEATMAP, P95, and any other numeric operator.
The cost fields also work in Triggers, SLOs, Boards, and Calculated Fields.
Example cost estimation queries
Cost by model or service
Find the estimated total cost of each LLM model or service.Cost per user
See the average cost per user or tenant.
Here are some useful queries you can run with the cost estimation fields:
Identify GenAI call cost outliers
Find cost outlier GenAI calls, then use BubbleUp to investigate further.Limitations
- The cost estimate is a catalog price, not your invoice.
- A span with no token counts cannot be priced, so a streaming call that never reports usage produces no cost.
- Agent, tool, and workflow spans are not priced. Cost accrues on the inference spans they contain.
- If a model is missing from the catalog, no cost estimate is calculated.
- Cost is estimated per call. You can use queries to aggregate to the trace or session.