Authentication
Set yourAIMLAPI_API_KEY environment variable. Get your key at aimlapi.com.
Example
UseAI/ML API with your Agent:
Params
AIMLApi also supports the params of OpenAI, where applicable.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
You are viewing v1 docs. For the latest documentation, visit docs.agno.com
Learn how to use AI/ML API with Agno.
AIMLAPI_API_KEY environment variable. Get your key at aimlapi.com.
export AIMLAPI_API_KEY=***
setx AIMLAPI_API_KEY ***
AI/ML API with your Agent:
from agno.agent import Agent
from agno.models.aimlapi import AIMLApi
agent = Agent(
model=AIMLApi(id="meta-llama/Llama-3.2-11B-Vision-Instruct-Turbo"),
markdown=True,
)
agent.print_response("Explain how black holes are formed.")
| Parameter | Type | Default | Description |
|---|---|---|---|
id | str | "gpt-4o-mini" | The specific model ID used for generating responses. |
name | str | "AIMLApi" | The name identifier for the AI/ML API agent. |
provider | str | "AIMLApi:" + id | The provider of the model, combining "AIMLApi" with the model ID. |
api_key | Optional[str] | – | The API key for authenticating requests to the AI/ML API service. Retrieved from the environment variable AIMLAPI_API_KEY. |
base_url | str | "https://api.aimlapi.com/v1" | The base URL for making API requests to the AI/ML API service. |
max_tokens | int | 4096 | The maximum number of tokens to generate in the response. |
AIMLApi also supports the params of OpenAI, where applicable.Was this page helpful?