Generate an image
generate_imageGenerates images from a prompt, or edits and combines reference images when image_urls is given (GPT Image 2.5: openai/gpt-image-2.5/flare/text-to-image, openai/gpt-image-2.5/flare/edit). background: transparent makes sprites and props with no background to remove. Billed against your credits; waits up to wait_seconds, then returns the request_id to follow with generate_status.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt": "<prompt>"
},
"name": "generate_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | What to draw, or with image_urls how to edit or combine them, up to 5,000 characters, e.g. `pixel-art knight sprite, side view` | |
| options | No | Any other input the model takes, per generate schema of its endpoint; the fields above win | |
| quality | No | Rendering quality from `low` (quick drafts) to `max`; higher takes longer and may cost more (see generate pricing). `auto` lets the model choose; omit for the model's default | |
| background | No | `transparent` leaves no background, for sprites and props; `opaque` always fills one; `auto` lets the model choose. Omit for the model's default | |
| image_size | No | A preset; pass `{width, height}` through options for an exact size | |
| image_urls | No | Images to edit or combine | |
| num_images | No | How many images to make from the one prompt, 1 to 4; omit for the model's default | |
| wait_seconds | No | How long to wait for the result before returning the request id |