How to use the OpenAI Vision Payload Builder tool
- Select Image file and choose a PNG, JPEG, GIF or WebP image up to 20 MiB.
- Type the model name in Model, for example gpt-4.1-mini.
- Write your instruction in Prompt, for example Describe this image.
- Select Build request to generate the JSON.
- Copy the JSON from the Result box or download it as payload.json, then send it with your own API key.
How a vision request carries an image
Chat-style vision APIs accept a user message whose content is an array of parts instead of a plain string. A text part holds the prompt. An image part of type image_url holds either a web address or a data URL with the picture inline. A data URL has three pieces: the media type, the marker base64 and the encoded bytes, as in data:image/jpeg;base64, followed by the data.
Inline images are the simplest option for local files, private images and anything behind a login, because the model provider never has to fetch a URL. The cost is size: the encoded image takes one third more space than the file.
The request body this vision payload builder produces
The output has a model string and a messages array with one user message. The text part comes first and the image part second. The media type in the data URL is taken from the file's signature bytes, so a PNG saved with a .jpg extension is still labeled image/png. The sample below is real output for a PNG of 1 by 1 pixel.
Spaces around the model name are trimmed. The prompt is used exactly as typed, including line breaks.
{
"model": "gpt-4.1-mini",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image."
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="
}
}
]
}
]
}Validation, limits and what is left out
The builder aims at a minimal, valid body that you can extend. These are the rules it applies and the parts it does not write for you.
- The file must start with a PNG, JPEG, GIF or WebP signature. Other data gives Expected PNG, JPEG, GIF or WebP bytes.
- The file size limit is 20 MiB. Provider limits for inline images are usually lower, so check them before sending.
- Model and Prompt must both contain text, or the tool reports Enter a model and prompt.
- The model name is not checked against any list. A typo is passed through unchanged.
- No system message, detail setting, token limit or temperature is added. Edit the JSON to include them.
- Exactly one image is embedded per run.
Sending the payload to an API
POST the JSON to the chat completions endpoint of your provider with a Content-Type of application/json and your bearer token. With curl, save the download and pass it with --data-binary @payload.json. That avoids shell quoting problems and the argument length limits that appear when a megabyte of Base64 is pasted on the command line.
Frequently asked questions
Does the builder send my image to OpenAI?
No. It makes no network request and never asks for an API key. The image is read and encoded inside your browser, and the request leaves your machine only when you send the JSON yourself.
Which image formats can I embed?
PNG, JPEG, GIF and WebP, identified by their leading bytes. HEIC photos from phones, SVG, BMP, TIFF and AVIF are rejected, so convert those to JPEG or PNG first.
Can I add more than one image to the request?
Not in one run. Build the request once, then run the tool again for the next image and copy its image_url part into the content array of the first request.
How large will the request be?
Expect the image size times 4/3, plus a data URL prefix of 22 or 23 characters and a few hundred characters of JSON and prompt. The AI Vision Size Estimator gives exact figures for a byte count.
Does it work with the Responses API or other providers?
The output follows the chat completions message layout with image_url parts. APIs that use a different shape, such as input_image parts or a source object with separate media type and data, need the JSON rearranged. The Base64 data itself can be reused.