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

# GitHub Copilot

> Run Copilot Chat and agent mode in VS Code — and the Copilot CLI — on AI Reserve models through Copilot's bring-your-own-key Custom Endpoint.

<Card title="Create your API key →" icon="key" href="https://portal.aireserve.com/keys" horizontal>
  Mint an `aireserve_api_…` key in the portal — every Copilot Chat and agent request is then metered and billed through
  your organization.
</Card>

Copilot Chat and agent mode in VS Code can use AI Reserve models through
Copilot's bring-your-own-key (BYOK) **Custom Endpoint** provider
([Microsoft's guide](https://code.visualstudio.com/docs/agent-customization/language-models)).
Every request then reaches the gateway on your key — metered and billed to
your organization, with your admin's model rules enforced server-side.

## VS Code

1. Open the Command Palette and run **Chat: Manage Language Models** (the gear
   icon in the chat model picker opens the same editor).
2. Select **Add Models → Custom Endpoint**. Name the group **AI Reserve**,
   enter a display name and your `aireserve_api_…` key when asked, and pick
   **Chat Completions** as the API type.
3. VS Code opens `chatLanguageModels.json`. Replace the generated entry with:

```json theme={"dark"}
[
  {
    "name": "AI Reserve",
    "vendor": "customendpoint",
    "apiKey": "${input:aireserveApiKey}",
    "apiType": "chat-completions",
    "models": [
      {
        "id": "auto",
        "name": "AI Reserve · Auto",
        "url": "https://api.aireserve.com/v1/chat/completions",
        "toolCalling": true,
        "vision": true,
        "maxInputTokens": 128000,
        "maxOutputTokens": 16000
      }
    ]
  }
]
```

4. Save, then choose **AI Reserve · Auto** from the model picker in chat. If it
   does not appear straight away, restart VS Code.

<Note>
  **The key never lands in the file.** `${input:aireserveApiKey}` is an input
  variable: VS Code prompts for the value once and keeps it in secret storage,
  so `chatLanguageModels.json` is safe to sync or commit. If you already pasted
  the key in the wizard, VS Code stored it under the `apiKey` variable it
  generated — keep that line or switch to `${input:aireserveApiKey}` and you
  will be prompted once.
</Note>

`auto` lets the gateway pick the model per request. To pin a model instead,
add an entry to `models` with any ID from the [catalog](/models) — for example
`claude-sonnet-4-6`, `gpt-5.4-mini`, or `gemini-2.5-pro` — same `url`, one
object per model. Keep `toolCalling: true`: agent mode requires tool calling,
which every gateway chat model supports. Set `vision` only on models that accept
images ([per-model table](/capabilities/vision)).

<Note>
  **Inline completions stay on GitHub.** BYOK covers Chat and agent mode (plus utility tasks such as commit messages);
  ghost-text inline suggestions keep using GitHub's own models and still need a Copilot sign-in. On Copilot Business or
  Enterprise, an administrator must first enable the **Bring Your Own Language Model Key in VS Code** policy in the
  Copilot settings on GitHub.com.
</Note>

## Copilot CLI

The same `/v1` base works for the Copilot CLI's BYOK mode, configured through
its `COPILOT_PROVIDER_*` environment variables: the `openai` provider type,
`https://api.aireserve.com/v1` as the base URL, your key, and a gateway model
ID. The exact variable names and their defaults are in
[GitHub's Copilot CLI guide](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/use-byok-models);
the guided portal page below prints a ready-to-paste block.

## Organization-wide: GitHub Enterprise custom models

Prefer that developers configure nothing? On GitHub Enterprise with Copilot
Business or Enterprise seats, your GitHub admin can add AI Reserve once as an
**OpenAI-compatible** custom model provider in GitHub's own settings (custom
models is a GitHub public preview). The models then appear in every
developer's Copilot picker — VS Code, JetBrains, github.com chat, and the
Copilot CLI — with no per-developer setup, all billed to one organization key.

<Card title="Connect GitHub Copilot organization-wide →" icon="zap" href="https://portal.aireserve.com/connect/copilot" horizontal>
  The guided connect page mints one organization-wide key, hands your GitHub admin the base URL and recommended model
  IDs, and confirms the moment Copilot's first request arrives.
</Card>

## Verify

Send any message in Copilot Chat with an AI Reserve model selected and watch
it stream. The request appears on your
[Analytics page](https://portal.aireserve.com/analytics) seconds later —
metered against the key you configured.
