Use Images in Prompts with a Multimodal Model
30-second answer
A multimodal model such as GPT-4.1, GPT-4o or the GPT-5 family can read images as part of a prompt. In the Foundry chat playground you attach a photo and ask about it. In code you send a user message with an input_text part and an input_image part, where the image is an https URL or a base64 data URL. The model describes, compares, reads text or answers questions about the image, but it can still misread small details, so ask specific questions and check important answers.
Simulate it » No Azure account neededExam objective: 2.3.1 Interpret visual input in prompts by using a deployed multimodal model. (Skills measured as of April 15, 2026)
Simulations
Feel it before you read it. No account needed, nothing leaves this page.
Use a <strong>multimodal</strong> deployment such as gpt-4.1-mini, which accepts images as well as text.
👆 Click the glowing item in the portal to continue
Read the steps as text
- Use a multimodal deployment such as gpt-4.1-mini, which accepts images as well as text.
- Attach a photo with the 📎 button and ask a question about it.
- In code, send an input_image part (a URL or base64 data) next to the input_text.
- Models reason about images; Azure Vision returns structured results.
🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.
🖱️ Drag to rotate · scroll or pinch to zoom
Computer vision
A photo goes in. Vision models return a caption, tags, objects with boxes, and any printed or handwritten text (OCR). A multimodal chat model can also answer questions about the picture.
🤔 What happens if…
Read this tour as text
- Five workload lanes. Most AI apps fall into a few workloads: generative and agentic AI, text analysis, speech, computer vision and information extraction. Each lane here takes a different kind of input and turns it into something useful.
- Text analysis. A hotel review goes in. Azure Language returns the sentiment (positive, neutral, negative), key phrases, named entities (people, places, dates), PII and a short summary.
- Speech to text. Speech recognition turns spoken audio into text: live captions, call transcripts, voice commands. It can also translate speech into another language as you talk.
- Text to speech. Speech synthesis turns text into natural speech with a neural voice. SSML lets you control speed, pitch and pauses. Think audiobooks, voice assistants and accessibility readers.
- Computer vision. A photo goes in. Vision models return a caption, tags, objects with boxes, and any printed or handwritten text (OCR). A multimodal chat model can also answer questions about the picture.
- Image generation. Image-generation models work the other way round: a text prompt goes in and a brand-new image comes out. Guardrails block harmful requests, and generated images are marked with content credentials.
- Extract from documents. Azure Content Understanding reads an invoice and returns fields you defined (vendor, date, total) with a confidence score for each, so low-confidence values can go to a person.
- Extract from audio and video. The same service handles media: an audio call becomes a transcript with speakers and a summary; a video is split into segments with key frames, descriptions and chapters.
Ask a multimodal model about a photo, generate a brand-new image from a prompt, then do both from a Python app.
🎓 Education-only simulation. Your lab is saved in this browser, so you can leave and continue later.
😟 THE PROBLEM
Insurance agents describe car damage by hand from photos.
😊 THE SOLUTION
Ask a multimodal model about each photo.
- Photos need describing✓ input_image in the prompt
- Specific questions about images✓ Ask them in plain words
- Need consistent fields✓ Ask for JSON output
Start with a question
What if you could show the model a photo instead of describing it?
Try explaining a dented car bumper in words: “it’s a small dent, sort of left of the number plate, maybe the size of a cricket ball”. Now just take a photo.
Multimodal models can look. You send the picture with your question, and the model answers about what it sees. An insurance clerk, a shopkeeper or a student with a confusing diagram can all skip the long description.
Explain it like I’m 10
The technical explanation
Models such as GPT-4.1, GPT-4o and the GPT-5 family accept images in the prompt. The model card in the Foundry model catalog lists the supported inputs, so check it says image input before you deploy.
In the chat playground
Open your multimodal deployment in the chat playground, attach an image to the message, and ask a question. The system message still applies, so you can say “You are an insurance assessor. Describe visible damage only, and don’t guess the repair cost.” It’s the fastest way to see whether the model handles your kind of image.
In code
With the Foundry SDK, the user message holds a list of content parts: input_text for the question and input_image for the picture.
import base64, os
from azure.identity import DefaultAzureCredential
from azure.ai.projects import AIProjectClient
project = AIProjectClient(endpoint=os.environ["FOUNDRY_PROJECT_ENDPOINT"], credential=DefaultAzureCredential())
openai = project.get_openai_client()
# A local photo becomes a base64 data URL
with open("bumper.jpg", "rb") as f:
data_url = "data:image/jpeg;base64," + base64.b64encode(f.read()).decode("utf-8")
response = openai.responses.create(
model="gpt-4.1", # a multimodal deployment name
instructions="You are an insurance assessor. Describe visible damage only.",
input=[{
"role": "user",
"content": [
{"type": "input_text", "text": "Where is the damage on this car, and how large does it look?"},
{"type": "input_image", "image_url": data_url},
# or an online image: {"type": "input_image", "image_url": "https://example.com/bumper.jpg"}
],
}],
)
print(response.output_text)
You can put several images in one message, for example “before” and “after” photos, and ask the model to compare them.
https URL
- Image is already online
- Small request
- The service must be able to fetch the link
Base64 data URL
- Image is on the device or private
- Works without a public link
- Bigger request, so resize big photos
Getting good answers from images
| Do | Why |
|---|---|
| Ask a specific question (“What’s the expiry date on the label?”) | Vague prompts get vague descriptions |
| Send a clear, well-lit, upright image, cropped to what matters | Blur, rotation and clutter cause misreads |
| Tell it to say when it’s unsure | Cuts down confident guesses |
| Check counts, small text and measurements | These are common weak spots |
| Keep a person in the loop for medical, legal or safety decisions | The model can be wrong and isn’t accountable |
Images cost tokens like text does, and bigger or higher-detail images use more. Your deployment’s guardrails (content filters) check image inputs too, and you shouldn’t send images of people without a good reason and their awareness.
Architect level The image detail setting
The input_image part can take an optional detail value: low, high or auto. Low sends a small version of the image and uses far fewer tokens, which is fine for “is this a cat or a dog?”. High lets the model look at tiles of the full image, which helps with small print and fine detail but costs more tokens. Auto lets the service choose.
Real-world business scenario
Fabrikam Insurance
- The problem
- Motor claims arrived with phone photos and short, unclear descriptions. Assessors spent the first ten minutes of each claim just working out what was damaged.
- What they used
- The claims app sends each photo as a base64 input_image to a gpt-4.1 deployment with a system message that asks for visible damage, location and a confidence note, and never a payout amount.
- Why that choice
- A multimodal model handles any angle and any car without training a custom model, and the system message keeps it to description, not decisions.
- The result
- Assessors start each claim with a short damage summary to check, while the payout decision stays with a person.
When to use it and when not to
✓ Use it when…
- Users can show the problem faster than they can describe it.
- Questions about images vary, so a fixed analysis feature would be too rigid.
- You want to compare images, explain a diagram or read a label in context.
✕ Think twice when…
- You need exact counts, measurements or bounding boxes. Use a dedicated vision feature and check results.
- High-stakes decisions such as diagnosis without a qualified person reviewing.
- Identifying people from their faces. Face recognition is limited access and needs a strong reason.
↔ Alternatives to consider
- Azure Vision in Foundry Tools for captions, tags, objects and OCR.
- Content Understanding to pull defined fields out of images.
- gpt-image-1 when you need to create or edit an image.
Test yourself with exercises
5 original practice questions in the AI-901 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.
Interview preparation
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner How do you ask a model a question about a photo?
Model answer
Use a deployed multimodal model like gpt-4.1. In the Foundry chat playground I attach the image and type the question. In code I send a user message with a text part and an input_image part holding a URL or base64 image.
Interviewer follows up
Does every model accept images?
You
No. The model card lists the input types. Text-only models and most small models can't take images.
Intermediate When would you send an image as base64 instead of a URL?
Model answer
When the image is on the user's device or in private storage the model can't reach, such as an insurance claim photo. A public https URL is fine for images that are already online. Base64 makes the request bigger, so I resize large photos first.
Experienced developer Would you use a multimodal model or Azure Vision to read meter numbers from thousands of photos?
Model answer
For a fixed job at volume, like reading printed numbers, Azure Vision's OCR or a Content Understanding analyzer gives structured, repeatable output. A multimodal model shines when the question changes, like 'is this meter damaged, and what would you check next?'. I'd often combine them.
Scenario Your model keeps miscounting items on a shelf photo. What do you do?
Model answer
Send a higher-detail or cropped image, ask a narrower question ('count only the red packets on the top shelf'), and tell it to say if it's unsure. If counts must be exact, I'd use a dedicated object detection approach and keep a person checking the results.
Quick revision
Key points
- Multimodal models (GPT-4.1, GPT-4o, GPT-5 family) accept images alongside text.
- In the chat playground, attach an image to your message and ask about it.
- In code, the user content has input_text and input_image parts.
- input_image takes an https URL or a base64 data URL (data:image/jpeg;base64,...).
- Ask specific questions, keep images clear, and check important answers. Guardrails apply to images too.
Important terminology
- Multimodal model
- A model that accepts more than one kind of input, here text plus images.
- input_image
- The Responses API content part that carries an image as an https URL or a base64 data URL.
- Data URL
- An image embedded as text, in the form data:image/jpeg;base64,... so the model doesn't need to fetch a link.
- Image detail
- An optional setting (low, high or auto) that trades image resolution, and so tokens, against detail.
- Azure Vision in Foundry Tools
- The Foundry Tools service for fixed image analysis such as captions, tags, objects and OCR.
Common mistakes
- Sending an image to a text-only deployment and expecting it to see the picture.
- Trusting exact counts, tiny text or measurements without checking.
Exam tips
- "Ask questions about a photo in a prompt" = multimodal model with an input_image part.
- "Fixed captions, tags or OCR at scale" = Azure Vision or Content Understanding instead.
Five quick revision questions
-
1.Which content part carries an image in the Responses API?Show
input_image
-
2.Name two ways to pass the image.Show
An https URL or a base64 data URL.
-
3.Where can you try image prompts without code?Show
The chat playground in the Foundry portal.
-
4.Do content filters apply to image prompts?Show
Yes, guardrails check image inputs too.
-
5.Name one task multimodal models often get wrong.Show
Exact counting, small text or precise measurements.
Official references
Finished this lesson? Tick it off. Your progress is saved in this browser.
Next up: Generate Images with Generative Models
Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges.