> This page is for Gateway.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Zed

> Configure Zed's settings.json to use Gateway models in the Assistant Panel and inline assists.

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](/merge-gateway/coding-agents/overview).

## 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`**

```json title="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](/merge-gateway/coding-agents/overview#persist-your-api-key), 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

#### [Building with coding agents](/merge-gateway/coding-agents/overview)

Keys, models, aliases, and project scoping

#### [Tool calling](/merge-gateway/capabilities/tool-calling)

Tool calls across vendors