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

# Every other agent — exact config.

> If a tool has an OpenAI-compatible setting, it runs on Layer X1: an API base pointed at the gateway, an lx1_ key, and a catalog model id. Copy-paste config for a dozen popular agents below — terminal-first, then editors.

## Compatibility at a glance

Every tool here speaks the OpenAI [Chat Completions](/api/chat-completions) dialect, which
the gateway serves at `https://api.layerx1.com/v1/chat/completions`. The only thing that
differs between tools is *where* you set the three values and whether the API base carries
the `/v1` suffix.

| Tool         | Configured in               | API base                     |
| ------------ | --------------------------- | ---------------------------- |
| opencode     | `opencode.json`             | `https://api.layerx1.com/v1` |
| Crush        | `crush.json`                | `https://api.layerx1.com/v1` |
| Goose        | `env / goose configure`     | `https://api.layerx1.com`    |
| Hermes Agent | `~/.hermes/config.yaml`     | `https://api.layerx1.com/v1` |
| OpenClaw     | `~/.openclaw/openclaw.json` | `https://api.layerx1.com/v1` |
| Qwen Code    | `.qwen/.env`                | `https://api.layerx1.com/v1` |
| OpenHands    | `Settings → LLM (Advanced)` | `https://api.layerx1.com/v1` |
| Aider        | `~/.aider.conf.yml`         | `https://api.layerx1.com/v1` |
| Zed          | `settings.json`             | `https://api.layerx1.com/v1` |
| Continue     | `~/.continue/config.yaml`   | `https://api.layerx1.com/v1` |
| Cline        | `GUI settings`              | `https://api.layerx1.com/v1` |
| Kilo Code    | `GUI settings`              | `https://api.layerx1.com/v1` |

<Note>
  Almost every tool wants the base URL to **include** `/v1` — it appends the method path
  (`/chat/completions`) itself. `Goose` is the one exception on this page: its
  `OPENAI_HOST` takes the bare origin and adds `/v1/chat/completions` for you. Claude Code
  and Codex have their own pages — [Claude Code](/guides/claude-code),
  [Codex CLI](/guides/codex), [Cursor](/guides/cursor). Cursor CLI (`agent`), Antigravity
  (`agy`), and Kiro CLI have **no** OpenAI-compatible hook — `npx layerx1 setup --tool
      cursor-cli,antigravity,kiro` prints that and a Hermes/Codex/Claude one-liner instead of
  writing a fake config.
</Note>

## Terminal agents

### opencode

Add a provider to `opencode.json` (project root, or
`~/.config/opencode/opencode.json` for a global default). The
`@ai-sdk/openai-compatible` package handles the wire format; the model keys must match
[catalog ids](/models) exactly.

```json title="opencode.json" theme={null}
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "layerx1": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Layer X1",
      "options": {
        "baseURL": "https://api.layerx1.com/v1",
        "apiKey": "lx1_your_key"
      },
      "models": {
        "lx1-gpt-oss-120b": { "name": "Layer X1 fast" },
        "lx1-glm-5": { "name": "Layer X1 coding" }
      }
    }
  },
  "model": "layerx1/lx1-gpt-oss-120b"
}
```

<Note>
  opencode has had intermittent issues wiring custom OpenAI-compatible providers across
  versions. After setup, confirm the values landed with `opencode debug config`. If you hit
  a 401 or a URL-parse error, move the URL to a top-level
  `"api": "https://api.layerx1.com/v1"` field instead of `options.baseURL`, and/or register
  the key via `opencode auth login` → "Other" → id `layerx1`.
</Note>

### Crush

Charm's Crush reads a project-local `crush.json`. Register the provider as
`openai-compat` and point the top-level `models` block at it so it's used by default:

```json title="crush.json (project root)" theme={null}
{
  "$schema": "https://charm.land/crush.json",
  "providers": {
    "layerx1": {
      "type": "openai-compat",
      "base_url": "https://api.layerx1.com/v1",
      "api_key": "lx1_your_key",
      "models": [
        { "id": "lx1-gpt-oss-120b", "name": "Layer X1 fast" },
        { "id": "lx1-glm-5", "name": "Layer X1 coding" }
      ]
    }
  },
  "models": {
    "large": { "provider": "layerx1", "model": "lx1-glm-5" },
    "small": { "provider": "layerx1", "model": "lx1-gpt-oss-120b" }
  }
}
```

