Skip to main content

VS Code Chat with AIProxy

VS Code Chat can connect to Serenity* Star's AIProxy agents through the OpenAI-compatible Responses endpoint. You can register an AIProxy agent as a custom model and then chat with it from the Chat view while you code.

This is VS Code Chat

This page explains how to add AIProxy as a custom model inside VS Code Chat. BYOK models work without a GitHub account or a Copilot plan, although some VS Code features, such as inline suggestions and semantic search, still require GitHub Copilot.

Prerequisites

  • Visual Studio Code installed. Download VS Code
  • VS Code Chat enabled. See AI language models in VS Code for information about using Chat and adding your own language models.
  • A Serenity* Star API key (see API Keys). Important: The API Key needs the "Agent Execution" role.
  • The agent code of the AIProxy agent you want to use, along with the Vendor and ModelId, in the {agentCode}:{vendor}:{modelId} format, for example my-aiproxy-agent:OpenAI:gpt-5.6-luna. See the model identifier.

How it works

VS Code Chat's custom models live under the customendpoint vendor. Each model points at a full AIProxy URL (including the /responses path) and carries its own capabilities and limits. The configuration is stored in a chatLanguageModels.json file in your VS Code user profile. The command palette flow below creates the endpoint and opens that file for you to add your agents.

Configuration

  1. In VS Code, open the command palette (Ctrl+Shift+P / Cmd+Shift+P) and run Chat: Manage Language Models.

The VS Code command palette with the "Chat: Manage Language Models" command

  1. Click Add Models and choose the Custom Endpoint option.

The "Add Models" button with the "Custom Endpoint" provider option

  1. When prompted for the group name, enter anything you like, for example Serenity* Star.
  2. When prompted for the API key, paste your Serenity* Star API key.
  3. When prompted for the API type, choose Responses.
  4. VS Code opens chatLanguageModels.json so you can configure the models. Add your AIProxy agent using the example below, then save.
chatLanguageModels.json
[
{
"name": "Serenity* Star",
"vendor": "customendpoint",
"apiKey": "${input:chat.lm.secret.aiproxy}",
"apiType": "responses",
"models": [
{
"id": "my-aiproxy-agent:OpenAI:gpt-5.6-luna",
"name": "My AIProxy Agent - GPT-5.6 Luna",
"url": "https://api.serenitystar.ai/api/v2/aiproxy/responses",
"toolCalling": true,
"maxInputTokens": 1050000,
"maxOutputTokens": 128000,
"apiType": "responses",
"zeroDataRetentionEnabled": true
}
]
}
]
FieldNotes
vendorAlways customendpoint for an OpenAI-compatible endpoint.
apiKeyYour Serenity API key. The ${input:...} form prompts for the value and stores it in VS Code's secret storage instead of in plain text.
idThe AIProxy {agentCode}:{vendor}:{model} identifier. This is what selects the agent and routes to the model, so it must match exactly.
nameA friendly display name shown in the model picker.
urlThe full AIProxy Responses endpoint, including the path: https://api.serenitystar.ai/api/v2/aiproxy/responses.
apiTyperesponses, matching the endpoint in url.
toolCallingSet true if the routed model supports function calling.
maxInputTokens, maxOutputTokensContext and output limits for the routed model; adjust to the model you target.
zeroDataRetentionEnabledRequired when using the Responses API.
Set zeroDataRetentionEnabled: true for the Responses API

AIProxy does not persist conversation state server-side. With the Responses API, clients can otherwise reference a stored prior turn by its response ID, which AIProxy has no record of. Setting zeroDataRetentionEnabled: true tells VS Code to send the full conversation on every request rather than relying on server-side retention, so multi-turn chats work correctly.

Select the model

Once you save chatLanguageModels.json, open the Chat view, open the model picker above the chat input, and select your AIProxy model. Reload VS Code if it does not appear immediately.

The VS Code Chat model picker with the Serenity* Star AIProxy agent selected

You can then type into the Chat input as usual. Your prompts will be answered by the AIProxy agent.