Image generation (async)
Submit an async StableStudio image-generation job from a text prompt; poll ai/image-generate-async-status with the returned jobId for the completed image assets.
Provider contract
- Call path
- /routes/stablestudio/ai/image-generate-async
- Method
- POST
- Selected provider
- stablestudiodefault
- Provider price
- Dynamic $0.02-$0.50; quote required
- Settlement
- Base USDC · x402 · 5% h402 fee
Quickstart
Both commands call the selected provider directly.
curl -X POST '/routes/stablestudio/ai/image-generate-async' \
-H 'content-type: application/json' \
-d '{"prompt":"A minimal flat illustration of a router directing colorful packets, dark background","model":"flux-2-pro"}'h402 call 'ai/image-generate-async' --provider 'stablestudio' --method POST --json '{"prompt":"A minimal flat illustration of a router directing colorful packets, dark background","model":"flux-2-pro"}'Parameters & live test
pays real USDCFill the request fields, quote the exact per-call total, then choose x402 or eligible bonus credit explicitly before sending. Only the selected provider's listed parameters are accepted.
promptstringrequiredText prompt describing the image.
modelstringoptionaldefault flux-2-proGeneration model; each quotes its own price. Optional — defaults to flux-2-pro when omitted; provider-native, so pin /routes/stablestudio to choose one.
aspect_ratiostringoptionalProvider-native aspect ratio for FLUX and Grok models.
aspectRatiostringoptionalProvider-native aspect ratio for Nano Banana models.
{
"prompt": "A minimal flat illustration of a router directing colorful packets, dark background",
"model": "flux-2-pro"
}This starts a job — poll Generation job status (ai/image-generate-async-status) for the final result.
{ "data": { "success": true, "jobId": "cmrw9dqf6000004l2011tp4c0", "status": "pending", "type": "flux-2-pro-generate", "pollUrl": "https://stablestudio.dev/api/jobs/cmrw9dqf6000004l2011tp4c0" }, "h402": { "routeId": "ai/image-generate-async", "provider": "stablestudio", "selectedCandidateId": "ai/image-generate-async/stablestudio", "routing": "manual", "followUp": { "routeId": "ai/image-generate-async-status", "path": "/routes/stablestudio/ai/image-generate-async-status", "method": "GET", "params": { "jobId": "cmrw9dqf6000004l2011tp4c0" }, "docsUrl": "https://h402-test.hunt.town/catalog/ai/image-generate-async-status", "instruction": "This response is a job receipt, not the final result. Poll GET /routes/stablestudio/ai/image-generate-async-status with the returned id as jobId (free) until the provider reports completion — terminal status labels are provider-native, and a failure status means the job errored. Final-result example: https://h402-test.hunt.town/catalog/ai/image-generate-async-status" }, "paidBy": "x402-exact" } }
Providers
Choose a provider for this task. The catalog recommends the current default from quality, reliability, and price; your selected provider stays pinned. Listed prices are provider prices; settlement adds a 5% h402 fee.
- Success
- 100%
- p50
- 2.12s
- Calls
- 2