Edit image
edit_image_fileEdit images using AI by providing a prompt and local image files. Supports GPT Image and xAI Grok Imagine models with mask, size, and quality options.
Instructions
Edit image Edits an image using multipart image uploads, JSON image URLs, or the official JSON images array for supported GPT Image models.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | ||
| mask | No | Pass local file path. | |
| size | No | ||
| user | No | ||
| async | No | ||
| image | No | Source image file(s). Repeat image for multiple source images. GPT Image edits accept up to 16 images; xAI Grok Imagine edit models accept at most 3 source images. Pass local file paths. | |
| model | Yes | Model to use for image edits. Send this explicitly, for example gpt-image-2. | |
| prompt | Yes | ||
| image[] | No | Alternative repeated multipart field name for multiple source images. The same model-specific limits apply: GPT Image up to 16, xAI Grok Imagine up to 3. Pass local file paths. | |
| quality | No | ||
| background | No | ||
| moderation | No | ||
| resolution | No | ||
| compression | No | ||
| aspect_ratio | No | ||
| output_format | No | ||
| response_format | No | ||
| output_compression | No |