Generate Images

November 17, 2025 (November 16, 2026)

Table of contents

  1. Model Capabilities
  2. Content Moderation
  3. Request Headers
  4. Request Body
    1. Inline @-mention markers (optional)
  5. Responses
  6. Model
  7. If fifeUrl is missing
  8. Examples
  9. Try It

Generate images using AI models Nano Banana 2 Lite / Gemini 3.1 Flash-Lite Image (Google Flow’s default since July 2026), Nano Banana 2.1, and Nano Banana Pro / Gemini 3 Pro Image from text prompts with optional reference images. Use any Google AI subscription or even free account for image generations.

This endpoint features dynamic concurrency management, allowing anywhere from 3 to 20 parallel generations depending on real-time capacity. Image generation typically completes within 10-20 seconds.

Model Capabilities

Parameter Nano Banana 2 Lite
nano-banana-2-lite (default)
Nano Banana 2.1
nano-banana-2
Nano Banana Pro
nano-banana-pro
T2I (text-to-image) Yes Yes Yes
I2I (reference images) Yes (max 10) Yes (max 10) Yes (max 10)
Aspect ratios 16:9, 4:3, 1:1, 3:4, 9:16, auto† 16:9, 4:3, 1:1, 3:4, 9:16, auto† 16:9, 4:3, 1:1, 3:4, 9:16, auto†
Default aspect ratio 16:9 (T2I & I2I) 16:9 (T2I) / auto (I2I) 16:9 (T2I) / auto (I2I)
count Yes (1-4) Yes (1-4) Yes (1-4)
seed Yes Yes Yes
thinkingLevel No Yes (low, medium, high) No
Subscription all all all

† auto is only valid in image-to-image mode (at least one reference_* provided) — the backend derives the aspect ratio from the first reference image. With multiple references the derived orientation is not guaranteed — individual images in the same batch may come back with different orientations, so pass an explicit ratio when you need a consistent output shape.

The nano-banana-2 model generates with Nano Banana 2.1.

Deprecated aliases, still accepted: nano-banana maps to nano-banana-2, and imagen-4 maps to nano-banana-2-lite (Google removed Imagen from Flow in July 2026).

Content Moderation

If your generation is moderated, retrying with the same prompt often succeeds on subsequent attempts — moderation decisions can vary between requests. Alternatively, switching between nano-banana-2-lite, nano-banana-2, and nano-banana-pro models may help, as each has different content-moderation behavior.

https://api.useapi.net/v1/google-flow/images

Request Headers

Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data

Request Body

{
  "prompt": "A serene mountain landscape at sunset with vibrant colors",
  "model": "nano-banana-2-lite",
  "aspectRatio": "16:9",
  "count": 4,
  "seed": 123456
}
  • email is optional. The email address of the Google Flow account to use.

    When only one account is configured, the API will automatically use that account.

    With multiple accounts configured, omitting the email parameter triggers automatic load balancing based on image generation job statistics to select the healthiest account.

    If reference images (reference_1 to _10) are provided, the email parameter can be omitted—the API will automatically use the same account where the images were uploaded.

  • prompt is required, text description for image generation.
  • model is optional, the AI model to use for image generation (default: nano-banana-2-lite).
    Supported values: nano-banana-2-lite, nano-banana-2, nano-banana-pro. Deprecated aliases are still accepted: nano-banana maps to nano-banana-2, and imagen-4 maps to nano-banana-2-lite (Google removed Imagen from Flow in July 2026).
  • aspectRatio is optional, output image aspect ratio. Supported values: 16:9, 4:3, 1:1, 3:4, 9:16, auto. Legacy aliases landscape (→ 16:9) and portrait (→ 9:16) are still accepted. auto is only valid when at least one reference_* is provided — the backend derives the aspect ratio from the first reference image. With 2+ references the derived orientation can vary between images in the same batch, so prefer an explicit ratio for consistent output. Default:
    • text-to-image (no references): 16:9
    • nano-banana-2-lite image-to-image: 16:9
    • nano-banana-2 / nano-banana-pro image-to-image: auto
  • count is optional, number of image variations to generate (1-4, default: 4).
  • seed is optional, random seed for reproducible results (integer ≥ 0).
  • thinkingLevel is optional, how long Nano Banana 2.1 reasons before it draws, the same as Flow’s Thinking level switch (nano-banana-2 only).
    Supported values: low, medium, high (default: high).
    Higher levels follow complex prompts more closely, such as exact text, counts, times on a clock or labelled diagrams, and take longer. In Flow, one image took about 11 s on low, 14 s on medium and 21 s on high. Use low for quick drafts. low and medium need a paid Google AI plan, because Flow offers a free account high only, so a free account answers 400 for them before any captcha is used. Any other model answers 400 when thinkingLevel is set.
  • reference_1 to reference_10 are optional, use mediaGenerationId from POST /assets/email for reference images. All models support up to 10 references.
  • character_1 to character_7 are optional, character reference-ids from POST /characters. Characters mix freely with reference_* — they share the same per-model image-ref budget on Google’s side (per-character image counts roll into the total).
  • replyUrl is optional, webhook URL for job status callbacks. Receives POST requests with job status updates (created, completed, failed). The JSON payload shape matches GET /jobs/jobId response. Callbacks timeout after 5 seconds.
  • replyRef is optional, custom reference string passed back in webhook callbacks. Useful for tracking jobs on your end.
  • captchaToken, captchaRetry, captchaOrder are optional, mutually exclusive captcha parameters. See Captcha Parameters for details.

