Pay-per-image generation via Nano Banana Pro with up to 4K resolution, settled in USDC on Base.
What it does
This endpoint generates images using the Nano Banana Pro model via StableStudio's pay-per-generation API. It accepts a text prompt and optional parameters for aspect ratio (10 options from 1:1 to 21:9) and resolution (1K, 2K, or 4K). Pricing is dynamic, ranging from $0.13 to $0.24 per generation depending on resolution, with typical generation time around 10 seconds. Payment is settled in USDC on Base (EIP-155:8453) using the x402/MPP protocol — no API keys or subscriptions required.
The workflow is asynchronous: POST the generation request with a signed USDC payment header, receive a jobId with status "pending", then poll the job status endpoint (GET /api/jobs/{jobId}) using a SIGN-IN-WITH-X wallet signature until the job completes and returns an imageUrl. StableStudio also offers a companion edit endpoint at /api/generate/nano-banana-pro/edit that accepts 1–14 reference images for guided editing.
StableStudio is part of a broader platform offering multiple image models (GPT Image 1.5, Flux 2 Pro, Grok) and video models (Sora 2, Veo 3.1, Seedance, Wan 2.6, Grok Video). The Nano Banana Pro generate endpoint is the recommended default for image tasks due to its quality-to-cost ratio. An MCP server is available via `npx -y agentcash@latest` for agent integration.
Capabilities
Use cases
- —Generating high-resolution images from text prompts for creative projects
- —Automated image creation in agent workflows without API key management
- —On-demand 4K asset generation for design or marketing pipelines
- —Programmatic image generation with per-call crypto micropayments
- —Batch image creation across multiple aspect ratios for social media
Fit
Best for
- —Agents or apps needing pay-per-call image generation without subscriptions
- —Developers wanting crypto-native (USDC on Base) payment for AI image APIs
- —Use cases requiring up to 4K resolution with flexible aspect ratios
- —Quick, low-cost image generation (~$0.13–$0.24 per image, ~10s latency)
Not for
- —Real-time or sub-second image generation (async polling adds latency)
- —Users without a crypto wallet (requires USDC on Base for payment)
- —Image editing with reference images (use the /edit endpoint instead)
Quick start
# 1. POST without payment to get 402 challenge
curl -X POST https://stablestudio.dev/api/generate/nano-banana-pro/generate \
-H 'Content-Type: application/json' \
-d '{"prompt": "A sunset over mountains", "aspectRatio": "16:9", "imageSize": "2K"}'
# Returns 402 with PAYMENT-REQUIRED header (base64 JSON)
# 2. Decode challenge, sign USDC payment, re-POST with PAYMENT-SIGNATURE header
# 3. Poll GET /api/jobs/{jobId} with SIGN-IN-WITH-X header until completeExample
Request
{
"prompt": "A sunset over mountains with golden light",
"imageSize": "2K",
"aspectRatio": "16:9"
}Response
{
"type": "nano-banana-pro",
"jobId": "abc123-def456",
"status": "pending",
"success": true
}Endpoint
Quality
Full OpenAPI 3.1 schema with detailed input/output definitions, clear pricing in the guidance docs, and a live 402 MPP challenge confirmed (the endpoint is POST-only, so HEAD/GET returning 405 is expected). Docs pages return 404 but the OpenAPI x-guidance field provides comprehensive documentation. Minor deduction for no standalone docs site and reliance on inline guidance.
Warnings
- —Probe used HEAD/GET which returned 405; the endpoint is POST-only and is expected to be live (confirmed by OpenAPI spec and payment protocol details)
- —No standalone documentation pages found (/docs, /pricing, /api all return 404); all docs are embedded in the OpenAPI x-guidance field
- —Dynamic pricing means the actual charge varies by resolution/aspect ratio; the 402 challenge at call time determines the exact amount
Citations
- —Nano Banana Pro generate costs $0.13–$0.24 per generation with ~10s latencyhttps://stablestudio.dev
- —Payment is USDC on Base (EIP-155:8453), amount 134000 micro-units = $0.134https://stablestudio.dev
- —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
- —MCP server available via npx -y agentcash@latesthttps://stablestudio.dev
- —Nano Banana Pro is the recommended default for image taskshttps://stablestudio.dev