generate_image
Create an image from a text prompt and save it locally, returning file path, cost, and remaining credits. Use reference images and aspect ratios to generate tailored visuals.
Instructions
Generate an image and save it locally. Returns the file path, cost and remaining credits (plus a preview).
prompt: what to draw. model: image model id (see list_models(kind="image")), default nano-banana-2. aspect: aspect ratio, e.g. "1:1", "16:9", "9:16". option: resolution/quality option such as "1K", "2K", "4K"; defaults to the model's first (cheapest) option. reference_images: optional list of local PNG/JPEG/WEBP paths used as references.
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 |
|---|---|---|---|
| model | No | nano-banana-2 | |
| aspect | No | 1:1 | |
| option | No | ||
| prompt | Yes | ||
| reference_images | No |