Generate image
generate_imageGenerate an image from a prompt, or edit one when image_url is given. Default model: image/nano-banana-2. image_url is the image to edit; image_urls are extra references for style, identity or composition; character_ids adds saved Characters. num_images (1-4) makes several images of the same request, each charged as one image. Returns a job; check_job returns the permanent image URLs once it is completed. Submitting charges credits, refunded automatically if the job fails; estimate_generation prices one image without charging.
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 | Legacy alias of aspect_ratio. | |
| model | No | Image model ID. Default image/nano-banana-2. | |
| extras | No | Model-specific parameters as listed by get_model_params. They are merged with the top-level fields. | |
| prompt | Yes | What to generate, or the edit instructions when image_url is given. | |
| force_new | No | An identical request submitted in the last 10 minutes returns that job without charging again; true generates it again. | |
| image_url | No | Source image to edit (https URL). | |
| image_urls | No | Reference images (https URLs). | |
| num_images | No | Number of images to generate (1-4). Each image is its own job, charged one image's price and refunded on its own if it fails; they share one job_id and the card shows them side by side. | |
| skills_used | No | Optional workflow analytics: names of the skills (or skill/reference paths) followed for this call. Stored with generation jobs only. Never include private data, local paths or media URLs. | |
| aspect_ratio | No | Output shape such as 16:9; allowed values per model in get_model_params. | |
| character_ids | No | Saved Characters for this shot, in order; a one-item array for one Character. Use list_characters for names and ids, then use the exact saved names in prompt. The server adds each identity description and reference image after existing references and states their Image N numbers; do not guess those numbers. All references count toward the model limit; unsupported requests fail before charging. | |
| budget_project | No | Optional budget project this generation's cost counts toward, for tracking spend per client or job. Pass its slug; an id or the exact display name also works. Create one with create_budget_project and find slugs with list_budget_projects. An unknown project never stops the generation: it runs without one, and the result warns how to add it with assign_to_budget_project. | |
| agentic_prompting | No | Optional prompt rewrite for the selected model. Omit it (default) or set false to preserve the user's wording; set true only when the user wants a model-specific rewrite. Adds a few seconds and costs nothing extra; the result returns the rewritten prompt (and original_prompt), or a warning when the original was kept. Selected Character identity context is appended unchanged either way. |