Your LLM dashboard may count Anthropic costs twice
By Chris Krah. Plexito, my company, maintains spantruth, the tool this page recommends. Measured on November 6, 2026 · the report · source
I sent one Claude call to a local stub that returned 1,000 input tokens and 200 output tokens. At $3 and $15 per million tokens, that call costs $0.006. With OpenLLMetry or the OpenTelemetry GenAI instrumentation, the totals of self-hosted Phoenix and Opik came to $0.012 for it.
Your invoice from Anthropic does not change, and no call is sent twice. The wrong number is the one your observability tool shows, and no error tells you. That number is what budget alerts, cost per customer and model comparisons read.
A span is a record of one operation. Since version 1.14.0, released in October 2026, the Anthropic Python SDK writes its own span for each call by default, named anthropic.messages.create, with token counts on it. It does this when your app has registered a global OpenTelemetry tracer provider, directly or through a setup call such as Traceloop.init. If an instrumentation library also writes a span with token counts, two spans now report the same call, and a backend that adds them up shows it twice.
This is documented. Anthropic's SDK tracing docs say: "If another library also traces the SDK, turn off one of the two." Each piece behaves reasonably alone. The default just means that an app that adds a library and does not read that line gets the overlap.
Check your project
Search all spans, not only root spans, for anthropic.messages.create. If they appear next to the spans of your library, both with token counts, you have the duplicate.
- Clear the default filter. On the GenAI and older OpenInference rows below, the SDK's span is a child span. In Phoenix, replace the default
parent_id is Nonefilter on the Spans tab. In Opik, use the Spans tab under Logs. - Do not rely on one trace. With OpenLLMetry and no parent span in your app, the two spans land in two separate traces, and each trace looks clean.
- Anthropic's API tracing adds a third source. If you turned it on, its spans have the same name and also carry usage, so the switch below can leave two counts. Anthropic's docs tell them apart by span kind (
CLIENTfor the SDK,SERVERfor the API) or byservice.name(claude-platformfor the API), and their rule is to sum one source per request. Phoenix does not keep the OpenTelemetry kind, sospan_kind == 'CLIENT'returns nothing there. An empty result does not mean you are clean.
A second check is to compare tokens in your tool with Anthropic's usage data, for the same traffic and a day that ended more than 24 hours ago, because the data can lag that long. It needs an Admin API key, which individual accounts do not have. A ratio near 2 is a reason to look, not proof: confirm it with one controlled call.
To check the versions in a Python project, run this in its directory. It needs no API key, and it does not run your code:
uvx spantruth@0.4.2 doctor
It reads your lock file, or your requirements if you have no lock file, and tests the libraries it recognizes against a local fake provider. It installs those versions in its own environments, so it needs network access. A clean result does not clear your dashboard: it knows nothing about your backend, it cannot see settings in your code, and it does not cover paths such as LangChain with Langfuse's handler, or JavaScript projects. It also follows ANTHROPIC_OPEN_TELEMETRY in the shell you run it from, so run it with that variable unset.
What to do
Let one span per call report usage. The switch is ANTHROPIC_OPEN_TELEMETRY=false, set before the client is created, or open_telemetry=False on the client. A client created earlier, or given its own open_telemetry option, ignores the variable. Check with a new call in a clean project, because this does not repair stored data.
- OpenLLMetry (
traceloop-sdk,opentelemetry-instrumentation-anthropic): no release handles this, as of November 12, so use the switch. I filed it as openllmetry#4700. It has a cost: until openllmetry#4536, reported by @armanunix, and #4643, which I filed, are fixed, the SDK's span is the only record of a stream that your app leaves early or of a sync stream that fails, so those calls leave no span. If you need that record, the other choice is to remove the library and keep the SDK's span, which loses the library's attributes. - OpenTelemetry GenAI instrumentation (
opentelemetry-instrumentation-genai-anthropic): its README warns about the duplicate. On anthropic 2.x it says to prefer the SDK's tracing and uninstall the package, or to keep the package, with its metrics and log events, and use the switch. - OpenInference (
openinference-instrumentation-anthropic): upgrade to 3.1.1 or later, which suppresses the SDK's span for a call it traces. On Opik this shows no cost at all, because Opik maps no provider for OpenInference's span. The open pull request opik#8141 maps it. There, the SDK's span alone, with OpenInference removed, gave the right cost on a plain call, without OpenInference's attributes. - Anything else, such as LangChain or Langfuse: the switch applies to the SDK's span. I did not measure these. langfuse#18978 and traceroot-py#226 report the same doubling there.
What was measured
One sync, non-streaming call to the stub, anthropic 2.4.0, the SDK's tracing at its default, a global tracer provider, and self-hosted backends receiving OTLP directly. The table shows what each backend's project pages display, with the exact values from their tooltips. The expected result is 1,200 tokens and $0.006.
| Library | Phoenix 21.0.0 | Opik 2.2.143 |
|---|---|---|
| OpenLLMetry 0.62.4 | Two traces, each 1,200 and $0.006. Metrics: 2,000 prompt and 400 completion tokens | Two traces, each 1,200 and $0.006. Total cost: $0.012 |
| OpenTelemetry GenAI instrumentation 1.3b0 | One trace: 2,400, $0.012 | One trace: 2,400, $0.012 |
| OpenInference 3.1.0 | One trace: 2,400, $0.012 | One trace: 1,200, $0.006. Two spans, and only the SDK's is priced |
| OpenInference 3.3.0 | One trace: 1,200, $0.006 | One trace, no tokens or cost in the tables |
| OpenLLMetry or GenAI instrumentation, with the switch | One trace: 1,200, $0.006 | One trace: 1,200, $0.006 |
The pages round to $0.01 and <$0.01, and the tooltips show the values above. For OpenLLMetry, Phoenix's Traces tab shows only the two rows. The Total Cost stat on its Spans tab shows $0.01, and the project API returns 0.012. With the GenAI and OpenInference 3.1.0 rows, that stat counts root spans only and shows <$0.01, while the traces table, the trace view and the project API show $0.012. I filed the token and cost mismatch as phoenix#17856. I took screenshots of OpenLLMetry with the switch, not of the GenAI row, which comes from the APIs, as does OpenInference 3.3.0 on Phoenix. On Phoenix, the GraphQL field tokenCountTotal says 1,200 for the GenAI and OpenInference 3.1.0 rows, while the traces table and the metrics show 2,400.
Changing the setup moves the details, not the result:
- With a parent span in the app, all the spans share one trace, and the totals stay the same.
- With one streamed call, the doubling is the same, and OpenLLMetry adds one more token of its own (openllmetry#4377).
- With cache tokens, it is about 1.9x, not exactly 2x. The same call with 4,000 cache reads and 800 cache writes added costs $0.0102 at list price, and showed $0.0198 with OpenLLMetry and $0.0192 with the GenAI instrumentation. The SDK's span alone, and the GenAI instrumentation with the switch, showed $0.0096, because neither backend prices
cache_write.input_tokensas a cache write. - At the latest versions, anthropic 2.6.0, OpenLLMetry 0.63.0 and OpenInference 3.3.1, a plain call gives the same results. On Opik that comes from the API, with and without the switch, and OpenInference still has no cost. I read Opik's web pages only at the versions in the table.
I did not measure a real API call, async calls, retries, a stream that fails or ends early, each library's quickstart, Anthropic's API tracing, other SDK languages, cloud clients such as Vertex or Bedrock, or any other backend. The backends' prices are their own, and they match Anthropic's list price for Sonnet 4.5, the model in the test. The raw responses, the screenshots and the steps to reproduce this are in the repository.
Who found it and who fixed it
- @rvndbalaji reported doubled dashboards on October 16 in langfuse#18978, from the same SDK span, with LangChain and Langfuse's callback handler: "Cost and token dashboards show about 2x."
- @PabloPardoGarcia reported it for OpenInference in openinference#4119 and fixed it in #4121, which @caroger reviewed and extended.
- @lmolkova opened opentelemetry-python-genai#971 with an analysis of the SDK's spans. The issue was open on November 12, and the 1.3b0 README documents the duplicate.
This is one of ten
A double span is one way that LLM telemetry goes wrong with nothing failing. A span that never ends makes the call disappear. A stream that drops its connection can count as a success. A cached token can vanish from your input count. spantruth tests those paths for each library every night, and compares each value with what the provider sent. Here are the ten bug classes, and here is the report. The report grades each library alone, with the SDK's tracing off, so your library's row will not show this. The row "OpenTelemetry GenAI instrumentation, with the Anthropic SDK's own tracing left on" does.
If your numbers are doubled and your setup is not in the table, or if a finding is unfair to your library, open an issue with your versions.