> ## 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 CodeBuddy

> Add Modellix as a CodeBuddy custom model with an OpenAI-compatible endpoint, models.json, and provider/name model IDs.

Configure [CodeBuddy](https://www.codebuddy.ai/) to call the Modellix LLM gateway. CodeBuddy supports OpenAI-compatible [custom models](https://www.codebuddy.ai/docs/cli/models) in the UI and in `models.json`, 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`). Enter that full string as the Model Name / `id`. In the UI, set Endpoint to `https://llm.modellix.ai/v1`. When editing `models.json` by hand, set `url` to the **full** Chat Completions path (`.../v1/chat/completions`). See [Models & Pricing](/llm/overview#models-and-pricing).
</Note>

## Set Up CodeBuddy

<Steps>
  <Step title="Get a Modellix API Key">
    Create a Modellix API key in the [console](https://modellix.ai/console/api-key) and export it for `models.json` env substitution:

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

    You can also paste the key directly into the CodeBuddy UI or config files.
  </Step>

  <Step title="Add a Custom Model in the UI">
    In CodeBuddy, open the model picker (for example **Default** under the input box), scroll to the bottom, and choose **Configure custom models** → **Add Model**.

    Set **Provider** to **Custom**, then fill in:

    | Field             | Value                                                                                                      |
    | ----------------- | ---------------------------------------------------------------------------------------------------------- |
    | Endpoint          | `https://llm.modellix.ai/v1`                                                                               |
    | API Key           | Your Modellix API Key                                                                                      |
    | Model Name        | Exact Modellix Model ID (for example `openai/gpt-5.5`)                                                     |
    | Advanced Settings | Enable **Tool Calling** for agent tool use; enable Image Input / Reasoning only if the model supports them |

    Save the model. Include `/v1` in the Endpoint so paths resolve to `/v1/chat/completions`.
  </Step>

  <Step title="Persist with models.json">
    CodeBuddy also stores custom models in a local file. Edit this when the UI is inconvenient, or to share a project-level config.

    * User scope (macOS / Linux): `~/.codebuddy/models.json`
    * User scope (Windows): `%USERPROFILE%\.codebuddy\models.json`
    * Project scope (higher priority): `<project>/.codebuddy/models.json`

    Example:

    ```json theme={null}
    {
      "models": [
        {
          "id": "openai/gpt-5.5",
          "name": "GPT 5.5",
          "vendor": "Modellix",
          "url": "https://llm.modellix.ai/v1/chat/completions",
          "apiKey": "${MODELLIX_API_KEY}",
          "maxInputTokens": 200000,
          "maxOutputTokens": 8192,
          "supportsToolCall": true
        }
      ],
      "availableModels": ["openai/gpt-5.5"]
    }
    ```

    | Field             | Value                                            |
    | ----------------- | ------------------------------------------------ |
    | `id` / `name`     | Exact Modellix Model ID (`provider/name`)        |
    | `vendor`          | `Modellix`                                       |
    | `url`             | `https://llm.modellix.ai/v1/chat/completions`    |
    | `apiKey`          | `${MODELLIX_API_KEY}` or your key string         |
    | `availableModels` | Must include each model `id` you want selectable |

    <Warning>
      When writing `models.json` by hand, use the **full** Chat Completions URL (including `/chat/completions`). A host-only value or `https://llm.modellix.ai/v1` without `/chat/completions` is less reliable than the full path. Do not point `url` at the media API host (`https://api.modellix.ai`).
    </Warning>

    <Tip>
      Add more entries for other Modellix IDs (for example `anthropic/claude-sonnet-5`, `google/gemini-3.6-flash`) on the same gateway URL. Full catalog: [Models & Pricing](/llm/overview#models-and-pricing).
    </Tip>

    After saving, restart CodeBuddy or reopen the model picker so the list refreshes.
  </Step>

  <Step title="Select and Start">
    Open the model picker, choose your model under **Custom Models**, and send a short test message.

    CodeBuddy may display custom models as `name:name`. That is normal if the selected model responds correctly.
  </Step>

  <Step title="Optional: CodeBuddy CLI">
    The CLI package is **CodeBuddy Code** (`codebuddy`). It uses a separate Anthropic-compatible entry point from the desktop custom-model OpenAI path.

    ```bash theme={null}
    export CODEBUDDY_API_KEY="mdlx-xxxxxxxx"
    export CODEBUDDY_BASE_URL="https://llm.modellix.ai"
    export CODEBUDDY_MODEL="anthropic/claude-sonnet-5"
    codebuddy
    ```

    Or persist in `~/.codebuddy/settings.json`:

    ```json theme={null}
    {
      "env": {
        "CODEBUDDY_API_KEY": "mdlx-xxxxxxxx",
        "CODEBUDDY_BASE_URL": "https://llm.modellix.ai",
        "CODEBUDDY_MODEL": "anthropic/claude-sonnet-5"
      }
    }
    ```

    | Setting              | Value                                         |
    | -------------------- | --------------------------------------------- |
    | `CODEBUDDY_BASE_URL` | `https://llm.modellix.ai` (**without** `/v1`) |
    | `CODEBUDDY_API_KEY`  | Modellix API Key                              |
    | `CODEBUDDY_MODEL`    | Prefer `anthropic/...` for this CLI path      |

    <Warning>
      Do not set `CODEBUDDY_BASE_URL` to an OpenAI Chat Completions path such as `.../v1/chat/completions`. If you see 404s on the CLI, check that the base URL is the LLM host root without `/v1`.
    </Warning>
  </Step>
</Steps>

## Troubleshooting

| Symptom                   | Check                                                                                     |
| ------------------------- | ----------------------------------------------------------------------------------------- |
| 401 / auth errors         | Key is a Modellix API Key; `${MODELLIX_API_KEY}` is set if used in `models.json`          |
| Model not found / 404     | Model Name / `id` is a full ID like `openai/gpt-5.5`, not bare `gpt-5.5`                  |
| UI Endpoint errors        | Endpoint includes `/v1`: `https://llm.modellix.ai/v1`                                     |
| `models.json` path errors | `url` ends with `/v1/chat/completions`, not the media API host                            |
| CLI 404                   | `CODEBUDDY_BASE_URL` is `https://llm.modellix.ai` without `/v1` or `/chat/completions`    |
| Model missing after edit  | Restart CodeBuddy or reopen the model picker; confirm `id` is listed in `availableModels` |

## Related

* [CodeBuddy models.json](https://www.codebuddy.ai/docs/cli/models) — custom model schema
* [Models & Pricing](/llm/overview#models-and-pricing) — Model IDs and rates
* [LLM API guide](/llm/api/api) — protocols and curl examples
* [Junie](/llm/agent/junie) — another client that uses a full Chat Completions URL
* [Claude Code](/llm/agent/claude-code) — Anthropic-style base URL without `/v1` (similar to CodeBuddy CLI)
