Base64 Tensors & Calculations — Vision & Multimodality
[ ABORT TO HUD ]
SEQ. 1
Base64 Tensors & Calculations
Direct Optical Processing
Claude treats images and PDFs as first-class citizens in the messages array via structured content blocks:
- Base64, URL & File Images: Provide a
sourceobject withtype: "base64"(image/jpeg,image/png,image/gif,image/webp),type: "url"(direct HTTPS URL), ortype: "file"(Files APIfile_id). - PDF Documents: Provide a
documentblock withtype: "base64",type: "url", ortype: "file"(application/pdf).
Resolution and Token Costs
Claude maps images into visual grid tokens (~ceil(width/28) * ceil(height/28)) and automatically scales oversized inputs (1568px standard long-edge optimal cap, up to 2576px on high-resolution tiers). A typical 1024x768 image costs ~1,100–1,600 input tokens.
PDF Document Processing
Claude natively ingests multi-page PDFs both visually (charts, tables, diagrams) and textually—ideal for contract review, engineering blueprints, and financial filings.
⌨ HANDS-ON LABSubmit Multimodal Base64 Image Tensors
⭐ +200 XPSend image data to Claude's vision encoder. Package a base64-encoded image into the user content array alongside a text prompt.
1POST to /v1/messages passing a content array with both an image block (type: image, source: base64) and a text prompt block.
OBJECTIVE 1 / 1 — type "hint" if stuck
SYNAPSE VERIFICATION
QUERY 1 // 2
How are visual image payloads passed to Claude in the Messages API?
Email attachments
Inside content blocks with type 'image' and a structured source object (base64, url, or file_id)
Only via external FTP
Plain text descriptions only