Prefer the project-local file — it's unambiguous on every OS. The machine-wide path is
`~/.config/crush/crush.json` (on Windows, `%USERPROFILE%\.config\crush\crush.json`).

### Goose

Block's Goose uses the built-in `openai` provider with a custom host. Set four variables
and start a session — or run `goose configure` → Configure Providers → `openai` and enter
the same values:

```sh theme={null}
export GOOSE_PROVIDER=openai
export GOOSE_MODEL=lx1-gpt-oss-120b
export OPENAI_HOST=https://api.layerx1.com
export OPENAI_API_KEY=lx1_your_key

goose session
```

<Note>
  Goose is the exception to the `/v1` rule: `OPENAI_HOST` takes the **bare origin**
  (`https://api.layerx1.com`, no `/v1`) — Goose appends `/v1/chat/completions` itself.
</Note>

### Hermes Agent

```sh theme={null}
npx layerx1 setup --tool hermes --key lx1_your_key --model lx1-deepseek-v4-flash
```

The installer writes a **named** provider (the current Hermes shape) — not bare
`provider: custom` with an inline `api_key`. Bare custom still falls through to
OpenRouter on some agent-run paths, and secrets belong in `~/.hermes/.env`.

```yaml title="~/.hermes/config.yaml" theme={null}
model:
  provider: custom:layerx1
  default: lx1-deepseek-v4-flash

providers:
  layerx1:
    name: Layer X1
    api: https://api.layerx1.com/v1
    key_env: LAYERX1_API_KEY
    transport: chat_completions
    default_model: lx1-deepseek-v4-flash
```

```sh title="~/.hermes/.env" theme={null}
LAYERX1_API_KEY=lx1_your_key
```

The `/v1` in `api` is required — Hermes does not add it. Swap `default` /
`default_model` to `lx1-glm-5` for heavy coding, or any other [catalog id](/models).
Then run `hermes`. Switch later with `hermes model` or `/model` inside a session.

### OpenClaw

OpenClaw registers custom providers in `~/.openclaw/openclaw.json` under
`models.providers`. Use `api: "openai-completions"` (the Responses variant is not yet
reliable for custom providers):

```json title="~/.openclaw/openclaw.json" theme={null}
{
  "models": {
    "providers": {
      "layerx1": {
        "api": "openai-completions",
        "baseUrl": "https://api.layerx1.com/v1",
        "apiKey": "lx1_your_key",
        "models": [
          { "id": "lx1-gpt-oss-120b", "name": "Layer X1 fast" },
          { "id": "lx1-glm-5", "name": "Layer X1 coding" }
        ]
      }
    }
  }
}
```

Then select `layerx1/lx1-gpt-oss-120b` as your agent model. Keep the provider key
(`layerx1`) and the model prefix in sync — a mismatch is the usual cause of a "no API key
found" error. The file is JSON5, so you can also paste this in the Config tab of the local
UI at `http://127.0.0.1:18789`.

### Qwen Code

Qwen Code auto-loads a `.qwen/.env` file (project-level, or `~/.qwen/.env` for a user-wide
default). Three variables:

```sh title=".qwen/.env" theme={null}
OPENAI_API_KEY=lx1_your_key
OPENAI_BASE_URL=https://api.layerx1.com/v1
OPENAI_MODEL=lx1-gpt-oss-120b
```

On first launch pick **Custom Provider** if prompted (or start with
`--auth-type openai`). Switch `OPENAI_MODEL` to `lx1-glm-5` for heavy sessions.

### OpenHands

In OpenHands, open `Settings → LLM`, click **see advanced settings**, toggle **Advanced**,
and fill in:

```text theme={null}
Custom Model:  openai/lx1-glm-5      (or openai/lx1-gpt-oss-120b)
Base URL:      https://api.layerx1.com/v1
API Key:       lx1_your_key
```

