Generate image
generate_imageStart generating a NEW image from a text prompt in a thread (create one with create_thread first). Spends credits; use estimate_cost first if unsure. Optionally pass sourceFileIds (file ids from upload_image or the library) as visual inputs. Use @Name to reference a named reference. Returns immediately with a nodeId and status; poll get_generation_status until it is COMPLETED or FAILED.
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": {
"threadId": "<threadId>",
"prompt": "<prompt>"
},
"name": "generate_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | What to generate. | |
| quality | No | Image quality. Defaults to high. | |
| modelKey | No | Optional model key from list_models; overrides quality-based routing. | |
| threadId | Yes | Thread to generate in. | |
| aspectRatio | No | Aspect ratio. Defaults to auto. | |
| sourceFileIds | No | Optional input image file ids. |