Skip to content

VS Code

VS Code supports an arbitrary HTTP endpoint through the built-in Custom Endpoint entry in Language Models. This covers chat and agent features; agents require tool calling for the selected model.

This is a built-in VS Code feature; no separate Nexus extension is needed. Choose one API type and do not mix Chat Completions, Responses, and Messages fields.

Configure through the UI

  1. Open Chat → model picker → Manage Language Models.
  2. Select Add Models → Custom Endpoint.
  3. Enter a group name, an API key through an input variable, and the API type.
  4. For Nexus, use one of:
  5. Responseshttps://api.nexus-hub.ru/v1;
  6. Chat Completionshttps://api.nexus-hub.ru/v1;
  7. Messageshttps://api.nexus-hub.ru.
  8. In chatLanguageModels.json, use a model from GET /v1/models and save the file.

VS Code can discover models when a base URL is set on the entry. The example below intentionally lists the model explicitly in the models array.

chatLanguageModels.json example

Responses example. ${input:nexusApiKey} keeps a real key out of the repository:

[
  {
    "name": "Nexus",
    "vendor": "customendpoint",
    "apiKey": "${input:nexusApiKey}",
    "apiType": "responses",
    "models": [
      {
        "id": "MODEL_FROM_V1_MODELS",
        "name": "MODEL_FROM_V1_MODELS",
        "url": "https://api.nexus-hub.ru/v1",
        "toolCalling": true,
        "maxInputTokens": 128000,
        "maxOutputTokens": 4096
      }
    ]
  }
]

For Anthropic Messages, change apiType to messages, use https://api.nexus-hub.ru, and select a Claude model from the catalog. Do not append /v1/messages to the base URL; VS Code adds the path from the API type.

Troubleshooting

  • 401: re-enter the key through the input variable; do not put it in a shared workspace file.
  • Missing model: query GET /v1/models and use the exact ID.
  • Agent does not list the model: check that tool calling is enabled for it.
  • Protocol error: check the apiType and base URL pair.
  • Send support the x-request-id, error code, and VS Code version, never the key or a full prompt.

Official reference: AI language models in VS Code.