Tutorials · Chapter D (4/4) · ~10 min
Multimodal API lab
Try it → see it → read → next
Send **image + text** in one chat request — vision models read pixels, you verify outputs.
Try tools: Code & developers
Try yourself
Playground
Vision API wiring
Image in → text out — same chat API, multimodal message parts.
- Base64 or URL-encode image
- User message with image + text parts
- POST chat/completions with vision model
- Parse text answer — verify before act
Recap
What you just did
You stepped through encode → multimodal message → API call → parse.
Read
Message shape
{
"role": "user",
"content": [
{ "type": "text", "text": "What's in this diagram?" },
{ "type": "image_url", "image_url": { "url": "data:image/png;base64,..." } }
]
}
Read
Safety
- Don't log raw customer images
- Block EXIF/metadata leaks in public demos