[ ABORT TO HUD ]
SEQ. 1

Base64 Tensors & Calculations

👁️ Vision & Multimodality⏱ 15 min⭐ 650 BASE XP⌨ HANDS-ON LAB

Direct Optical Processing

Claude treats images and PDFs as first-class citizens in the messages array. You pass visual data inside content blocks:

  • Base64 Images: Provide a source object with type: "base64", media_type (e.g., image/jpeg, image/png, image/gif, image/webp), and raw base64 data.
  • PDF Documents: Provide a source object with type: "base64" and media_type: "application/pdf".

Resolution and Token Costs

Claude automatically scales images that exceed maximum bounds. The optimal resolution is up to 1568px on the longest edge. Every image is converted into visual tokens. A typical 1024x768 image costs approximately 1,600 input tokens. Understanding this mapping is essential for managing costs in high-frequency vision applications.

PDF Document Processing

Claude natively supports PDF document ingestion - you can pass multi-page PDF documents directly as content blocks. Each page is processed visually and structurally, making it ideal for contract review, technical specifications, and financial reports.

⌨ HANDS-ON LABSubmit Multimodal Base64 Image Tensors
⭐ +200 XP

Send 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.
lab-sandbox — simulated environment
INFINITY LAB SANDBOX v2.6 — simulated shell
Type the command for the current objective. Helpers: "hint", "solution", "clear".
$
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 base64 source object
Only via external FTP
Plain text descriptions only