Generate Image
generate_imageGenerate or EDIT an image. This is the tool for ALL image models (kind=image — flux-1-schnell, recraft-v3, gpt-image-2, gemini-3.1-flash-image, nano-banana, etc.). Synchronous — the call returns when the image is done: about 5 s for flux-1-schnell, 10–40 s for most others, usually under 2 min for gpt-image-2 at high quality — keep the connection open up to 5 min (the server's limit); if your client times out, retrying the identical call while it still runs returns the same image without a second charge. Returns { imageUrl, modelId } DIRECTLY — there is no job to poll and no get_job step (that's video only). IMAGE-TO-IMAGE: pass referenceImageUrl (a public image URL) to edit/restyle a source image while preserving its subjects — use modelId "nano-banana" for best identity/element preservation (e.g. keep a logo or face, redesign around it). Only models whose supports include image-to-image (list_models with modelId shows it; plus flux-1.1-pro, which uses it as a style prompt) take a reference; others refuse it. Do NOT pass image models to generate_video. For end-user choice among candidates, prefer pick_reference_images. Scope required: generate:image.
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": {
"prompt": "<prompt>"
},
"name": "generate_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | What to generate, or for an edit what to change (at least 3 characters). | |
| modelId | No | Image model id from list_models (kind image). Default flux-1-schnell. | flux-1-schnell |
| aspectRatio | No | Image shape. Default 16:9. | 16:9 |
| referenceImageUrl | No | Public URL of a source image to edit or restyle (image-to-image); nano-banana preserves subjects best. Omit for text-to-image. | |
| reference_image_url | No | Alias of referenceImageUrl (the spelling generate_video uses), used only when that is not sent. |