When model is not specified the API uses nano-banana-2-lite — it handles both text-to-image and reference-to-image, so the right variant is picked automatically from the presence of reference_* / character_* parameters.

Inline @-mention markers (optional)

You can place @-markers inside prompt that resolve to the body parameters you supply. Markers are case-insensitive and opt-in — a prompt with no markers behaves exactly like before.

Supported markers:

Marker Resolves to
@character_1..7 matching character_N body param
@reference_1..10 matching reference_N body param

Rules:

  • Each marker MUST have a matching body slot supplied. Otherwise the API returns 400 with 'character_N' was not provided in the request body.
  • A slot referenced inline still goes into the upstream reference array — markers are positional/grounding info, not a replacement for the body params.
  • Same slot may be inlined multiple times; the upstream reference array de-duplicates by id.
  • Body params supplied but NOT inlined still flow to the upstream reference array (unchanged behavior).
  • Unknown strings like @gmail.com or @anyword_1 (no _<digit> after a recognized slot name) pass through as literal prompt text.

Example:

{
  "model": "nano-banana-pro",
  "prompt": "@character_1 standing next to @reference_1, golden hour light",
  "character_1": "user:123-email:...-character:...-imgs:1",
  "reference_1": "user:123-email:...-image:..."
}

Responses

  • 200 OK

    Images generated successfully. Returns job ID and media array with generated image data.

    {
      "jobId": "j1117123545678193846i-u12345-email:john@gmail.com-bot:google-flow",
      "media": [
        {
          "name": "…redacted…",
          "workflowId": "…redacted…",
          "image": {
            "generatedImage": {
              "seed": 123456,
              "mediaGenerationId": "user:12345…redacted…",
              "mediaVisibility": "",
              "prompt": "A serene mountain landscape at sunset with vibrant colors",
              "modelNameType": "HARBOR_SEAL",
              "workflowId": "…redacted…",
              "fifeUrl": "https://flow-content.google/image/…redacted…?Expires=…&KeyName=labs-flow-prod-cdn-key&Signature=…",
              "aspectRatio": "IMAGE_ASPECT_RATIO_LANDSCAPE",
              "requestData": {
                "promptInputs": [
                  {
                    "textInput": "A serene mountain landscape at sunset with vibrant colors"
                  }
                ],
                "imageGenerationRequestData": {
                  "backend": "flow",
                  "referencesApplied": {
                    "media": [],
                    "entities": []
                  },
                  "aspectEnum": 3,
                  "modelEnum": 31
                }
              }
            },
            "dimensions": {
              "width": 1376,
              "height": 768
            }
          }
        }
      ],
      "captcha": {
        "service": "AntiCaptcha",
        "taskId": "540913782",
        "durationMs": 3500,
        "attempts": [
          {
            "service": "AntiCaptcha",
            "taskId": "540913782",
            "durationMs": 3500,
            "success": true
          }
        ]
      }
    }
    
  • 400 Bad Request

    Invalid request (validation error, reference count exceeded, email mismatch, or content policy violation).

    General error:

    {
      "error": "Parameter prompt is required",
      "code": 400
    }
    

    Content policy error:

    {
      "jobId": "j1117123545678193846i-u12345-email:john@gmail.com-bot:google-flow",
      "error": "PUBLIC_ERROR_UNSAFE_GENERATION (HTTP 400)",
      "code": 400,
      "response": {
        "error": {
          "code": 400,
          "message": "flow.google.com ogiZ0b failed",
          "status": "INVALID_ARGUMENT",
          "details": [
            {
              "@type": "type.googleapis.com/google.rpc.ErrorInfo",
              "reason": "PUBLIC_ERROR_UNSAFE_GENERATION"
            }
          ]
        },
        "captcha": {
          "service": "CapSolver",
          "taskId": "14af1dbb-885c-4e25-8121-7a79489dfd0e",
          "durationMs": 3500,
          "attempts": [
            {
              "service": "CapSolver",
              "success": true,
              "durationMs": 3500,
              "taskId": "14af1dbb-885c-4e25-8121-7a79489dfd0e"
            }
          ]
        }
      }
    }
    
  • 401 Unauthorized

    Invalid API token.

    {
      "error": "useapi.net ⁝ Unauthorized",
      "code": 401
    }
    
  • 402 Payment Required

    Subscription expired or insufficient credits.

    {
      "error": "useapi.net ⁝ Your account has no subscription, please subscribe to our services before submitting requests",
      "code": 402
    }
    
  • 403 Forbidden

    Google rejected the captcha on every try. We retry with a fresh captcha as many times as you allow (captchaRetry, default 5, or the providers in captchaOrder) and return this 403 only when all of them were rejected. The top-level error starts with captcha_quality:, for example "captcha_quality: PUBLIC_ERROR_UNUSUAL_ACTIVITY after 5 attempts. Google refused all 5 captcha tokens for user@example.com, so nothing was generated and no Google Flow credits were used (5 captcha solves were spent). Google is flagging this account's requests as unusual activity. If it keeps happening, use another account, or leave out email so the API picks one. See GET /accounts/captcha-stats summary.by_account". A 429 with PUBLIC_ERROR_UNUSUAL_ACTIVITY_TOO_MUCH_TRAFFIC reads the same way.

    Two 403s are not a captcha problem, and we answer them after one try instead of retrying. PUBLIC_ERROR_MODEL_ACCESS_DENIED in the response means Google refused the model on that account, so raising captchaRetry or adding providers will not help. Check that the account’s plan includes the model. Since 2026-09-23 Google no longer offers veo-3.1-lite-low-priority to invited members of an Ultra $199 family plan — only the family manager’s account keeps it.

    PUBLIC_ERROR_USER_MINOR means Google treats the Google account as belonging to someone under 18, and Google Flow is not available to such accounts. The error says so in plain words. No captcha or retry changes it: use another Google account, or have this one’s age verified with Google first. With email omitted, the load balancer sets such an account aside for 1 hour, then tries it again.

    Nothing was created when this happens. Google checks the captcha before it starts generating, so no Google credits were used and you can resubmit straight away. Your captcha provider still bills each solve.

    The usual cause is the Google account, not the captcha provider. Google gives each account its own trust level. On a trusted account it accepts about 9 in 10 captchas, on a distrusted one about 3 in 10, whichever provider solved them. Most customers have a few distrusted accounts among many good ones.

    To see which accounts are affected, use GET /accounts/captcha-stats. Its summary.by_account shows, for each of your Google accounts, how many captchas were tried and what share Google accepted. GET account/stats with bot=google-flow also shows how many requests each account finished with each response code.

    • If one or a few accounts are far below the others, the API already sends them less work: when you leave out email, each captcha Google rejected on an account in the last 15 minutes lowers its chance of being picked, for generations and for image uploads. They still get some work, so an account that recovers gets its full share back. If you pin requests with email, move them to your other accounts yourself. Replace an account that stays low for more than a day or two.
    • If all your accounts drop at the same time, it’s the captcha provider. Configure at least two providers with POST /accounts/captcha-providers, and the API will start with whichever one Google accepts best.

    A higher captchaRetry gets more requests through on a distrusted account, but every extra try is another paid solve.

  • 404 Not Found

    Account not found or not configured.

    {
      "error": "Google Flow account john@gmail.com not found",
      "code": 404
    }
    
  • 429 Too Many Requests

    Google returns several RESOURCE_EXHAUSTED 429 variants. Check the reason field and respond accordingly:

    Reason Meaning Scope What to do Cooldown
    PUBLIC_ERROR_
    USER_REQUESTS_THROTTLED
    Google is throttling the account (the token was fine). Uploads and generation are metered separately All models on the account — or uploads only, when POST /assets triggered it Run fewer parallel requests, or switch accounts. From POST /assets, retrying the same one rarely clears it ~30 min. From POST /assets, treat it as a minimum — it can persist
    PUBLIC_ERROR_
    USER_QUOTA_REACHED
    Account’s overall Flow quota cap All models on the account Add accounts, or omit email to load-balance ~30 min
    PUBLIC_ERROR_
    PER_MODEL_DAILY_QUOTA_REACHED
    Per-model daily quota Only that model, on that account Switch model, or wait Next UTC midnight
    PUBLIC_ERROR_
    UNUSUAL_ACTIVITY_TOO_MUCH_TRAFFIC
    Google rejected the captcha on every try (we already retried). Usually a distrusted Google account, sometimes the provider Per request Check which accounts are affected in captcha-stats. Rest or replace those accounts. Add a second provider if all accounts drop together 60s

    Every 429 returns the cooldown two ways — an HTTP Retry-After: <seconds> header and a body retryAfter: <ISO timestamp> field. Honor it before retrying.

    When email is omitted, the first three reasons quarantine the account and the load balancer routes around it. If every account is quarantined for the model you get 429 with error: "no_eligible_account". Routing details: GET /jobs › Load Balancing Algorithm.

    Captcha-quality failures prefix the top-level error with captcha_quality: (e.g. "captcha_quality: PUBLIC_ERROR_UNUSUAL_ACTIVITY_TOO_MUCH_TRAFFIC after 3 attempts") so you can detect them without parsing the nested body.

  • 500 Internal Server Error

    One or more generated images were moderated by Google’s content policy. Try one of the following:

    • Switch to a different model — nano-banana-2-lite, nano-banana-2, and nano-banana-pro each have different content-moderation behavior
    • Modify your prompt or remove/change reference images
    • Retry the same request (moderation decisions can vary between attempts)
    {
      "jobId": "j1117123545678193846i-u12345-email:john@gmail.com-bot:google-flow",
      "error": "API error: 500",
      "code": 500,
      "response": {
        "error": {
          "code": 500,
          "message": "flow.google.com ogiZ0b failed",
          "status": "INTERNAL",
          "details": []
        },
        "captcha": {
          "service": "CapSolver",
          "taskId": "14af1dbb-885c-4e25-8121-7a79489dfd0e",
          "durationMs": 3500,
          "attempts": [
            {
              "service": "CapSolver",
              "success": true,
              "durationMs": 3500,
              "taskId": "14af1dbb-885c-4e25-8121-7a79489dfd0e"
            }
          ]
        }
      }
    }
    
  • 503 Service Unavailable

    503 has two distinct causes — check the response body to tell them apart.

    A transient Google-side outage. Wait 5-10 seconds and retry.

    {
      "error": {
        "code": 503,
        "message": "Service temporarily unavailable.",
        "status": "UNAVAILABLE"
      }
    }
    

    A captcha-provider failure — the top-level error is prefixed Captcha service failed:. The problem is your captcha provider (check its API key and balance), not Google. Don’t retry until the provider is back.

    {
      "error": "Captcha service failed: ERROR_ZERO_BALANCE",
      "code": 503
    }
    
  • 596 Session Error

    Google rejected the account’s session, and the API is re-verifying the account on its own: retry in about a minute. If Google signed the account out, the account keeps answering 596 and you get a reconnect email: add it again by following Setup Google Flow.

    {
      "error": "Google Flow account john@gmail.com Google rejected this account session (HTTP 401). We are automatically re-verifying it — please retry in about a minute. If the account was signed out, you will receive a reconnect email.",
      "code": 596
    }
    

