generate_image
Create images from text prompts with configurable size, quality, and format. Save output to a file or receive a URL.
Instructions
Generate image(s) with the OpenAI Images API. SSE/HTTP transports auto-save files and return image URLs; stdio requires filepath.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Number of images to generate. | |
| size | No | Image size. Supported values: auto, 256x256, 512x512, 1024x1024, 1536x1024, 1024x1536, 1792x1024, 1024x1792. Some models only support a subset. | |
| prompt | Yes | Image generation prompt. | |
| quality | No | Image generation quality. | |
| filepath | Yes | Absolute path where the generated image should be saved. | |
| overwrite | No | Allow replacing existing output files. | |
| background | No | Generated image background behavior. | |
| moderation | No | Image moderation strictness. | |
| output_format | No | Output image format. jpg is normalized to jpeg for the API request. | |
| output_compression | No | Compression level for jpeg or webp outputs, from 0 to 100. |