> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-service-account.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Image analysis example using CometAPI with vision models

> Stream an image description from a vision model through CometAPI.

```python image_agent.py theme={null}
"""
Image analysis example using CometAPI with vision models.
"""

from agno.agent import Agent
from agno.media import Image
from agno.models.cometapi import CometAPI

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------

# Use a vision-capable model from CometAPI
agent = Agent(
    model=CometAPI(id="gpt-4o"),  # GPT-4o has vision capabilities
    markdown=True,
)

agent.print_response(
    "Describe this image in detail and tell me what you can see",
    images=[
        Image(
            url="https://httpbin.org/image/png"  # Reliable test image
        )
    ],
    stream=True,
)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    pass
```

## 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 environment variables">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export COMETAPI_KEY="your_cometapi_key_here"
      ```

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

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

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

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