Overview
GitHub Copilot is an OpenAI-compatible provider with a dedicated Bifrost provider implementation. Two things make it unlike the other OpenAI-compatible providers, and both are handled for you:- Organization billing - Bifrost authenticates as a GitHub App, so Copilot usage bills to the organization that owns the App installation. No individual Copilot seat is consumed.
- Per-account API host - the Copilot API host differs by plan tier and arrives with the token, so it is resolved per request rather than configured.
- Editor identity - Copilot rejects requests that look like generic API clients. Bifrost sends the required headers on every call.
- Automatic token refresh - GitHub App installation tokens live one hour and Copilot tokens about thirty minutes. Bifrost mints and refreshes both.
Supported Operations
Which models you can reach depends on your plan tier and your organization’s Copilot
policy. Two operators with valid credentials can see different catalogs, so check
/v1/models rather than assuming a model is available.Before you start
Server-to-server access needs three things set up on the GitHub side. All three are prerequisites, not optional hardening.- Create a GitHub App with the Copilot Requests repository permission set to Read & write.
- Install it on the organization that should be billed. The Copilot permission check currently requires All repositories access.
- Enable the organization for Copilot requests from GitHub App installations.
Bifrost validates these shapes when you save the key, so a typo is caught in the form rather
than at the first request. Values supplied as
env. or vault references are checked when
they resolve, not at save time.
The Allow use of Copilot CLI billed to the organization policy is not part of this flow.
It applies to running Copilot CLI in GitHub Actions with the built-in
GITHUB_TOKEN, which
is a different path from the GitHub App credentials described here.A repository ID is needed even though step 2 already grants All repositories access.
Copilot’s permission check looks for one in the token request, so it is a required part of
the request shape rather than a scoping choice. Any repository the installation can see
works.
Setup & Configuration
- Web UI
- config.json
- API
- Go SDK
- Navigate to Models > Model Providers.
- Click Add Provider and choose GitHub Copilot.
- Leave API Key blank.
- Under GitHub App Credentials, fill in App ID, Installation ID, Repository ID and Private Key.
- Leave GitHub Enterprise Domain blank unless you run GitHub Enterprise.
- Click Save.
env. reference, so the private key can stay in your secret manager
rather than in the database.Using a Copilot API token instead
If you already hold a Copilot API token, put it invalue and leave
github_copilot_key_config out. Copilot tokens expire after roughly thirty minutes and
Bifrost cannot refresh one it did not mint, so this suits testing rather than a running
gateway.
1. Chat Completions
Identical to OpenAI Chat Completions, including tool calls, streaming and vision.A long stream started within the last minute of a Copilot token’s life can fail partway.
Bifrost refreshes with a sixty second margin, which covers ordinary traffic; a very long
agentic stream is the exposed case.
2. Responses API
Converted through chat completions, so it works on every account regardless of whether your plan exposes a native Responses endpoint.3. List Models
4. Cost tracking
Copilot bills GitHub AI Credits at 1 credit = $0.01, converted from token counts at per-model rates. The rate card is per model and covers input, output and cached-input tokens, with some models (the GPT-5.6 family, and Anthropic models) adding a separate cache-write cost. Code completions and next edit suggestions are not billed in credits at all. Separately, subscribers who stayed on a legacy annual plan are still billed in premium requests rather than credits. Bifrost’s cost engine can express that shape:input_cost_per_token,
output_cost_per_token, cache_read_input_token_cost and cache_creation_input_token_cost
map onto GitHub’s four token categories, so no new pricing field is needed. What is missing
is the data. Until per-model rows are published, or you add
custom pricing for the models you use, cost stays $0.
See Models and pricing for GitHub Copilot
for the current per-model rate card.
5. Troubleshooting
Every Copilot error from Bifrost is prefixedgithub copilot: and names the field to change.
Every Copilot setup fault blocks fallbacks. That covers auth failures from GitHub (a revoked
credential, a policy excluding a model) and configuration faults Bifrost catches itself
before any request goes out: missing credentials, a non-numeric installation ID, a private
key that will not parse, an implausible token expiry.
All of them mean the same thing, and quietly draining that traffic onto another paid
provider is the wrong outcome: you would be billed elsewhere for a request you asked Copilot
to serve, and the setup mistake would never surface.
Rate limits and server errors are transient rather than faults, so those still fall back
normally.

