Skip to main content
POST
/
vendors
/
google
/
v1
/
nano-banana-2
/
generation
Text to Image Generation
curl --request POST \
  --url https://api.mulerun.com/vendors/google/v1/nano-banana-2/generation \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "A photorealistic close-up portrait of an elderly Japanese ceramicist with a warm, knowing smile",
  "aspect_ratio": "3:4",
  "resolution": "2K"
}
'
{
  "task_info": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "status": "pending",
    "created_at": "2026-02-27T00:00:00.000Z",
    "updated_at": "2026-02-27T00:00:00.000Z"
  }
}

Overview

Generate high-quality images from text prompts using Google’s Nano Banana 2 model (Gemini 3.1 Flash Image Preview). Compared with the base Nano Banana release, Nano Banana 2 unlocks:
  • 14 aspect ratios (from 1:4 portrait up to 21:9 panoramic)
  • Higher fidelity presets (resolution up to 4K)
  • Web search grounding for real-time data and accurate depictions of real-world subjects

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Text to image generation request body

prompt
string
required

Text prompt for image generation. For best results, describe the scene narratively rather than listing keywords.

Include details such as:

  • Subject (object, person, animal, scenery)
  • Style (photorealistic, illustration, sketch, etc.)
  • Lighting and mood
  • Camera angle and composition
  • Color palette

Example: "A photorealistic close-up portrait of an elderly Japanese ceramicist with deep, sun-etched wrinkles and a warm, knowing smile. Captured with an 85mm portrait lens, resulting in soft bokeh."

aspect_ratio
enum<string>
default:1:1

Aspect ratio of the generated image (width:height).

Available options:
1:1,
1:4,
1:8,
2:3,
3:2,
3:4,
4:1,
4:3,
4:5,
5:4,
8:1,
9:16,
16:9,
21:9
resolution
enum<string>
default:1K

Output resolution preset.

Note: Must use uppercase K (e.g. 1K, 2K, 4K). Lowercase will be rejected.

Available options:
1K,
2K,
4K

Enable Google Search grounding for image generation. When enabled, the model can use Google Search (including Web Search and Image Search) to verify facts and generate imagery based on real-time data such as current weather, stock charts, recent events, or accurate depictions of real-world subjects.

Response

202 - application/json

Accepted - Task created successfully

task_info
object