Adding Tetrate Agent Router as a model provider in Visual Studio Code
One Agent Router API key brings Anthropic, OpenAI, Google, and more into VS Code chat, agent mode, and every extension that uses the Language Model API.
Count the AI extensions in your VS Code window. Chat and agent mode. A code review assistant. Something that writes tests. Something that drafts commit messages. Each one ships its own model configuration surface, and most of them want their own provider API key.
That is a governance problem wearing a developer experience costume. Every API key is a credential to rotate when someone leaves the team. Every configuration is a place where an unapproved model can quietly get used on proprietary source code. Every provider account is a separate invoice, which means nobody can answer what the team actually spent on AI inference last month without exporting four CSVs.
The Tetrate Agent Router Model Provider extension collapses that surface to one key. Install it, paste an Agent Router Service key once, and every model your account can reach becomes available to VS Code chat, to agent mode, and to any other extension in the window that asks VS Code for a model. One credential, backed by an AI gateway that already handles routing, spend attribution, and model policy.
Tetrate Agent Router Model Provider on the Visual Studio Marketplace. Apache-2.0 licensed. Requires VS Code 1.106 or newer and an Agent Router Service API key.
A model provider, not just a custom endpoint (BYOK)
VS Code already lets you bring your own key. Its custom endpoint support points the chat view at any OpenAI-compatible URL, and that covers a genuine need.
It stops at the chat view. According to the extension’s documentation, models configured as a custom endpoint are not offered to other extensions that select models through the vscode.lm API. The code review extension you installed last week cannot see them. Neither can the test generator. Both fall back to asking you for a key of their own, and the API key sprawl reassembles itself one extension at a time.
Registering as a language model chat provider is a different integration point. The Language Model Chat Provider API has been stable since VS Code 1.104 and exists precisely so that model access becomes a shared editor resource rather than a per-extension configuration. Tetrate Model Provider registers there, under the vendor id tetrate-agent-router.
One key. One place to change it. Every consumer in the window.
One API key for models across major providers
Model discovery happens at runtime, not at build time. When VS Code asks for the model list, the extension calls your Agent Router endpoint to find out what your key can actually reach, then joins that against the service catalog for the metadata VS Code needs — display name, context window, output limit, and whether the model accepts images.
At the time of writing, that catalog exposes 164 conversational models across Anthropic, OpenAI, Google Gemini, Google Vertex AI, xAI, Groq, and DeepInfra.
That number is already wrong. It changes whenever a provider ships something new, and the runtime discovery is the point: a model that appeared this morning shows up in your picker this afternoon, with no extension update, no VS Code release, and no ticket filed against a platform team. If you want to force the issue, run Tetrate Agent Router: Refresh Model List.
The practical effect is that model choice stops being a procurement decision and becomes a workspace decision. Trying a cheaper model for boilerplate and a stronger one for a gnarly refactor costs a dropdown selection instead of a new account, a new key, and a new line item.
Works with every extension that uses the VS Code Language Model API
For extension authors, the integration requires no dependency on this extension and no coordination with Tetrate. Select by vendor and use the model:
const [model] = await vscode.lm.selectChatModels({
vendor: "tetrate-agent-router",
family: "anthropic",
});
const response = await model.sendRequest(
[vscode.LanguageModelChatMessage.User("Summarize this diff.")],
{ justification: "Generating a pull request description." },
);
for await (const chunk of response.text) {
// stream it wherever it needs to go
} The selector accepts family for the upstream provider (anthropic, openai, gemini, xai, groq), id for a specific model, and version. Tool calling works: supply tools and read tool call parts off the response stream. Provider-specific options such as temperature, max_tokens, and reasoning_effort pass through unchanged via modelOptions.
Users are asked for consent the first time a given extension makes a request, which is why the justification string is worth writing carefully.
Built for how enterprises actually run VS Code
Developer tooling tends to treat credential handling as an afterthought. A few of the choices here are worth calling out, because they are the difference between an extension a security team tolerates and one it approves.
The key lives in VS Code secret storage, backed by the OS keychain. It is never written to settings.json, never printed to the output channel, and never included in logs. It is per-machine and excluded from Settings Sync, so it does not propagate to a personal laptop along with your color theme.
The base URL and request headers are machine-scoped settings. This is a deliberate constraint with a real threat model behind it. Workspace settings travel with a repository, so a workspace-scoped base URL would mean that cloning an untrusted repo could silently redirect your API key to an endpoint of the repo author’s choosing. Machine scope removes that path.
The model filter is workspace-scoped, which is the setting you do want to travel with a repository. A team working under an approved model list can commit a filter and have every developer on the project see the same narrowed catalog:
{
"tetrate-model-provider.modelFilter": ["claude-*", "gpt-5.6-*"]
} The base URL is configurable, so the same extension points at a dedicated Agent Router Enterprise instance (https://router.tare-<tenantID>.tetrate.ai/v1) or at a local proxy, without a separate build for regulated environments.
Taken together: developers get every model without managing a single credential, and the platform team gets one enforcement point where routing, spend, and model policy already live. This is the same access-without-sprawl pattern an AI gateway provides across the whole organization. The extension just brings it into the editor.
How to install the Tetrate Agent Router extension in VS Code
Extension-contributed models start out hidden in the VS Code chat model picker. If you install the extension, set your key, and see nothing in the dropdown, this is why — it is the single most common setup issue, and it is a VS Code default rather than a bug.
- Install from the Marketplace, or run
code --install-extension tetrate.tetrate-model-provider. - Run Tetrate Agent Router: Set Agent Router API Key and paste your key. You can skip this; the extension prompts on first use.
- Run Chat: Manage Language Models, choose Tetrate Agent Router, and enable the models you want to see.
Discovery is lazy, so an installed-but-unconfigured extension costs nothing at startup.
What it does not do yet
Being straight about the edges is more useful than a feature list.
- Reasoning traces are not surfaced. Supported VS Code versions have no thinking part to render them into.
- Images go only to vision-capable models. Audio and PDF inputs are not forwarded at all. Sending an image to a text-only model is a hard API error, so the extension declines rather than guesses.
- Token counts are estimated locally. There is no counting endpoint, and at least three different tokenizers are involved upstream. The estimate is deliberately pessimistic, because overcounting only wastes a little context while undercounting fails the request outright.
- Prompt caching is not explicitly configured. Automatic upstream caching still applies where providers offer it.
- Output length uses each model’s server default unless you set
max_tokensormax_completion_tokensthroughmodelOptions.
The extension is early in its life. The AI gateway routing and billing behind it are not.
One key, one catalog, one bill
One credential in the keychain instead of four in scattered configuration files. One catalog that every extension in the editor can reach. One bill, attributable to a team and a project, for all of it. And a base URL that points wherever your organization needs inference to go — the hosted service today, a dedicated enterprise instance when governance requirements catch up with adoption.
Developers get model choice without friction. The people accountable for spend and for what leaves the building get a single place to see and shape it. Those two goals are usually in tension, and they do not have to be.
Frequently asked questions
How do I use multiple AI models in VS Code with one API key?
Install the Tetrate Agent Router Model Provider extension from the Visual Studio Marketplace, set your Agent Router Service API key once, and enable the models you want in Chat: Manage Language Models. Every model your key can reach across Anthropic, OpenAI, Google, xAI, Groq, and DeepInfra becomes available to VS Code chat, agent mode, and any extension that uses the Language Model API.
How is this different from VS Code’s built-in bring-your-own-key (BYOK) support?
VS Code’s custom endpoint (BYOK) support only serves the chat view. Models configured that way are not offered to other extensions through the vscode.lm API. The Tetrate extension registers as a language model chat provider instead, so a single key serves chat, agent mode, and every model-consuming extension in the window.
Where is my API key stored?
In VS Code secret storage, backed by the operating system keychain. The key is never written to settings.json, never logged, and excluded from Settings Sync, so it stays on the machine where you set it.
Can I restrict which models my team sees?
Yes. The model filter is workspace-scoped, so a team can commit an approved model list to .vscode/settings.json and every developer on the project sees the same narrowed catalog. Broader model and MCP catalog policy is enforced centrally in Agent Router.
Does it work with a dedicated Agent Router Enterprise instance?
Yes. The base URL is configurable, so the same extension can point at a dedicated Agent Router Enterprise tenant or a local proxy, with no separate build for regulated environments.
Now Available
MCP Catalog with verified first-party servers, profile-based configuration, and OpenInference observability are now generally available in Tetrate Agent Router Service. Start building production AI agents today with $5 free credit.
References
- Tetrate Agent Router Model Provider — Visual Studio Marketplace
- Language Model Chat Provider API — VS Code extension docs
- Language Model API — consuming models with
selectChatModels - AI language models in VS Code — BYOK and custom endpoints