1. Check the price
Use your TaskFuel API key as TASKFUEL_API_KEY in your terminal or server. Keep it out of browser code. This request checks the price without paying.
Exact request from the image test above. A new generation can produce a different image.
curl --fail-with-body https://app.taskfuel.ai/v1/call \
-H "Authorization: Bearer $TASKFUEL_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary @- <<'TASKFUEL_REQUEST'
{
"url": "https://stablestudio.dev/api/generate/gpt-image-2/generate",
"method": "POST",
"body": {
"prompt": "Photorealistic automotive campaign photograph of one unbranded scarlet-red two-door sports coupe accelerating along an empty closed desert test circuit at golden hour. Low front three-quarter tracking-camera view, car pointed to the right, entire car and all visible wheels inside the frame. Sculpted low bonnet, simple narrow headlights, black five-spoke wheels, dark windows, realistic red paint reflecting the warm sky. The car body is crisp while the spinning wheels and asphalt show controlled directional motion blur. Pale desert hills, a sweeping bend and trackside barriers recede behind it. Dynamic but physically believable, natural light, realistic scale and geometry. Leave generous space ahead of the car and keep its complete silhouette within the middle 60 percent of the image height for a later widescreen crop. No other vehicles, no people visible, no badges, no brand logos, no words, no watermark. Landscape photograph, not an illustration.",
"size": "1536x1024",
"quality": "high",
"background": "opaque",
"output_format": "png"
},
"dryRun": true
}
TASKFUEL_REQUEST
2. Run the request
Review amount_usd in the quote. To pay and run, change dryRun to false and add maxAmountUsd with that approved amount inside the same JSON object. Keep the inputs unchanged; this limit applies to one call.
3. Read the result
The first response contains a job ID and pollUrl. Send that URL through TaskFuel’s /v1/call with method GET and no body. Check until complete or failed, then read result.imageUrl. Do not resubmit a pending generation.
Open the test image
Setup and API reference · Job polling and timeout recovery