Image As Input

Pass images to agents for analysis and description.

Agno supports images as input to agents and teams. Take a look at the compatibility matrix to see which models support images as input.

Let's create an agent that can understand images and make tool calls as needed.

image_input.py
from agno.agent import Agent
from agno.media import Image
from agno.models.openai import OpenAIResponses
from agno.tools.hackernews import HackerNewsTools

agent = Agent(
    model=OpenAIResponses(id="gpt-5.2"),
    tools=[HackerNewsTools()],
    markdown=True,
)

agent.print_response(
    "Describe this image, then separately summarize the current top Hacker News stories.",
    images=[
        Image(
            url="https://upload.wikimedia.org/wikipedia/commons/0/0c/GoldenGateBridge-001.jpg"
        )
    ],
    stream=True,
)

Usage

Set up your virtual environment

uv venv --python 3.12
source .venv/bin/activate

Install dependencies

uv pip install -U openai agno

Export your OpenAI API key

  export OPENAI_API_KEY="your_openai_api_key_here"

Run Agent

python image_input.py