VS Code chat: Custom Endpoint with your own key

Add uttapen to VS Code chat through the Custom Endpoint provider: the chatLanguageModels.json entry, token limits, and a cheap utility model.

Updated: 22 Sep 2026

VS Code chat (the Copilot Chat panel) ships a Custom Endpoint provider that accepts any Chat Completions endpoint, uttapen included — and BYOK models work without a Copilot plan. This page was checked against the official VS Code docs (September 2026 revision).

Adding a model

  1. In the chat panel, choose Manage Language Models from the model picker, or run Chat: Manage Language Models from the Command Palette.
  2. Select Add Models → Custom Endpoint.
  3. Give it a group name (for example uttapen), a display name and your sk-up-… key (Dashboard → API keys).
  4. Pick Chat Completions as the API type.
  5. VS Code opens chatLanguageModels.json. Describe your models like this:
[
  {
    "name": "uttapen",
    "vendor": "customendpoint",
    "apiKey": "${input:uttapenApiKey}",
    "apiType": "chat-completions",
    "models": [
      {
        "id": "anthropic/claude-sonnet-5",
        "name": "Claude Sonnet 5",
        "url": "https://api.uttapen.ir/v1/chat/completions",
        "toolCalling": true,
        "vision": true,
        "maxInputTokens": 184000,
        "maxOutputTokens": 16000
      },
      {
        "id": "openai/gpt-5-nano",
        "name": "GPT-5 nano",
        "url": "https://api.uttapen.ir/v1/chat/completions",
        "toolCalling": true,
        "vision": false,
        "maxInputTokens": 120000,
        "maxOutputTokens": 8000
      }
    ]
  }
]

Details that matter:

  • Give the full url including /chat/completions so VS Code never has to guess the path.
  • Keep apiType on chat-completions; responses and messages don't work against uttapen.
  • Don't add a provider-level url field. With it, VS Code discovers models from the endpoint and all 400+ of ours flood the picker. List the models you want instead.
  • maxInputTokens plus maxOutputTokens define the model's context for VS Code and their sum must stay within the model's real window; the numbers are on the model list. maxOutputTokens is what we reserve against, so don't inflate it.
  • A model without toolCalling: true is hidden in agent mode.

A model for utility tasks

VS Code calls separate models for session titles, commit messages, pull request titles and descriptions, and intent detection. If you use BYOK without a GitHub account, those features stay off until you name a model. Open Settings, find chat.utilityModel and chat.utilitySmallModel, and point them at a cheap uttapen model such as openai/gpt-5-nano. chat.byokUtilityModelDefault decides what utility flows use by default when your main model is BYOK.

What BYOK does not cover

Inline code suggestions, semantic search and anything built on embeddings need the Copilot service and won't run on an uttapen key. Chat and agent mode work fully. On a Copilot Business or Enterprise account, your administrator has to enable the "Bring Your Own Language Model Key" policy first.

Troubleshooting

ErrorCauseFix
401 invalid_api_keyWrong or revoked keyCreate a new key and re-enter it
404 model_not_foundid doesn't match a real model idCopy it from /en/models (the 404 also lists the closest ids it guessed, in uttapen.suggestions)
404 not_foundapiType is responses or messages, or the url is incompleteUse chat-completions and the full URL
402 insufficient_balanceBalance below the required holdTop up, or lower maxOutputTokens
429The key's rate or monthly limit (rate limits)Wait, or raise the limit
Model missing from the pickertoolCalling not set, or VS Code needs a restartAdd the field and restart VS Code

If the balance can't cover the full maxOutputTokens, uttapen lowers the ceiling to what it can pay for (floor 1,024 tokens) and returns the granted value in the X-Uttapen-Max-Tokens header, which can leave a reply unfinished. 402 only happens when even that floor doesn't fit.

Other tools are in integrations; error codes are in errors.

No API key yet?

Sign up with a phone number, top up your wallet from 100,000 toman and create a key. Free models work without a top-up — up to 50 requests a day. Create an API key →