Skip to main content
GitHub Copilot’s Bring Your Own Key (BYOK) setting in VS Code accepts “any endpoint compatible with the OpenAI Chat Completions API.” Tokios is one of those endpoints: point Copilot at https://api.tokios.com/v1 with an sk-tok-… key and Copilot Chat and agent mode can call your local model without a tunnel. BYOK went GA in VS Code in April 2026. Copilot’s settings UI changes across releases, so confirm the exact menu path and field labels against your installed version.

Prerequisites

  • A running Tokios connector paired with your local model — see Connector install
  • A registered model deployment name — see Register a model
  • A Tokios API key (sk-tok-…) — see API Keys
  • VS Code with the GitHub Copilot and Copilot Chat extensions installed and signed in
BYOK is available on Copilot Business and Enterprise plans. GitHub’s Copilot plans and features page lists which tiers include BYOK — confirm your account before troubleshooting a missing setting.
BYOK applies to Copilot Chat and agent mode only. It does not change inline code completions — those keep using GitHub’s own completion models regardless of any BYOK model you add.

Point Copilot at Tokios

1

Open the model picker

Run Chat: Manage Language Models from the command palette, or open Copilot Chat and click the model picker above the chat input, then select Manage Models…. The exact wording varies by Copilot Chat version, so check yours.
2

Choose the OpenAI-compatible provider

Pick the option for adding a custom OpenAI-compatible endpoint (BYOK). GitHub’s docs describe this generically as adding “any other endpoint compatible with the OpenAI Chat Completions API,” alongside named providers like Ollama, vLLM, and Foundry Local — the exact label in your version may differ slightly.
3

Enter the base URL

Set the endpoint URL to:
4

Add your deployment as the model

Enter the public deployment name you registered on the Models tab — for example, gemma-tunnel. This is the value Copilot sends in the model field; it is not Ollama’s, llama.cpp’s, vLLM’s, or LM Studio’s local model id.
5

Paste your Tokios API key

Paste your sk-tok-… key into the API key field for the custom model. Copilot sends it as a Bearer token on every request.
Replace gemma-tunnel with the deployment name you registered, and sk-tok-YOUR_KEY with your own key. Never commit either into a shared settings file.

Why this needs a public HTTPS endpoint

Copilot’s BYOK requests are made from VS Code against the endpoint you configure — but that endpoint still needs to be reachable wherever Copilot’s client-side extension is running, and a bare http://localhost:11434 only works if VS Code and your model are on the exact same machine. As soon as you’re on a different laptop, a devcontainer, or a remote workspace, localhost no longer points at your model. Tokios’s connector is outbound-only, so your model never opens an inbound port, and every request carries a scoped sk-tok-… key instead of nothing at all:
  • No unauthenticated exposure — the connector dials out to Tokios; it never listens on a port, and requests need a valid key.
  • Stable URL — https://api.tokios.com/v1 doesn’t change between restarts, so you set it in Copilot once and it keeps working from any machine.
  • Scoped keys — a key can be limited to specific deployments and revoked instantly if it leaks, without touching your local model or connector.

Troubleshooting

Your Copilot plan may not include BYOK. Confirm whether your account is on a tier that supports it (see the prerequisites note above).
The API key Copilot sent is missing, malformed, or has been revoked. Confirm you pasted the full sk-tok-… key with no extra whitespace, and check its status on the Keys tab.
The model value Copilot sent doesn’t match a registered deployment. Confirm the custom model name in Copilot exactly matches the public name on the Models tab — not your Ollama/llama.cpp/vLLM/LM Studio local model id.
The connector for that deployment is offline or at its concurrency cap. Check the Connectors tab — the connector needs to show as Online, and the machine running it needs to still be up and reachable.
This is expected. BYOK only affects Copilot Chat and agent mode — inline completions are not configurable via BYOK.

Next steps

Quickstart

Pair a connector, register a model, and create an API key from scratch.

Compatible clients

See base URL and key setup for other OpenAI- and Anthropic-compatible clients.