{"uid":"cap_EjNHKZYP-78BNv3FPrfOv","slug":"image-withzero-xyz-generate-images-via-google-gemini-3-1-flash-nano-a910a17d","name":"Generate Images via Google Gemini 3.1 Flash (Nano Banana 2)","description":"Generate images from a text prompt with Google's Nano Banana 2 (Gemini 3.1 Flash Image) — fast, high-quality generation. Returns hosted image URLs.","url":"https://image.withzero.xyz/api/v1/images/nano-banana-2","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","example":{"count":1,"prompt":"A watercolor painting of a lighthouse at sunrise"},"required":["prompt","count"],"properties":{"count":{"type":"integer","default":1,"maximum":4,"minimum":1,"description":"How many images to generate (1–4)."},"prompt":{"type":"string","maxLength":4000,"minLength":1,"description":"Text description of the image to generate."}},"additionalProperties":false},"responseSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["images","model","price_usdc"],"properties":{"model":{"type":"string","description":"The model that produced the images."},"images":{"type":"array","items":{"type":"object","required":["url","mimeType","sizeBytes"],"properties":{"url":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"number"}},"additionalProperties":false},"description":"The generated images, as hosted URLs."},"price_usdc":{"type":"string","description":"The amount charged for this request, in USDC."}},"additionalProperties":false},"example":{"request":{"count":2,"prompt":"A serene mountain landscape at sunrise with snow-capped peaks, a calm alpine lake reflecting the sky, and pine forests in the foreground"},"response":{"model":"google/gemini-3.1-flash-image-preview","images":[{"url":"https://storage.googleapis.com/withzero/image/18b19acf-cce9-4b4a-a0ef-d43f191392d3.jpg","mimeType":"image/jpeg","sizeBytes":961494},{"url":"https://storage.googleapis.com/withzero/image/f5ca7e66-57cf-48ed-93a4-27a668f78d80.jpg","mimeType":"image/jpeg","sizeBytes":976927}],"price_usdc":"0.14"}},"exampleRequest":{"count":2,"prompt":"A serene mountain landscape at sunrise with snow-capped peaks, a calm alpine lake reflecting the sky, and pine forests in the foreground"},"tags":[],"displayCostAmount":"0.07","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":6,"rating":{"score":"0.81","successRate":"0.97","reviews":6,"stars":"4.2","state":"rated"},"availabilityStatus":"healthy","priceObserved":{"p10Cents":"7.0000","medianCents":"7.0000","p90Cents":"7.0000","minCents":"7.0000","maxCents":"7.0000","p95Cents":"7.0000","sampleCount":94,"varies":false,"failureChargeRate":null},"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.07/call","primary":{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.07","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.07","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_hILzZsA54hM-k4naFH8vc","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.07","costPer":"request","priority":0,"asset":"0x20C000000000000000000000b9537d11c60E8b50","unit":"request","depositMicros":null,"planRef":"image.nano-banana-2:1"}],"brandName":"image.withzero.xyz","brandSlug":"image-withzero-xyz-mpp","brandBaseUrl":"https://image.withzero.xyz","brandDocsUrl":null,"whatItDoes":"Generates 1–4 images from a text prompt using Google's Gemini 3.1 Flash Image model and returns hosted image URLs.","exampleAgentPrompt":"Using the Nano Banana 2 Gemini Flash model, generate 2 images of a sun-drenched Tuscan vineyard at golden hour with rolling hills and cypress trees in the background.","exampleUseCases":[{"title":"Create product mockup images for ecommerce","prompt":"I need 4 different product photos showing a minimalist ceramic mug on a wooden desk with natural morning light. Can you generate those for me using the Gemini Flash model so I can pick the best one for my store?"},{"title":"Generate branded social media graphics","prompt":"Make me 3 eye-catching Instagram post images for my coffee brand. Each one should feature a steaming latte cup with latte art, warm lighting, and a cozy café setting in the background."},{"title":"Illustrate storybook scenes quickly","prompt":"I'm writing a children's book and need some quick illustrations. Generate 2 images of a friendly robot character helping kids plant a garden in a sunny backyard, both with bright, cheerful colors."}],"resultDescription":"Returns an array of generated images, each with a hosted URL, MIME type, and file size in bytes, along with the model name used and the USDC amount charged for the request.","failureModes":["Prompt exceeds 4000 character limit — request rejected with validation error","Count outside 1–4 range — request rejected with validation error","Model unavailable or overloaded — upstream error from Google Gemini","Prompt violates content policy — generation refused with policy error","Empty or missing prompt — validation error returned"],"whenToPreferThis":"Choose this endpoint when you need fast, cost-effective image generation using Google's Gemini 3.1 Flash Image model and want results returned as hosted URLs. Prefer over the Nano Banana Pro variant when speed is prioritized over maximum quality, and over OpenAI GPT-5 Image when Google's model style is preferred.","instructions":null,"reviewSummary":"Nano Banana 2 (Gemini 3.1 Flash Image) delivers fast, stylistically consistent image generation — typically 12–30 seconds per image — with strong adherence to negative prompts like 'no text' and precise compositional instructions. Semantic fidelity is high across diverse styles including riso print, anatomical diagrams, icon pipelines, and pixel art. The main limitations are output resolution (around 1376×768), minor color drift between calls in matched-set workflows, and pixel-size instructions degrading under long prompts.","reviewSummaryHighlights":["Strong adherence to 'no text/no lettering' constraints across all tested styles","Fast generation (12–30s) with consistent style across multi-image series","Precise compositional control — framing, perspective, and layout rules reliably honored"],"reviewSummaryConcerns":["Output resolution (~1376×768) is noticeably lower than competing services at similar price points","Background color drifts slightly between calls — normalize if images must match exactly","Stated pixel dimensions are not reliably preserved when prompts are long and detailed"],"reviewSummaryGeneratedAt":"2026-09-14T20:15:20.965Z","activationCount":184,"lastUsedAt":"2026-09-14T20:25:26.537Z","lastSuccessfullyRanAt":"2026-09-14T19:59:58.244Z","lastHealthCheckAt":"2026-09-15T07:29:17.082Z","isFirstParty":true}