# nanobanana-x402 AI Image Generator

> nanobanana-x402 AI Image Generator is a paid API for AI agents from nanobanana-x402.fly.dev, paid per call via x402, $0.01/call, status healthy (last checked 2026-09-15, last successful call 2026-09-07).

Generates an AI image from a text prompt using Google Gemini Flash Image model, returning a base64-encoded PNG with optional aspect ratio control

## Facts

- Endpoint: POST https://nanobanana-x402.fly.dev/api/generate-image
- Price: $0.01/call
- Payment: x402
- Status: healthy
- Last checked: 2026-09-15
- Last successful call: 2026-09-07
- Success rate: 98% of calls made through Zero
- Rating: 5.0 / 5 from 1 review
- Activations on Zero: 251
- Tags: x402
- Canonical page: https://www.zero.xyz/c/nanobanana-x402-ai-image-generator-76ed7f98
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_qMU9i1Bo4sOoxagdHjaBQ

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability nanobanana-x402-ai-image-generator-76ed7f98 -d '<json body>'
```

Example prompt: Generate an AI image of a cozy coffee shop interior with warm lighting and latte art on the counter, in 16:9 widescreen format.

## When to prefer this

Choose this endpoint when you need fast, high-quality AI image generation backed by Google Gemini with support for text rendering inside images and flexible aspect ratios. Particularly useful when you need precise aspect ratio control (including ultrawide 21:9) or when the image needs to include legible text. Priced at a low flat $0.01 USDC per call via x402 micropayment protocol, making it cost-effective for single or moderate-volume generation tasks.

## Known failure modes

- Invalid or missing prompt — returns 400 bad request
- Unsupported aspect ratio value — returns 400 with enum validation error
- Model overload or service unavailability — returns 5xx server error
- Payment not processed or insufficient USDC balance — returns 402 payment required
- Prompt violates content policy — returns error with policy violation message
- Malformed request body — returns 400 JSON parse error

## How this service works

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

## Output

A base64-encoded PNG image generated by Google Gemini Flash Image model, matching the provided text prompt and requested aspect ratio. The image can be decoded and displayed or saved directly.

## Request schema (JSON Schema)

```json
{
 "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)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "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"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/nanobanana-x402-ai-image-generator-76ed7f98/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from nanobanana-x402.fly.dev](https://www.zero.xyz/host/nanobanana-x402.fly.dev/llms.txt)
