> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Responses Image Agent File

> Attach a local image by filepath to a Responses API agent, overriding the MIME type if needed.

```python image_agent_file.py theme={null}
from pathlib import Path

import httpx
from agno.agent import Agent
from agno.media import Image
from agno.models.openai import OpenAIResponses

agent = Agent(
    model=OpenAIResponses(id="gpt-4o"),
    markdown=True,
)

image_path = Path(__file__).parent.joinpath("sample.jpg")

if not image_path.exists():
    resp = httpx.get(
        "https://picsum.photos/id/1/640/480",
        headers={"User-Agent": "agno-cookbook/1.0"},
        follow_redirects=True,
    )
    image_path.write_bytes(resp.content)

# Auto-detect MIME from file extension (.jpg -> image/jpeg)
agent.print_response(
    "Tell me about this image.",
    images=[Image(filepath=image_path)],
    stream=True,
)

# Explicit MIME type override
agent.print_response(
    "What do you see?",
    images=[Image(filepath=image_path, mime_type="image/jpeg")],
    stream=True,
)
```

## Run the Example

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno openai
    ```
  </Step>

  <Step title="Export your OpenAI API key">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export OPENAI_API_KEY="your_openai_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:OPENAI_API_KEY="your_openai_api_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the example">
    Save the code above as `image_agent_file.py`, then run:

    ```bash theme={null}
    python image_agent_file.py
    ```
  </Step>
</Steps>

Full source: [cookbook/90\_models/openai/responses/image\_agent\_file.py](https://github.com/agno-agi/agno/blob/main/cookbook/90_models/openai/responses/image_agent_file.py)
