This section has moved to Images API.
Generate images
Use theimage_generation tool to create images from text prompts. The model interprets your message, generates a prompt for the image model, and returns the result.
Image generation models
Image generation options
image_generation_call item with the generated image URL and the revised prompt used by the image model:
result field contains a URL to the generated image. The revised_prompt shows the expanded prompt the image model used — the LLM enhances your brief instruction into a detailed image description.
Force image generation
Usetool_choice to ensure the model generates an image rather than responding with text only.
Image output structure
The responseoutput array contains these items when an image is generated:
function_call— the model’s call to the image generation tool with the refined promptimage_generation_call— the generation result withstatus: "completed"andresult(image URL)function_call_output— the raw tool output containing the URLmessage— the model’s text response describing or referencing the image