Model

The images made, each with a signed link and its mediaGenerationId, and the captcha used.

The images, field by field, and the type it uses (FlowCaptcha)
  • jobId - Unique job identifier (for use with GET /jobs/jobId)
  • media - Array of generated images (1-4 images based on count)
  • media[].image.generatedImage - Generated image data object
  • generatedImage.fifeUrl - Direct signed URL to access the generated image (valid for ~6 hours). An empty string when Google’s answer had no URL, see below
  • generatedImage.seed - Seed used for this generation (for reproducibility)
  • generatedImage.mediaGenerationId - mediaGenerationId for use in subsequent API calls
  • generatedImage.prompt - The prompt used for generation
  • generatedImage.modelNameType - Model variant used (HARBOR_SEAL, GEM_PIX_2, BELUGA, NARWHAL). BELUGA is Nano Banana 2.1.
  • generatedImage.aspectRatio - Generated image aspect ratio (IMAGE_ASPECT_RATIO_LANDSCAPE, IMAGE_ASPECT_RATIO_LANDSCAPE_FOUR_THREE, IMAGE_ASPECT_RATIO_SQUARE, IMAGE_ASPECT_RATIO_PORTRAIT_THREE_FOUR, IMAGE_ASPECT_RATIO_PORTRAIT, or IMAGE_ASPECT_RATIO_UNSPECIFIED for auto)
  • generatedImage.mediaVisibility - Always an empty string (Google Flow does not report it for images)
  • generatedImage.workflowId - Unique workflow identifier
  • generatedImage.requestData - What the image was made from: the prompt, and the references Google applied
  • media[].image.dimensions - The image’s width and height in pixels
  • media[].name - Internal identifier for the media item
  • media[].workflowId - Unique workflow identifier for this generation
  • captcha - Captcha metadata for debugging/research
  • captcha.service - Provider that returned the successful token
  • captcha.taskId - Task ID from the captcha service
  • captcha.durationMs - Total time for all captcha attempts
  • captcha.attempts - Array of all captcha attempts (including failures)
{
  jobId: string                     // Job identifier
  media: Array<{                    // the images made, up to count
    name: string                    // Internal media identifier
    workflowId: string              // Unique workflow ID (an empty string when Google reports none)
    image: {                        // the generated image
      generatedImage: {             // the image file and how it was made
        seed: number                // the seed Google used
        mediaGenerationId: string   // Format: user:{userid}-email:{hex}-image:{id}
        mediaVisibility: ''         // always an empty string
        prompt: string              // the prompt as Google ran it
        modelNameType: string       // HARBOR_SEAL, GEM_PIX_2, BELUGA or NARWHAL
        workflowId: string          // same as media[].workflowId
        fifeUrl: string             // Direct signed URL to the generated image, valid ~6 hours. An empty string when Google's answer had none
        aspectRatio: string         // IMAGE_ASPECT_RATIO_LANDSCAPE, IMAGE_ASPECT_RATIO_LANDSCAPE_FOUR_THREE, IMAGE_ASPECT_RATIO_SQUARE, IMAGE_ASPECT_RATIO_PORTRAIT_THREE_FOUR, IMAGE_ASPECT_RATIO_PORTRAIT or IMAGE_ASPECT_RATIO_UNSPECIFIED (auto)
        requestData: {              // what the image was made from
          promptInputs: Array<{     // the prompt sent to Google
            textInput: string       // the prompt text
          }>
          imageGenerationRequestData: {  // what Google applied
            backend: 'flow'         // the image was made on `flow.google.com`
            referencesApplied: {    // the references Google echoed back as applied
              media: string[]       // Google's media ids of the reference images applied
              entities: string[]    // the entity ids of the characters applied
            }
            aspectEnum: number | null  // Google's raw aspect number (3 landscape, 1 square, 2 portrait, 4 3:4, 5 4:3, 0 auto)
            modelEnum: number | null   // Google's raw model number (25 GEM_PIX_2, 29 NARWHAL, 31 HARBOR_SEAL, 36-39 BELUGA)
          }
        }
      }
      dimensions?: {                // the image's size, when Google reports it
        width: number               // width in pixels
        height: number              // height in pixels
      }
    }
  }>
  captcha: FlowCaptcha              // the captcha solved for this request (described below)
}

