Zed with AI Gateway
Zed is a high-performance code editor with a built-in agent panel. It ships a first-party vercel_ai_gateway language model provider, so the gateway catalog loads into its model picker with no provider definition of your own.
Run the Vercel CLI setup command for Zed:
npx vercel ai-gateway setup --agent zedThe command configures Zed's first-party vercel_ai_gateway provider in its JSONC settings.json with a comment-preserving merge, points it at the gateway's coding-agent endpoint, sets the Agent Panel default model, and exports VERCEL_AI_GATEWAY_API_KEY from a managed block in your shell startup file so the key stays out of the settings file.
If you can't use the Vercel CLI, configure Zed manually:
Go to the AI Gateway section in the Vercel dashboard sidebar and click API keys to create a new API key.
Zed reads the provider key from the environment. Export it in your shell:
Terminalexport VERCEL_AI_GATEWAY_API_KEY="your-ai-gateway-api-key"To persist the key, add the same line to your shell's startup file. Settings > AI > LLM Providers also accepts the key directly if you'd rather paste it.
Add the provider to Zed's
settings.json(open it withzed: open settingsin the command palette):settings.json{ "language_models": { "vercel_ai_gateway": { "api_url": "https://ai-gateway.vercel.sh/coding-agent/v1", "available_models": [ { "name": "openai/gpt-6-astra", "display_name": "GPT-6 Astra", "max_tokens": 1050000, "max_output_tokens": 128000, "capabilities": { "tools": true, "images": true } } ] } }, "agent": { "default_model": { "provider": "vercel_ai_gateway", "model": "openai/gpt-6-astra" } } }Zed's settings are JSONC, so comments in your existing file are preserved when you add this. The
available_modelsentry seeds the picker. Once the key is visible to Zed, the full gateway catalog loads from/modelsand you can trim the starter entry.Launch Zed from a new terminal so the key is in its environment, then open the Agent Panel and pick a gateway model.
agent.default_modelsets the one the panel starts with.
View your usage, spend, and request activity in the AI Gateway section in the Vercel dashboard sidebar. See the observability documentation for more details.
| Variable | Description |
|---|---|
VERCEL_AI_GATEWAY_API_KEY | Your AI Gateway API key. Required |
ZED_HOME | Overrides Zed's config directory on macOS and Linux |
- Browse the models catalog for available models
- Configure spend limits on your API key
- Read the Zed documentation for agent panel options
Was this helpful?