Generate an image
generate_imageGenerates an AI image. COSTS CREDITS (call get_pricing: generate_* for Nano Banana 2, generate_pro_* for Nano Banana Pro, generate_gpt_* for GPT Image 2.5). Returns the image inline plus id and credits_remaining. Attach references with reference_asset_ids (up to 14). Pick model for the job: Nano Banana 2 (default) for light, texture, mood and speed; Nano Banana Pro when structure and proportion must hold exactly; GPT 2.5 Flare for text you can actually read (labels, packaging, signs); GPT 2.5 Sunburst for the same with more care over references, slower. GPT tops out at 2K.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | gemini-3.1-flash-image = Nano Banana 2 (default), gemini-3-pro-image = Nano Banana Pro, gpt-image-2.5-flare = GPT 2.5 Flare, gpt-image-2.5-sunburst = GPT 2.5 Sunburst. | |
| prompt | Yes | Max 16000 chars. | |
| project_id | Yes | Required (no default on a hosted server). | |
| resolution | No | GPT Image 2.5 renders 1K and 2K only. | |
| aspect_ratio | No | ||
| reference_asset_ids | No | Up to 14. |