Docs

GitHub Copilot CLI

Copilot CLI's BYOK path is four environment variables and, by GitHub's own documentation, no GitHub login at all. Point it at Kunavo and the agent runs on a prepaid balance instead of AI Credits — while /delegate, the GitHub MCP server and GitHub Code Search stay behind that login.

Four environment variables — COPILOT_PROVIDER_BASE_URL, COPILOT_PROVIDER_TYPE, COPILOT_PROVIDER_API_KEY and COPILOT_MODEL — move Copilot CLI onto your own endpoint, and GitHub documents that BYOK needs no GitHub login.

the shell you start copilot from
# Set before you start Copilot CLI. Variable names and order are GitHub's;
# COPILOT_PROVIDER_BASE_URL and COPILOT_MODEL are the two marked Required.
export COPILOT_PROVIDER_BASE_URL=https://api.kunavo.com/v1   # see the note below
export COPILOT_PROVIDER_TYPE=openai                          # the default, shown for clarity
export COPILOT_PROVIDER_API_KEY=sk-kn-...
export COPILOT_MODEL=claude-sonnet-5

copilot
GitHub does not state which path Copilot CLI appends, so the /v1 above is a worked example rather than a rule. The BYOK page defines the field only as “The base URL of your model provider's API endpoint”, and its own examples point both ways: the remote OpenAI-compatible one is https://api.openai.com/v1, while the Ollama and Anthropic ones are bare origins. This page uses the remote OpenAI-compatible shape because that is the case Kunavo is. If requests come back 404, the suffix is being doubled — drop it and use https://api.kunavo.com. A 401 is the key, not the URL, and the curl below tells the two apart before you debug the CLI.
A leftover ~/.copilot/providers.json silently beats these exports. GitHub's config-dir reference says that when that file declares any provider or model it takes precedence over the COPILOT_PROVIDER_* variables, which it calls legacy — and the BYOK how-to never mentions the file. If the CLI ignores the base URL you just exported, look there first. The same reference describes the file only as a JSON object with providers and models keys and publishes no schema, so no example of it is printed here; copilot help providers is what GitHub points at for more.
This configuration was read off GitHub's own documentation on the date below. Kunavo has not run Copilot CLI against its endpoint — not a session, not a streamed turn, not a tool round-trip, and the same is true of every other client in this family. A published setup page is not a test. GitHub requires that a BYOK model support tool calling and streaming and returns an error otherwise, so the first task you give it should touch a file rather than say hello.
Kunavo serves no embedding, text-to-speech or speech-to-text model, so this endpoint answers chat turns and nothing else. GitHub Code Search, the GitHub MCP server and /delegate are GitHub-side features that a BYOK provider does not replace — GitHub documents them as unavailable without a login, and you can keep them by signing in as well as configuring a provider.

Step by step

  1. Create a key at /app/keys and copy it — it is shown once.
  2. Check for a stale ~/.copilot/providers.json (or whatever COPILOT_PROVIDERS_CONFIG points at). If one declares a provider or a model, it wins over everything in step 3.
  3. Export COPILOT_PROVIDER_BASE_URL, COPILOT_PROVIDER_API_KEY and COPILOT_MODEL as above. COPILOT_PROVIDER_TYPE defaults to openai, which GitHub describes as covering “any other OpenAI Chat Completions API-compatible endpoint”.
  4. Start copilot from that same shell — these are read at startup, so a terminal opened earlier still has the old values.
  5. Give it a task that reads and edits a file. Copilot CLI needs tool calling and streaming from the model, and a first run that exercises both tells you more than a greeting does. --model overrides COPILOT_MODEL for one run if you want to compare two ids.

Checked against GitHub's “Using your own LLM models in GitHub Copilot CLI” on September 21, 2026. Third-party settings move; if a field name here no longer matches what you see, that page is the authority, not this one.

This is the short version. The full walkthrough — model choice, what a real session costs, and the failure modes — is in Copilot CLI vs Claude Code — the BYOK boundary and the two bills.

Verify before you debug the client

One request settles whether a failure is the endpoint, the key, or the configuration file. If this returns JSON, the same base URL and key work in GitHub Copilot CLI.

# Settles whether a failure is the endpoint, the key, or the client.
curl -sS https://api.kunavo.com/v1/models \
  -H "Authorization: Bearer sk-kn-..."

Which model id to put in the field

