Skip to navigation

Zed

Add Gateway as an OpenAI-compatible provider in Zed

Zed’s language_models.openai_compatible block adds Gateway as a provider for the Assistant Panel and inline assists. Shared setup: Building with coding agents.

Configure Zed

Run zed: open settings from the command palette and add a provider. Its key (Merge Gateway) is the picker name, and each available_models entry is one picker item.

settings.json
{
"language_models": {
"openai_compatible": {
"Merge Gateway": {
"api_url": "https://api-gateway.merge.dev/v1/openai",
"available_models": [
{
"name": "anthropic/claude-opus-5",
"display_name": "Claude Opus 5 (Gateway)",
"max_tokens": 1000000,
"capabilities": { "tools": true, "images": true, "parallel_tool_calls": false, "prompt_cache_key": false }
},
{
"name": "@alias/support-agent",
"display_name": "Support agent policy (Gateway)",
"max_tokens": 200000,
"capabilities": { "tools": true, "images": true, "parallel_tool_calls": false, "prompt_cache_key": false }
}
]
}
}
}
}

Zed reads the API key from an environment variable named after the provider, uppercased with non-alphanumerics as underscores plus _API_KEY: here, MERGE_GATEWAY_API_KEY. Persist it, restart Zed, and pick the model in the panel.

Gotchas

  • Zed trusts your declared capabilities. Set "tools": true only for models that support tool calling, or requests fail at the vendor.
  • Zed reads custom-provider keys from environment variables only, not settings.json
  • Zed defaults to chat completions. Set "chat_completions": false on an entry to use the Responses API, also served under /v1/openai.
  • For an alias or default_routing entry, set max_tokens to the smallest context window among its routable models

Next steps