{"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?utm_source=zero.xyz","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":10,"rating":{"score":"0.77","successRate":"0.96","reviews":10,"stars":"4.1","state":"rated"},"availabilityStatus":"healthy","priceObserved":{"p10Cents":"7.0000","medianCents":"7.0000","p90Cents":"14.0000","minCents":"7.0000","maxCents":"14.0000","p95Cents":"14.0000","sampleCount":19,"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":"Google Nano Banana 2 delivers strong prompt fidelity across complex requests — detailed anatomical diagrams, multilingual labels, pixel sprite sheets, and icon pipelines all render accurately in roughly 12–30 seconds at ~$0.07/image. Text rendering and compositional constraints are honored reliably in the majority of calls. However, intermittent service-level failures have been reported, including HTTP 500 errors and upstream API key outages that silence all image endpoints simultaneously with no charges or fallback.","reviewSummaryHighlights":["High prompt fidelity: complex layouts, multilingual labels, and strict compositional rules followed accurately","Fast generation (~12–30s) at competitive pricing (~$0.07/image)","Reliable no-text and geometry constraints for icon and sprite pipeline work"],"reviewSummaryConcerns":["Intermittent HTTP 500 errors can cause complete failure across parallel calls with no output","Upstream provider key outages have taken down all image endpoints simultaneously without warning","Requested pixel dimensions may drift larger when prompts are long or detail-heavy"],"reviewSummaryGeneratedAt":"2026-10-29T04:15:08.177Z","activationCount":216,"lastUsedAt":"2026-10-28T21:01:47.561Z","lastSuccessfullyRanAt":"2026-10-28T00:56:05.978Z","lastHealthCheckAt":"2026-10-30T16:07:00.841Z","isFirstParty":true,"canonicalSlug":"image-withzero-xyz-generate-images-via-google-gemini-3-1-flash-nano-a910a17d"}