Skip to main content
Post

BYOK and enterprise custom models in the Copilot usage API

GitHub added bring your own key (BYOK) reporting to the Copilot usage metrics API, so BYOK usage no longer blends into Copilot-hosted model totals. Local models and custom models often share names with Copilot models, which is why they were hard to tell apart before.

The reports cover two kinds of BYOK. Local BYOK is set up by developers in their own client: Copilot CLI or the GitHub Copilot app sends requests straight to their provider key or a local model, such as one served by Ollama, Foundry Local, LM Studio, or llama-server. It shows up in three places:

  • used_local_byok, in user-level reports, shows whether someone made at least one local BYOK request that day.
  • totals_by_local_byok gives session, request, prompt, and token counts. It's broken out by byok_kind (local_managed, local_user, local_auto, or remote_user) and by surface (copilot_cli or copilot_app).
  • Aggregate reports add daily, weekly, and monthly active local BYOK user counts.

Enterprise custom models are the ones admins configure in GitHub settings, with requests routed through GitHub to your provider. Each totals_by_client[].totals_by_model[] entry now has an is_custom_enterprise_model boolean. GitHub sees these requests server-side, so the field covers every client, IDEs included. A model used both as a Copilot-hosted model and as a custom one appears as two entries, so the counts stay separate, and custom entries carry real request and token counts.

Both kinds appear in enterprise and organization reports, at user and aggregate level, in 1-day and 28-day reports. The usage metrics endpoints need the "Copilot usage metrics" policy set to Enabled everywhere for the enterprise. GitHub points to checking who's sending requests to their own keys against your BYOK policy, and separating Copilot-hosted usage from usage billed by your own provider.

Loading replies…