Integration guide
Zed Editor Custom LLM Provider Setup (settings.json)
Configure Zed's Agent Panel and Inline Assist via language_models.openai_compatible in ~/.config/zed/settings.json (https://proxystacks.com/v1) or native language_models.anthropic (/anthropic) — unlocking claude-sonnet-5-5 (-50% vs official USD), gpt-6.1-sol (-30%), deepseek-v4.1-flash ($0.18/1M), and glm-5.3 with tool calling enabled.
Setup
- 1
Add language_models.openai_compatible.proxystacks_relay to ~/.config/zed/settings.json with api_url "https://proxystacks.com/v1" (no trailing slash) and declare available_models.
- 2
Never store API keys inside settings.json — open Zed Command Palette (Cmd+Shift+P / Ctrl+Shift+P) → "agent: open settings" → LLM Providers to save sk-relay-... in your OS keychain, or export PROXYSTACKS_RELAY_API_KEY.
- 3
Set max_tokens: 1000000 (Zed's context-window field), max_output_tokens: 64000, and capabilities.tools: true so Zed Agent can edit files and run terminal tools.
Configuration
{
// ~/.config/zed/settings.json (macOS / Linux)
// Do NOT place API keys in settings.json — run "agent: open settings" → LLM Providers
// or export PROXYSTACKS_RELAY_API_KEY="sk-relay-your-key" before launching Zed.
"language_models": {
"openai_compatible": {
"proxystacks_relay": {
"api_url": "https://proxystacks.com/v1",
"available_models": [
{
"name": "deepseek-v4.1-flash",
"display_name": "deepseek-v4.1-flash (ProxyStacks Relay)",
"max_tokens": 1000000,
"max_output_tokens": 64000,
"capabilities": {
"tools": true,
"images": false
}
}
]
}
}
}
}Configure language_models.openai_compatible in ~/.config/zed/settings.json and store your key in Zed's system keychain or PROXYSTACKS_RELAY_API_KEY.
Advanced config: environment variable API key, multi-model routing & max output tokens
Use a project-specific config or multi-profile setup with environment variable keys, flagship and fast models — Claude Opus/Sonnet 5.5 (-50%), GPT-6.1 Sol / GPT-6 Luna (-30%), DeepSeek V4.1 Flash (-40%), GLM-5.3 & Kimi K3.1 Pro (-30%) — and explicit context/output token limits.
{
// ~/.config/zed/settings.json — Multi-model Agent Panel + Native Anthropic /anthropic
// APAC / CN low-latency endpoint: "https://hk.proxystacks.com/v1" (no trailing slash)
// Keychain auth: Cmd+Shift+P → "agent: open settings" → LLM Providers → proxystacks_relay
// Or env var: export PROXYSTACKS_RELAY_API_KEY="sk-relay-your-key"
"agent": {
"default_model": {
"provider": "proxystacks_relay",
"model": "claude-sonnet-5-5"
}
},
"language_models": {
"anthropic": {
"api_url": "https://proxystacks.com/anthropic"
},
"openai_compatible": {
"proxystacks_relay": {
"api_url": "https://proxystacks.com/v1",
"available_models": [
{
"name": "claude-sonnet-5-5",
"display_name": "Claude Sonnet 5.5 (-50% · Agent Default)",
"max_tokens": 1000000,
"max_output_tokens": 64000,
"capabilities": { "tools": true, "images": true }
},
{
"name": "gpt-6.1-sol",
"display_name": "GPT-6.1 Sol (-30% · Deep Reasoning)",
"max_tokens": 1000000,
"max_output_tokens": 64000,
"capabilities": { "tools": true, "images": true }
},
{
"name": "deepseek-v4.1-flash",
"display_name": "DeepSeek V4.1 Flash ($0.18/1M · Inline Edit)",
"max_tokens": 1000000,
"max_output_tokens": 64000,
"capabilities": { "tools": true, "images": false }
},
{
"name": "glm-5.3",
"display_name": "GLM-5.3 ($0.98/1M · 1M Repo Context)",
"max_tokens": 1000000,
"max_output_tokens": 64000,
"capabilities": { "tools": true, "images": false }
}
]
}
}
}
}Troubleshooting
- 401: check the Relay key and authentication header. Never paste a secret into a support ticket.
- 404: use an exact published model ID and the documented base URL, not an upstream alias.
- For streaming use stream: true. Codex uses Responses; keep disable_response_storage = true.
Common questions
Where do I put my API key for a custom openai_compatible provider in Zed?
Zed intentionally ignores API keys inside settings.json. Open the Command Palette (Cmd+Shift+P or Ctrl+Shift+P), run "agent: open settings", paste your sk-relay-... key under LLM Providers → proxystacks_relay (saved to your OS keychain), or export PROXYSTACKS_RELAY_API_KEY (<PROVIDER_ID>_API_KEY in UPPER_SNAKE_CASE).
What is the difference between max_tokens and max_output_tokens in Zed's settings.json?
In Zed's available_models schema, "max_tokens" defines the total input context window (set to 1000000), while "max_output_tokens" controls the per-turn generation cap (set to 64000 so large multi-file agent edits never truncate).