Edit image
edit_imageEdit images with multipart uploads, JSON image URLs, or JSON arrays for supported GPT Image models.
Instructions
Edits an image using multipart image uploads, JSON image URLs, or the official JSON images array for supported GPT Image models.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"model": "<model>",
"prompt": "<prompt>"
},
"name": "edit_image"
}
}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. Multipar… | |
| 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 eac… | |
| prompt | Yes | ||
| 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 mo… | |
| moderation | No | ||
| resolution | No | ||
| compression | No | ||
| aspect_ratio | No | ||
| output_format | No | ||
| response_format | No | ||
| output_compression | No | ||
| X-TokenLab-Delivery-Policy | No | Per-request Delivery policy. Overrides the API key and Workspace defaults. Auto tries TokenLab Veri… |