Nano Banana Pro image generation via micropayments — up to 4K, ~10s, $0.13–$0.24 per image
What it does
This endpoint generates images using the Nano Banana Pro model through StableStudio's pay-per-generation API. It accepts a text prompt and optional aspect ratio (10 options from 1:1 to 21:9) and resolution (1K, 2K, or 4K), returning a job ID that can be polled for the completed image URL. Pricing is $0.13–$0.24 per generation depending on resolution, with results typically delivered in ~10 seconds.
StableStudio is a broader platform offering multiple AI image and video models (GPT Image 1.5, Flux 2 Pro, Grok, Seedance, Wan 2.6, Sora 2, Veo 3.1) all accessible through the same payment flow. This specific endpoint covers Nano Banana Pro's generate operation. Payment is settled in USDC on Base (EIP-155:8453) via x402 or MPP (Tempo method). No API keys are required — authentication and payment happen through on-chain USDC authorization headers.
The workflow is: POST to the endpoint without payment to receive a 402 challenge with the exact USDC amount, sign the payment, re-POST with the PAYMENT-SIGNATURE header to get a pending job, then poll GET /api/jobs/{jobId} with a SIGN-IN-WITH-X wallet signature header until the job completes and returns an imageUrl. An edit endpoint at the same model path also supports image-to-image editing with up to 14 reference images. The full OpenAPI spec is available at /api/openapi.json and an MCP server is available via `npx -y agentcash@latest`.
Capabilities
Use cases
- —Generate high-resolution images from text prompts with per-call micropayments
- —Programmatic image creation for apps/agents without subscription commitments
- —Produce images up to 4K resolution in various aspect ratios for marketing or content
- —Agent-driven image generation using on-chain USDC payments
Fit
Best for
- —Agents or apps needing on-demand image generation without API key management
- —Pay-per-use image generation with no subscription
- —High-resolution (up to 4K) text-to-image with flexible aspect ratios
- —Crypto-native workflows settling in USDC on Base
Not for
- —Users without an EVM wallet or USDC on Base
- —Bulk batch image generation requiring sub-second latency
- —Image editing workflows (use the /edit endpoint instead)
Quick start
# 1. Get payment challenge
curl -X POST https://stablestudio.dev/api/generate/nano-banana-pro/generate \
-H 'Content-Type: application/json' \
-d '{"prompt": "A cat astronaut floating in space"}'
# Returns 402 with PAYMENT-REQUIRED header (base64 JSON)
# 2. Decode challenge, sign USDC authorization, re-POST with PAYMENT-SIGNATURE header
# 3. Poll GET /api/jobs/{jobId} with SIGN-IN-WITH-X header until completeExample
Request
{
"prompt": "A cat astronaut floating in space, photorealistic",
"imageSize": "2K",
"aspectRatio": "16:9"
}Response
{
"type": "nano-banana-pro-generate",
"jobId": "abc123-def456",
"status": "pending",
"success": true
}Endpoint
Quality
Full OpenAPI 3.1 schema with detailed input/output definitions, comprehensive guidance docs, clear pricing, and live 402 challenge flow documented. The probe returned 405 on HEAD/GET (expected since this is a POST-only endpoint), so the endpoint is not confirmed broken. Deducting slightly because the probe didn't capture an actual 402 on POST, and no dedicated docs page exists (404 on /docs).
Warnings
- —Probe used HEAD/GET which returned 405; this is a POST-only endpoint so liveness is not confirmed by probe but is expected to work based on OpenAPI spec
- —No dedicated documentation page at /docs (returns 404); all docs are embedded in the OpenAPI x-guidance field
- —The listing URL path is /nano-banana/generate but the OpenAPI spec documents /nano-banana-pro/generate — verify the correct model slug
Citations
- —Nano Banana Pro generate costs $0.13–$0.24 per generation and takes ~10shttps://stablestudio.dev/api/openapi.json
- —Payment is USDC on Base (eip155:8453) with amount in 6-decimal micro-units (134000 = $0.134)https://stablestudio.dev/api/openapi.json
- —Supports aspect ratios 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 and resolutions 1K, 2K, 4Khttps://stablestudio.dev/api/openapi.json
- —MCP server available via npx -y agentcash@latesthttps://stablestudio.dev/agents.txt
- —Payment system is USDC on Base with no API keys requiredhttps://stablestudio.dev/agents.txt