> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-service-account.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AI/ML API

> Configure models served through the AI/ML API OpenAI-compatible endpoint.

`AIMLAPI` sends OpenAI-compatible requests to the AI/ML API endpoint.

```python theme={null}
from agno.models.aimlapi import AIMLAPI

model = AIMLAPI(id="gpt-4o-mini")
```

```bash theme={null}
uv pip install -U agno openai
export AIMLAPI_API_KEY=***
```

See the [AI/ML API documentation](https://docs.aimlapi.com/?utm_source=agno\&utm_medium=github\&utm_campaign=integration) for available model IDs.

## Parameters

| Parameter    | Type            | Default                        | Description                            |
| ------------ | --------------- | ------------------------------ | -------------------------------------- |
| `id`         | `str`           | `"gpt-4o-mini"`                | Model ID                               |
| `name`       | `str`           | `"AIMLAPI"`                    | The name of the model                  |
| `provider`   | `str`           | `"AIMLAPI"`                    | The provider of the model              |
| `api_key`    | `Optional[str]` | `None`                         | API key. Defaults to `AIMLAPI_API_KEY` |
| `base_url`   | `str`           | `"https://api.aimlapi.com/v1"` | AI/ML API base URL                     |
| `max_tokens` | `int`           | `4096`                         | Maximum number of tokens to generate   |

`AIMLAPI` extends [OpenAILike](/reference/models/openai-like) and accepts all of its parameters.
