Skip to main content
Some questions you can only show — a chart, a screenshot, a product photo, a scanned document. Attach the image directly and the agent answers from the pixels instead of your paraphrase: pass it next to your text in a user message and ask in the same request. For formats, size limits, the request spec, and pricing, see Image Attachments.

Attach an image

An image is one input_image content part inside a user message, sitting next to your input_text. The image_url field takes a public HTTPS URL or a base64 data URI for a local file. This example points the agent at a hosted photo and asks about it.
from perplexity import Perplexity

client = Perplexity()

response = client.responses.create(
    model="openai/gpt-5.5",
    input=[
        {
            "role": "user",
            "content": [
                {"type": "input_text", "text": "What's in this photo?"},
                {
                    "type": "input_image",
                    "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
                },
            ],
        }
    ],
)

print(response.output_text)
To send a local file instead, base64-encode it into a data URI and pass that as the image_url — the request shape is identical.

When to reach for it

  • Read a chart, dashboard, or table and report the trend or numbers
  • Debug from a screenshot of an error, a UI state, or a stack trace
  • Identify what’s in a photo — a product, a landmark, a species, a part
  • Pull text and structure out of a document scan, receipt, or form

Next steps

Give it tools

Combine image input with web search and other tools.

Image Attachments

Formats, size limits, request format, and pricing.