> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokios.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Tokios exposes private local models through https://api.tokios.com using an outbound-only connector tunnel.
> Use 'connector' for the local tokios-connector process.
> Use 'deployment' for the public model name in the API model field.
> Use 'upstream model id' for the model served by Ollama, llama.cpp, vLLM, LM Studio, or another local backend.
> API keys use the prefix sk-tok-. Connector tokens use the prefix ct-tok-.

# Use GitHub Copilot in VS Code with your own model (BYOK)

> Point GitHub Copilot Chat's Bring Your Own Key setting at Tokios so Copilot's chat and agent mode can call a local model on Ollama, LM Studio, or vLLM.

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](https://docs.tokios.com/setup/connector-install.md)
* A registered model deployment name — see [Register a model](https://docs.tokios.com/setup/register-model.md)
* A Tokios API key (`sk-tok-…`) — see [API Keys](https://docs.tokios.com/setup/api-keys.md)
* VS Code with the GitHub Copilot and Copilot Chat extensions installed and signed in

> [!NOTE]
>
> BYOK is available on Copilot Business and Enterprise plans. GitHub's [Copilot plans and features](https://docs.github.com/en/copilot/about-github-copilot/plans-for-github-copilot) page lists which tiers include BYOK — confirm your account before troubleshooting a missing setting.

> [!WARNING]
>
> 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:

```text theme={"theme":{"light":"github-light","dark":"css-variables"}}
https://api.tokios.com/v1
```

**4. Add your deployment as the model**

Enter the **public deployment name** you registered on the [Models](https://tokios.com/console/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.

> [!NOTE]
>
> 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

> [accordion] BYOK option is missing from the model picker
>
> Your Copilot plan may not include BYOK. Confirm whether your account is on a tier that supports it (see the prerequisites note above).

> [accordion] 401 error
>
> 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](https://tokios.com/console/keys) tab.

> [accordion] 404 error
>
> 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](https://tokios.com/console/models) tab — not your Ollama/llama.cpp/vLLM/LM Studio local model id.

> [accordion] 503 error
>
> The connector for that deployment is offline or at its concurrency cap. Check the [Connectors](https://tokios.com/console/connectors) tab — the connector needs to show as **Online**, and the machine running it needs to still be up and reachable.

> [accordion] Inline completions still use GitHub's models
>
> This is expected. BYOK only affects Copilot Chat and agent mode — inline completions are not configurable via BYOK.

## Next steps

> [card] [Quickstart](https://docs.tokios.com/quickstart.md)
>
> Pair a connector, register a model, and create an API key from scratch.

> [card] [Compatible clients](https://docs.tokios.com/guides/compatible-clients.md)
>
> See base URL and key setup for other OpenAI- and Anthropic-compatible clients.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.