AI/ML API is a platform providing unified access to 300+ AI models including Deepseek, Gemini, ChatGPT, and more — with production-grade uptime and high rate limits.

Authentication

Set your AIMLAPI_API_KEY environment variable. Get your key at aimlapi.com.

export AIMLAPI_API_KEY=***

Example

Use 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.")

Params

ParameterTypeDefaultDescription
idstr"gpt-4o-mini"The specific model ID used for generating responses.
namestr"AIMLApi"The name identifier for the AI/ML API agent.
providerstr"AIMLApi:" + idThe provider of the model, combining "AIMLApi" with the model ID.
api_keyOptional[str]The API key for authenticating requests to the AI/ML API service. Retrieved from the environment variable AIMLAPI_API_KEY.
base_urlstr"https://api.aimlapi.com/v1"The base URL for making API requests to the AI/ML API service.
max_tokensint4096The maximum number of tokens to generate in the response.

AIMLApi also supports the params of OpenAI, where applicable.