Nano Banana x402 API documentation

Generate or edit an image with Gemini and receive base64 PNG output through a pay-per-request API.

POST /api/generate-image

Generate an AI image from a text prompt ($0.01)

$0.01 USDC per request on eip155:8453.

Request example

{
  "prompt": "A product hero image for a Telegram breach monitor, neon terminal style",
  "aspectRatio": "16:9"
}

200 response fields

POST /api/edit-image

Edit an existing image with a text prompt ($0.01)

$0.01 USDC per request on eip155:8453.

Request example

{
  "prompt": "Change the background to a sunset",
  "image_b64": "<BASE64_IMAGE>",
  "mime_type": "image/png",
  "aspectRatio": "16:9"
}

200 response fields

Related resources