AIMLAPI sends OpenAI-compatible requests to the AI/ML API endpoint.
Parameters
AIMLAPI extends OpenAILike and accepts all of its parameters.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Configure models served through the AI/ML API OpenAI-compatible endpoint.
AIMLAPI sends OpenAI-compatible requests to the AI/ML API endpoint.
from agno.models.aimlapi import AIMLAPI
model = AIMLAPI(id="gpt-4o-mini")
uv pip install -U agno openai
export AIMLAPI_API_KEY=***
| 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 and accepts all of its parameters.Was this page helpful?