Copilot BYOK metrics: keep the billing boundary
Dated November3 implementation analysis: preserve subset relationships and unknown historical routes; confront schema examples lagging the announcement rather than inventing raw exports.
Quick answer
GitHub's November BYOK usage fields help distinguish local and enterprise custom-model activity from Copilot-hosted activity. Preserve their subset relationships, treat missing routing flags as unknown, and reconcile provider invoices separately. The new visibility is a reporting change; it does not turn Copilot usage telemetry into a complete provider-billing ledger.
On this page
GitHub's November BYOK usage fields help distinguish local and enterprise custom-model activity from Copilot-hosted activity. Preserve their subset relationships, treat missing routing flags as unknown, and reconcile provider invoices separately. The new visibility is a reporting change; it does not turn Copilot usage telemetry into a complete provider-billing ledger. [1][2][3]
What changed in the November announcement?#
GitHub's announcement dated 3 November 2026 introduces local BYOK indicators and breakdowns, including used_local_byok and totals_by_local_byok. Enterprise custom-model entries gain is_custom_enterprise_model. Local BYOK is already a subset of the CLI and app totals; custom-model usage is already included in client totals. Adding these breakdowns back to their parents would count activity again. [1]
The announcement also identifies limits: local telemetry can undercount, some providers omit token usage, and earlier report days do not receive the custom-model flag through backfill. This is a dated implementation analysis of that announcement, checked during editorial review. It does not promise that every client already supplies complete routing information. [1]
The useful engineering question is how an existing reporting pipeline should absorb the new dimensions without changing the meaning of its old totals. The answer starts with report identity, missing-data semantics and an explicit relationship between a parent metric and its breakdowns. The importer must preserve what the new flag means before a dashboard can safely filter on it.
Scenario: a fictional platform team combines Copilot reports with provider invoices for its monthly engineering review. Before the change, its model table uses the normalized model name as the only grouping dimension. The new release gives the team a way to distinguish routes, but a careless migration could merge different billing paths or inflate usage by summing parents and subsets.
Start with the report boundary, not the model name#
The usage-report REST endpoints return links to downloadable reports rather than a single universal activity array. Their scope, date interval and granularity matter. Preserve the report metadata and process all returned download links for the requested report. Signed download links expire; retain the authorized report data and provenance according to policy, rather than treating a transient URL as the durable source record. [2]
The data reference and example schemas distinguish per-user, aggregate and other report shapes. Build an adapter for a named report type and version the adapter. During this review, the opened schema examples did not yet show the announced BYOK fields. That is a documentation boundary to handle explicitly: this guide does not invent a complete raw response or claim a tenant export was tested. [3][4]
Inspect an authorized export before enabling its adapter in production. Record the report's scope and interval, which fields are actually present, and how missing or null values appear. Check the authorized organization export before enabling the announced fields; the opened example alone cannot establish their presence. Keep the unmodified authorized input available for a bounded audit period. [2][4]
For a normalized internal table, use a key such as report scope, report identity, day, granularity, client, model name and route classification. Include a user identifier only when the report is actually per-user and the analysis needs it. This is a proposed warehouse design, not a claim about a single GitHub API schema. The adapter owns the mapping from observed source fields to those columns.
Do not use model name as the route key. In this design, the route classification comes from the applicable explicit source signal and its provenance, while the displayed name is a label. If a signal is absent, the row remains unclassified. Renaming the label or matching a familiar substring must not silently decide which organization should pay for the request.
How do you preserve missing flags during normalization?#
The following helper accepts a deliberately small internal projection, not a complete GitHub response. An upstream adapter must extract it from a verified client/model entry in the chosen export. The helper is useful because its contract is narrow: a literal boolean determines the known route, absence remains unknown, and unexpected values fail visibly. [1][3][4]
def custom_model_route(projected_entry):
field = "is_custom_enterprise_model"
if field not in projected_entry or projected_entry[field] is None:
return "unknown"
value = projected_entry[field]
if type(value) is not bool:
raise ValueError("custom-model flag must be a boolean")
return "enterprise_custom" if value else "copilot_hosted"
def grouping_key(report_scope, client, model, projected_entry):
return (report_scope, client, model,
custom_model_route(projected_entry))Scenario: older exports without the flag enter the unknown group. They do not become hosted activity by default. A newer export with a true value enters the enterprise-custom group; a false value enters the hosted group under this adapter contract. A string containing the letters “false” is rejected rather than treated as truthy or silently converted.
Rejecting a string flag makes an export-shape change visible at ingestion. A permissive coercion can hide a changed export shape for months. The ingestion job should quarantine malformed rows, report the affected source and keep the prior accepted aggregate available. It should not erase malformed rows and announce a healthy lower total. Decide separately whether a partially ingested report can appear in a dashboard and how prominently its incompleteness is shown.
Keep historical records honest. Backfilling an unknown route from a model-name dictionary creates an estimate, not an observed classification. If the team needs such an estimate, store it in a separate derived field with its method and uncertainty. Never replace the observed missing flag with the estimate, because later comparisons would lose the distinction between old uncertainty and new evidence.
Local BYOK has a different reporting shape and should pass through its own adapter. Do not assume the custom-model boolean classifies every local-provider request, or manufacture a model-level breakdown from a local aggregate that lacks model identity. Preserve the source grain even when a common warehouse table would be more convenient. [1][4]
Which totals can you add without counting the same activity twice?#
Write a metric relationship record before changing dashboards. For each imported metric, identify its unit, reporting population, time window, parent relationship and whether its groups are disjoint. A route breakdown can explain a parent total; it is not automatically another total to add. Keep the old parent metric unchanged until a reconciled migration has passed review.
| View in the fictional report | Intended use | Unsafe calculation |
|---|---|---|
| Existing client totals | Continuity with prior reports | Parent plus newly visible subset |
| Local BYOK breakdown | Explain observed local activity | Add it to CLI/app parents again |
| Custom-model route | Separate known model routes | Merge solely by displayed model name |
| Unknown classification | Expose missing routing evidence | Treat absence as hosted usage |
| Provider invoice | Reconcile provider charges | Derive an invoice from request count |
Scenario: the team reruns the unchanged legacy query and the new normalized pipeline on the same authorized export. The parent totals should remain equal. It then verifies that adding a route dimension changes the breakdown, not the parent definition. This is a conservation test for a schema migration, not a test that every underlying request was observable.
Test aggregation across organization boundaries separately. GitHub documents organization attribution based on membership, so organization-level populations cannot simply be added to reproduce an enterprise population. Likewise, summing daily active-user counts measures user-days rather than distinct people across the entire interval. State the population and unit in the metric definition before reconciling numbers. [5][6]
When subsets do not reconcile exactly, do not immediately fill the residual as hosted use. First check comparable scope, window, unit, telemetry completeness and adapter behavior. A residual can reveal an observation gap or a grain mismatch. It becomes a valid derived quantity only after the relationship is established for the actual fields being compared. [3][5]
Why is usage classification different from invoice reconciliation?#
The data reference describes usage metrics for consumption analysis, and the reconciliation guidance explains telemetry gaps and presentation differences. Those are reasons to keep usage reporting distinct from an invoicing source. A request count does not encode a provider contract, discount, billable unit or the complete provider-side population. Treating it as a currency amount is a separate unsupported transformation. [3][5]
For the fictional team's invoice review, create a distinct provider ledger with the provider account, billing interval, currency, charge category and invoice reference. Link it to an approved model-route inventory where a reliable join exists. If no defensible join exists, report the provider total beside the observed usage rather than distributing it across users using an invented allocation formula.
A local model can have infrastructure costs outside a provider invoice. A remote provider key may be billed to another account. Those are possible accounting boundaries in the scenario, not claims that a particular GitHub report identifies all of them. Keep the decision record explicit about which accounts the team can actually reconcile and which remain outside the available evidence.
Avoid ranking engineers by the resulting cost allocation. The immediate operational purpose is to understand routes and budgets, not to infer individual effectiveness from incomplete telemetry. If the organization later evaluates productivity, it needs an outcome model and appropriate governance. This reporting migration can establish metric lineage, but it cannot supply that missing causal evidence.
How should the team stage and verify the reporting change?#
Start with read-only collection under the documented metrics access and policy requirements. Use the narrow report scope needed for the review. Do not distribute download links or per-user exports in a public dashboard; publish only the approved aggregate and retain access-controlled provenance. Access to a usage report is not permission to expose its underlying user records. [2][3]
Run the new adapter beside the existing pipeline. Compare identical mature reporting periods and explain every discrepancy before switching the dashboard. GitHub's documentation allows a processing delay of two full UTC days after a report day closes. A partially processed recent day is unsuitable as the only migration fixture, because later arrivals can look like a parser regression. [5][6]
The acceptance fixture should contain present true and false flags, missing and null flags, an invalid non-boolean flag, a shared displayed model name under different routes, and a historical row without routing evidence. Add a repeated import of the same report to test ingestion idempotency. The reporting change must not append the same daily facts again on a retry.
Keep the source report identifier and a controlled replacement policy for refreshed exports. A later export may represent more complete telemetry for the same day. Decide whether the pipeline replaces the accepted partition, versions it, or requires review. Appending it as new independent activity would make an ordinary refresh look like additional usage. [2][5]
The article's local checks exercise the normalization and grouping rules with synthetic projections. No GitHub enterprise report, provider invoice or live tenant configuration was retrieved or changed. The announcement and linked documentation were rechecked before scheduling; raw-field availability still requires the intended tenant's authorized export. That limit is part of the proposed rollout, not a reason to guess the schema. [1][4]
- Should local BYOK activity be added to existing CLI totals?
- No. GitHub describes local BYOK as a subset of existing CLI and app totals. Use it to explain those totals, with matched units and report scope, rather than adding the same activity as a separate parent. [1]
- Does a missing custom-model flag mean false?
- No. Preserve missing routing evidence as unknown, especially for historical reports. The normalization example rejects malformed values and keeps absence separate from an observed false value. Do not infer the route from a familiar model label. [1][4]
- Can these metrics replace the provider invoice?
- They can help explain observed routes and consumption, but a provider invoice has its own account, pricing and billing boundary. Reconcile that source separately and state when no reliable allocation to observed usage is available. [3][5]
- What if the published schema example lacks the announced fields?
- Keep the adapter disabled for that unverified shape until an authorized export establishes it. Preserve the announcement and observation dates, and test missing-field behavior. An example response does not prove that every tenant report already contains a new field. [1][4]