generate_image
Create an image from a text prompt and save it to disk, using ChatGPT/Codex when signed in or a free FLUX backend otherwise. Returns the saved path or a job ID for long generations to poll.
Instructions
Generate an image from a text prompt and save it to disk. Uses the ChatGPT/Codex plan when signed in, otherwise a free FLUX backend. Returns the image and saved path, or a job_id when generation takes longer than ~50 seconds; in that case call get_image_job with the job_id.
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 |
|---|---|---|---|
| size | No | Output size. Defaults to 1024x1024. | |
| prompt | Yes | Detailed description of the image: subject, setting, composition, lighting, style, and any constraints. | |
| backend | No | auto (default) tries the ChatGPT/Codex plan, then falls back to free FLUX. Use 'pollinations' to force the free backend. | |
| filename | No | Optional base filename, e.g. 'hero-banner'. The extension is chosen automatically. |