> ## 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 Kilo Code

> Add Modellix as a Kilo Code custom OpenAI Compatible provider with kilo.jsonc, baseURL, and provider/name model IDs.

Configure [Kilo Code](https://kilo.ai/docs/getting-started) to call the Modellix LLM gateway. Modellix is not a built-in Kilo provider — use a [custom OpenAI Compatible](https://kilo.ai/docs/ai-providers/openai-compatible) provider pointed 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 the custom provider `models` map (and as the Model ID in the UI) so Kilo sends it unchanged in the request body. See [Models & Pricing](/llm/overview#models-and-pricing).
</Note>

## Set Up Kilo Code

<Steps>
  <Step title="Install Kilo Code">
    Install the [VS Code extension](https://marketplace.visualstudio.com/items?itemName=kilocode.kilo-code) (also works in Cursor, Windsurf, and other VS Code forks):

    ```bash theme={null}
    code --install-extension kilocode.kilo-code
    ```

    Or install the CLI:

    ```bash theme={null}
    npm install -g @kilocode/cli
    kilo --version
    ```
  </Step>

  <Step title="Store Credentials">
    Export your Modellix API key from the [console](https://modellix.ai/console/api-key):

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

    Add the line to your shell profile (for example `~/.zshrc`), then run `source ~/.zshrc`.

    Prefer the **global** config path `~/.config/kilo/kilo.jsonc` for `{env:MODELLIX_API_KEY}`. Project-level `kilo.jsonc` does not resolve `{env:...}` references (Kilo security restriction).
  </Step>

  <Step title="Add a Custom Provider in the UI">
    In Kilo Code, open **Settings** (gear icon) → **Providers**, scroll to the bottom, and click **Custom provider**.

    Fill in:

    | Field        | Value                                                                       |
    | ------------ | --------------------------------------------------------------------------- |
    | Provider ID  | `modellix` (lowercase; becomes the `provider_id` in `provider_id/model_id`) |
    | Display name | `Modellix`                                                                  |
    | Provider API | **OpenAI Compatible** (Chat Completions)                                    |
    | Base URL     | `https://llm.modellix.ai/v1`                                                |
    | API key      | Your Modellix API Key (or leave empty and use `options.apiKey` in config)   |
    | Models       | Add Model IDs manually (exact `provider/name` strings)                      |

    Submit to save. Include `/v1` in the Base URL so paths resolve to `/v1/chat/completions`.

    <Tip>
      Kilo may try to auto-fetch models from `/v1/models`. If detection fails, enter Model IDs manually — that is expected for gateways without an OpenAI models list endpoint.
    </Tip>

    Do **not** pick a third-party built-in provider (for example AIhubmix) and paste a Modellix key there. Use a dedicated Custom provider with the Modellix Base URL.
  </Step>

  <Step title="Or Edit kilo.jsonc">
    Create or update `~/.config/kilo/kilo.jsonc` (Windows: `%USERPROFILE%\.config\kilo\kilo.jsonc`):

    ```jsonc theme={null}
    {
      "$schema": "https://app.kilo.ai/config.json",
      "model": "modellix/openai/gpt-5.5",
      "provider": {
        "modellix": {
          "npm": "@ai-sdk/openai-compatible",
          "name": "Modellix",
          "options": {
            "baseURL": "https://llm.modellix.ai/v1",
            "apiKey": "{env:MODELLIX_API_KEY}"
          },
          "models": {
            "openai/gpt-5.5": {
              "name": "GPT 5.5",
              "tool_call": true,
              "limit": {
                "context": 200000,
                "output": 8192
              }
            },
            "openai/gpt-5.6-sol": {
              "name": "GPT 5.6 Sol",
              "tool_call": true,
              "limit": {
                "context": 200000,
                "output": 8192
              }
            },
            "openai/gpt-5.6-terra": {
              "name": "GPT 5.6 Terra",
              "tool_call": true,
              "limit": {
                "context": 200000,
                "output": 8192
              }
            },
            "openai/gpt-5.6-luna": {
              "name": "GPT 5.6 Luna",
              "tool_call": true,
              "limit": {
                "context": 200000,
                "output": 8192
              }
            },
            "anthropic/claude-sonnet-5": {
              "name": "Claude Sonnet 5",
              "tool_call": true,
              "limit": {
                "context": 200000,
                "output": 8192
              }
            },
            "google/gemini-3.6-flash": {
              "name": "Gemini 3.6 Flash",
              "tool_call": true,
              "limit": {
                "context": 200000,
                "output": 8192
              }
            },
            "xai/grok-4.5": {
              "name": "Grok 4.5",
              "tool_call": true,
              "limit": {
                "context": 200000,
                "output": 8192
              }
            }
          }
        }
      }
    }
    ```

    | Field                            | Value                                                              |
    | -------------------------------- | ------------------------------------------------------------------ |
    | Provider ID                      | Any string (for example `modellix`); must match the UI Provider ID |
    | `npm`                            | `@ai-sdk/openai-compatible` for Chat Completions                   |
    | `options.baseURL`                | `https://llm.modellix.ai/v1`                                       |
    | `options.apiKey`                 | `{env:MODELLIX_API_KEY}` in global config                          |
    | `models` keys                    | Exact Modellix Model IDs (`provider/name`)                         |
    | Top-level `model`                | `modellix/<model-id>` (provider ID + model key)                    |
    | `tool_call`                      | `true` for agent tool use                                          |
    | `limit.context` / `limit.output` | Set explicitly so Kilo can compact context                         |

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

    <Warning>
      For custom models, always set `limit.context` and `limit.output`. If both are unset and the ID is not in Kilo's catalog, context compaction is disabled and conversations can grow until the provider rejects the request.
    </Warning>
  </Step>

  <Step title="Select a Modellix Model">
    In the IDE, open the model picker and choose a Modellix model (format `modellix/openai/gpt-5.5`).

    From the CLI:

    ```bash theme={null}
    kilo models
    ```

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

    Native Anthropic Messages is for the [Anthropic SDK](/llm/sdk/anthropic-sdk) and [Claude Code](/llm/agent/claude-code), not required here.
  </Step>
</Steps>

## Troubleshooting

| Symptom                          | Check                                                                                           |
| -------------------------------- | ----------------------------------------------------------------------------------------------- |
| 401 / Invalid API Key            | `MODELLIX_API_KEY` is a valid Modellix key; global `kilo.jsonc` uses `{env:MODELLIX_API_KEY}`   |
| Model not found / 404            | Model key is a full ID like `openai/gpt-5.5`, not bare `gpt-5.5`                                |
| Wrong path / connection errors   | `baseURL` is `https://llm.modellix.ai/v1` (include `/v1`); do not use `https://api.modellix.ai` |
| Auto-detect finds no models      | Enter Model IDs manually; auto-fetch needs `/v1/models`                                         |
| `{env:...}` ignored              | Credentials must live in `~/.config/kilo/kilo.jsonc`, not a project-level file                  |
| Tools / agent steps fail         | Set `"tool_call": true` on the model entry                                                      |
| Context grows without compacting | Set `limit.context` and `limit.output` on each custom model                                     |

## Related

* [Kilo OpenAI Compatible](https://kilo.ai/docs/ai-providers/openai-compatible) — custom provider UI and Base URL
* [Kilo Custom Models](https://kilo.ai/docs/code-with-ai/agents/custom-models) — `kilo.jsonc` schema, limits, and `id` mapping
* [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) — similar `@ai-sdk/openai-compatible` custom provider setup