When the request fails:

{
  jobId?: string                    // the job id, when the request got as far as Google
  error: string                     // what went wrong, e.g. "PUBLIC_ERROR_UNSAFE_GENERATION (HTTP 400)" or "No images generated"
  code?: number                     // the HTTP status (left out on "No images generated", a 500)
  retryAfter?: string               // ISO 8601 time to retry after, on a 429 (the Retry-After header carries the same in seconds)
  response?: {                      // Google's answer, when Google or the captcha refused the request
    error?: {                       // Google's error
      code: number                  // HTTP status Google answered
      message: string               // the error message, e.g. "flow.google.com ogiZ0b failed"
      status: string                // Google's status name, e.g. "RESOURCE_EXHAUSTED"
      details: Array<{              // Google's error details
        '@type': string             // the type name of the detail
        reason: string              // Google's reason code, e.g. "PUBLIC_ERROR_USER_QUOTA_REACHED"
      }>
    }
    captcha: FlowCaptcha            // the captcha tried or used
  }
  captcha?: FlowCaptcha             // on "No images generated" only: the captcha used
  message?: string                  // on the load-balancer 429 only (error no_eligible_account: every account is quarantined for this model): the explanation
  skipReasons?: Array<{             // on the load-balancer 429 only: why each account was left out
    email: string                   // the account left out
    reason: string                  // Google reason that triggered the quarantine (a 429 reason, or the MODEL_ACCESS_DENIED or USER_MINOR 403)
    model: string                   // Quarantined model, or "*" for account-wide
  }>
}

