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

> Point Agno agents at Modellix with OpenAILike base_url, a Modellix API key, and provider/name model IDs.

Use [Agno](https://docs.agno.com/models/overview) against the Modellix LLM gateway. Agno provides [`OpenAILike`](https://docs.agno.com/models/providers/openai-like) for any OpenAI-compatible Chat Completions endpoint — set `base_url` to `https://llm.modellix.ai/v1` and `id` to a Modellix `provider/name` Model ID.

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

  Modellix model IDs are `provider/name` (for example `openai/gpt-5.5`). Pass that full string as `OpenAILike(id=...)`. Do not rely on a bare string like `model="openai:gpt-5.4"` — that uses Agno's built-in OpenAI provider defaults, not Modellix. See [Models & Pricing](/llm/overview#models-and-pricing).
</Note>

## Set Up Agno

<Steps>
  <Step title="Install Agno">
    ```bash theme={null}
    pip install "agno[openai]"
    ```

    Or with [uv](https://docs.astral.sh/uv/):

    ```bash theme={null}
    uv pip install "agno[openai]"
    ```
  </Step>

  <Step title="Set Credentials">
    Create a Modellix API key in the [console](https://modellix.ai/console/api-key):

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

    | Setting                        | Value                                        |
    | ------------------------------ | -------------------------------------------- |
    | `api_key` / `MODELLIX_API_KEY` | Modellix API Key                             |
    | `base_url`                     | `https://llm.modellix.ai/v1` (include `/v1`) |
    | `id`                           | Exact Modellix Model ID (`provider/name`)    |

    <Warning>
      Use a Modellix key, not an OpenAI platform key. Do not point Agno at the media host (`https://api.modellix.ai`).
    </Warning>
  </Step>

  <Step title="Create an Agent with OpenAILike">
    ```python theme={null}
    from os import getenv
    from agno.agent import Agent
    from agno.models.openai.like import OpenAILike

    agent = Agent(
        model=OpenAILike(
            id="openai/gpt-5.5",
            api_key=getenv("MODELLIX_API_KEY"),
            base_url="https://llm.modellix.ai/v1",
        ),
        markdown=True,
    )

    agent.print_response("Introduce yourself in one sentence.", stream=True)
    ```

    Change `id` to any catalog Model ID (`anthropic/claude-sonnet-5`, `google/gemini-3.6-flash`, and so on). Traffic still uses Chat Completions on `https://llm.modellix.ai/v1`.
  </Step>

  <Step title="Optional: Retries and Streaming">
    ```python theme={null}
    model = OpenAILike(
        id="openai/gpt-5.5",
        api_key=getenv("MODELLIX_API_KEY"),
        base_url="https://llm.modellix.ai/v1",
        retries=2,
        delay_between_retries=1,
        exponential_backoff=True,
    )

    agent = Agent(model=model, markdown=True)
    agent.print_response("Write a one-line haiku about APIs.", stream=True)
    ```

    Model-level retries cover transient provider errors (rate limits, server errors). Auth and invalid-request failures are not retried.
  </Step>

  <Step title="Optional: Responses API">
    Modellix also exposes [`POST /v1/responses`](/llm/responses). For OpenAI-compatible Responses / Open Responses style clients, Agno documents `OpenResponses` with a custom `base_url`:

    ```python theme={null}
    from agno.agent import Agent
    from agno.models.openai import OpenResponses

    agent = Agent(
        model=OpenResponses(
            id="openai/gpt-5.5",
            api_key=getenv("MODELLIX_API_KEY"),
            base_url="https://llm.modellix.ai/v1",
        ),
    )

    agent.print_response("Say hello in one short sentence.")
    ```

    Prefer `OpenAILike` (Chat Completions) first unless you specifically need the Responses path. Class names and imports can vary by Agno version — check the [OpenAI-like](https://docs.agno.com/models/providers/openai-like) and [Models overview](https://docs.agno.com/models/overview) pages for your release.
  </Step>
</Steps>

## Troubleshooting

| Symptom               | Check                                                                                  |
| --------------------- | -------------------------------------------------------------------------------------- |
| Still hitting OpenAI  | Use `OpenAILike(..., base_url="https://llm.modellix.ai/v1")`, not `model="openai:..."` |
| 401 Unauthorized      | `api_key` / `MODELLIX_API_KEY` is a valid Modellix key                                 |
| Model not found / 404 | `id` is a full ID like `openai/gpt-5.5`, not bare `gpt-5.5`                            |
| Wrong path            | `base_url` is `https://llm.modellix.ai/v1` (include `/v1`)                             |
| Import errors         | Install `agno[openai]`; confirm `OpenAILike` import path for your Agno version         |

## Related

* [Agno models overview](https://docs.agno.com/models/overview) — model configuration and retries
* [OpenAI-compatible models](https://docs.agno.com/models/providers/openai-like) — `OpenAILike` + custom `base_url`
* [OpenAI SDK](/llm/sdk/openai-sdk) — same `/v1` gateway without Agno
* [CrewAI](/llm/framework/crewai) — another Python agent framework on Chat Completions
* [Models & Pricing](/llm/overview#models-and-pricing) — Model IDs and rates
* [LLM API guide](/llm/api/api) — protocols and curl examples
