← All insights

News analysisLens: United States3 min read

GitHub now counts Copilot tokens used from Claude Code, Codex and OpenCode. Use it for cost, not productivity

Copilot's usage metrics API now splits model requests, sessions and tokens by client, including tools outside GitHub's own plugins. Useful for cost and adoption, misleading as productivity.

Listen to this article · 5 min

AI-generated narration of the full article.

A wooden abacus with rows of colored beads, in La Madre duotone, beside the words Count cost, not output
Photo: rawpixel (CC0)

opencode, claude_code, codex, zed, copilot_cli, github_app, cloud_agent, code_review, vscode, jetbrains. That is the list of clients GitHub’s Copilot usage metrics API can now tell apart, and it says something about how developers use AI in 2026: through many front ends, often not GitHub’s own, with Copilot as the model provider behind them.

Until October 23, usage from tools such as OpenCode that call models through a Copilot subscription did not show up in the reports. A new totals_by_client field fixes that.

What the new field reports

For each client, the API returns:

  • request_count: successful model requests. GitHub warns that “one prompt can trigger several model calls,” so this is not a count of things people asked for.
  • session_count: distinct sessions.
  • token_usage: prompt tokens, output tokens and the average per request.
  • totals_by_model: the same metrics per model, with a model_selection_mode saying whether the user chose the model, automatic selection did, or the product did (as with code review and the cloud agent).

The data is available in enterprise, organization and per-user reports, for one-day and 28-day periods. Access is limited to enterprise owners, billing managers, organization owners and custom roles with the View Copilot Metrics permission, and the usage metrics policy has to be enabled. The change is additive; existing fields are untouched.

One caveat is stated plainly by GitHub: clients are identified by the integration ID they send, so client is “a best-effort grouping, not a verified identity.”

Good for three questions

Where does the spend go? Model usage that happens outside the IDE plugin is exactly the usage that surprises budgets: long agentic sessions in a terminal tool can consume far more tokens than inline completions. Per-client token counts let platform teams see that and allocate it. We described how Databricks cut its AI coding unit costs through a gateway; data like this is the starting point for that kind of work.

Which tools did people actually adopt? Approved-tool lists and real usage tend to diverge. A per-client view shows which front ends developers chose, which is useful input for support, training and security reviews.

Which models are being chosen, and by whom? The selection mode separates deliberate model choices from automatic routing, which helps when a model retirement or price change is coming and you need to know who will notice.

Not good for the question managers will ask

The tempting misuse is obvious: rank teams by tokens or requests and call it productivity. The metric does not support that. More tokens can mean harder work, a poorly scoped agent loop, or a tool that retries more. Requests are model calls, not tasks. Nothing in the API says whether the code was merged, reverted or caused an incident. We made the general case that hours saved are capacity, not value; tokens consumed are even further from value.

There is also a boundary to remember: the API sees traffic that goes through Copilot. A developer using Claude Code with an Anthropic key, or Codex with an OpenAI account, does not appear. The report is a complete view of one provider’s traffic, not of AI coding in the company.

A sensible way to use it

  1. Report tokens per client and per model monthly to whoever owns the AI coding budget, next to the price per token for each model.
  2. Pair usage with an outcome from your delivery system (merged pull requests, review time, change failure rate) before drawing conclusions about any team.
  3. Treat an unknown or unapproved client in the list as a conversation with the developers, not an incident; the identifier is self-reported.
  4. Check which coding tools in your company bypass Copilot entirely, because their usage and data handling are outside this report.

Telemetry is following the model endpoint rather than the editor, and that is the right direction: it is where the cost is incurred. It is still telemetry about consumption. What the code was worth has to be measured somewhere else.

Have an AI use case stuck between prototype and production?

Tell us what you’re trying to ship. We’ll reply with honest next steps.

Discuss a use case