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

# Zed

> Configure Zed's RunInfra models with a manual environment or in-app credential handoff.

Configure Zed's RunInfra models with a manual environment or in-app credential handoff.

Support level: `preview`.

<Note>
  This preview writes RunInfra models to `settings.json` with a manual environment or keychain handoff. Connect could not confirm path overrides, the compatible-provider schema, `RUNINFRA_API_KEY` environment/keychain precedence, CLI diagnostics or restoration after saves against the current Zed documentation; check the [configuration guide](https://zed.dev/docs/configuring-zed.html) and [API access guide](https://zed.dev/docs/ai/use-api-access.html) before relying on it.

  `on` requires `--preview`. Preview is not a dry run: it writes settings and sends a request using credits. Confirm Zed's behavior separately.
</Note>

## Connect Zed

Have Zed installed, a workspace API key, and available RunInfra credits. Quit Zed before connecting because its settings UI also writes `settings.json`.

```bash theme={"dark"}
npx @runinfra/connect zed --preview
```

The bare agent command is an alias for `on`. In an interactive terminal, Connect starts login if needed. Review and approve the proposed changes. Connect saves a snapshot, writes the global provider settings and default model, and makes a real Chat Completions request that uses credits. Complete the credential handoff below before using Zed.

To choose a model during setup:

```bash theme={"dark"}
npx @runinfra/connect zed on --model deepseek-v4-flash --preview
```

See [Connect](/docs/tools-sdks/connect) for status, diagnostics, and key replacement.

## What Connect writes

| Platform | Connect's configuration target                                                                                            |
| -------- | ------------------------------------------------------------------------------------------------------------------------- |
| macOS    | `~/.config/zed/settings.json`                                                                                             |
| Linux    | `FLATPAK_XDG_CONFIG_HOME/zed/settings.json`, then `XDG_CONFIG_HOME/zed/settings.json`, then `~/.config/zed/settings.json` |
| Windows  | `%APPDATA%\Zed\settings.json`                                                                                             |

On Linux, Connect uses the first set override in the order above. On macOS, Connect does not use the Linux overrides. On Windows, Connect requires an absolute `APPDATA`. It refuses a selected override that is empty, relative, or contains control characters or surrounding whitespace.

Connect targets only global settings. It does not manage project `.zed/settings.json` or the `config/settings.json` selected by `--user-data-dir`. Confirm the actual settings file in Zed before using this setup.

Connect writes `language_models.openai_compatible.runinfra.api_url` as `https://api.runinfra.ai/v1` and populates `available_models` from the catalog. Each row contains `name`, `display_name`, `max_tokens`, `max_output_tokens`, and `capabilities.chat_completions: true`. Connect sets `max_tokens` from catalog context capacity and `max_output_tokens` from the catalog output limit.

It sets `agent.default_model.provider` to `runinfra` and `agent.default_model.model` to the selected id. Connect does not use `openai_compatible` as the provider selector. Check existing chats and feature-specific choices for separate model selections.

Connect could not confirm the platform paths and override order, provider fields and required metadata, model-id rules, limit semantics or persisted default selectors against the current Zed documentation; check the [configuration guide](https://zed.dev/docs/configuring-zed.html), [provider guide](https://zed.dev/docs/ai/llm-providers.html), and [Agent settings guide](https://zed.dev/docs/ai/agent-settings.html) before relying on it.

### Key placement

Helper mode is the default and the only supported mode. Keys saved through Zed go to the system keychain, not `settings.json`. Connect writes no literal key, environment reference, or keychain entry.

Set `RUNINFRA_API_KEY` securely in the environment that launches the fully restarted editor. GUI and Start menu launches need that actual environment; a terminal-only assignment does not configure a separate launcher.

Alternatively, enter the RunInfra key manually in Zed's provider settings or system credential store. Check whether a nonempty `RUNINFRA_API_KEY` process value takes precedence over the stored key. Connect does not change either source, dotenv files, or shell profiles. It refuses a conflicting nonempty launch credential.

Connect could not confirm the environment variable's lookup rules, empty-value behavior, precedence over the keychain or GUI launch behavior against the current Zed documentation; check the [API access guide](https://zed.dev/docs/ai/use-api-access.html) and [compatible-provider implementation](https://github.com/zed-industries/zed/blob/main/crates/language_models/src/provider/api_compatible.rs) before relying on it.

## Verify

Connect prints command-palette actions, not a shell diagnostic. In Zed's command palette, open provider settings with:

```text theme={"dark"}
agent: open settings
```

For advanced JSON settings, use:

```text theme={"dark"}
zed: open settings file
```

These are editor actions, not shell commands. Check the actual settings file and credential settings before testing.

Start a new Agent conversation. Select provider `runinfra` and the model chosen during setup. Confirm a reply, streams, tools, the selected model, and the request destination in an authorized environment. Check existing chats and feature-specific choices separately. A Connect API probe alone does not prove Zed used the settings.

Connect could not confirm a shell diagnostic or headless request check against the current Zed documentation; check the [CLI reference](https://zed.dev/docs/reference/cli.html) before relying on it.

## Restart

Fully quit and restart Zed with the intended `RUNINFRA_API_KEY` environment. Open a new Agent chat. Select the RunInfra model.

## Known behaviours

Connect accepts JSON comments. It refuses a BOM, trailing commas, duplicate keys, and other JSON5 syntax. Connect preserves unknown unrelated settings without claiming your installed Zed version accepts them.

Existing `available_models` rows match by unique `name`. Connect updates known fields in matching rows and appends new rows. Noncatalog rows, foreign providers, and unrelated settings retain their bytes. This is an explicit catalog, not automatic `/models` discovery by Zed.

This preview requires Chat Completions and tool-capable catalog models. Connect does not infer image, parallel-tool, or reasoning capabilities. Competing protocol or capability overrides require manual review.

Connect could not confirm current parser tolerance, capability defaults, cross-provider collision behavior, restart requirements, comment and unknown-key preservation or restoration after native saves against the current Zed documentation; check the [API access guide](https://zed.dev/docs/ai/use-api-access.html) and [configuration guide](https://zed.dev/docs/configuring-zed.html) before relying on it. Check model limits, GUI launch credentials, streams, tools, and native saves in the installed app.

## Troubleshooting

| Symptom                            | What to check                                                                                                                        |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| Literal mode is refused            | Use the default helper mode and complete the environment or in-app credential handoff.                                               |
| The provider is refused            | Review a `runinfra` collision in `anthropic_compatible`, a foreign URL, inline credentials, headers, or unsupported provider fields. |
| A model row is refused             | Review duplicate names, invalid context limits, extra output or reasoning fields, and competing capability flags.                    |
| Zed still uses an old model or key | Fully restart with the intended environment, start a new Agent chat, and check feature-specific overrides and the stored credential. |
| Settings differ after startup      | Zed's settings UI can rewrite the file. Re-read it before restoring; review any detected changes.                                    |

## Revert

```bash theme={"dark"}
npx @runinfra/connect zed off
```

With intact state and snapshots, `off` restores the original bytes from before the first `on` in the active connection. If `settings.json` did not exist then, Connect removes it. Later `on` calls and key rotations keep that restore point.

If Zed or another editor changed the file, Connect refuses to overwrite it. Back up and review the edits before choosing to discard them:

```bash theme={"dark"}
npx @runinfra/connect zed off --force
```

Connect saves the current contents in a recovery snapshot and prints its id before restoring the origin. Keep the snapshots. If the origin snapshot is missing, automatic cleanup refuses while a RunInfra provider or default selection remains; see [Connect recovery](/docs/tools-sdks/connect#what-off-restores).

There is no file credential to remove. Undo the manual environment or credential-store handoff yourself. Restoring settings does not disconnect a key in the environment or keychain.

## Related

<Columns cols={3}>
  <Card title="Connect" icon="plug" href="/docs/tools-sdks/connect">
    Set up, inspect, and restore your coding agent.
  </Card>

  <Card title="Chat completions" icon="braces" href="/docs/api-reference/chat-completions">
    Read the request contract.
  </Card>

  <Card title="Models" icon="list" href="/docs/api-reference/models">
    Find model ids and context windows.
  </Card>
</Columns>