<Note>
  The `openai/` prefix on the model is required — it tells OpenHands' routing layer to use
  the Chat Completions client (our `/v1/chat/completions` surface), not a provider-native
  one.
</Note>

### Aider

Configure `~/.aider.conf.yml` with an `openai/`-prefixed model id and the gateway as the
API base (including `/v1`):

```yaml title="~/.aider.conf.yml" theme={null}
model: openai/lx1-gpt-oss-120b
openai-api-base: https://api.layerx1.com/v1
openai-api-key: lx1_your_key
```

Or per-invocation:
`aider --model openai/lx1-glm-5 --openai-api-base https://api.layerx1.com/v1`.

## Editors & IDE extensions

### Zed

Zed reads an `openai_compatible` provider from `settings.json` (Command Palette →
`zed: open settings`):

```json title="settings.json" theme={null}
{
  "language_models": {
    "openai_compatible": {
      "layerx1": {
        "api_url": "https://api.layerx1.com/v1",
        "available_models": [
          { "name": "lx1-gpt-oss-120b", "display_name": "Layer X1 fast", "max_tokens": 128000 },
          { "name": "lx1-glm-5", "display_name": "Layer X1 coding", "max_tokens": 200000 }
        ]
      }
    }
  }
}
```

<Note>
  Don't put the key in `settings.json`. Zed reads it from the provider's Settings UI or
  from a `LAYERX1_API_KEY` environment variable (the provider id, upper-cased, plus
  `_API_KEY`). The settings file lives at `~/.config/zed/settings.json` on macOS and Linux,
  and `%APPDATA%\Zed\settings.json` on Windows.
</Note>

### Cline

Cline is configured in its GUI. In the model settings choose:

* API Provider: **OpenAI Compatible**.
* Base URL: `https://api.layerx1.com/v1`.
* API key: your `lx1_` key.
* Model id: any catalog model, e.g. `lx1-glm-5` for heavy coding or `lx1-gpt-oss-120b` for
  speed.

### Continue

Add a `models` entry to `~/.continue/config.yaml` using the OpenAI provider type pointed
at the gateway:

```yaml title="~/.continue/config.yaml" theme={null}
models:
  - name: Layer X1
    provider: openai
    model: lx1-gpt-oss-120b
    apiBase: https://api.layerx1.com/v1
    apiKey: lx1_your_key
```

Add one entry per model you want in the picker — chat, edit, and autocomplete roles can
each point at a different catalog id.

### Kilo Code

Kilo Code is configured in its VS Code GUI: `Settings → Providers → Custom provider`. In
the dialog:

* Provider API: **OpenAI Compatible**.
* Base URL: `https://api.layerx1.com/v1`.
* API key: your `lx1_` key.
* Models: add `lx1-gpt-oss-120b` and `lx1-glm-5` (manual entry is the guaranteed path;
  leave provider id lowercase).

<Note>
  Migrating from Roo Code? Roo Code was archived in May 2026 and its repo is read-only. If
  you still run an existing install, the same OpenAI Compatible recipe applies (Base URL
  `https://api.layerx1.com/v1`, your `lx1_` key, a catalog model id). New setups should use
  Cline or Kilo Code above.
</Note>

## Anything OpenAI-compatible

The universal recipe, for tools not listed here:

* Base URL: `https://api.layerx1.com/v1` (append `/v1` unless the tool documents that it
  adds it — as Goose and Claude Code do).
* API key: an `lx1_` key, usually in the tool's "OpenAI API key" field. The gateway accepts
  it as either an `Authorization: Bearer` or `x-api-key` header, so whichever the client
  sends works.
* Model: any id from the [catalog](/models) — the tool does not need to know the list in
  advance. Model ids are exact (`lx1-glm-5`, not `glm-5`).

<Note>
  The `npx layerx1` CLI automates the common setups (Claude Code, Codex, Hermes, Aider,
  Continue, Cline, Cursor, Windsurf) — see [CLI](/cli). Cursor CLI, Antigravity (`agy`),
  and Kiro CLI are recognized `--tool` ids too; they have no custom OpenAI hook, so
  setup prints that limit instead of writing a config that would fail. For the tools
  above, paste the config by hand if you are not using the installer.
</Note>
