Zed¶
Add the gateway to Zed's settings once and the Agent Panel, the inline assistant and commit messages run on governed calls: checked against your policies, charged to your team and recorded in Request logs. One provider entry can list GPT, Claude and Gemini models side by side.
What it is¶
Zed is a code editor with its own AI features. Besides its built-in providers, it lets you add any number of OpenAI-compatible and Anthropic-compatible providers, each with an API URL and a list of models. Zed calls them from your machine.
The two settings¶
Add a provider under language_models in Zed's settings.json (zed: open settings), or in Agent Settings ›
LLM Providers › Add Provider. Use the OpenAI-compatible form for most cases:
| Setting | Where | Value |
|---|---|---|
| Base address | api_url |
https://<your-gateway>/v1 (OpenAI-compatible) or https://<your-gateway> (Anthropic-compatible; Zed adds /v1/messages) |
| Key | entered in the provider's settings UI (kept in the system keychain), or an environment variable named after the provider: provider id in upper snake case plus _API_KEY |
Your Vidai key (starts vk_) |
{
"language_models": {
"openai_compatible": {
"vidai": {
"api_url": "https://<your-gateway>/v1",
"available_models": [
{ "name": "gpt-4.1", "display_name": "GPT-4.1", "max_tokens": 1000000 },
{ "name": "claude-sonnet-4.5", "display_name": "Claude Sonnet 4.5", "max_tokens": 200000,
"capabilities": { "tools": true, "images": true } },
{ "name": "gemini-3.5-flash", "display_name": "Gemini 3.5 Flash", "max_tokens": 1000000 }
]
}
}
}
}
export VIDAI_API_KEY="vk_…" # provider id "vidai" → VIDAI_API_KEY
{
"language_models": {
"anthropic_compatible": {
"Vidai": {
"api_url": "https://<your-gateway>",
"available_models": [
{ "name": "claude-sonnet-4.5", "display_name": "Claude Sonnet 4.5",
"max_tokens": 200000, "max_output_tokens": 32000,
"capabilities": { "tools": true, "images": true, "prompt_caching": true } }
]
}
}
}
}
export VIDAI_API_KEY="vk_…" # provider name "Vidai" → VIDAI_API_KEY
Don't put the key in settings.json. The gateway's address is under Connect your app on the Keys page and in
System › Settings › Gateway; the key comes from Keys › Issue a key (its secret is shown once). Zed sends the key as
Authorization: Bearer to an OpenAI-compatible provider and as x-api-key to an Anthropic-compatible one; the gateway
accepts both. Zed starts with environment variables it inherited, so set the variable before you open Zed, or enter
the key in the settings UI instead.
A minimal call¶
- Save the provider entry above and set the key.
- Open the Agent Panel, pick GPT-4.1 (or another of your models) in the model picker.
- Send "Reply with exactly: ok". A short answer means the address and key are right.
Streaming¶
Zed streams every answer. Through the OpenAI-compatible provider, a stream from Claude or Gemini arrives as OpenAI chunks; Vidai records the tokens and cost either way.
Tool calls¶
The Agent Panel works through tools (reading files, editing, running commands). Zed marks OpenAI-compatible models as
able to use tools by default (capabilities.tools); they travel as OpenAI tool calls and work on every provider the
gateway translates to. Set "images": true for models that read images; it's off by default.
Reading what the gateway did¶
Zed doesn't show response headers. Look the call up in Request logs: filter on Key, Model or Path
(/v1/chat/completions or /v1/messages).
Errors¶
Zed shows the gateway's error message in the panel. Common ones while setting up: 401 invalid_api_key (wrong or
missing key, or the variable wasn't set when Zed started), 403 model_not_allowed (your key may not call that model),
404 model_not_found (a name your organisation hasn't set up), 429 (a limit on the key or team). The full list is in
Headers and errors.
Model names¶
name is the model name your organisation approved under Models in the Control room; display_name is only the
label in Zed's picker. max_tokens is the model's context window.
What goes through the gateway¶
| Zed feature | Through the gateway |
|---|---|
| Agent Panel, inline assistant, commit messages, thread summaries with a gateway model selected | Yes |
| Edit predictions (as-you-type suggestions) | No: they have their own provider settings |
| External agents run inside Zed | Only if that agent is itself set up for the gateway, for example Claude Code |
Check it works in a minute¶
Select a gateway model in the Agent Panel, send "Reply with exactly: ok", then open Request logs a few seconds later and filter on your key.
Good to know¶
- With the Anthropic-compatible form,
prompt_caching: truemakes Zed send cache markers. They work on Claude models; on other providers the gateway removes them (cache savings are still reported). Leave it off if you mix providers. - If a reasoning model only works through OpenAI's Responses API, Zed lets you set
capabilities.chat_completions: false; Responses reaches OpenAI models only, so keep it on for Claude and Gemini. - Zed's docs: Use API access.