IDEs & editorsGuide reviewed 2026-09-13

Zed

Configure Zed's agent panel with RouterPlex models.

Follow updates Share setup
On this page

Set it up with your coding agent #

Paste your key into the prompt's key field, then copy the prompt into Claude Code, Codex, Cursor, or any coding agent. It configures the tool and keeps testing until a real request goes through RouterPlex, fixing environment problems along the way. Prefer to do it by hand? Follow the manual setup below; your key fills those commands too.

prompt

Optional. It stays in this browser tab and is never saved or sent. No key yet? Create one in guided setup.

Set up Zed on this machine to use RouterPlex, an OpenAI- and Anthropic-compatible AI gateway. Keep working until a real request from Zed succeeds through RouterPlex.
 
My RouterPlex API key: YOUR_ROUTERPLEX_API_KEY
 
Key handling:
- If the key line above is a placeholder rather than a real key (real keys start with sk-), use my ROUTERPLEX_API_KEY environment variable. If that is empty too, ask me for the key once, then continue.
- Store the key only in user-level config or my user environment. Never put it in a project file, never commit it, and do not repeat the full key in your replies.
 
Full guide: https://docs.routerplex.com/zed
 
Step 1. Prove the key and the RouterPlex gateway work before changing anything else. Run:
curl -sS https://api.routerplex.com/v1/chat/completions -H "Authorization: Bearer YOUR_ROUTERPLEX_API_KEY" -H "Content-Type: application/json" -d '{"model":"claude-sonnet-4-6","max_tokens":32,"messages":[{"role":"user","content":"Reply with exactly: RouterPlex connected."}]}'
On Windows PowerShell, use curl.exe with the body in a file, or Invoke-RestMethod.
- A reply containing "RouterPlex connected.": go on.
- 401: the key is wrong or revoked. Stop and ask me for a correct key.
- 402: my balance or trial credit is used up. 403: this key reached its own spending limit. Stop and tell me; retrying cannot fix these.
- Network, DNS, TLS, or proxy errors: find and fix the cause (proxy variables, VPN, firewall, system clock, outdated CA certificates), then run it again.
 
Step 2. Configure Zed:
- Merge this into my Zed settings file (macOS/Linux: ~/.config/zed/settings.json; Windows: %APPDATA%\Zed\settings.json), keeping my other settings and providers:
"language_models": {"openai_compatible": {"RouterPlex": {"api_url": "https://api.routerplex.com/v1", "available_models": [{"name": "claude-sonnet-4-6", "display_name": "RouterPlex Sonnet", "max_tokens": 1000000, "max_output_tokens": 4096, "capabilities": {"tools": true, "images": true, "chat_completions": true, "max_tokens_parameter": true}}]}}}
- Do not put the key in settings.json. Tell me to run agent: open settings in Zed and paste the key into the RouterPlex provider.
 
Step 3. Test Zed itself from a new terminal or a restarted app, so you test the saved setup rather than the shell you changed:
Ask me to open a new Agent Panel thread, select RouterPlex Sonnet, send this, and report the reply: Reply with exactly: RouterPlex connected.
Expected reply: "RouterPlex connected."
 
Step 4. If step 1 works but step 3 fails, the problem is Zed's configuration or environment, not RouterPlex. Check these, fix what is wrong, and repeat step 3:
- The key or base URL is set in one place but not where Zed starts: zsh vs bash startup files, login vs non-login shells, a desktop launcher, a background service, Windows vs WSL, or a remote SSH or container environment.
- Another setting wins: OPENAI_API_KEY, OPENAI_BASE_URL, OPENAI_API_BASE, ANTHROPIC_API_KEY, ANTHROPIC_BASE_URL, or a project-level config that overrides the user-level one.
- Zed is outdated, or still needs a full restart to read the new settings.
- If an environment variable cannot be made to reach Zed reliably and Zed accepts a key in its user-level config, put the key there instead.
 
Keep repeating steps 3 and 4 until the test reply comes back. Stop early only for a 401, 402, or 403, or for a step only I can do, such as a click in a settings window or a login. Then tell me exactly what to do, wait for me, and continue testing afterwards.
 
When it works, tell me which files you changed, where the key is stored, and the final test output.

Manual setup #

Add RouterPlex as its own OpenAI-compatible provider for Zed's Agent Panel. Use a current supported Zed build for macOS, Linux, or Windows. Check Zed's installation requirements for your OS version and graphics support.

1. Open Agent Settings #

Open the Command Palette (Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows/Linux) and run agent: open settings. In LLM Providers, choose Add Provider and enter RouterPlex, the API URL below, and a model ID.

You can also open your settings file from Zed's Command Palette and merge this configuration:

json
{
"language_models": {
"openai_compatible": {
"RouterPlex": {
"api_url": "https://api.routerplex.com/v1",
"available_models": [
{
"name": "claude-sonnet-4-6",
"display_name": "RouterPlex Sonnet",
"max_tokens": 1000000,
"max_output_tokens": 4096,
"capabilities": {
"tools": true,
"images": true,
"chat_completions": true,
"max_tokens_parameter": true
}
}
]
}
}
}
}

Keep other providers and settings. This config uses the custom provider namespace rather than replacing Zed's built-in OpenAI provider.

2. Enter the API key #

Enter your dedicated RouterPlex key in the RouterPlex provider's settings UI. Do not put a raw key in settings.json. Using the UI also avoids environment inheritance differences between desktop launchers on macOS, Linux, and Windows.

3. Select and verify #

Open a new Agent Panel thread, select RouterPlex Sonnet, and ask Reply with exactly: RouterPlex connected. Check Usage.

For another model, update the ID and capabilities using the catalog. OpenAI-compatible providers default image support to false; enable it only for an image-capable model. These settings apply to Zed's own agent features, not external agents such as Codex or Claude Code, which have their own configuration.

Official reference: Zed OpenAI-compatible endpoints.

Zed — Docs