F

Fly · Generate Image

by Fly

POSTBase

$0.01

per call · USD Coin on Base

Generate an AI image from a text prompt using Google Gemini 3.1 Flash Image. Returns base64-encoded PNG. Optional aspectRatio (1:1, 16:9, 9:16, 3:2, 2:3, 4:3, 3:4, 4:5, 5:4, 21:9). Backed by Google's Gemini image preview model — fast, high-quality, supports text rendering inside images.

Endpoint

POST https://nanobanana-x402.fly.dev/api/generate-image

262

Calls / 30d

17

Unique payers / 30d

Sep 7

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://nanobanana-x402.fly.dev/api/generate-image", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "aspectRatio": "16:9",
    "prompt": "A product hero image for a Telegram breach monitor, neon terminal style"
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://nanobanana-x402.fly.dev/api/generate-image" \
  -H "Content-Type: application/json" \
  -d '{"aspectRatio":"16:9","prompt":"A product hero image for a Telegram breach monitor, neon terminal style"}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "aspectRatio": "1:1",
  "image_b64": "iVBORw0KGgoAAAANSUhEUgAA...",
  "input": {
    "bodyFields": {
      "aspectRatio": "16:9",
      "prompt": "A product hero image for a Telegram breach monitor, neon terminal style"
    },
    "method": "POST",
    "type": "http"
  },
  "mime_type": "image/png",
  "model": "gemini-3.1-flash-image-preview",
  "ok": true
}

Payment details

Pay to0x9b8a2786a3df7a7837ccfc4e792e9eb90a36f72f
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase
Schemesexact

Is this your API?

Pin it to the top of Media & Generation and the homepage with a featured placement.

Get featured →

More from Fly & similar services