AI / Claude Models Basics Interview Questions
What are Claude's multimodal capabilities — how does it process images and documents?
Claude's vision capabilities allow it to analyse and reason about images, PDFs, and screenshots alongside text. This makes it useful for document analysis, UI debugging, chart interpretation, and more.
import anthropic, base64 client = anthropic.Anthropic() # Option 1: URL-based image (Claude fetches from URL) response = client.messages.create( model="claude-opus-4-8", max_tokens=1024, messages=[{ "role": "user", "content": [ { "type": "image", "source": {"type": "url", "url": "https://example.com/chart.png"} }, {"type": "text", "text": "Describe this chart."} ] }] ) # Option 2: Base64-encoded image with open("image.jpg", "rb") as f: image_data = base64.standard_b64encode(f.read()).decode("utf-8") response = client.messages.create( model="claude-opus-4-8", max_tokens=1024, messages=[{ "role": "user", "content": [ { "type": "image", "source": {"type": "base64", "media_type": "image/jpeg", "data": image_data} }, {"type": "text", "text": "What is in this image?"} ] }] )
| Format / Limit | Detail |
|---|---|
| Supported types | JPEG, PNG, GIF, WebP |
| Max image size | 5 MB per image |
| Max images per request | Up to 600 images (100 for 200k context models like Haiku 4.5) |
| Max resolution | Resized to fit within 1568×1568 pixels — larger images scaled down |
| Token cost (small image) | ~1,000 tokens |
| Token cost (large image) | ~1,600 tokens (maximum) |
PDFs are also supported — they are converted to images internally and each page counts against the image limit. For documents, Claude can read text, interpret charts, and understand layout.
More Related questions...