openai_image_generate
Generate still images, animated GIFs, or SVGs from text prompts, save them to a specified output directory, and return file paths for use in your workflow.
Instructions
Generate images (OpenAI images.generate): still images, animated GIF (output_format=gif) or SVG. Saves files to output_dir and returns their paths.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Number of images, 1-10 | |
| svg | No | SVG only (output_format=svg, n=1): author model and reasoning, e.g. {"model":"...","reasoning":{"effort":"high"}}. Needs SVG model-selection access; omit otherwise | |
| size | No | auto, 1024x1024, 1536x1024, 1024x1536, or WIDTHxHEIGHT (both multiples of 16, aspect 1:3 to 3:1, max 3840x2160). For GIF this is the size of each frame; keep it small (e.g. 512x512) to fit the pixel budget | |
| extra | No | Extra API params shallow-merged into the request last, e.g. {"complexity":"high"} | |
| model | No | Image model (default gpt-image-2.6-flare). e.g. gpt-image-2.6-flare (fast), gpt-image-2.6-sunburst (detail/precise edits), gpt-image-2.5-flare, gpt-image-2.5-sunburst | |
| prompt | Yes | Text prompt (max 32000 chars) | |
| quality | No | auto (default), low, medium, high, xhigh, max | |
| background | No | auto (default), opaque, transparent (transparent needs png, webp or svg) | |
| complexity | No | Planning effort, separate from quality: low, medium, high (2.6 default high) | |
| moderation | No | auto (default), low | |
| output_dir | Yes | Absolute directory to save images in. Follow your workspace conventions: the current project folder if any, else your own tmp dir. | |
| frame_count | No | GIF only: number of frames (default 9; SDK says 2-16, guide says 2-64). Describe the motion and a return to the starting pose in the prompt for a smooth loop | |
| output_format | No | png (default), jpeg, webp; generate also supports gif (animated) and svg | |
| frame_duration_ms | No | GIF only: ms per frame, 20-2000, rounded to 10 (default 200) | |
| safety_identifier | No | Optional stable hashed end-user id for OpenAI abuse monitoring | |
| output_compression | No | 0-100, jpeg/webp only |