Zed

Zed configures third-party OpenAI-compatible services under language_models.openai_compatible.<provider>. This guide uses the provider ID getrouter.

Integration status
  • 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:

export GETROUTER_API_KEY="YOUR_API_KEY"

2. Configure the provider and model

Open Zed's settings.json and merge the following template:

{
  "language_models": {
    "openai_compatible": {
      "getrouter": {
        "api_url": "https://getrouter.ai/v1",
        "available_models": [
          {
            "name": "MODEL_ID",
            "display_name": "GetRouter Model",
            "max_tokens": MODEL_MAX_TOKENS
          }
        ]
      }
    }
  }
}

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_models hierarchy and replace MODEL_MAX_TOKENS with an integer before saving.
  • Credential is not found: The getrouter provider ID maps to GETROUTER_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.