> ## 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 Junie CLI

> Add Modellix as a Junie custom LLM profile with OpenAICompletion, a full chat completions URL, and provider/name model IDs.

Configure [Junie CLI](https://junie.jetbrains.com/docs/junie-cli.html) by JetBrains to call the Modellix LLM gateway. Junie does not ship a built-in Modellix BYOK provider, so add a [custom LLM profile](https://junie.jetbrains.com/docs/custom-llm-models.html) 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 the profile `id` field. Junie requires `baseUrl` to be the **full** Chat Completions URL (including `/v1/chat/completions`), not a host-only or `/v1` base. See [Models & Pricing](/llm/overview#models-and-pricing).
</Note>

## Set Up Junie

<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 so the profile can resolve `${MODELLIX_API_KEY}`:

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

    Add the same line to your shell profile (for example `~/.zshrc`) for persistent use.
  </Step>

  <Step title="Add a Custom Model Profile">
    Create `~/.junie/models/modellix.json` (or `.junie/models/modellix.json` in a project):

    ```json theme={null}
    {
      "id": "openai/gpt-5.5",
      "baseUrl": "https://llm.modellix.ai/v1/chat/completions",
      "apiType": "OpenAICompletion",
      "apiKey": "${MODELLIX_API_KEY}"
    }
    ```

    The filename without `.json` is the profile ID (`modellix`). Junie discovers profiles from `$JUNIE_HOME/models/*.json` (default `~/.junie/models/`) and project-level `.junie/models/*.json`.

    | Field     | Value                                                 |
    | --------- | ----------------------------------------------------- |
    | `id`      | Exact Modellix Model ID (`provider/name`)             |
    | `baseUrl` | `https://llm.modellix.ai/v1/chat/completions`         |
    | `apiType` | `OpenAICompletion`                                    |
    | `apiKey`  | `${MODELLIX_API_KEY}` (resolved from the environment) |

    <Warning>
      Use the full Chat Completions URL. A host-only value or `https://llm.modellix.ai/v1` without `/chat/completions` will fail. Do not point `baseUrl` at the media API host (`https://api.modellix.ai`).
    </Warning>

    <Tip>
      Optionally add a cheaper helper model for Junie's internal tasks:

      ```json theme={null}
      {
        "id": "openai/gpt-5.5",
        "baseUrl": "https://llm.modellix.ai/v1/chat/completions",
        "apiType": "OpenAICompletion",
        "apiKey": "${MODELLIX_API_KEY}",
        "fasterModel": {
          "id": "google/gemini-3.6-flash"
        }
      }
      ```

      Change `id` (and `fasterModel.id`) to any Modellix catalog ID. Full list: [Models & Pricing](/llm/overview#models-and-pricing).
    </Tip>
  </Step>

  <Step title="Select the Modellix Profile">
    Start Junie with the custom profile:

    ```bash theme={null}
    junie --model custom:modellix
    ```

    Custom models use the `custom:` prefix plus the profile filename (without `.json`). In the interactive TUI, pick the Modellix profile from the model list or use `/model`.

    <Warning>
      Do not use built-in BYOK flags such as `--openrouter-api-key` or `JUNIE_OPENAI_API_KEY` for Modellix. Those route to vendor providers, not your custom profile.
    </Warning>
  </Step>

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

    ```bash theme={null}
    cd /path/to/your/project
    junie --model custom:modellix
    ```

    For a one-shot (headless) task:

    ```bash theme={null}
    junie --model custom:modellix "Review and fix any code quality issues in the latest commit"
    ```
  </Step>
</Steps>

## Troubleshooting

| Symptom                         | Check                                                                                                            |
| ------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| 401 / missing API key           | `MODELLIX_API_KEY` is set in the environment; profile uses `${MODELLIX_API_KEY}` (unset vars fail profile load)  |
| Model not found / 404           | Profile `id` is a full ID like `openai/gpt-5.5`, not bare `gpt-5.5`; ID is in the live catalog                   |
| Wrong path / URL errors         | `baseUrl` is `https://llm.modellix.ai/v1/chat/completions` (include `/chat/completions`), not the media API host |
| Profile missing from model list | File is under `~/.junie/models/` or `.junie/models/`; selection uses `custom:` + filename without `.json`        |

## Related

* [Junie Custom LLMs](https://junie.jetbrains.com/docs/custom-llm-models.html) — profile schema and discovery
* [Models & Pricing](/llm/overview#models-and-pricing) — Model IDs and rates
* [LLM API guide](/llm/api/api) — protocols and curl examples
* [Hermes](/llm/agent/hermes) · [OpenClaw](/llm/agent/openclaw) — other OpenAI-compatible custom setups
