edit_image
Edit an existing image using AI text prompts, optional masks, and configurable size/format settings. Save the output to a filepath or receive a URL.
Instructions
Edit image(s) with the OpenAI Images Edit 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. | |
| mask_path | No | Optional absolute path to the edit mask image. | |
| overwrite | No | Allow replacing existing output files. | |
| background | No | Generated image background behavior. | |
| image_path | Yes | Absolute path to the source image to edit. | |
| 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. |