AGENTIC COMMONSAI industry briefings

繁中EN

TagGitHubPublished

All English articles

Copilot Usage Metrics API: totals_by_client Breakdown

Summary: GitHub’s Copilot usage metrics API now reports model usage broken down by the client tool that made the request, including tools like OpenCode that previously went uncounted. A new totals_by_client array landed on October 23, 2026 in the enterprise, organization, enterprise-user, and organization-user 1-day and 28-day reports. If you track Copilot spend or govern which tools your team uses, this closes a real blind spot.

The gap it fills

More developers now use Copilot as the model provider behind tools outside the IDE — terminal agents, editors, cloud agents. The problem, per GitHub’s changelog, is that those tools often skip editor telemetry, so their usage never showed up in totals_by_ide. You’d see an IDE-shaped picture of usage while a chunk of your bill came from tools you couldn’t see.

The fix is counting requests on the server rather than trusting the client to report. That’s a more reliable design for exactly this reason, and it’s the same instinct behind measuring production behavior directly instead of inferring it, as we covered in profile your Workers in production.

What’s in an entry

Each totals_by_client entry covers one client and carries four things:

  • client: the tool that sent the requests — opencode, claude_code, codex, zed, copilot_cli, github_app, cloud_agent, code_review, vscode, or jetbrains. Unrecognized clients land under other.
  • request_count: successful model requests from that client.
  • session_count: distinct sessions.
  • token_usage: prompt tokens, output tokens, and average tokens per request.

Inside each entry there’s also totals_by_model, with the same request and token metrics split by model, plus a model_selection_mode telling you whether the model was picked directly (user_selected), by auto (auto), or by the product (product_selected). Modes not yet reported individually show as other; values that can’t be normalized show as unknown.

Reading the numbers without fooling yourself

A few caveats matter if you’re building dashboards on this:

request_count counts model calls, not prompts. One prompt can fan out into several model calls, so don’t compare it against prompt or interaction counts from elsewhere. And client is derived from the integration ID each request sends — GitHub describes it as a best-effort grouping, not a verified identity.

Two product-specific quirks: Copilot code review and Copilot cloud agent report product_selected because the product chooses the model, and code review models show up as unknown.

Also worth distinguishing: this measures model traffic — requests and tokens from any tool using Copilot. It is not agent app activity, which counts jobs started by agent apps like Claude and Codex on GitHub. Different question, different metric.

Access and compatibility

The field is available to enterprise owners and billing managers, organization owners, and anyone with a custom role granting the View Copilot Metrics permission — and only when the Copilot usage metrics policy is enabled. In the aggregated 28-day reports, totals_by_client appears inside each day_totals entry.

The change is additive: existing fields are untouched, and the array is empty when there’s nothing to report, so existing pipelines shouldn’t break.

For teams reconciling this against invoices, it pairs naturally with the shift to usage-based billing we wrote about in GitHub Copilot’s move to AI credits — knowing which tool drove the tokens is the missing half of knowing what you paid for.

The practical next step: pull the docs, join totals_by_client against your existing totals_by_ide view, and see how much of your usage was invisible before.

Sources

Original post
AGENTIC COMMONSOperated by PHLEGON LABS
ShareXEmail
Support us

Related reading

  1. GitHub Copilot in Visual Studio: PR Chat, BYOM Shift, NuGet Fixes

    The September Visual Studio update adds PR exploration via the Git agent, makes BYOM require the new Agent preview, and adds Copilot fixes for NuGet audit warnings.

    Copilot

  2. Vercel AI Gateway: See Which Sessions Stayed on a Warm Cache

    Vercel's AI Gateway logs add a Sessions view showing cache hit rate, cost, and provider routing per multi-turn conversation.

    Vercel

  3. Multi-Model Orchestration Gets a Tier: What HydraFusion Max Changes for Copilot Work

    GitHub updates HydraFusion's model pool and workflows, and adds a Max tier tuned for deeper reasoning across Copilot clients.

    AI coding