Edit an image
edit_imageEdit an existing image with an instruction using an image-edit model. Returns signed output URLs or a job_id for the running job. Uses credits.
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>",
"image": "<image>"
},
"name": "edit_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image | Yes | The HTTPS URL of the image to edit, or a list of URLs on models that take several. | |
| model | Yes | Image-edit model id, such as `grok-imagine-image-2-0`. | |
| prompt | Yes | The edit instruction. | |
| parameters | No | Extra request fields passed through unchanged. Each model's supported parameters, ranges and defaults are listed in its model details. | |
| wait_seconds | No | Seconds to wait for the result before returning a job_id for the running job (default 40, max 50). |