Edit image
edit_imageEdit images by providing a prompt and source images via multipart upload, URL, or JSON array, with optional mask editing.
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 | Optional JSON mask reference for image edits. Provide exactly one of image_url or file_id. Multipart requests can also send mask as a file part. | |
| size | No | ||
| user | No | ||
| async | No | Return a task before the edited image is ready for models that support public async execution. | |
| model | Yes | Model to use for image edits. Send this explicitly. | |
| images | No | Official JSON image references for image edits. Provide exactly one of image_url or file_id for each item. GPT Image edits accept up to 16 source images; xAI Grok Imagine edit models accept at most 3 source images. | |
| prompt | Yes | ||
| stream | No | Image streaming is not exposed through MCP tool calls; omit stream or set it to false. | |
| quality | No | ||
| image_url | No | Single source image URL. Kept for TokenLab compatibility; use images for the official JSON shape. | |
| background | No | ||
| image_urls | No | Multiple source image URLs. GPT Image edits accept up to 16 source images; xAI Grok Imagine edit models accept at most 3 source images. | |
| moderation | No | ||
| resolution | No | ||
| compression | No | ||
| aspect_ratio | No | ||
| output_format | No | ||
| response_format | No | ||
| output_compression | No |