The type used above:

FlowCaptcha: the captcha in the answer above.

{
  service?: string                           // the provider whose token Google accepted: `CapSolver`, `AntiCaptcha`,
                                             // `YesCaptcha`, `CapMonster`, `SolveCaptcha`, `2Captcha`, `EzCaptcha` or
                                             // `UserProvided`. Always on a success answer
  taskId?: string                            // that provider's task id (none for `UserProvided`)
  durationMs?: number                        // ms from the first solve to the token used. Always on a success answer
  error?: string                             // why no captcha token could be had, on a failed request
  attempts: Array<{                          // every solve tried, in order, failed ones included
    service: string                          // the provider asked
    taskId?: string                          // that provider's task id
    durationMs: number                       // how long this solve took, in ms
    success: boolean                         // true when the provider returned a token (Google may still have refused it)
    error?: string                           // why the solve failed
    userAgent?: string                       // the browser user agent the provider solved with, when it reports one
    secChUa?: string                         // the Sec-CH-UA value the provider solved with, when it reports one (may be empty)
    cost?: string                            // the provider's price for this solve, as the provider reports it
    ip?: string                              // the IP address the provider reports for this solve
    createTime?: number                      // Unix time the provider started the solve, as it reports it
    endTime?: number                         // Unix time the provider finished the solve, as it reports it
    solveCount?: number                      // the provider's own solve counter for this task
  }>
}

