Flux 2 Pro image generation via micropayment — $0.02–$0.04 per image, up to 2 MP, no API key needed.
What it does
This endpoint generates images using the Flux 2 Pro model through StableStudio's pay-per-generation platform. It accepts a text prompt and returns an asynchronous job that produces an image in configurable aspect ratios (1:1, 16:9, 9:16, 3:2, 2:3, 4:5, 5:4, 4:3, 3:4), resolutions (0.5 MP, 1 MP, 2 MP), and output formats (webp, jpg, png). Pricing is dynamic, ranging from $0.02 to $0.04 per generation, with results typically ready in ~5 seconds.
Payment is settled in USDC on Base (EIP-155:8453) or via Tempo L2 pathUSD. The flow is: POST without payment to receive a 402 challenge with the exact USDC amount, sign the authorization, then POST again with the PAYMENT-SIGNATURE header. The response contains a jobId which you poll via GET /api/jobs/{jobId} (authenticated with a SIGN-IN-WITH-X wallet signature) until the status is "complete" and an imageUrl is returned.
Flux 2 Pro also supports an edit endpoint at /api/generate/flux-2-pro/edit that accepts 1–8 reference images (uploaded via the /api/upload flow at $0.01 each) for image-guided generation at $0.03–$0.06. This listing covers the generate endpoint specifically. The endpoint is part of StableStudio's broader platform which offers multiple image models (Nano Banana Pro, GPT Image 1.5, Grok) and video models (Seedance, Wan, Sora, Veo). No API keys or subscriptions are required — payment is the only authentication for generation.
Capabilities
Use cases
- —Generate high-quality images from text prompts at low per-call cost
- —Produce images in specific aspect ratios and resolutions for design workflows
- —Automate image creation in agent pipelines without managing API keys or subscriptions
- —Generate reproducible images using seed values for A/B testing or iteration
- —Batch image generation with configurable safety tolerance levels
Fit
Best for
- —Agents needing cheap, fast text-to-image generation ($0.02–$0.04 per call)
- —Developers who want pay-per-use without subscriptions or API key management
- —Workflows requiring multiple aspect ratios and resolution options up to 2 MP
Not for
- —Real-time image generation requiring sub-second latency (typical ~5s turnaround)
- —Users without a crypto wallet (USDC on Base or Tempo L2 required for payment)
- —Image editing with reference images (use the /edit endpoint instead)
Quick start
# 1. Get payment challenge
curl -X POST https://stablestudio.dev/api/generate/flux-2-pro/generate \
-H 'Content-Type: application/json' \
-d '{"prompt": "A sunset over mountains"}'
# Returns 402 with PAYMENT-REQUIRED header (base64 JSON)
# 2. Decode challenge, sign USDC payment, re-POST with:
# -H 'PAYMENT-SIGNATURE: <signed_payment>'
# 3. Poll GET /api/jobs/{jobId} with SIGN-IN-WITH-X headerExample
Request
{
"prompt": "A photorealistic sunset over snow-capped mountains with a lake reflection",
"resolution": "1 MP",
"aspect_ratio": "16:9",
"output_format": "webp",
"output_quality": 80,
"safety_tolerance": 2,
"prompt_upsampling": false
}Response
{
"type": "flux-2-pro-generate",
"jobId": "abc123-def456-ghi789",
"status": "pending",
"success": true
}Endpoint
Quality
Full OpenAPI schema with detailed input/output definitions, comprehensive documentation in x-guidance, clear pricing ($0.02–$0.04), and well-documented payment flow. The probe shows 405 on HEAD/GET (expected since this is a POST-only endpoint), and the OpenAPI spec confirms the endpoint is POST. Deducting slightly because no live 402 challenge was captured directly for this specific endpoint and no dedicated docs page exists (404).
Warnings
- —Probe returned 405 because HEAD/GET were tried on a POST-only endpoint — this does not indicate the endpoint is down
- —No dedicated documentation page exists at /docs (returns 404); all docs are embedded in the OpenAPI x-guidance field
- —Payment requires a crypto wallet with USDC on Base (EIP-155:8453) or Tempo L2 pathUSD
Citations
- —Flux 2 Pro generate costs $0.02–$0.04 per generation with ~5s latencyhttps://stablestudio.dev/api/openapi.json
- —Payment is USDC on Base (EIP-155:8453) with 6 decimal placeshttps://stablestudio.dev/api/openapi.json
- —Supports aspect ratios 1:1, 16:9, 9:16, 3:2, 2:3, 4:5, 5:4, 4:3, 3:4 and resolutions 0.5 MP, 1 MP, 2 MPhttps://stablestudio.dev/api/openapi.json
- —Also supports Tempo L2 (mpp method=tempo, intent=charge)https://stablestudio.dev/api/openapi.json
- —StableStudio describes itself as AI image/video generation with micropayments, USDC on Basehttps://stablestudio.dev