> ## 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 CC Switch

> Add Modellix as a custom CC Switch provider for Claude Code, Codex, and OpenAI Compatible apps with the correct Base URL per protocol.

[CC Switch](https://ccswitch.io/) manages API providers for Claude Code, Codex, OpenCode, OpenClaw, Hermes, and related tools. Modellix is **not** a built-in preset — add a [custom provider](https://ccswitch.io/en/docs?section=providers\&item=add) and point each app at the Modellix LLM gateway.

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

  Base URL differs by protocol:

  | App / protocol                                  | Endpoint                                 | Model IDs                                         |
  | ----------------------------------------------- | ---------------------------------------- | ------------------------------------------------- |
  | Claude Code (Anthropic Messages)                | `https://llm.modellix.ai` (**no** `/v1`) | `anthropic/...`                                   |
  | Codex / OpenCode / OpenClaw (OpenAI-compatible) | `https://llm.modellix.ai/v1`             | `openai/...`, `anthropic/...`, `google/...`, etc. |

  See [Models & Pricing](/llm/overview#models-and-pricing). Prefer **app-specific** providers over a single Unified Provider — Claude and Codex need different Base URL shapes.
</Note>

## Set Up CC Switch

<Steps>
  <Step title="Install CC Switch">
    Download and install [CC Switch](https://ccswitch.io/) for your OS. Open the app and select the target tool tab (for example **Claude Code** or **Codex**).
  </Step>

  <Step title="Get a Modellix API Key">
    Create a key in the [Modellix console](https://modellix.ai/console/api-key). You will paste it into the custom provider form.
  </Step>

  <Step title="Add Modellix for Claude Code">
    On the **Claude Code** tab, click **+** → choose the **Custom** preset (not AiHubMix or another built-in).

    In the JSON config (or form fields that map to it), set:

    ```json theme={null}
    {
      "env": {
        "ANTHROPIC_API_KEY": "mdlx-xxxxxxxx",
        "ANTHROPIC_BASE_URL": "https://llm.modellix.ai"
      }
    }
    ```

    | Field                 | Value                                                     |
    | --------------------- | --------------------------------------------------------- |
    | Name                  | `Modellix` (display name)                                 |
    | `ANTHROPIC_API_KEY`   | Your Modellix API Key                                     |
    | `ANTHROPIC_BASE_URL`  | `https://llm.modellix.ai` (**without** `/v1`)             |
    | API Format (Advanced) | **Anthropic Messages** (default)                          |
    | Model                 | `anthropic/...` (for example `anthropic/claude-sonnet-5`) |

    <Warning>
      Do **not** append `/v1` to `ANTHROPIC_BASE_URL`. Claude Code appends `/v1/messages` itself. Leave **Full URL Mode** off for this setup. Do not switch API Format to OpenAI Chat Completions unless you intentionally use CC Switch proxy conversion — Modellix already speaks native Messages at this host.
    </Warning>

    Save, then **Enable** the Modellix provider card so Claude Code uses it. Details match the standalone [Claude Code](/llm/agent/claude-code) guide.
  </Step>

  <Step title="Add Modellix for Codex">
    On the **Codex** tab, click **+** → **Custom**. Configure auth and TOML (CC Switch writes `~/.codex/auth.json` and `~/.codex/config.toml`):

    **auth.json**

    ```json theme={null}
    {
      "OPENAI_API_KEY": "mdlx-xxxxxxxx"
    }
    ```

    **config.toml**

    ```toml theme={null}
    model_provider = "modellix"
    model = "openai/gpt-5.5"
    disable_response_storage = true

    [model_providers.modellix]
    name = "Modellix"
    base_url = "https://llm.modellix.ai/v1"
    wire_api = "responses"
    requires_openai_auth = true
    ```

    | Field            | Value                                                                                                    |
    | ---------------- | -------------------------------------------------------------------------------------------------------- |
    | `OPENAI_API_KEY` | Modellix API Key                                                                                         |
    | `model_provider` | Must match `[model_providers.xxx]` (for example `modellix`)                                              |
    | `base_url`       | `https://llm.modellix.ai/v1` (include `/v1`)                                                             |
    | `wire_api`       | `responses` (Modellix [`POST /v1/responses`](/llm/responses)); use `chat` if you prefer Chat Completions |
    | `model`          | Exact Modellix Model ID (for example `openai/gpt-5.5`)                                                   |

    Save and enable the provider. Related: [Codex](/llm/agent/codex).
  </Step>

  <Step title="Optional: OpenCode or OpenClaw">
    On the **OpenCode** or **OpenClaw** tab, prefer the **OpenAI Compatible** preset (or **Custom** if you need a full provider block).

    | Field                | Value                                                |
    | -------------------- | ---------------------------------------------------- |
    | Base URL / `baseURL` | `https://llm.modellix.ai/v1`                         |
    | API Key              | Modellix API Key                                     |
    | Model ID             | Exact `provider/name` (for example `openai/gpt-5.5`) |

    For hand-edited OpenCode / OpenClaw configs, see [OpenCode](/llm/agent/opencode) and [OpenClaw](/llm/agent/openclaw).
  </Step>

  <Step title="Select Models">
    Enter Modellix Model IDs manually when needed. **Fetch Models** calls OpenAI-compatible `/v1/models`; if that endpoint is unavailable, the picker stays empty — paste IDs from [Models & Pricing](/llm/overview#models-and-pricing).

    Enable the Modellix provider for the active app, then run that CLI/IDE as usual.
  </Step>
</Steps>

## Troubleshooting

| Symptom                            | Check                                                                                |
| ---------------------------------- | ------------------------------------------------------------------------------------ |
| 401 / auth errors                  | Key is a valid Modellix key for the selected app                                     |
| Claude path / 404                  | `ANTHROPIC_BASE_URL` is `https://llm.modellix.ai` with **no** `/v1`                  |
| Codex path errors                  | `base_url` is `https://llm.modellix.ai/v1` with `/v1`                                |
| Model not found                    | Full ID like `openai/gpt-5.5` or `anthropic/claude-sonnet-5`, not a bare vendor name |
| Fetch Models empty                 | Manual Model ID is fine; gateway may not expose `/v1/models`                         |
| Unified Provider fails across apps | Use separate Claude vs Codex providers (different Base URL shapes)                   |
| Wrong path after Full URL Mode     | Turn **Full URL Mode** off for standard Modellix endpoints                           |

## Related

* [CC Switch — Add Provider](https://ccswitch.io/en/docs?section=providers\&item=add) — Custom preset and API Format
* [Claude Code](/llm/agent/claude-code) — same Anthropic env pattern without CC Switch
* [Codex](/llm/agent/codex) — same OpenAI-compatible gateway
* [OpenCode](/llm/agent/opencode) / [OpenClaw](/llm/agent/openclaw) — direct config when not using CC Switch
* [Models & Pricing](/llm/overview#models-and-pricing) — Model IDs and rates
* [LLM API guide](/llm/api/api) — protocols and curl examples
