images_generate
Generates an image from a text prompt (Gemini 2.5 Flash Image, with Seedream and OpenAI as automatic fallbacks; model picks one). Returns a file_id consumable by messages.send(attachments=[...]) and other file-aware tools. Supports up to 12 reference image file_ids for subject-consistent edits and composition (use file IDs from the [ATTACHMENTS] block, files.search, or search.files). Latency: ~8-30s per image. Output: PNG or JPEG.
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": "images_generate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Which generator draws. 'auto' (default): Gemini 2.5 Flash Image, and Seedream then OpenAI if Gemini is unavailable. 'gemini', 'seedream' (ByteDance Seedream, strong at edits from a reference) or 'openai' (gpt-image-2, best at keeping a reference's details; set quality) use only that one, and report its failure. | auto |
| prompt | Yes | Text description of the image to generate (3-4000 chars). | |
| quality | No | OpenAI only: 'low' (cheapest, drafts), 'medium', 'high' (finest detail, several times dearer) or 'auto' (default). Ignored by the other models. | auto |
| aspect_ratio | No | Output aspect ratio. | 1:1 |
| in_workspace | No | Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected. | |
| reference_file_ids | No | Optional list of up to 3 file_ids whose images should be used as visual references (for edits, subject consistency, or composition). Files must be image MIME types (image/png, image/jpeg, image/webp, image/gif). |