---
description: Monitor Claude Code token usage across your team with Bifrost. Compare /usage, the Claude Console, and OpenTelemetry, and set per-developer and team budgets.
title: Best AI Gateway to Monitor Claude Code Token Usage
image: https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w1200/2026/07/best-ai-gateway-to-monitor-claude-code-token-usage-bifrost-weave.optimized.png
---

Try Bifrost Enterprise free for 14 days. [Request access](https://www.getmaxim.ai/#enterprise-trial)

**TL;DR**

- Claude Code's `/usage` command shows token usage for one session on one machine; it cannot attribute spend across a team or block a request when a budget runs out.
- An AI gateway in front of Claude Code logs input, output, and cache tokens plus computed cost for every request, tagged to a developer or team.
- Bifrost tags every Claude Code request with a virtual key, exports Prometheus metrics and OpenTelemetry traces, and enforces hierarchical budgets.
- Bifrost adds 11 microseconds of overhead per request at 5,000 requests per second, so monitoring does not slow interactive sessions.
- Connecting Claude Code takes two environment variables: `ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN` set to a Bifrost virtual key.

**The** [**best AI gateway**](https://www.getmaxim.ai/articles/top-5-llm-gateways-in-2026-a-production-ready-comparison/)** to monitor Claude Code token usage is** [**Bifrost**](https://www.getmaxim.ai)**. Get per-request cost attribution, per-team budgets, Prometheus metrics, and OTel tracing.**

Claude Code spend averages around $13 per developer per active day and $150 to $250 per developer per month across enterprise deployments, [according to Anthropic's Claude Code cost documentation](https://code.claude.com/docs/en/costs), and agent teams running in plan mode use approximately 7x more tokens than standard sessions. Most engineering teams have no centralized visibility into which models, developers, or sessions drive that consumption. [Bifrost](https://www.getmaxim.ai), the [open-source AI gateway](https://github.com/maximhq/bifrost) by Maxim AI, is the best AI gateway to monitor Claude Code token usage. Built in Go and available on GitHub under Apache 2.0, Bifrost sits between Claude Code and any LLM provider and captures per-request token counts, per-virtual-key cost attribution, and full session traces with 11 microseconds of overhead at 5,000 requests per second.

## Why Claude Code Token Usage Demands Centralized Monitoring

Claude Code token consumption is unpredictable at team scale because the same product can be invoked in radically different ways. A focused bug fix may use 20,000 tokens. A multi-file refactor with subagents can use millions. Claude Code sends the full conversation with every request, so token usage climbs as a session grows even when each new prompt is short.

Without monitoring at the gateway layer, engineering leaders cannot answer basic questions:

- Which teams or developers account for the majority of monthly Claude Code spend?
- How much of that spend is on Opus versus Sonnet versus Haiku?
- Which sessions are burning tokens through autocompact loops or runaway subagent fan-out?
- Are projected budgets being breached, and by which cost center?

Claude Code's built-in `/usage` command shows token usage for the current session, and the Claude Console reports spend per member with workspace-level spend limits. Neither enforces a per-developer or per-team budget at request time, and neither covers Claude traffic served through Amazon Bedrock or Google Vertex AI in the same view. That is the job of an AI gateway placed in front of Claude Code, where every request is logged, costed, and attributed before it ever reaches Anthropic. [The Bifrost AI gateway](https://www.getmaxim.ai) is built for this role.

## How to Check Claude Code Token Usage

Claude Code token usage can be checked in four places: the `/usage` command, the Claude Console, Claude Code's OpenTelemetry export, and an AI gateway on the request path. Each answers a different question, and only the gateway combines team attribution with budget enforcement across every provider.

| Where to check | What it shows | Team attribution | Enforces budgets |
| --- | --- | --- | --- |
| `/usage` command | Session tokens by model, cache reads and writes, estimated cost | No, one machine | No |
| Claude Console usage page | Spend per member and workspace for API-billed usage | Yes, Anthropic API only | Workspace spend limits |
| Claude Code OpenTelemetry export | `claude_code.token.usage` and `claude_code.cost.usage` metrics per user and session | Yes, if every machine is configured | No |
| Bifrost AI gateway | Tokens, cost, latency, model, and provider per request, per virtual key | Yes, any provider | Yes, hierarchical |

For anyone asking how to check Claude token usage on a single machine, the `/usage` session block is the fastest answer: it lists input, output, cache read, and cache write tokens per model with a cost estimate at list price. Claude Code's [OpenTelemetry monitoring](https://code.claude.com/docs/en/monitoring-usage) goes further by exporting token and cost metrics, but every developer machine has to set `CLAUDE_CODE_ENABLE_TELEMETRY=1` and point at a collector. The answer to how to track Claude token usage across a whole team is different: a gateway such as Bifrost acts as a Claude token usage tracker that works centrally with no per-machine setup beyond the base URL, which is why platform teams choose it to [govern Claude Code token usage per team](https://www.getmaxim.ai/articles/best-claude-code-gateway-to-govern-token-usage-per-team/).

## What an AI Gateway Should Track for Claude Code Token Usage

An AI gateway used to monitor Claude Code token usage should capture tokens, cost, attribution, and model mix for every request, then export that data to the tools engineering already uses. The gateway should capture and expose the following data points at request granularity:

![A Claude Code request passes virtual key authentication and a budget check, reaches the provider, and its tokens and cost are logged asynchronously and exported as metrics](https://articles-images-cdn.t3.tigrisfiles.io/diagrams/best-ai-gateway-to-monitor-claude-code-token-usage/claude-code-request-cost-logging-pipeline.png)

*Figure 1: Cost is computed at request time from synced pricing, and logging runs off the request path.*

- **Per-request token counts**: input tokens, output tokens, and cache reads or writes for every Claude Code call
- **Per-request cost**: dollar amount computed against current Anthropic, Bedrock, Vertex, or Azure pricing
- **Per-user and per-team attribution**: which developer, team, or business unit issued the request
- **Model breakdown**: how much spend goes to Opus, Sonnet, and Haiku separately
- **Session and trace correlation**: full session view across multi-turn Claude Code interactions
- **Budget enforcement**: ability to block requests when a team or developer exceeds an allocation
- **Standards-based export**: Prometheus, OpenTelemetry, and Datadog integration so the data lives where the rest of engineering monitoring lives

A gateway that captures only aggregate totals does not solve the team-scale problem. The gateway has to attribute spend down to the individual key or developer, and it has to make that data extractable into existing observability platforms. The [Bifrost governance model](https://www.getmaxim.ai/resources/governance) is built around exactly this pattern: virtual keys as the unit of attribution, hierarchical budgets as the unit of enforcement, and standards-based export as the unit of integration.

## Bifrost: The Best AI Gateway to Monitor Claude Code Token Usage

Bifrost is the best AI gateway to monitor Claude Code token usage because it logs every request with tokens and computed cost, attributes it to a virtual key, exports it to Prometheus and OpenTelemetry, and enforces budgets on the same path. [The Bifrost gateway](https://www.getmaxim.ai) is built around four monitoring capabilities that map directly to the requirements above.

![Claude Code sessions from three developers route through Bifrost to Anthropic, AWS Bedrock, or Vertex AI, and Bifrost exports token and cost data to Prometheus and OpenTelemetry](https://articles-images-cdn.t3.tigrisfiles.io/diagrams/best-ai-gateway-to-monitor-claude-code-token-usage/claude-code-token-usage-monitoring-architecture.png)

*Figure 2: Token and cost data is captured on the request path, so no developer machine needs its own telemetry setup.*

**Per-request cost and token attribution.** Bifrost logs every Claude Code request with input tokens, output tokens, latency, model, provider, status, and computed cost. The pricing catalog is automatically synced from a remote datasheet every 24 hours, and [custom pricing overrides](https://docs.getbifrost.ai/providers/custom-pricing) let teams reflect negotiated Anthropic, AWS Bedrock, or Vertex rates. Cost is computed at request time, not in a nightly batch.

**Per-team and per-developer visibility through virtual keys.** [Virtual keys](https://docs.getbifrost.ai/features/governance/virtual-keys) are the primary governance entity in Bifrost. Each developer or team gets a virtual key that Claude Code uses as its `ANTHROPIC_AUTH_TOKEN`, and every request is automatically tagged with that key. Dashboards, metrics, and exports filter by virtual key, team, or customer, producing a clear answer to who spent what.

**Native Prometheus metrics and OpenTelemetry tracing.** Bifrost exposes a `/metrics` endpoint that [Prometheus can scrape](https://docs.getbifrost.ai/features/observability/prometheus) or push to a Push Gateway for multi-node clusters. Request-level metrics carry virtual key, team, and customer labels, and `bifrost_stream_inter_token_latency_seconds` tracks streaming speed, which answers how many Claude Code tokens per second each provider delivers. The same data also flows through [OpenTelemetry](https://opentelemetry.io/) as span-level traces, exportable to Grafana, New Relic, Honeycomb, or any OTLP-compatible backend. Metrics collection runs asynchronously with no impact on Claude Code request latency.

**Real-time built-in dashboard.** As a Claude Code usage monitor, Bifrost ships with a built-in dashboard at `http://localhost:8080` whose [request logs](https://docs.getbifrost.ai/features/observability/default) show token usage, cost, model breakdown, and latency, filterable by virtual key, token range, cost range, and time window. No external tools are required to see who consumed what. The same dashboard supports per-team filtering for engineering leads who need a weekly review without setting up Grafana.

For teams that already run Grafana, New Relic, or Honeycomb, [the OTel observability plugin](https://docs.getbifrost.ai/features/observability/otel) pushes traces directly into each platform, and Bifrost Enterprise adds a native [Datadog connector](https://docs.getbifrost.ai/features/observability/datadog) for APM traces and LLM Observability.

## How Bifrost Connects to Claude Code

Connecting Claude Code to Bifrost takes one virtual key and two environment variables, after which every request is monitored with no change to how developers work. The [Claude Code integration](https://docs.getbifrost.ai/cli-agents/claude-code) requires changing two environment variables in Claude Code's `settings.json` and creating a virtual key in Bifrost.

![Claude Code reads ANTHROPIC\_BASE\_URL and ANTHROPIC\_AUTH\_TOKEN from settings.json, sends requests to the Bifrost anthropic endpoint with a virtual key, and Bifrost forwards them to the provider](https://articles-images-cdn.t3.tigrisfiles.io/diagrams/best-ai-gateway-to-monitor-claude-code-token-usage/claude-code-bifrost-connection-settings.png)

*Figure 3: The virtual key replaces the Anthropic login, so attribution starts with the first request.*

```
"env": {
  "ANTHROPIC_BASE_URL": "http://localhost:8080/anthropic",
  "ANTHROPIC_AUTH_TOKEN": "your-bifrost-virtual-key"
}
```

After this change, every Claude Code request routes through Bifrost transparently. Developers continue using Claude Code exactly as before, with no workflow changes. [The open-source Bifrost gateway](https://www.getmaxim.ai) translates between the Anthropic API format and any target provider, including AWS Bedrock, Google Vertex AI, Azure, OpenAI, Groq, and Mistral, so platform teams can route Claude Code to whichever provider holds the contract or fits the cost model. The `ANTHROPIC_AUTH_TOKEN` method does not require an Anthropic account login at all; the virtual key handles authentication and billing routing on its own.

Once routing is in place, monitoring is automatic. No additional SDK, instrumentation, or code change in Claude Code is needed. Claude Code also sends an `x-claude-code-session-id` header on every request, which keeps a session on the same provider key and prompt cache. The [Claude Code resource page](https://www.getmaxim.ai/resources/claude-code) covers team rollout patterns.

## Budget Enforcement and Active Cost Control

Visibility without enforcement leaves cost overruns to discover after the fact. Bifrost moves from passive monitoring to active control through [hierarchical budgets](https://docs.getbifrost.ai/features/governance/budget-and-limits) attached to virtual keys, teams, and customers. Each level enforces independently.

![A Claude Code request passes the developer virtual key budget, the team budget, and the customer budget before the provider call, and any exhausted level blocks it](https://articles-images-cdn.t3.tigrisfiles.io/diagrams/best-ai-gateway-to-monitor-claude-code-token-usage/claude-code-hierarchical-budget-enforcement.png)

*Figure 4: A runaway session hits the developer limit first, long before it can drain the team or organization budget; Enterprise alerting can warn before any limit is reached.*

- **Per-developer daily limits** prevent a single runaway session from burning the team budget
- **Per-team monthly budgets** keep cost predictable at the engineering manager level
- **Organization-wide caps** give finance and platform leads a hard ceiling

When a budget is exhausted, Bifrost blocks further requests automatically. Calendar-aligned reset durations (`1d`, `1w`, `1M`, `1Q`, `1Y`) align with billing cycles, and Bifrost Enterprise [alerting](https://docs.getbifrost.ai/enterprise/alerting/overview) notifies Slack, Microsoft Teams, PagerDuty, or a webhook when a budget crosses a threshold. Rate limits on tokens per hour and requests per minute add another layer of protection against accidental burst spend, especially for subagent-heavy and agent-team Claude Code workflows that run several parallel sessions. The guide to [Claude Code usage limits](https://www.getmaxim.ai/articles/claude-code-usage-limits-how-teams-manage-them/) explains how these gateway limits interact with Anthropic's own plan limits.

For platform teams, the [governance resource](https://www.getmaxim.ai/resources/governance) covers the full virtual-key, RBAC, and SSO model. For deeper monitoring patterns, the [MCP gateway resource](https://www.getmaxim.ai/resources/mcp-gateway) walks through how Code Mode and tool filtering further reduce Claude Code token consumption.

## How Bifrost Compares to Alternative Monitoring Approaches

Engineering teams evaluating how to monitor Claude Code token usage typically consider five options, and they differ mainly in whether they can attribute spend across a team and stop a request before a budget is exceeded.

**Claude Code's built-in `/usage` command:** Useful for individual developers checking their own session. It cannot aggregate across users, attribute to teams, enforce budgets, or feed Prometheus.

**Anthropic Console organizational view:** Adds workspace-level cost tracking, workspace spend limits, and per-user breakdowns when developers are on API billing. Its limits apply per workspace rather than per developer or team, and it only reflects spend from Anthropic-hosted models, not Bedrock, Vertex, or Azure deployments of Claude.

**Claude Code OpenTelemetry export:** Streams per-user token and cost metrics from each developer's machine into an existing collector, including a Prometheus exporter. It reports usage but does not enforce budgets, and coverage depends on every machine carrying the telemetry settings.

**LiteLLM proxy:** A Python-based gateway that supports routing to multiple providers including Anthropic, with virtual keys, per-key budgets, and centralized cost monitoring. Anthropic's own documentation notes that the project is unaffiliated with Anthropic and has not been audited for security, and a [March 2026 PyPI supply-chain compromise](https://securitylabs.datadoghq.com/articles/litellm-compromised-pypi-teampcp-supply-chain-campaign/) affected published LiteLLM packages. Teams comparing options can review [Bifrost as a drop-in LiteLLM alternative](https://www.getmaxim.ai/bifrost/alternatives/litellm-alternatives) for the complete feature delta.

[**The Bifrost AI gateway**](https://www.getmaxim.ai)**:** Provides the most comprehensive monitoring stack for Claude Code token usage: per-request cost, virtual key attribution, hierarchical budgets, Prometheus and OTel export, a built-in dashboard, and an enterprise Datadog connector. Bifrost adds only 11 microseconds of overhead at 5,000 requests per second in [published benchmarks](https://www.getmaxim.ai/resources/benchmarks), so the monitoring layer does not slow down interactive Claude Code sessions. The Go-based architecture handles governance enforcement, cost logging, and observability export concurrently without impacting request latency. For a wider field of options, the roundup of [LLM gateways for monitoring Claude Code token spend](https://www.getmaxim.ai/articles/best-llm-gateways-for-monitoring-claude-code-token-spend/) compares more products on the same criteria.

## Frequently Asked Questions

### How do I check Claude Code token usage?

Run `/usage` inside Claude Code to see the current session's input, output, and cache tokens per model with an estimated cost. For usage across a team, check the Claude Console for API-billed workspaces, enable Claude Code's OpenTelemetry export, or route Claude Code through an AI gateway such as Bifrost, which logs tokens and cost for every request by virtual key.

### What is the best Claude token usage monitor for teams?

The best Claude token usage monitor for teams sits on the request path, which a local Claude token monitor such as `/usage` cannot do, attributes every request to a developer or team, and enforces budgets. Bifrost does all three for Claude Code, exports metrics to Prometheus and OpenTelemetry, and covers Claude served through Anthropic, Bedrock, Vertex AI, or Azure in one view.

### How much does Claude Code cost per developer?

Anthropic reports an average of around $13 per developer per active day and $150 to $250 per developer per month across enterprise deployments, with costs below $30 per active day for 90% of users. Actual spend depends on model choice, codebase size, session length, and use of subagents or agent teams.

### Can I build a Claude Code token usage dashboard?

Yes. Bifrost includes a built-in dashboard with token, cost, and latency analytics filterable by virtual key, and it exposes a Prometheus `/metrics` endpoint with `bifrost_input_tokens_total`, `bifrost_output_tokens_total`, and `bifrost_cost_total` labeled by virtual key and team. Those metrics feed a Grafana dashboard or a weekly Claude Code token usage report with no custom instrumentation, and the [Prometheus integration guide](https://docs.getbifrost.ai/features/observability/prometheus) lists every label.

### How do I track Claude Code tokens per second?

Bifrost records `bifrost_stream_inter_token_latency_seconds` and `bifrost_stream_first_token_latency_seconds` for every streamed Claude Code response, labeled by provider and model. Tokens per second is the inverse of inter-token latency, which lets teams compare how fast Anthropic, Bedrock, and Vertex AI serve the same Claude model.

### Does monitoring through a gateway require changes to Claude Code?

No. Claude Code only needs `ANTHROPIC_BASE_URL` pointed at Bifrost and `ANTHROPIC_AUTH_TOKEN` set to a virtual key in `settings.json`. Developers keep using Claude Code the same way, and every request is logged, costed, and attributed automatically.

## Getting Started with Bifrost for Claude Code Token Monitoring

Engineering organizations running Claude Code at team scale need an AI gateway that monitors token usage at request granularity, attributes spend to virtual keys, enforces hierarchical budgets, and exports data to existing observability platforms. Bifrost delivers all four in a single open-source binary that deploys with zero configuration. Teams that also want to cut consumption, not just measure it, can pair monitoring with the tactics in [how to reduce Claude Code token costs](https://www.getmaxim.ai/articles/how-to-reduce-claude-code-token-costs/), and the pillar guide to the [best AI gateway for Claude Code](https://www.getmaxim.ai/articles/the-best-ai-gateway-for-claude-code-why-bifrost-leads-in-2026/) covers routing and governance beyond monitoring.

For regulated industries and enterprise teams that need air-gapped deployment, VPC isolation, SSO integration with Okta or Entra, or RBAC for finance and platform teams, [Bifrost Enterprise](https://www.getmaxim.ai/enterprise) adds clustering, [secret management](https://docs.getbifrost.ai/enterprise/secret-management) with HashiCorp Vault, AWS Secrets Manager, or GCP Secret Manager, audit logs of administrative activity, and adaptive load balancing on top of the open-source core.

To see how Bifrost can centralize Claude Code token usage monitoring for your engineering organization, [book a demo](https://www.getmaxim.ai/book-a-demo) with the Bifrost team.

## Read next

[![Top 5 AI Inventory Tools to Track Every Model and AI App in 2026](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/10/top-5-ai-inventory-tools-to-track-every-model-and-ai-app-in--bifrost-1920x1080.png) An AI inventory is a continuously updated record of every model, provider, AI app, agent, and MCP server an organization uses. This guide compares five AI inventory tools, including Bifrost, Wiz AI-SPM, and ServiceNow AI Control Tower, by coverage, discovery method, and enforcement.](https://www.getmaxim.ai/articles/top-5-ai-inventory-tools-to-track-every-model-and-ai-app-in-2026/)

[![Top 5 LLM Monitoring Tools at the Gateway Layer in 2026](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/10/top-5-llm-monitoring-tools-at-the-gateway-layer-in-2026-bifrost-1920x1080.png) LLM monitoring tools at the gateway layer record tokens, cost, latency, and status for each model call as it passes through the request path. This guide compares Bifrost, Kong AI Gateway, LiteLLM, Cloudflare AI Gateway, and Envoy AI Gateway on capture, export, retention, and budget alerting.](https://www.getmaxim.ai/articles/top-5-llm-monitoring-tools-at-the-gateway-layer-in-2026/)

[![Top 5 LLM Gateways with an OpenAI-Compatible API in 2026](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/10/top-5-llm-gateways-with-an-openai-compatible-api-in-2026-bifrost-1920x1080.png) An OpenAI-compatible API lets any OpenAI SDK client reach many model providers by changing only the base URL. This guide compares Bifrost, LiteLLM, Kong AI Gateway, Cloudflare AI Gateway, and OpenRouter on endpoints, deployment, failover, and governance.](https://www.getmaxim.ai/articles/top-5-llm-gateways-with-an-openai-compatible-api-in-2026/)

## More in AI Gateway

[![Top 5 Auto Routing Tools for LLM Apps in 2026](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/09/top-5-auto-routing-tools-for-llm-apps-in-2026-bifrost-isometric.png) Auto routing selects which model serves each LLM request based on the prompt, cost policy, and capacity. This guide compares five auto routing tools, including Bifrost, OpenRouter Auto Router, Not Diamond, and RouteLLM, on routing signals, failover, and governance.](https://www.getmaxim.ai/articles/top-5-auto-routing-tools-for-llm-apps-in-2026/)

[![How AI Gateways Tackle Rate Limiting for LLM Apps](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/09/how-ai-gateways-tackle-rate-limiting-for-llm-apps-bifrost-isometric.png) Rate limiting in LLM apps is two problems: provider quotas you cannot change, and internal quotas you must enforce. This guide covers the limit dimensions, key pooling, and per-consumer virtual key limits at the gateway.](https://www.getmaxim.ai/articles/how-ai-gateways-tackle-rate-limiting-for-llm-apps/)

```json
{
    "@context": "https://schema.org",
    "@type": "Article",
    "publisher": {
        "@type": "Organization",
        "name": "Maxim Articles",
        "url": "https://www.getmaxim.ai/articles/",
        "logo": {
            "@type": "ImageObject",
            "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w256h256/2025/08/thumbnail.png",
            "width": 60,
            "height": 60
        }
    },
    "author": {
        "@type": "Person",
        "name": "Kamya Shah",
        "image": {
            "@type": "ImageObject",
            "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/2025/09/WhatsApp-Image-2025-08-29-at-17.40.40-1.jpeg",
            "width": 1200,
            "height": 1600
        },
        "url": "https://www.getmaxim.ai/articles/author/kamya/",
        "sameAs": []
    },
    "headline": "Best AI Gateway to Monitor Claude Code Token Usage",
    "url": "https://www.getmaxim.ai/articles/best-ai-gateway-to-monitor-claude-code-token-usage/",
    "datePublished": "2026-09-24T16:40:00.000Z",
    "dateModified": "2026-10-13T11:01:04.000Z",
    "image": {
        "@type": "ImageObject",
        "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w1200/2026/07/best-ai-gateway-to-monitor-claude-code-token-usage-bifrost-weave.optimized.png",
        "width": 1200,
        "height": 630
    },
    "keywords": "AI Gateway",
    "description": "An AI gateway monitors Claude Code token usage by logging tokens and cost for every request and tagging each one to a developer or team. This guide shows how Bifrost tracks usage, exports metrics to Prometheus and OpenTelemetry, and enforces budgets.",
    "mainEntityOfPage": "https://www.getmaxim.ai/articles/best-ai-gateway-to-monitor-claude-code-token-usage/"
}
```
