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.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
