Raw schema
{
"type": "object",
"properties": {
"prompt": {
"description": "Clear, detailed image prompt. Include subject, composition, action, location, style, and any text to render. Add 'Square image' or '16:9' in the text to influence aspect ratio.",
"maxLength": 8192,
"minLength": 1,
"type": "string"
},
"n": {
"default": 1,
"description": "Requested image count (model may return fewer).",
"maximum": 14,
"minimum": 1,
"type": "integer"
},
"negative_prompt": {
"anyOf": [
{
"maxLength": 1024,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Things to avoid (style, objects, text)."
},
"system_instruction": {
"anyOf": [
{
"maxLength": 512,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional system tone/style guidance."
},
"input_images": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Images for editing or conditioning. Accepts agent-iris://images/{image_id}, gemini://files/{name}, and http(s) image URLs. Hosted URLs are fetched server-side inside this authenticated tool call; upload local bytes with POST /images when a durable server handle is needed."
},
"operation": {
"default": "general",
"description": "Strict operation preset: general, icon, pattern, diagram, storyboard, or photo_repair.",
"enum": [
"general",
"icon",
"pattern",
"diagram",
"storyboard",
"photo_repair"
],
"type": "string"
},
"interaction_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Interactions API id from a PRIOR generate/edit call (e.g., 'v1_Chd...'). PREFERRED way to iterate on an image: pass it to chain a high-fidelity edit that preserves the rest of the composition (no need to re-send the source image). Implies edit mode. TTL ~55 days (paid) / 1 day (free)."
},
"mode": {
"default": "auto",
"description": "Operation mode: 'auto' (default), 'generate', or 'edit'. AUTO BEHAVIOR: interaction_id or photo_repair โ edit mode; generation presets โ generate mode; one general input image โ edit mode. USE 'generate' FOR: Creating new images with character reference, style transfer, conditioning. USE 'edit' FOR: Modifying a specific existing image (change background, outfit, add text). You can override auto-detection by explicitly setting mode='generate' or mode='edit'.",
"enum": [
"auto",
"generate",
"edit"
],
"type": "string"
},
"aspect_ratio": {
"anyOf": [
{
"enum": [
"1:1",
"2:3",
"3:2",
"3:4",
"4:3",
"4:5",
"5:4",
"9:16",
"16:9",
"21:9",
"1:4",
"4:1",
"1:8",
"8:1"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional output aspect ratio. Standard: 1:1 (square), 3:4, 4:3, 2:3, 3:2, 4:5, 5:4, 9:16 (portrait), 16:9 (landscape), 21:9 (ultra-wide). New in Nano Banana 2: 1:4 (tall strip), 4:1 (wide banner), 1:8 (ultra-tall), 8:1 (ultra-wide)."
},
"resolution": {
"anyOf": [
{
"enum": [
"0.5K",
"1K",
"2K",
"4K"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional resolution. gemini-3.1-flash-image supports 0.5K, 1K, 2K, and 4K. gemini-3-pro-image supports 1K, 2K, and 4K. gemini-2.5-flash-image supports 1K only."
},
"thinking_level": {
"anyOf": [
{
"enum": [
"low",
"high"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional thinking level for Gemini 3 image models. Allowed values: low or high. Use high for complex compositions, text-heavy images, or unusual prompts. Leave unset for the model default."
},
"use_grounding": {
"default": false,
"description": "Enable Google Search grounding for real-time data retrieval before generation. REQUIRED for infographics, charts, current events, statistics, or any real-world data. IMPORTANT: Grounding works with 'gemini-3.1-flash-image' (default) and 'gemini-3-pro-image'. Default: False.",
"type": "boolean"
},
"model": {
"anyOf": [
{
"enum": [
"gemini-3.1-flash-image",
"gemini-3-pro-image",
"gemini-2.5-flash-image",
"gemini-3.1-flash-image-preview",
"gemini-3-pro-image-preview",
"gemini-2.5-flash-image-preview"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Model selection. gemini-3.1-flash-image: Nano Banana 2 (DEFAULT), supports grounding, 14 aspect ratios, and 0.5K-4K output. gemini-3-pro-image: Nano Banana Pro, professional asset production, grounding, 14 total references, 1K-4K output. gemini-2.5-flash-image: Original Nano Banana โ fast drafts ($0.039/image), no grounding support. Legacy -preview aliases are accepted and normalized to current model IDs."
},
"output_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional base name for output file(s). If provided, files will be named '<output_name>.png' (or '<output_name>_1.png', '<output_name>_2.png' for multiple images). Use descriptive names like 'brand-linkedin-headshot' or 'product-hero-banner'. If not provided, defaults to timestamped names like 'gen_20251217_120000_1_1_abc123.png'."
},
"include_preview": {
"default": false,
"description": "Whether to ALSO embed the inline base64 thumbnail preview block(s). Default false (link-first): the response is the text summary + signed download URLs (including a signed thumbnail URL) + structured metadata, with no base64 โ saving context tokens. Set true to additionally embed the inline thumbnail for a quick interactive visual check on a single image. Thumbnails are always stored server-side and reachable via the signed thumbnail URL regardless of this flag.",
"type": "boolean"
}
},
"required": [
"prompt"
],
"additionalProperties": false
}