user message can carry images as content parts of type image_url. Models lists which models accept images.
Send an image
Add an image part to thecontent array, next to the text:
string
required
An absolute
https:// URL, or a data URL such as data:image/png;base64,<data>. The media type in a data URL must match the image data.string
auto, low or high. Optional.Accepted images
- A request over a limit fails with
413 request_too_large. An image in another format or from another source is rejected. - A data URL is part of the request body, so it counts toward the request body limit.
- Each image also uses input tokens.
Images sent by URL
The API downloads the image. The URL must:- resolve to a public address;
- contain no credentials;
- use at most 3 redirects;
- connect within 10 seconds and finish within 30 seconds;
- return a
2xxstatus with aContent-Typeofimage/png,image/jpegorimage/webp. A generic type such asapplication/octet-streamis rejected; - return the image uncompressed, without
Content-Encoding.