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

# Connect GitHub Copilot to LLMEasy with a custom model

> Configure LLMEasy API Key and Base URL in GitHub Copilot Chat through a Custom Endpoint in VS Code.

GitHub Copilot Chat supports custom models through **Custom Endpoint**. To connect LLMEasy, use a **GPT group** API Key and select **Chat Completions**.

<Info>
  This guide configures a custom language model for GitHub Copilot Chat in VS Code. It does not replace GitHub Copilot inline code completion.
</Info>

## Prerequisites

* Latest VS Code installed
* GitHub Copilot / Copilot Chat installed and signed in
* LLMEasy API Key ready (<a href={"https://www.llmeasy.ru/register"}>register and get one</a>)
* The API Key belongs to the **GPT group**
* A model ID is available, for example `gpt-5.5`

<Warning>
  Do not manually write your real API Key into `chatLanguageModels.json`. Paste it into the VS Code API Key prompt. VS Code will generate a local secret reference such as `${input:chat.lm.secret...}`.
</Warning>

## Setup steps

<Steps>
  <Step title="Open model management">
    In the Copilot Chat input area, click the model selector, then choose **Manage Models...**.

    <Frame>
      <img src="https://mintcdn.com/bettertoken/saursmLAn72TOGCS/images/github-copilot/manage-models-entry.png?fit=max&auto=format&n=saursmLAn72TOGCS&q=85&s=b3c89a8a8a1505dd56776d6d270aad38" alt="Open Manage Models from the Copilot Chat model selector." style={{ borderRadius: '0.5rem' }} width="3012" height="1600" data-path="images/github-copilot/manage-models-entry.png" />
    </Frame>
  </Step>

  <Step title="Add Custom Endpoint">
    In **Language Models**, click **Add Models**, then choose **Custom Endpoint**.

    <Frame>
      <img src="https://mintcdn.com/bettertoken/saursmLAn72TOGCS/images/github-copilot/add-custom-endpoint.png?fit=max&auto=format&n=saursmLAn72TOGCS&q=85&s=28bf7fc3b707dd43e12c0ac8ffc925ab" alt="Click Add Models in Language Models and choose Custom Endpoint." style={{ borderRadius: '0.5rem' }} width="3840" height="2160" data-path="images/github-copilot/add-custom-endpoint.png" />
    </Frame>
  </Step>

  <Step title="Enter the group name">
    In **Group Name**, enter:

    ```text theme={null}
    LLMEasy
    ```

    Then press **Enter**.

    <Frame>
      <img src="https://mintcdn.com/bettertoken/saursmLAn72TOGCS/images/github-copilot/group-name.png?fit=max&auto=format&n=saursmLAn72TOGCS&q=85&s=46c88048f0883a7523a9797a55586217" alt="Enter LLMEasy in the Group Name input." style={{ borderRadius: '0.5rem' }} width="3840" height="2160" data-path="images/github-copilot/group-name.png" />
    </Frame>
  </Step>

  <Step title="Enter the API Key">
    VS Code will ask for the API Key. Paste your LLMEasy API Key, then press **Enter**.

    This value will not be shown directly in the configuration file. VS Code stores it as a local secret and generates a reference like this:

    ```json theme={null}
    "apiKey": "${input:chat.lm.secret.xxxxx}"
    ```

    <Warning>
      Do not replace `${input:chat.lm.secret...}` with your real API Key. Keep the secret reference generated by VS Code.
    </Warning>
  </Step>

  <Step title="Select the API type">
    In **Custom Endpoint: API Type**, select **Chat Completions**.

    <Frame>
      <img src="https://mintcdn.com/bettertoken/saursmLAn72TOGCS/images/github-copilot/select-chat-completions.png?fit=max&auto=format&n=saursmLAn72TOGCS&q=85&s=cbfbd4129e09c88fa571e0686473d06a" alt="Select Chat Completions in Custom Endpoint API Type." style={{ borderRadius: '0.5rem' }} width="3012" height="1600" data-path="images/github-copilot/select-chat-completions.png" />
    </Frame>
  </Step>

  <Step title="Edit the JSON configuration">
    VS Code opens `chatLanguageModels.json`. Confirm or update the configuration:

    <Frame>
      <img src="https://mintcdn.com/bettertoken/saursmLAn72TOGCS/images/github-copilot/chat-language-models-json.png?fit=max&auto=format&n=saursmLAn72TOGCS&q=85&s=8d57b982f01ee44e25810b18754369b7" alt="Configure LLMEasy model URL, toolCalling, vision, and token limits in chatLanguageModels.json." style={{ borderRadius: '0.5rem' }} width="3012" height="1600" data-path="images/github-copilot/chat-language-models-json.png" />
    </Frame>

    ```json theme={null}
    [
      {
        "name": "LLMEasy",
        "vendor": "customendpoint",
        "apiKey": "${input:chat.lm.secret.xxxxx}",
        "apiType": "chat-completions",
        "models": [
          {
            "id": "gpt-5.5",
            "name": "gpt-5.5",
            "url": "https://www.llmeasy.ru/v1/chat/completions",
            "toolCalling": true,
            "vision": true,
            "maxInputTokens": 1000000,
            "maxOutputTokens": 64000
          }
        ]
      }
    ]
    ```

    Check these fields:

    | Field             | Recommended value                                                                                           |
    | ----------------- | ----------------------------------------------------------------------------------------------------------- |
    | `name`            | `LLMEasy`                                                                                                   |
    | `apiType`         | `chat-completions`                                                                                          |
    | `id`              | `gpt-5.5` or another GPT group model ID from the <a href={"https://www.llmeasy.ru/pricing"}>model plaza</a> |
    | `name`            | Same as the model ID                                                                                        |
    | `url`             | `https://www.llmeasy.ru/v1/chat/completions`                                                                |
    | `toolCalling`     | `true`                                                                                                      |
    | `vision`          | `true`                                                                                                      |
    | `maxInputTokens`  | `1000000`                                                                                                   |
    | `maxOutputTokens` | `64000`                                                                                                     |
  </Step>

  <Step title="Save and reload VS Code">
    Save `chatLanguageModels.json`, then run:

    ```text theme={null}
    Developer: Reload Window
    ```

    After reload, return to the Copilot Chat model selector and choose `gpt-5.5`.
  </Step>

  <Step title="Send a test message">
    Send a simple message in Copilot Chat:

    ```text theme={null}
    Describe the model you are using in one sentence.
    ```

    If Copilot Chat replies normally, the LLMEasy Custom Endpoint is configured successfully.
  </Step>
</Steps>

## FAQ

### Why should I enter the API Key in the prompt?

VS Code stores the API Key in local secret storage and references it in JSON with `${input:chat.lm.secret...}`. This is safer than writing the real API Key into the JSON file.

### Why use Chat Completions?

The verified working configuration uses **Chat Completions**. The URL is:

```text theme={null}
https://www.llmeasy.ru/v1/chat/completions
```

Do not use `/v1/responses`, and do not stop at `/v1`.

### Does this replace GitHub Copilot inline completion?

No. This Custom Endpoint is mainly used for Copilot Chat language model calls. GitHub Copilot inline completion is still provided by GitHub Copilot itself.

### What should I do if I see Invalid token?

Check these items in order:

1. The API Key was entered in the VS Code prompt
2. JSON keeps the `${input:chat.lm.secret...}` reference
3. The API Key belongs to the **GPT group**
4. `url` is `https://www.llmeasy.ru/v1/chat/completions`
5. `apiType` is `chat-completions`
6. The model ID is a GPT group model from the <a href={"https://www.llmeasy.ru/pricing"}>model plaza</a>