Every text model is reachable as a model id — the live list is GET /v1/models, and the catalog with prices is on the models page. Rates are USD per 1M tokens, input / output.

Model idKunavo in / outWhere it fits in GitHub Copilot CLI
claude-sonnet-5$2.00 / $10.00the default working model for sessions that edit files
claude-opus-5$2.00 / $10.00planning a change that would be expensive to get wrong
claude-haiku-4-5$0.40 / $2.00cheap turns — triage, summaries, the loop that runs all day
gpt-5-6-sol$2.00 / $12.00a second opinion from another family, same key and same base URL
Billing is per token from a prepaid balance with no monthly fee — see billing. On repeated context — which is most of what an editor or a chat client sends — prompt caching moves the bill more than the model choice does.

The other route: COPILOT_PROVIDER_TYPE=anthropic

GitHub documents three provider types, and Kunavo answers two of the wire formats behind them: /v1/chat/completions for openai and /v1/messages for anthropic. The Anthropic example on GitHub's page is four exports, and its base URL is the bare origin https://api.anthropic.com:

  1. COPILOT_PROVIDER_TYPE=anthropic
  2. COPILOT_PROVIDER_BASE_URL — by the shape of GitHub's example, https://api.kunavo.com with no suffix, since Anthropic's own route lives at /v1/messages under that origin and Kunavo mirrors it. The same caveat as above applies: GitHub shows an example, not a rule.
  3. COPILOT_PROVIDER_API_KEY — your sk-kn- key. Kunavo's Messages surface accepts it as either x-api-key or Authorization: Bearer, so whichever header the CLI chooses here is read.
  4. COPILOT_MODEL — the id your provider expects. GitHub's example passes a dashed Anthropic-style spelling, while its own supported-models list writes the same families with dots; under BYOK the id goes to your endpoint, so use the spelling in the table above.

Why this page leads with the openai type anyway: nothing in GitHub's documentation says whether the Anthropic BYOK path forwards cache_control, anthropic-beta or a particular anthropic-version. On repeated context that matters to the bill — see prompt caching — and an undocumented answer is not one this page is willing to assume. The openai type has no such open question, so it is the one with a filled-in config block.

FAQ

How do I point GitHub Copilot CLI at a custom API endpoint?

Set environment variables before starting the CLI. GitHub's BYOK page marks two as required — COPILOT_PROVIDER_BASE_URL and COPILOT_MODEL — and adds COPILOT_PROVIDER_API_KEY for any endpoint that authenticates. COPILOT_PROVIDER_TYPE defaults to openai, which GitHub describes as covering OpenAI, Ollama, vLLM, Foundry Local and any other OpenAI Chat Completions API-compatible endpoint; the other values are azure and anthropic. One catch GitHub documents elsewhere: if ~/.copilot/providers.json declares any provider or model, it takes precedence over all of these variables.

Does the Copilot CLI base URL need /v1 at the end?

GitHub's documentation does not settle this. The field is defined only as "The base URL of your model provider's API endpoint", and the page's own examples point both ways: the remote OpenAI-compatible example is https://api.openai.com/v1, while the Ollama and Anthropic examples are bare origins. For an OpenAI-compatible endpoint, start with the form GitHub shows for that case — https://api.kunavo.com/v1 — and if requests fail with 404 rather than 401, the suffix is being doubled, so drop it. A 404 is the URL and a 401 is the key; a plain curl against the same base URL separates them before you debug the CLI.

Does GitHub Copilot CLI BYOK require a GitHub account?

No. GitHub's authentication documentation states that when Copilot CLI is configured with your own LLM provider API key, GitHub authentication is not required and the CLI connects directly to your configured provider. Three features are then unavailable: /delegate, the GitHub MCP server and GitHub Code Search. You can also sign in and configure a provider at the same time to keep both. GitHub additionally documents COPILOT_OFFLINE=true for environments where the CLI should not contact GitHub's servers at all — though that only isolates the network if the provider is local, since a remote base URL still receives your prompts and code context.

Has Kunavo tested GitHub Copilot CLI against its endpoint?

No. The configuration on this page is read from GitHub's own BYOK documentation on the date shown, and nothing on it is a runtime result — no session, no streamed turn, no tool round-trip, and the same is true of every other client documented here. GitHub requires a BYOK model to support tool calling and streaming and returns an error when one does not, so the honest first check is your own: run one task that reads and edits a file, and treat the recorded charge and the CLI's behaviour as the evidence rather than this page.