generate_image
Make or create an image from text or a reference photo. Default model: nano_banana_pro (best face preservation, supports reference photo). Use nano_banana_2 or z_image only if the user asks for a cheaper one; read the coin cost from list_models (cost_coins, and cost_by_resolution when present), never from memory. Do not ask about model or resolution: the default resolution is 2K when it costs the same as 1K for the model, else 1K; use 4K only when the user asks. Aspect ratio: story, reel, TikTok, Shorts 9:16; YouTube 16:9; Instagram post or carousel 4:5; unknown 9:16. For multi-character or character-plus-outfit shots, pass extra anchor images in reference_image_urls — Nano Banana 2 / Pro accept up to 7 inputs. Returns job_id; poll check_job until status=done.
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 | ||
| photos | No | Photos the user attached in this chat. Use this for attachments; image URL fields are only for public https links. | |
| prompt | Yes | ||
| resolution | No | 1K cheapest; 4K up to 50% more. Default: 2K when it costs the same as 1K for the model (Nano Banana Pro), else 1K. | |
| aspect_ratio | No | Choose it from where the person will use it: story, reel, TikTok, Shorts 9:16; YouTube 16:9; Instagram post or carousel 4:5; anything else or unknown 9:16 (the default). A model that does not take the ratio gets the nearest one it does; the result says which in aspect_ratio_used, so report that one. | |
| reference_image_url | No | Primary reference image. Optional. For multi-ref pass reference_image_urls instead or in addition. | |
| reference_image_urls | No | Extra reference images (Nano Banana 2 / Pro accept up to 7 total including reference_image_url). Use for multi-character, face + outfit, style references. Order matters. |