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

# VS Code (Chat)

> Use the Hostlinku model in VS Code’s built-in chat and agent via the Custom Endpoint provider-no GitHub login required; just your Hostlinku API key

The built-in chat in [VS Code](https://code.visualstudio.com/docs/agent-customization/language-models) (Chat panel, Agent mode, and inline chat) can use external models via the **Custom Endpoint** provider. This provider supports three API formats-Chat Completions, Responses, and Anthropic Messages-and all three are served by Hostlinku. BYOK models like this **do not require a GitHub login or the Copilot package**.

**Prerequisites:** The latest version of VS Code (Custom Endpoint replaces the deprecated *OpenAI Compatible* provider) and the [GitHub Copilot Chat](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat) extension.

### Add a Custom Endpoint Provider

Open the Command Palette (⌘/Ctrl + Shift + P) → **Chat: Manage Language Models** → **Add Models** → **Custom Endpoint**. Then enter:

| Prompt | Value |
| - | - |
| **Group name** | `Hostlinku` |
| **Display name** | `Hostlinku` |
| **API key** | `sk-…` (Hostlinku API key) |
| **API type** | **Chat Completions** |

VS Code stores the API key in secret storage and writes a reference to it (`${input:chat.lm.secret.…}`) to `chatLanguageModels.json`. **Do not** paste the raw key into the JSON file.

### Register your Hostlinku model

VS Code opens `chatLanguageModels.json`. Populate the `models` array with slugs from the [catalog](https://docs.hostlinku.com/en/models.md) - leave the `apiKey` value as generated by VS Code:

```json theme={null}
[
  {
    "name": "Hostlinku",
    "vendor": "customendpoint",
    "apiKey": "${input:chat.lm.secret.XXXXX}",
    "apiType": "chat-completions",
    "models": [
      {
        "id": "claude-sonnet-4-6",
        "name": "Claude Sonnet 4.6",
        "url": "https://api.hostlinku.com/v1/chat/completions",
        "toolCalling": true,
        "vision": true,
        "contextWindow": 1000000,
        "maxOutputTokens": 64000
      },
      {
        "id": "gpt-5-5",
        "name": "GPT-5.5",
        "url": "https://api.hostlinku.com/v1/chat/completions",
        "toolCalling": true,
        "vision": true,
        "contextWindow": 1000000,
        "maxOutputTokens": 64000
      },
      {
        "id": "claude-haiku-4-5",
        "name": "Claude Haiku 4.5",
        "url": "https://api.hostlinku.com/v1/chat/completions",
        "toolCalling": true,
        "vision": false,
        "contextWindow": 200000,
        "maxOutputTokens": 16000
      }
    ]
  }
]
```

![The chatLanguageModels.json file in VS Code contains the Hostlinku provider with the URL https://api.hostlinku.com/v1/chat/completions](https://mintcdn.com/hostlinku/wMpi8klIZneDqj3k/images/integrations/vscode-chatlanguagemodels.webp?fit=max\&auto=format\&n=wMpi8klIZneDqj3k\&q=85\&s=0dc1a32e0ece7d9acda151012babb8b0)

Enter the `url` **including the endpoint path** (`/v1/chat/completions`) so VS Code doesn't have to guess. `toolCalling: true` is required for the model to appear in **Agent** mode.

### Select a model in Chat

Save the file. My Hostlink model appears in **Chat: Manage Language Models**, along with its context size and capabilities:

![VS Code's Language Models dialog displays the Hostlinku group: Claude Haiku 4.5, Claude Sonnet 4.6, GPT-5.5](https://mintcdn.com/hostlinku/wMpi8klIZneDqj3k/images/integrations/vscode-language-models.webp?fit=max\&auto=format\&n=wMpi8klIZneDqj3k\&q=85\&s=3980871a3e1292ab4d9677616c867fc6)

Then select a model from the model selector in the Chat panel (restart VS Code if it doesn't appear). The first request appears in the console → **Request Log**.

![The model selector in the VS Code Chat panel displays Claude Sonnet 4.6, Claude Haiku 4.5, and GPT-5.5 from Hostlinku](https://mintcdn.com/hostlinku/wMpi8klIZneDqj3k/images/integrations/vscode-chat-model-picker.webp?fit=max\&auto=format\&n=wMpi8klIZneDqj3k\&q=85\&s=5da7221d3f6a824ea0b095c9b5150a8b)

## Other API Formats

Each model can use a different format via the `apiType` per model:

| `apiType` | `url` | Notes |
| - | - | - |
| `chat-completions` | `https://api.hostlinku.com/v1/chat/completions` | Recommended default - all catalog models. |
| `messages` | `https://api.hostlinku.com/v1/messages` | Anthropic format; VS Code sends the key as `x-api-key` (accepted by the gateway). |
| `responses` | `https://api.hostlinku.com/v1/responses` | **Required**: Add `"statefulResponses": false` - see below. |

Hostlinku API responses are stateless

By default, VS Code sends `previous_response_id` for models with `apiType: "responses"`, whereas Hostlinku does not store responses, so such requests result in a `400` error. If you want to use the Responses API, add `"statefulResponses": false` to that model so that VS Code sends the full conversation history. See [Responses API](https://docs.hostlinku.com/en/responses.md).

```json theme={null}
{
  "id": "gpt-5-5",
  "name": "GPT-5.5 (Responses)",
  "url": "https://api.hostlinku.com/v1/responses",
  "apiType": "responses",
  "statefulResponses": false,
  "toolCalling": true,
  "vision": true,
  "contextWindow": 1000000,
  "maxOutputTokens": 64000
}
```

## What You Need to Know

* **Inline suggestions (autocomplete) will continue to use Copilot.** BYOK applies only to chat and
  utility task; semantic search, embeddings, and code completions require a GitHub account.
* **Without logging into GitHub**, VS Code asks you to choose a *utility model* (session title, commit message,
  etc.). Set `chat.utilityModel` and `chat.utilitySmallModel` to the Hostlinku model-`claude-haiku-4-5` is suitable for the *small* model.
* **Copilot Business/Enterprise:** The organization's administrator must enable the *Bring Your Own* policy
  "Language Model Key in VS Code\*" in the GitHub Copilot settings.
* **Untrusted workspace** (Restricted Mode) displays only **Auto** models; trust
  workspace so that my Hostlink model appears.

## Troubleshooting

| Symptoms | Solutions |
| - | - |
| The model does not appear in Agent mode | Set `"toolCalling": true` and use the model via *tool calling* from the catalog. |
| `401` | Invalid or revoked API key - update it via the provider's gear icon in the Language Models editor. |
| `404 model_not_found` | `id` must be the exact slug from `GET /v1/models`. |
| `400` refers to `previous_response_id` | A model with `apiType: "responses"` without `"statefulResponses": false`. |
| The new model isn't showing up | Restart VS Code after saving `chatLanguageModels.json`. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.