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

# Zed

> Run Zed's agent panel and inline assistant through the AI Reserve gateway with one language_models block in settings.json.

> **[Connect Zed with a guided setup →](https://portal.aireserve.com/connect/zed)**
>
> The guided connect page mints your key, lets you pick models from the live
> catalog, and generates the exact `settings.json` block below for them —
> then confirms the moment your first request arrives.

Everything below is the manual equivalent.

Zed reads custom providers from `settings.json` under
`language_models.openai_compatible`
([Zed's OpenAI-compatible provider docs](https://zed.dev/docs/ai/llm-providers#openai-api-compatible)).
One `aireserve` entry pointed at the gateway's OpenAI surface serves every
gateway model — Claude models included, since the gateway bridges them —
with streaming, tool calls, and image input intact.

## 1. Merge the settings block

Open `settings.json` (in Zed press `⌘,` or run **zed: open settings**) and
merge this block. If you already have a
`language_models` section, add the `aireserve` entry inside it:

```json theme={"dark"}
{
  "language_models": {
    "openai_compatible": {
      "aireserve": {
        "api_url": "https://api.aireserve.com/v1",
        "available_models": [
          {
            "name": "claude-sonnet-4-6",
            "display_name": "Claude Sonnet 4.6",
            "max_tokens": 1000000,
            "max_output_tokens": 128000,
            "capabilities": { "tools": true, "images": true }
          },
          {
            "name": "claude-fable-5",
            "display_name": "Claude Fable 5",
            "max_tokens": 1000000,
            "max_output_tokens": 128000,
            "capabilities": { "tools": true, "images": true }
          },
          {
            "name": "gpt-5.4-mini",
            "display_name": "GPT-5.4 Mini",
            "max_tokens": 400000,
            "max_output_tokens": 128000,
            "capabilities": { "tools": true, "images": true }
          }
        ]
      }
    }
  }
}
```

Add any other gateway model the same way — `name` is the gateway model id
(see [Models](/models)), and Zed requires `max_tokens` (the model's context
window) on every entry. `max_output_tokens` and `capabilities` are optional;
the guided page fills all three from the catalog for the models you pick.

> [!NOTE]
>
> **Keep the `/v1` suffix on `api_url`.** Zed appends `/chat/completions` to
> it — without `/v1` every request 404s.

## 2. Give Zed your key

The settings block deliberately holds no secret — Zed never reads API keys
from `settings.json`, so the block is safe to commit to dotfiles. Provide the
key one of two ways:

* **In Zed:** open the agent panel, choose **Settings** (or run **agent: open
  settings**), find the `aireserve` provider you just added, and paste your
  `aireserve_api_…` key. Zed stores it in its credential store.
* **From the shell:** Zed derives the env var from the provider id
  (uppercase + `_API_KEY`), which lands exactly on the gateway's convention:

```bash theme={"dark"}
export AIRESERVE_API_KEY="aireserve_api_..."   # your key
```

Restart Zed after exporting so it picks the variable up.

## Verify

Open the agent panel, pick an AI Reserve model in the model selector, and send
any message. The reply streams back through the gateway, and the request
appears on your [usage page](https://portal.aireserve.com/profile) seconds
later — metered and billed to your organization's wallet.

## Changing models later

Rerun the [guided page](https://portal.aireserve.com/connect/zed) with a
different selection and paste the fresh block over the `aireserve` entry, or
edit `available_models` by hand. Revoking the key from your
[API keys](https://portal.aireserve.com/keys) cuts Zed off immediately.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.