Skip to main content
This example uses c4ai-aya-vision-8b, which Cohere retired on April 4, 2026. Replace it with command-a-vision-07-2025 before running. See Cohere’s retirement notice.
image_agent_bytes.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your Cohere API key

4

Use Command A Vision

Replace c4ai-aya-vision-8b with command-a-vision-07-2025 in the saved Python file before running.
5

Add the sample image

Place a JPEG named sample.jpg in the same directory as the saved Python file.
6

Run the example

Save the code above as image_agent_bytes.py, then run:
Full source: cookbook/90_models/cohere/image_agent_bytes.py