{"uid":"cap_SXbqbTMaLO-vzfM9TAZ0D","slug":"nanobanana-x402-ai-image-generation-8c6456e1","name":"Nanobanana x402 AI Image Generation","description":"Generate or edit an image with Gemini and receive base64 PNG output through a pay-per-request API.","url":"https://nanobanana-x402.fly.dev/api/edit-image","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"prompt":{"type":"string","minLength":3,"description":"Text prompt describing the image to generate"},"aspectRatio":{"enum":["1:1","16:9","9:16","3:2","2:3","4:3","3:4","4:5","5:4","21:9"],"type":"string","description":"Output aspect ratio (default: 1:1)"}}},"responseSchema":{"type":"json","example":{"ok":true,"input":{"type":"http","method":"POST","bodyFields":{"prompt":"A product hero image for a Telegram breach monitor, neon terminal style","aspectRatio":"16:9"}},"model":"gemini-3.1-flash-image-preview","image_b64":"iVBORw0KGgoAAAANSUhEUgAA...","mime_type":"image/png","aspectRatio":"1:1"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_fWviRsj7FFYbfV325H9bd","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Generates AI images from a text prompt via micropayment (x402/Base USDC), returning a base64-encoded PNG at a chosen aspect ratio powered by Gemini.","exampleAgentPrompt":"Generate a product hero image of a sleek black coffee mug on a marble countertop with soft morning light, in 16:9 widescreen format — pay the per-image fee automatically.","exampleUseCases":[{"title":"Product hero image for e-commerce","prompt":"Create a product hero image of a minimalist white wireless speaker on a clean white background with subtle shadows, in 4:3 format, for our product listing page."},{"title":"Social media banner generation","prompt":"Generate a cinematic 16:9 AI image of a futuristic cityscape at night with neon lights reflecting on rain-wet streets — I need it for a social media cover banner."},{"title":"Portrait illustration for blog post","prompt":"Make a 2:3 portrait-format AI illustration of a cozy reading nook with warm lamp light and stacked books, for my blog post header."}],"resultDescription":"A JSON object containing a base64-encoded PNG image (image_b64), the MIME type (image/png), the aspect ratio used, the Gemini model name used, and an echo of the input parameters. The image can be decoded and used directly.","failureModes":["Payment failure or insufficient USDC balance — x402 payment not completed, image not generated","Invalid aspect ratio value — must be one of the 10 supported enum values","Missing or empty prompt — returns error without generating an image","Gemini API downstream error — model unavailable or rate-limited","Network timeout on the fly.dev host — request may need to be retried"],"whenToPreferThis":"Choose this endpoint when you need pay-per-use AI image generation with no subscription, billed in USDC micropayments via the x402 protocol on Base. Ideal for agents that need to generate images on demand without managing API keys for Gemini directly, and where cost predictability ($0.01 per image) matters. Prefer this over self-managed Gemini API calls when the agent stack already supports x402 payment flows.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":1,"lastUsedAt":"2026-08-18T21:59:08.700Z","lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T17:08:09.447Z","isFirstParty":false}