generate_image
Generate images with OpenAI gpt-image-2.5 using your own API key, saving them locally and returning file paths plus the cost of each run.
Instructions
Generate an image with OpenAI gpt-image-2.5 using the user's own API key; saves it locally and returns the file paths and cost. Without a requested spec use 2K 16:9 + high (about $0.06). 4K, xhigh, max or several images cost more — tell the user the rough cost first. Always tell the user what each run cost.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | number of images | |
| mask | No | absolute path of a mask PNG (transparent = repaint); requires reference images | |
| name | No | short file name prefix | img |
| size | No | e.g. "2K 16:9", "4K 9:16", "1K 1:1", "2560x1440" or "auto" | 2K 16:9 |
| model | No | gpt-image-2.5-sunburst | |
| prompt | Yes | prompt (positive description of the image) | |
| quality | No | high | |
| moderation | No | auto | |
| reference_images | No | absolute local paths of reference images, up to 16 |