Generate or edit an image
generate_imageGenerate or edit images from text prompts, using any OpenAI-compatible provider, and store output images to disk for later use.
Instructions
Generate an image, or edit existing images, via an OpenAI-compatible provider.
Model selection
model accepts three forms:
provider:model— explicit, e.g.openrouter:google/gemini-3.1-flash-image-preview,openai:gpt-image-1,xai:grok-imagine-image-2.0. Fastest and unambiguous.a bare model id — searched across every configured provider's catalogue (run
list_modelsfirst). Ambiguous ids raise an error listing candidates.an alias — defined in
providers.json(e.g.nb2).
If omitted, the configured default model is used.
Editing
Pass input_image_path (and optionally input_image_paths) and the
prompt becomes an edit instruction. Requirements vary by provider.
Output
Images are always written to disk and their paths returned. Set
return_image_content=true to additionally embed the images in the tool
result so the model can look at them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | ||
| seed | No | ||
| size | No | ||
| model | No | ||
| prompt | Yes | ||
| quality | No | ||
| timeout_s | No | ||
| background | No | ||
| extra_body | No | ||
| output_path | No | ||
| aspect_ratio | No | ||
| output_format | No | ||
| filename_prefix | No | ||
| input_image_path | No | ||
| input_image_paths | No | ||
| return_image_content | No |