Generate an image from a text prompt with Qwen Image 2.1. Choose the output resolution, aspect ratio and background, then retrieve the image when the asynchronous generation completes.
Developer API pricing
Provider: SeeAPI
USD estimate: $0.0037 / credit · Estimated equivalent, not an additional charge.
1K: 5 credits/gen (≈ $0.019/gen)
2K: 10 credits/gen (≈ $0.037/gen)
After submitting a task, use the unified query endpoint to check progress and retrieve results:
Keep the returned generation ID and query task status until completion. A successful submission only confirms that the task was accepted; retrieve the image from the completed task result.
Manage the secret used to verify generation webhook signatures. Callback URLs are supplied when you create each generation.
Callback URL per generation.
/v1/generationsA new, stable key for each generation request. Reuse it only when retrying the same request body.
order-20260818-001The model ID shown in the selected model's API documentation.
qwen-image-2-1qwen-image-2-1qwen-image-2-1Text to Image. Use the Endpoint ID shown in this model's API documentation.
text-to-imagetext-to-imagetext-to-imageOptional public Provider ID. Omit it to use the Endpoint default Provider (seeapi).
seeapiseeapiseeapiPlace the image generation parameters below inside this object.
Provider parameters
seeapiDefault ProviderDescribe the subject, composition, style and any text to render. For a transparent output, describe the subject without adding a surrounding scene.
A small ceramic fox figurineChoose the proportions of the generated image.
1:14:33:43:22:316:99:1621:99:211:1Choose the output resolution tier. This setting affects the credits required for the generation.
1K2K1KChoose an opaque image or a subject with a transparent background. Transparent output requires PNG or WebP.
opaquetransparentopaquetransparentChoose the output file format. JPEG is only available with an opaque background.
pngwebpjpegpngwebpEnable automatic prompt rewriting before generation. Disable it when you want to submit your wording without prompt enhancement.
trueOptional integer seed. Omit it for a random seed; comparisons should use the same model version and generation settings.
Enable the optional content safety check. API requests default to false.
falseAn absolute HTTPS URL that receives the terminal generation Webhook.
https://client.example.com/webhooks/seeapiUnique generation identifier. Use it to query task status and match completion events.
task_xxxqwen-image-2-1text-to-imageseeapiseeapi: SeeAPIseeapiCurrent task status. The submission response reports processing; query the task for its final result.
processingprocessingEstimated public credits. Values can include up to three decimal places.
5Consumed public credits, with up to three decimal places.
0Refunded public credits, with up to three decimal places.
0Time the generation was created.
2026-08-18T10:00:00ZTime the generation record was last updated.
2026-08-18T10:00:00ZWhether this response is an idempotent replay of an earlier request.
falseUnique generation identifier. Use it to query task status and match completion events.
task_xxxqwen-image-2-1text-to-imageseeapiseeapi: SeeAPIseeapiCurrent task status. The submission response reports processing; query the task for its final result.
processingprocessingEstimated public credits. Values can include up to three decimal places.
5Consumed public credits, with up to three decimal places.
0Refunded public credits, with up to three decimal places.
0Time the generation was created.
2026-08-18T10:00:00ZTime the generation record was last updated.
2026-08-18T10:00:00ZWhether this response is an idempotent replay of an earlier request.
falseInvalid JSON or input parameters. Check the parameter values and cross-field requirements before retrying.
Invalid API Key or authentication failed
Insufficient credits
The current request is not allowed
Model, Endpoint, or task not found
Idempotency conflict or the same request is still being created
Request body is too large
Too many requests
Service temporarily unavailable
const response = await fetch("https://api.seeapi.com/v1/generations", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Idempotency-Key": "order-20260818-001",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "qwen-image-2-1",
"endpoint": "text-to-image",
"provider": "seeapi",
"input": {
"prompt": "A small ceramic fox figurine",
"aspect_ratio": "1:1",
"resolution": "1K",
"background": "transparent",
"output_format": "webp",
"enhance_prompt": true,
"nsfw_checker": false
},
"callback_url": "https://client.example.com/webhooks/seeapi"
})
});
const result = await response.json();{
"generation": {
"id": "task_xxx",
"model": "qwen-image-2-1",
"endpoint": "text-to-image",
"provider": "seeapi",
"status": "processing",
"estimated_credits": 5,
"consumed_credits": 0,
"refunded_credits": 0,
"created_at": "2026-08-18T10:00:00Z",
"updated_at": "2026-08-18T10:00:00Z"
},
"idempotent": false
}