> ## 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 OpenClaw 🦞

> Add Modellix as a custom OpenAI-compatible provider in OpenClaw with models.providers, openai-completions, and provider/name model IDs.

Configure [OpenClaw](https://docs.openclaw.ai) to call the Modellix LLM gateway. OpenClaw does not ship a built-in Modellix provider, so add a [custom provider](https://docs.openclaw.ai/concepts/model-providers) that points at Chat Completions on [`POST /v1/chat/completions`](/llm/chat-completions).

<Note>
  This page covers **LLM text** only (`https://llm.modellix.ai`). For OpenClaw media skills and plugins (image, video, speech), see [Plugin](/ways-to-use/plugin) and [Skill](/ways-to-use/skill).

  Modellix model IDs are `provider/name` (for example `openai/gpt-5.5`). In OpenClaw, register that full string under your custom provider, then select `modellix/<model-id>` (for example `modellix/openai/gpt-5.5`). See [Models & Pricing](/llm/overview#models-and-pricing).
</Note>

## Set Up OpenClaw

<Steps>
  <Step title="Get a Modellix API Key">
    Create a Modellix API key in the [console](https://modellix.ai/console/api-key) and store it securely. You will set it as `MODELLIX_API_KEY` in the OpenClaw config below.
  </Step>

  <Step title="Add a Custom Provider">
    Create or update `~/.openclaw/openclaw.json` with a full config that defines the Modellix provider, models, and a primary agent model:

    ```json theme={null}
    {
      "env": {
        "MODELLIX_API_KEY": "mdlx-xxxxxxxx"
      },
      "models": {
        "mode": "merge",
        "providers": {
          "modellix": {
            "baseUrl": "https://llm.modellix.ai/v1",
            "apiKey": "${MODELLIX_API_KEY}",
            "api": "openai-completions",
            "models": [
              { "id": "openai/gpt-5.5", "name": "GPT 5.5" },
              { "id": "openai/gpt-5.6-sol", "name": "GPT 5.6 Sol" },
              { "id": "openai/gpt-5.6-terra", "name": "GPT 5.6 Terra" },
              { "id": "openai/gpt-5.6-luna", "name": "GPT 5.6 Luna" },
              { "id": "anthropic/claude-sonnet-5", "name": "Claude Sonnet 5" },
              { "id": "google/gemini-3.6-flash", "name": "Gemini 3.6 Flash" },
              { "id": "xai/grok-4.5", "name": "Grok 4.5" }
            ]
          }
        }
      },
      "agents": {
        "defaults": {
          "model": {
            "primary": "modellix/openai/gpt-5.5"
          },
          "models": {
            "modellix/openai/gpt-5.5": {}
          }
        }
      }
    }
    ```

    Replace `mdlx-xxxxxxxx` with your Modellix API key. Merge these fields into an existing config if you already use OpenClaw.

    | Field                           | Value                                                            |
    | ------------------------------- | ---------------------------------------------------------------- |
    | `Provider ID`                   | `modellix` (custom; do not use built-in `openai` or `anthropic`) |
    | `baseUrl`                       | `https://llm.modellix.ai/v1`                                     |
    | `api`                           | `openai-completions`                                             |
    | `apiKey`                        | `${MODELLIX_API_KEY}` (or your key string)                       |
    | `models[].id`                   | Exact Modellix Model IDs (`provider/name`)                       |
    | `agents.defaults.model.primary` | `modellix/<model-id>`                                            |

    <Warning>
      Use a custom provider key such as `modellix`. Overwriting OpenClaw's built-in `openai` or `anthropic` providers sends traffic to the vendor endpoints instead of Modellix.
    </Warning>

    Add or remove entries under `models.providers.modellix.models` as needed. Full catalog: [Models & Pricing](/llm/overview#models-and-pricing).
  </Step>

  <Step title="Set the Primary Model">
    The example above sets the primary model to `modellix/openai/gpt-5.5`. To switch models, update both fields:

    * `agents.defaults.model.primary` — OpenClaw ref: `modellix/` + Modellix Model ID
    * `agents.defaults.models` — include the same ref so the agent can use it

    Examples:

    | Modellix Model ID           | OpenClaw primary                     |
    | --------------------------- | ------------------------------------ |
    | `openai/gpt-5.5`            | `modellix/openai/gpt-5.5`            |
    | `anthropic/claude-sonnet-5` | `modellix/anthropic/claude-sonnet-5` |
    | `google/gemini-3.6-flash`   | `modellix/google/gemini-3.6-flash`   |

    You do **not** need a separate Anthropic base URL for OpenClaw. Register `anthropic/...` and `google/...` IDs on the same Modellix custom provider; traffic goes through OpenAI-compatible Chat Completions on `https://llm.modellix.ai/v1`.

    <Tip>
      Do not set `agents.defaults.model.primary` to a built-in ref such as `openai/gpt-5.5`. That routes through OpenClaw's native OpenAI provider, not Modellix.
    </Tip>
  </Step>

  <Step title="Start OpenClaw">
    Start or restart the OpenClaw gateway so it loads the updated config:

    ```bash theme={null}
    openclaw gateway run
    ```

    Optionally list models to confirm Modellix entries appear:

    ```bash theme={null}
    openclaw models list
    ```
  </Step>
</Steps>

## Troubleshooting

| Symptom                           | Check                                                                                           |
| --------------------------------- | ----------------------------------------------------------------------------------------------- |
| 401 / auth errors                 | `MODELLIX_API_KEY` is a valid Modellix key; `${MODELLIX_API_KEY}` resolves in config            |
| Model not found / 404             | `models[].id` is a full ID like `openai/gpt-5.5`, not bare `gpt-5.5`; ID is in the live catalog |
| Traffic hits OpenAI, not Modellix | Primary uses `modellix/...`, not built-in `openai/...`; provider key is `modellix`              |
| Wrong path / URL errors           | `baseUrl` is `https://llm.modellix.ai/v1` (include `/v1`), not the media API host               |
| Model ignored by agent            | Add the OpenClaw ref under both `models.providers.modellix.models` and `agents.defaults.models` |

## Related

* [OpenClaw model providers](https://docs.openclaw.ai/concepts/model-providers) — custom provider reference
* [Models & Pricing](/llm/overview#models-and-pricing) — Model IDs and rates
* [LLM API guide](/llm/api/api) — protocols and curl examples
* [OpenCode](/llm/agent/opencode) — another OpenAI-compatible custom provider setup
* [Plugin](/ways-to-use/plugin) · [Skill](/ways-to-use/skill) — OpenClaw media capabilities