If fifeUrl is missing

Once in a while Google’s generation response comes back without a URL for an image, and fifeUrl is then an empty string. The image itself is unaffected and no credits are lost.

Ask for its URL with GET /assets/mediaGenerationId, which answers { url, mediaGenerationId }. Every example below already does this, in all three languages.

Examples

  • curl -X POST \
         -H "Authorization: Bearer YOUR_API_TOKEN" \
         -H "Content-Type: application/json" \
         -d '{
           "prompt": "A serene mountain landscape at sunset with vibrant colors",
           "model": "nano-banana-2-lite",
           "aspectRatio": "16:9",
           "count": 4,
           "seed": 123456
         }' \
         "https://api.useapi.net/v1/google-flow/images" > response.json
    
    # Download each image. fifeUrl is normally set; when it is empty, ask
    # GET /assets/{mediaGenerationId} for the image's URL.
    for i in 0 1; do
      IMG=$(jq -r ".media[$i].image.generatedImage" response.json)
      URL=$(echo "$IMG" | jq -r '.fifeUrl // empty')
      if [ -z "$URL" ]; then
        ID=$(echo "$IMG" | jq -r '.mediaGenerationId | @uri')
        URL=$(curl -s -H "Authorization: Bearer YOUR_API_TOKEN" \
          "https://api.useapi.net/v1/google-flow/assets/$ID" | jq -r '.url')
      fi
      curl -o "image_$((i+1)).jpg" "$URL"
    done
    # Continue for remaining images...
    
  • const token = 'YOUR_API_TOKEN';
    const apiUrl = 'https://api.useapi.net/v1/google-flow/images';
    
    const response = await fetch(apiUrl, {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        prompt: 'A serene mountain landscape at sunset with vibrant colors',
        model: 'nano-banana-2-lite',
        aspectRatio: '16:9',
        count: 4,
        seed: 123456
      })
    });
    
    const result = await response.json();
    console.log('Generated images:', result.media.length);
    
    // Download and save images
    for (const [index, item] of result.media.entries()) {
      const img = item.image.generatedImage;
      console.log(`Image ${index + 1} seed:`, img.seed);
      console.log(`mediaGenerationId:`, img.mediaGenerationId);
    
      // fifeUrl is normally set. When it is empty, ask GET /assets/{mediaGenerationId}
      // for the image's URL.
      const imageUrl = img.fifeUrl || (await (await fetch(
        `https://api.useapi.net/v1/google-flow/assets/${encodeURIComponent(img.mediaGenerationId)}`,
        { headers: { 'Authorization': `Bearer ${token}` } })).json()).url;
      const imageBlob = await (await fetch(imageUrl)).blob();
    
      // In Node.js with fs:
      // const buffer = Buffer.from(await imageBlob.arrayBuffer());
      // require('fs').writeFileSync(`generated_image_${index + 1}.jpg`, buffer);
    
      // In browser: create download link or display in <img> element
      // const url = URL.createObjectURL(imageBlob);
      // document.querySelector('img').src = url;
    }
    
  • import requests
    from urllib.parse import quote
    
    token = 'YOUR_API_TOKEN'
    api_url = 'https://api.useapi.net/v1/google-flow/images'
    
    headers = {
        'Authorization': f'Bearer {token}',
        'Content-Type': 'application/json'
    }
    
    data = {
        'prompt': 'A serene mountain landscape at sunset with vibrant colors',
        'model': 'nano-banana-2-lite',
        'aspectRatio': '16:9',
        'count': 4,
        'seed': 123456
    }
    
    response = requests.post(api_url, headers=headers, json=data)
    result = response.json()
    
    print(f"Generated {len(result['media'])} images")
    
    # Download and save images
    for index, item in enumerate(result['media']):
        img = item['image']['generatedImage']
        print(f"Image {index + 1} seed:", img['seed'])
        print(f"mediaGenerationId:", img['mediaGenerationId'])
    
        # fifeUrl is normally set. When it is empty, ask GET /assets/{mediaGenerationId}
        # for the image's URL.
        image_url = img.get('fifeUrl') or requests.get(
            'https://api.useapi.net/v1/google-flow/assets/' + quote(img['mediaGenerationId'], safe=''),
            headers={'Authorization': f'Bearer {token}'}).json()['url']
    
        image_response = requests.get(image_url)
        with open(f'generated_image_{index + 1}.jpg', 'wb') as f:
            f.write(image_response.content)
    

Try It