---
title: "VS Code Copilot API: Add FreeTheAI Models (BYOK)"
description: "Use FreeTheAI models in VS Code chat and Copilot agent mode with bring your own key: the Custom Endpoint provider and chatLanguageModels.json."
url: https://freetheai.org/setup/github-copilot
language: en
updated: 2026-09-29
---

# VS Code Copilot API: Add FreeTheAI Models (BYOK)

VS Code chat adds FreeTheAI through its Custom Endpoint provider (bring your own key). It works even without a Copilot plan.

## Settings

- Provider: `Custom Endpoint`
- API type: `Chat Completions`
- url: `https://api.freetheai.org/v1/chat/completions`
- API key: `your FreeTheAI key (ftai_..., 53 characters)`

## Steps

1. **Open the language models.** In the chat model picker, press the gear (Manage Language Models), or run Chat: Manage Language Models.
2. **Add a Custom Endpoint.** Press Add Models, choose Custom Endpoint, enter a group name (FreeTheAI) and your key, and choose Chat Completions.
3. **Describe the models.** VS Code opens chatLanguageModels.json. Fill in the models and save:

```json
[
  {
    "name": "FreeTheAI",
    "vendor": "customendpoint",
    "apiKey": "ftai_your_key_here",
    "apiType": "chat-completions",
    "models": [
      {
        "id": "glm-5.3",
        "name": "GLM 5.3",
        "url": "https://api.freetheai.org/v1/chat/completions",
        "toolCalling": true,
        "vision": false,
        "maxInputTokens": 200000,
        "maxOutputTokens": 32000
      }
    ]
  }
]
```
4. **Pick the model.** Choose GLM 5.3 in the chat model picker. Restart VS Code if it does not show up.

## Tips

- If VS Code already wrote an apiKey value (a reference to its secret storage), keep that line instead of pasting your key.
- Without a GitHub sign-in, set chat.utilityModel and chat.utilitySmallModel to a FreeTheAI model so titles and commit messages work.
- Bring your own key covers chat and agent mode, not inline code completions.

## Troubleshooting

**I used the old "OpenAI Compatible" provider. Does it still work?**

It is deprecated. Add FreeTheAI again with the Custom Endpoint provider and the chat-completions API type.

**Why do I get a 401 "invalid API key" error?**

The key is wrong or incomplete. Remove the FreeTheAI group, add it again, and paste the whole ftai_ key (53 characters).

**The model does not show in the picker. What now?**

Save chatLanguageModels.json and restart VS Code.

**Agent mode does nothing with FreeTheAI. Why?**

Keep "toolCalling": true and use a model that supports tools, such as glm-5.3 or kimi-k3.1-pro.

**Why do I get a 403 error?**

A 403 usually means the account follows no provider of that model, or your email is not confirmed. Follow a provider on freetheai.org/providers, then try again.

Checked: Checked against the VS Code language models docs (Custom Endpoint provider) on 2026-09-29.
