Quick answer

Turn on Claude Code's OpenTelemetry export and point it at Ganivra's OTLP endpoint with a workspace key. Every API request arrives with its model, tokens and the developer's email, and Ganivra prices it and adds it up by developer, team and model. Deploy the settings through managed settings so every machine reports, and add a team.id so spend splits by team.

Why the bill doesn't show it

Each way of paying for Claude Code hides a different part of the picture:

  • Team and Enterprise seats. The spend report in org analytics lists spend per user, but only for usage credits. Usage inside each seat's allowance isn't shown in dollars, so a developer who never passes the limit looks free.
  • Claude Console (API billing). The Console shows spend per member for Claude Code, but not by your teams or cost centers, and not next to anything else you spend on AI.
  • Amazon Bedrock and Google Vertex AI. Usage lands on your cloud bill per token, with no developer attached at all.

Anthropic's own cost guide names OpenTelemetry as the one option that works on every setup and streams per-user cost in near real time.

What Claude Code reports

With telemetry on, Claude Code sends an api_request event for every call to the model. Each one carries the model, input, output, cache-read and cache-write tokens, the duration and an estimated cost, plus the developer's email or account ID, the session and the organization. Failed calls arrive as api_error events.

What it leaves out matters as much. Prompt text is redacted unless someone sets OTEL_LOG_USER_PROMPTS=1, and tool inputs unless OTEL_LOG_TOOL_DETAILS=1 is set. Ganivra reads only the usage fields either way. See the Claude Code monitoring docs for the full list of fields.

Investigating a spike? Read one Claude Code session log to see where the tokens went.

Set it up in five minutes

  1. 01
    Create a workspace API key

    In Ganivra, open Profile & setup and generate a key. The key decides which workspace receives the usage.

  2. 02
    Add the settings to your shell

    Put the settings below in your shell profile, replacing the key. Ganivra accepts OTLP over HTTP, as protobuf or JSON; gRPC isn't supported.

  3. 03
    Run one request

    Start Claude Code and ask it anything. Within a minute the request appears under Executions with an ID starting cc-.

  4. 04
    Open Coding agents

    The dashboard's Coding agents tab shows the request priced, under your email and team.

export CLAUDE_CODE_ENABLE_TELEMETRY=1
export OTEL_LOGS_EXPORTER=otlp
export OTEL_METRICS_EXPORTER=none
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_ENDPOINT=https://api.ganivra.com/v1/otlp
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer gv_live_..."
export OTEL_LOGS_EXPORT_INTERVAL=60000
export OTEL_RESOURCE_ATTRIBUTES="team.id=platform,cost_center=eng-123"

Metrics are turned off because every request already carries its cost; sending them as well would only add traffic. The full reference is in the integration guide.

Roll it out to every machine

Asking each developer to edit their shell profile gets you partial coverage. Claude Code reads an env block from its managed settings, which IT can deploy through device management such as Jamf or Intune, and which developers can't override. A project's own .claude/settings.json can't set these exporter variables, so use managed settings or each user's own settings.

{
  "env": {
    "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
    "OTEL_LOGS_EXPORTER": "otlp",
    "OTEL_METRICS_EXPORTER": "none",
    "OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf",
    "OTEL_EXPORTER_OTLP_ENDPOINT": "https://api.ganivra.com/v1/otlp",
    "OTEL_EXPORTER_OTLP_HEADERS": "Authorization=Bearer gv_live_...",
    "OTEL_LOGS_EXPORT_INTERVAL": "60000"
  }
}

Use one workspace key for the whole company and tell teams apart with resource attributes, so all coding-agent spend lands in one place.

Add teams and cost centers

Claude Code attaches whatever you put in OTEL_RESOURCE_ATTRIBUTES to every request. Ganivra groups by team.id, team or cost_center, in that order, and keeps any other keys as attributes you can filter by.

  • Values can't contain spaces: use team.id=payments, or percent-encode, as in team.id=data%20platform.
  • With managed settings, deploy a different value per team, or set the attribute in each team's own developer setup.
  • Developers with no team attribute appear under No team, so gaps are easy to spot.

Read the numbers

In the dashboard, open Coding agents. It shows total Claude Code spend, cost per developer and cost per million tokens, then a table you can group by developer, team or model, with requests, active days, tokens and cost for each.

Two things are worth checking first:

  • The spread between developers. A few people usually account for most of the spend. That isn't bad on its own: compare it with what they ship before drawing conclusions.
  • The model mix. Claude Opus 5.5 costs twice as much per token as Sonnet 5.5, and Haiku 5.5 a twentieth of Sonnet. The same view re-prices your actual usage on Sonnet, Haiku, GPT-5.5 or open models such as GLM-5.3, or on your own GPUs at a rate you enter, so you can see what a switch would save before you try it.

To compare seats, per-token billing and self-hosting for your whole team, use the AI coding tools cost calculator.

Claude Code cost tracking: frequently asked questions

Does Claude Code send my prompts or code?

Not by default. Claude Code's telemetry leaves out prompt text unless OTEL_LOG_USER_PROMPTS=1 is set, and tool inputs unless OTEL_LOG_TOOL_DETAILS=1 is set. Ganivra only reads the usage fields of each API request: model, token counts, timing, session and the developer's identity.

Does this work on the Claude Team or Enterprise plan?

Yes. OpenTelemetry export works on every way of signing in: Team and Enterprise seats, the Claude Console, Amazon Bedrock and Google Vertex AI. On seat plans, costs show what the same usage would cost at API list prices, which is the useful number for comparing developers and deciding on seat tiers.

How does Ganivra know which team a developer is on?

From a resource attribute: set team.id, team or cost_center in OTEL_RESOURCE_ATTRIBUTES. If you deploy settings centrally, give each team's machines their own value. Developers without one appear under No team.

Why set the log export interval to 60 seconds?

Claude Code exports logs every 5 seconds by default. Batching each developer's requests into one export a minute keeps a large team well inside Ganivra's per-workspace request limit, and costs still appear within a minute or two.

Do the costs match my Anthropic invoice?

They use list prices for each model on the day of the request. If you have a negotiated discount, your invoice will be lower by that discount; the split between developers and teams stays the same.

Five minutes of setup

See Claude Code spend per developer.

Start a 14-day Ganivra trial, add the settings, and see cost by developer, team and model. No credit card required.