Skip to main content
Text to image is a single request to an image model. Most image models expose several operations, usually generate and edit, so the request must name one. Omitting operation returns error.code: "run.operation_required" with the valid names in the message. The example below uses GPT Image 2, which takes a quality tier and a resolution alongside the operation name.
The file lands on image.url when the run completes, and the asset_id on outputs feeds straight into another run, as in Animate an image.