Zed
Zed configures third-party OpenAI-compatible services under language_models.openai_compatible.<provider>. This guide uses the provider ID getrouter.
- Protocol: OpenAI-compatible (Chat Completions by default)
- Configuration checked: July 15, 2026
- Runtime verification: Pending
1. Store the API key
Open Zed's Agent Settings with agent: open settings, add or select the getrouter OpenAI-compatible provider, and save YOUR_API_KEY in Zed's credential UI. Zed stores UI-managed credentials in the system keychain, not in settings.json.
Alternatively, provide the environment variable derived from the provider ID before starting Zed:
2. Configure the provider and model
Open Zed's settings.json and merge the following template:
MODEL_MAX_TOKENS is a template token, not a literal JSON value. Before saving, replace it with an integer equal to the selected model's real context-window limit. Do not copy or guess another model's limit.
This structure follows Zed's official OpenAI-compatible endpoint configuration.
3. Verify
Open the Agent Panel, select GetRouter Model, and send a short plain-text prompt. After basic chat succeeds, test editing and tool features only if the selected model supports them. This guide has not been runtime-verified yet.
Troubleshooting
- Model does not appear: Check the
openai_compatible.getrouter.available_modelshierarchy and replaceMODEL_MAX_TOKENSwith an integer before saving. - Credential is not found: The
getrouterprovider ID maps toGETROUTER_API_KEY; save the key in Zed's provider UI or restart Zed after exporting the variable. - 401 response: Confirm that the local Zed process can access the intended credential.
- Agent or tools fail: Confirm the selected model's capabilities and use its real context-window limit.
