> For the complete documentation index, see [llms.txt](https://docs.cortecs.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cortecs.ai/integration-examples/coding/github-copilot.md).

# GitHub Copilot

Visual Studio Code supports custom model endpoints for GitHub Copilot Chat. Connect Cortecs to use its models for chat and agent tools in VS Code.

{% hint style="info" %}
Before you begin, create a Cortecs API key by following the [Quickstart](/quickstart.md) and choose a tool-calling model from the [model catalog](https://cortecs.ai/serverlessModels).
{% endhint %}

## 1. Add a custom endpoint

1. Install the latest Visual Studio Code and the **GitHub Copilot Chat** extension.
2. Open the Command Palette and run **Chat: Manage Language Models**.
3. Select **Add Models**, then **Custom Endpoint**.
4. Use **Cortecs** as the group and display name, enter your Cortecs API key, and select **Responses** as the API type.

## 2. Configure a model

VS Code opens `chatLanguageModels.json`. Update the generated model entry with:

* **id:** The exact Cortecs model ID
* **name:** The label shown in the model picker
* **url:** `https://api.cortecs.ai/v1/responses`
* **toolCalling:** `true` for a model that supports tool calling
* **vision:** `true` only for a model that supports image input
* **maxOutputTokens:** A supported output limit for the model
* **maxInputTokens:** The model's context size minus `maxOutputTokens`

Use the [model catalog](https://cortecs.ai/serverlessModels) to check capabilities and context size. Keep the API key value generated by VS Code instead of adding the key directly to version-controlled files.

Save the file, return to Copilot Chat, and select the Cortecs model from the model picker. If it does not appear, reload VS Code.

{% hint style="info" %}
The Cortecs [Responses API](https://docs.cortecs.ai/api-overview/responses-beta) is recommended for reasoning, tool-calling, and multi-turn agent workflows. VS Code also supports **Chat Completions**; select it and use `https://api.cortecs.ai/v1/chat/completions` only if a model or workflow requires that API.
{% endhint %}

{% hint style="warning" %}
Custom endpoints power Copilot Chat and agent features, but not inline code completions, semantic search, or other embedding-based features.
{% endhint %}

For the full configuration schema, see the [Visual Studio Code language model documentation](https://code.visualstudio.com/docs/agent-customization/language-models#_add-a-custom-endpoint-model).
