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

# VS Code Copilot

> Use GitHub Copilot Chat in VS Code with ITAR and FedRAMP High data via Consus Gateway.

<Warning>
  Your `chatLanguageModels.json` should list only the models authorized for **your data's classification**. Choose the compliance level your data classification and authorization require, list models at that level, and do not mix levels within a single file. Step 1 gives two examples to base yours on: an **ITAR** configuration and an **All models** configuration.

  The gateway enforces the compliance boundary for the models it serves, but it does **not** control client-side behavior: local tool execution, file access, outbound destinations, and so on. Client-side behavior is the customer's responsibility.
</Warning>

<video width="100%" style={{ aspectRatio: "16/9" }} controls>
  <source src="https://mintcdn.com/consusindustries/Oxp-mNynLAt4Z1O7/assets/copilot_integration.mp4?fit=max&auto=format&n=Oxp-mNynLAt4Z1O7&q=85&s=c5b39553575f03a66eb6f951e583f5ba" type="video/mp4" data-path="assets/copilot_integration.mp4" />
</video>

[GitHub Copilot Chat](https://code.visualstudio.com/docs/copilot/overview) in VS Code supports Bring Your Own Key (BYOK), letting you register custom OpenAI-compatible model providers. Point it at Consus Gateway to get Claude and GPT models in your editor while keeping all traffic within government-authorized cloud infrastructure.

## Before you start

You need:

* **A Consus API key** from your Consus admin.
* **A recent version of VS Code** with the GitHub Copilot Chat extension (BYOK custom endpoints).

## Step 1: Configure Consus as a BYOK provider

VS Code stores custom BYOK endpoints in `chatLanguageModels.json`. To create it:

1. Open the Command Palette (`Cmd/Ctrl+Shift+P`) and run **Chat: Manage Language Models** (or click the gear icon in the model picker in the Chat view).
2. Select **Add Models**, then choose **Custom Endpoint** from the provider list.
3. When prompted, enter a group name and select the API type **Chat Completions**. VS Code then opens `chatLanguageModels.json` for editing.

The file lives in your VS Code **User** directory, alongside `settings.json`:

* **macOS:** `~/Library/Application Support/Code/User/chatLanguageModels.json`
* **Linux:** `~/.config/Code/User/chatLanguageModels.json`
* **Windows:** `%APPDATA%\Code\User\chatLanguageModels.json`

(For VS Code Insiders, substitute `Code - Insiders` for `Code`.)

Populate it with the models authorized for your data classification. The two examples below use the identical provider block (`name`, `vendor`, `apiType`) and differ only in the `models` array: one scoped to ITAR / export-controlled data, one listing a broad set of models across compliance levels. Use whichever matches your authorization, or adapt the model list to your classification. Do not mix levels within a single file.

Replace `<CONSUS_API_KEY>` in each `requestHeaders` block with your actual Consus Gateway API key. VS Code sends this header value **literally** — it does not expand environment variables, so paste the real key rather than a `$VAR` reference.

<Warning>
  `chatLanguageModels.json` stores your API key in **plain text**. Do not commit it to source control; keep it in your local VS Code **User** directory only.
</Warning>

### Example: ITAR

Use this when handling ITAR / export-controlled data. It exposes **Claude Opus 4.8**, **Claude Sonnet 4.5**, **GPT-5.1**, **GPT-5.4**, and **GPT OSS 120B**, all with ITAR authorization on AWS GovCloud Bedrock. Opus 4.8 is authorized for ITAR only, so it uses the standalone `:itar` ID.

<Accordion title="chatLanguageModels.json (ITAR)">
  ```json theme={null}
  [
    {
      "name": "Consus Gateway",
      "vendor": "customendpoint",
      "apiType": "chat-completions",
      "models": [
        {
          "id": "claude-opus-4-8:itar",
          "name": "Claude Opus 4.8 (ITAR)",
          "url": "https://api.consus.io/v1",
          "requestHeaders": { "x-api-key": "<CONSUS_API_KEY>" },
          "toolCalling": true,
          "vision": true,
          "maxInputTokens": 1000000,
          "maxOutputTokens": 8192
        },
        {
          "id": "claude-sonnet-4-5:itar",
          "name": "Claude Sonnet 4.5 (ITAR)",
          "url": "https://api.consus.io/v1",
          "requestHeaders": { "x-api-key": "<CONSUS_API_KEY>" },
          "toolCalling": true,
          "vision": true,
          "maxInputTokens": 200000,
          "maxOutputTokens": 8192
        },
        {
          "id": "gpt-5.1:itar",
          "name": "GPT-5.1 (ITAR)",
          "url": "https://api.consus.io/v1",
          "requestHeaders": { "x-api-key": "<CONSUS_API_KEY>" },
          "toolCalling": true,
          "vision": true,
          "maxInputTokens": 272000,
          "maxOutputTokens": 8192
        },
        {
          "id": "gpt-5.4:itar",
          "name": "GPT-5.4 (ITAR)",
          "url": "https://api.consus.io/v1",
          "requestHeaders": { "x-api-key": "<CONSUS_API_KEY>" },
          "toolCalling": true,
          "vision": true,
          "maxInputTokens": 272000,
          "maxOutputTokens": 8192
        },
        {
          "id": "gpt-oss-120b:itar",
          "name": "GPT OSS 120B (ITAR)",
          "url": "https://api.consus.io/v1",
          "requestHeaders": { "x-api-key": "<CONSUS_API_KEY>" },
          "toolCalling": true,
          "vision": false,
          "maxInputTokens": 128000,
          "maxOutputTokens": 8192
        }
      ]
    }
  ]
  ```
</Accordion>

### Example: All models

Lists the models people actually reach for, spanning several compliance levels so you can switch from the chat model picker mid-session. Each `id` carries its own level; trim this list, or swap the levels (`:il5+itar`, `:itar`, `:il2`, `:il4`, `:fedramp-high`, and so on), to match your data classification and authorization.

<Accordion title="chatLanguageModels.json (all models)">
  ```json theme={null}
  [
    {
      "name": "Consus Gateway",
      "vendor": "customendpoint",
      "apiType": "chat-completions",
      "models": [
        {
          "id": "claude-sonnet-4-5:il5+itar",
          "name": "Claude Sonnet 4.5 (IL5 + ITAR)",
          "url": "https://api.consus.io/v1",
          "requestHeaders": { "x-api-key": "<CONSUS_API_KEY>" },
          "toolCalling": true,
          "vision": true,
          "maxInputTokens": 200000,
          "maxOutputTokens": 8192
        },
        {
          "id": "claude-sonnet-4-5:itar",
          "name": "Claude Sonnet 4.5 (ITAR)",
          "url": "https://api.consus.io/v1",
          "requestHeaders": { "x-api-key": "<CONSUS_API_KEY>" },
          "toolCalling": true,
          "vision": true,
          "maxInputTokens": 200000,
          "maxOutputTokens": 8192
        },
        {
          "id": "claude-opus-4-7:il2",
          "name": "Claude Opus 4.7 (IL2)",
          "url": "https://api.consus.io/v1",
          "requestHeaders": { "x-api-key": "<CONSUS_API_KEY>" },
          "toolCalling": true,
          "vision": true,
          "maxInputTokens": 1000000,
          "maxOutputTokens": 8192
        },
        {
          "id": "claude-opus-4-6:il2",
          "name": "Claude Opus 4.6 (IL2)",
          "url": "https://api.consus.io/v1",
          "requestHeaders": { "x-api-key": "<CONSUS_API_KEY>" },
          "toolCalling": true,
          "vision": true,
          "maxInputTokens": 1000000,
          "maxOutputTokens": 8192
        },
        {
          "id": "claude-sonnet-4-6:il2",
          "name": "Claude Sonnet 4.6 (IL2)",
          "url": "https://api.consus.io/v1",
          "requestHeaders": { "x-api-key": "<CONSUS_API_KEY>" },
          "toolCalling": true,
          "vision": true,
          "maxInputTokens": 1000000,
          "maxOutputTokens": 8192
        },
        {
          "id": "claude-haiku-4-5:il2",
          "name": "Claude Haiku 4.5 (IL2)",
          "url": "https://api.consus.io/v1",
          "requestHeaders": { "x-api-key": "<CONSUS_API_KEY>" },
          "toolCalling": true,
          "vision": true,
          "maxInputTokens": 200000,
          "maxOutputTokens": 8192
        },
        {
          "id": "gemini-3-1-pro:fedramp-high",
          "name": "Gemini 3.1 Pro (FedRAMP High)",
          "url": "https://api.consus.io/v1",
          "requestHeaders": { "x-api-key": "<CONSUS_API_KEY>" },
          "toolCalling": true,
          "vision": true,
          "maxInputTokens": 1048576,
          "maxOutputTokens": 8192
        },
        {
          "id": "gpt-5.4:il5+itar",
          "name": "GPT-5.4 (IL5 + ITAR)",
          "url": "https://api.consus.io/v1",
          "requestHeaders": { "x-api-key": "<CONSUS_API_KEY>" },
          "toolCalling": true,
          "vision": true,
          "maxInputTokens": 272000,
          "maxOutputTokens": 8192
        },
        {
          "id": "gpt-5.4:itar",
          "name": "GPT-5.4 (ITAR)",
          "url": "https://api.consus.io/v1",
          "requestHeaders": { "x-api-key": "<CONSUS_API_KEY>" },
          "toolCalling": true,
          "vision": true,
          "maxInputTokens": 272000,
          "maxOutputTokens": 8192
        },
        {
          "id": "gpt-oss-120b:il5+itar",
          "name": "GPT OSS 120B (IL5 + ITAR)",
          "url": "https://api.consus.io/v1",
          "requestHeaders": { "x-api-key": "<CONSUS_API_KEY>" },
          "toolCalling": true,
          "vision": false,
          "maxInputTokens": 128000,
          "maxOutputTokens": 8192
        },
        {
          "id": "gpt-oss-120b:itar",
          "name": "GPT OSS 120B (ITAR)",
          "url": "https://api.consus.io/v1",
          "requestHeaders": { "x-api-key": "<CONSUS_API_KEY>" },
          "toolCalling": true,
          "vision": false,
          "maxInputTokens": 128000,
          "maxOutputTokens": 8192
        },
        {
          "id": "gemini-3-5-flash:il4",
          "name": "Gemini 3.5 Flash (IL4)",
          "url": "https://api.consus.io/v1",
          "requestHeaders": { "x-api-key": "<CONSUS_API_KEY>" },
          "toolCalling": true,
          "vision": true,
          "maxInputTokens": 1048576,
          "maxOutputTokens": 8192
        }
      ]
    }
  ]
  ```
</Accordion>

<Note>
  This is a starting point. Trim it to the models you actually use, or add any other authorized model with the same shape. Run `curl -H "x-api-key: $CONSUS_API_KEY" https://api.consus.io/v1/models` to list every composite ID available to your key. Every `id` must carry a compliance level (e.g. `:fedramp-high`, `:il5`, `:itar`); a bare model name is rejected with a `400`.
</Note>

## Step 2: Sign out for a Consus-only setup (recommended)

Signing out of GitHub in VS Code disables the built-in Copilot models, so the **only** model that actually serves requests is Consus. This guarantees no request silently falls back to a non-authorized model. (`Auto` may still appear in the picker, but it won't work — see the note in Step 3.)

1. **Sign out of GitHub in VS Code.** Click the account icon (bottom-left), select your GitHub account, and click **Sign Out**.
2. **Restart VS Code.**
3. **Open settings.json** (`Cmd/Ctrl+Shift+P` → **Preferences: Open User Settings (JSON)**) and add utility model overrides so background tasks also route to Consus instead of a built-in:

   ```json theme={null}
   {
     "chat.utilityModel": "gpt-5.4:itar",
     "chat.utilitySmallModel": "gpt-5.4:itar"
   }
   ```

   Set both to a model `id` from your `chatLanguageModels.json`.

## Step 3: Select the model and verify

1. Open the chat model picker and select a Consus model (for example **GPT-5.4 (ITAR)**).
2. Send a test prompt. Confirm it responds and that **no Copilot credits are consumed** — zero credits means the request was served by Consus, not a Copilot built-in.

<Note>
  `Auto` may still appear in the picker even after signing out, but it **won't work** — selecting it does nothing. Ignore it and always pick a Consus model explicitly.
</Note>

All requests now route through Consus Gateway to government-authorized cloud infrastructure. Streaming, tool use (file reads, writes, terminal commands), and multi-turn conversations all work out of the box.

## What gets served

Every request from Copilot Chat — coding turns, reasoning, tool use — is served by the model you select in the picker, at the compliance level set in its `id`. The gateway routes each request to whichever government-authorized provider hosts that model at the requested compliance level (AWS GovCloud Bedrock, GCP Assured Workloads Vertex AI, Azure Government OpenAI); the compliance boundary is enforced at the gateway architecture level.

VS Code talks to the gateway over the OpenAI-compatible Chat Completions API. For the full request/response surface (multimodal input, streaming behavior, tool-use shape), see [`POST /v1/chat/completions`](/endpoints/chat-completions).

## What each setting does

`name`
: Display name for the provider group in VS Code.

`vendor`
: `customendpoint` tells VS Code this is a custom OpenAI-compatible provider rather than a built-in.

`apiType`
: `chat-completions` selects the OpenAI-compatible Chat Completions wire format, which the gateway exposes for every provider (Anthropic, OpenAI, Google).

`models[].id`
: The composite model ID VS Code sends to the gateway. Must include a `:level` suffix (e.g. `:itar`, `:il5+itar`, `:fedramp-high`).

`models[].url`
: Routes the request to the gateway's OpenAI-compatible endpoint (`https://api.consus.io/v1`).

`models[].requestHeaders."x-api-key"`
: Sends your Consus key on every request. Consus authenticates with the `x-api-key` header, **not** `Authorization: Bearer`. Replace `<CONSUS_API_KEY>` with your actual key.

`models[].toolCalling`
: `true` enables tool/function calling — required for Copilot's agentic coding (file edits, terminal commands).

`models[].vision`
: `true` for models that accept image input; `false` for text-only models such as GPT OSS 120B.

`models[].maxInputTokens` / `maxOutputTokens`
: The model's input context window and the maximum output tokens requested per turn.

`chat.utilityModel` / `chat.utilitySmallModel`
: (settings.json) The models VS Code uses for background/utility tasks. Point them at a Consus `id` so utility calls don't fall back to a Copilot built-in.

## Troubleshooting

**`401 Unauthorized`**: `x-api-key` is missing or wrong. Verify the `requestHeaders."x-api-key"` value in `chatLanguageModels.json` holds your real key.

**`403 Forbidden`**: An `Authorization: Bearer` token reached the gateway, or the header name is misspelled. Consus authenticates only via `x-api-key` (all lowercase, with hyphens).

**`400 ... compliance level required`**: A model `id` is missing its `:level` suffix (e.g. `gpt-5.4` instead of `gpt-5.4:itar`). Add the level your authorization requires.

**Model not appearing in the picker**: `chatLanguageModels.json` didn't parse. Validate it (`python3 -m json.tool chatLanguageModels.json`), fix any error, and reload the window.

**Copilot credits being consumed**: The request was served by a Copilot built-in, not Consus. Confirm you selected a Consus model, and sign out of GitHub (Step 2) to remove built-ins entirely.
