> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Zed | AI Gateway

> Route Zed's Agent Panel and Inline Assist through the Orq.ai AI Gateway. Access every model in the catalog, including Claude, from a single API key.

[**Zed**](https://zed.dev) is a high-performance code editor with a built-in AI Agent Panel and Inline Assist. Both features use the `language_models.openai_compatible` provider mechanism, which routes requests through the **Orq.ai AI Gateway** and makes the full model catalog available, including Anthropic Claude models.

## Prerequisites

* [**Zed**](https://zed.dev) installed
* Active **Orq.ai** account
* [**Orq.ai** API key](/docs/ai-studio/organization/api-keys)

## Setup

Two paths produce equivalent results. The GUI writes to the same `settings.json` as the manual approach.

<Tabs>
  <Tab title="settings.json">
    **Open Zed settings**

    Press <kbd><Icon icon="command" /> ,</kbd> on macOS or <kbd>Ctrl ,</kbd> on Linux / Windows to open `settings.json`.

    **Add the provider block**

    Merge the following into the top-level object:

    ```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
    "language_models": {
      "openai_compatible": {
        "Orq": {
          "api_url": "https://api.orq.ai/v3/router",
          "available_models": [
            {
              "name": "anthropic/claude-sonnet-4-6",
              "display_name": "Claude Sonnet 4.6 (Orq)",
              "max_tokens": 200000,
              "capabilities": {
                "tools": true,
                "images": true,
                "parallel_tool_calls": true,
                "prompt_cache_key": false
              }
            },
            {
              "name": "openai/gpt-4o",
              "display_name": "GPT-4o (Orq)",
              "max_tokens": 128000,
              "capabilities": {
                "tools": true,
                "images": true,
                "parallel_tool_calls": true,
                "prompt_cache_key": false
              }
            }
          ]
        }
      }
    }
    ```

    Add as many models as needed. Use the `provider/model_id` format for `name` (e.g. `anthropic/claude-opus-4-7`, `openai/gpt-4o-mini`).

    <Warning>
      The `capabilities` object requires all four fields (`tools`, `images`, `parallel_tool_calls`, `prompt_cache_key`). Zed's settings schema rejects model entries that omit any of them.
    </Warning>

    **Add the API key**

    Open the Agent Panel → **Configure Providers** → click **Orq** → paste the `<ORQ_API_KEY>`.

    Alternatively, export it as an environment variable before launching Zed. Zed derives the variable name from the provider name, so a provider named `Orq` reads `ORQ_API_KEY` automatically:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    export ORQ_API_KEY="<ORQ_API_KEY>"
    ```

    **Start a session**

    Open the Agent Panel, pick a model from the dropdown, and send a message.
  </Tab>

  <Tab title="GUI">
    **Open the provider form**

    Open the Agent Panel → **Configure Providers** → click **Add Provider** (top-right of the LLM Providers section).

    **Fill the modal**

    | Field             | Value                                                                      |
    | ----------------- | -------------------------------------------------------------------------- |
    | **Provider Name** | `Orq` (display name; also determines the env var Zed reads: `ORQ_API_KEY`) |
    | **API URL**       | `https://api.orq.ai/v3/router`                                             |
    | **API Key**       | `<ORQ_API_KEY>`                                                            |

    **Add models**

    Click **Add Model** for each model. Fill **Model Name** using the `provider/model_id` format, set **Max Tokens**, and tick the supported capabilities (`tools`, `images`, `parallel_tool_calls`, `prompt_cache_key`).

    **Save** the configuration. Models appear immediately in the Agent Panel dropdown.

    Open the Agent Panel, pick a model from the dropdown, and send a message.
  </Tab>
</Tabs>

## Caveats

<Warning>
  Zed generates thread titles via a separate LLM call that may route to any model in `available_models`. **Traces** will show token usage against that model regardless of which model was active in the Agent Panel.
</Warning>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Models not appearing in the dropdown">
    Verify that `settings.json` is valid JSON and that the `capabilities` object for each model includes all four fields: `tools`, `images`, `parallel_tool_calls`, and `prompt_cache_key`. Zed silently drops malformed model entries.
  </Accordion>

  <Accordion title="Authentication errors">
    Confirm that `ORQ_API_KEY` is set in the environment Zed was launched from, or that the key was pasted directly in the Configure Providers panel. The environment variable name is derived from the provider name: a provider named `Orq` reads `ORQ_API_KEY`.
  </Accordion>

  <Accordion title="Requests not appearing in Orq.ai Traces">
    Verify the `api_url` in `settings.json` (or the GUI field) is set to `https://api.orq.ai/v3/router`. Requests sent to the provider's own endpoint bypass the **AI Gateway** and produce no **Traces**.
  </Accordion>

  <Accordion title="Edit Predictions (inline autocomplete) not working">
    **Edit Predictions** is not currently supported through the **AI Gateway**.
  </Accordion>
</AccordionGroup>

## Verification

Open the **Agent Panel**, pick a model from the dropdown, and send a message. The response appears in the panel and the request appears in [**Orq.ai** Traces](/docs/ai-studio/observability/traces) with the selected model identifier.
