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

# Use Modellix LLM with Reasonix

> Point Reasonix at the Modellix LLM gateway with a custom OpenAI-compatible [[providers]] entry, MODELLIX_API_KEY in ~/.reasonix/.env, and provider/name model IDs.

Configure [Reasonix](https://reasonix.io/docs/) to call the Modellix LLM gateway. Reasonix is a local coding agent (CLI/TUI, desktop app, browser UI, or ACP). It has no built-in Modellix provider, so add an OpenAI-compatible `[[providers]]` entry in `~/.reasonix/config.toml` that points at Chat Completions on [`POST /v1/chat/completions`](/llm/chat-completions).

<Note>
  This page covers **LLM text** only (`https://llm.modellix.ai`).

  Modellix model IDs are `provider/name` (for example `openai/gpt-5.5`). Put that full string in `model` or `models` so Reasonix sends it unchanged in the request body. See [Models & Pricing](/llm/overview#models-and-pricing).
</Note>

## Set Up Reasonix

<Steps>
  <Step title="Install Reasonix">
    Install the 1.x CLI (npm is the documented default):

    <CodeGroup>
      ```bash npm theme={null}
      npm i -g reasonix
      ```

      ```bash Homebrew theme={null}
      brew install esengine/reasonix/reasonix
      ```
    </CodeGroup>

    Desktop downloads are on the [Reasonix docs](https://reasonix.io/docs/). CLI and desktop share the same config and credential files.
  </Step>

  <Step title="Store the Modellix API Key">
    Create a key in the [Modellix console](https://modellix.ai/console/api-key). Reasonix reads provider secrets from its **global** `.env`, not from your shell profile or a project `.env`.

    macOS / Linux: `~/.reasonix/.env`\
    Windows: `%APPDATA%\reasonix\.env`

    ```bash theme={null}
    MODELLIX_API_KEY=mdlx-xxxxxxxx
    ```

    Replace `mdlx-xxxxxxxx` with your Modellix API key. You can also paste the key in `reasonix setup` or desktop **Settings → Model → Access**; those flows write the same file.

    <Warning>
      Use a Modellix API key, not a DeepSeek, OpenAI, or other vendor platform key. Shell `export MODELLIX_API_KEY=...` is not a Reasonix provider-key fallback.
    </Warning>
  </Step>

  <Step title="Add a Custom Provider">
    Edit the **user** config at `~/.reasonix/config.toml` (Windows: `%APPDATA%\reasonix\config.toml`). Merge the `[[providers]]` table into an existing file; do not delete other providers.

    ```toml theme={null}
    default_model = "modellix"

    [[providers]]
    name = "modellix"
    kind = "openai"
    base_url = "https://llm.modellix.ai/v1"
    models = [
      "openai/gpt-5.5",
      "openai/gpt-5.6-sol",
      "anthropic/claude-sonnet-5",
      "google/gemini-3.6-flash",
      "xai/grok-4.6",
    ]
    default = "openai/gpt-5.5"
    api_key_env = "MODELLIX_API_KEY"
    context_window = 200000
    ```

    Add or remove IDs in `models` as needed. Full catalog: [Models & Pricing](/llm/overview#models-and-pricing).

    | Field            | Value                                                                          |
    | ---------------- | ------------------------------------------------------------------------------ |
    | `name`           | Local provider ID (use `modellix`; do not reuse `openai` or `anthropic`)       |
    | `kind`           | `openai` for Chat Completions                                                  |
    | `base_url`       | `https://llm.modellix.ai/v1` (Reasonix posts to `{base_url}/chat/completions`) |
    | `models`         | Exact Modellix Model IDs (`provider/name`)                                     |
    | `default`        | Default Modellix ID for this provider                                          |
    | `api_key_env`    | `MODELLIX_API_KEY` (must match a key in `~/.reasonix/.env`)                    |
    | `context_window` | Token window used for compaction; raise it if the catalog model is larger      |
    | `default_model`  | Reasonix picker ref: provider name (`modellix`) or `modellix/<model-id>`       |

    Config resolution is flags → `./reasonix.toml` → user `config.toml`. Keep personal API providers in the user file.

    <Tip>
      You do **not** need a separate Anthropic `kind` or base URL. Register `anthropic/...` and `google/...` IDs on the same Modellix `kind = "openai"` entry; traffic goes through OpenAI-compatible Chat Completions. Native Anthropic Messages is for the [Anthropic SDK](/llm/sdk/anthropic-sdk) and [Claude Code](/llm/agent/claude-code).
    </Tip>

    <Tip>
      In Reasonix 1.24+, the desktop custom-provider form stores an exact **API address** as `request_url` (no path rewriting). If you use that form, enter `https://llm.modellix.ai/v1/chat/completions`. Manual `base_url = "https://llm.modellix.ai/v1"` remains valid for TOML edits.
    </Tip>
  </Step>

  <Step title="Start a Session">
    From your project directory:

    ```bash theme={null}
    cd your-project
    reasonix
    ```

    Switch models with `/model`. Prefer the explicit Reasonix ref `modellix/openai/gpt-5.5` (provider name, then the Modellix ID). Headless:

    ```bash theme={null}
    reasonix run --model "modellix/openai/gpt-5.5" "Explain this repo"
    ```

    `reasonix setup` can also add a custom OpenAI-compatible provider and write the key; afterwards, confirm `base_url` / `request_url` and `models` match the table above.
  </Step>
</Steps>

## Troubleshooting

| Symptom                                 | Check                                                                                                                                                              |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 401 / missing API key                   | `MODELLIX_API_KEY` is in `~/.reasonix/.env` (or `%APPDATA%\reasonix\.env`), and `api_key_env` matches that name                                                    |
| Model not found / unknown model         | `models` lists the full ID (`openai/gpt-5.5`); select `modellix/openai/gpt-5.5` or the provider name `modellix`                                                    |
| Wrong path / URL errors                 | `base_url` is `https://llm.modellix.ai/v1`, or `request_url` is `https://llm.modellix.ai/v1/chat/completions` — not the media API host (`https://api.modellix.ai`) |
| Traffic hits DeepSeek or another vendor | You selected the `modellix` provider, not a built-in DeepSeek / OpenAI / Anthropic preset                                                                          |
| Early compaction                        | Raise `context_window` for the catalog model; custom providers no longer inherit DeepSeek window defaults                                                          |
| Provider name clash                     | Do not name the Reasonix provider `openai` or `anthropic` — Modellix IDs already start with those prefixes                                                         |

## Related

* [Reasonix docs](https://reasonix.io/docs/) — install, config paths, TUI and desktop
* [Models & Pricing](/llm/overview#models-and-pricing) — Model IDs and rates
* [LLM API guide](/llm/api/api) — protocols and curl examples
* [OpenAI SDK](/llm/sdk/openai-sdk) — same `/v1` Chat Completions gateway
* [OpenCode](/llm/agent/opencode) · [Grok Build](/llm/agent/grok-build) — other OpenAI-compatible agent setups
