wylon
POSThttps://api.wylon.cn/v1/contents/generations/tasks
GEThttps://api.wylon.cn/v1/contents/generations/tasks/{task_id}

Asynchronous generation

Create an image-generation task in the background, save its task ID, and query it for status and final output.

Create an asynchronous task when image generation should continue independently of the original connection. Save the returned id, poll its status with increasing intervals, and download the signed result URL promptly after success.

Authorization and request format

Authorizationstring · headerrequired
Pass Authorization: Bearer $WYLON_API_KEY.
Content-Typestring · headerrequired
Send the request body as application/json.

Create a task

Create parameters

typestringrequired
Use image. If omitted, the API treats the request as a video task.
modelstringrequired
A complete wylon model ID, such as Qwen/Qwen-Image-2512.
promptstringrequired
Describe the subject, scene, composition, lighting, style, and text to generate.
negative_promptstringoptional
Describe content to exclude. Support depends on the model.
seedintegeroptional
Controls generation randomness when supported by the model.
sizestringoptional
Output dimensions in widthxheight format.
ninteger1
Number of images to generate.
output_formatstringpng
Requested output file format.
output_compressionintegeroptional
Requested compression level. It has no effect on PNG output by default.
backgroundstringoptional
OpenAI-compatible background option. It has no effect in V1 by default.
qualitystringoptional
OpenAI-compatible quality option. It has no effect in V1 by default.
stylestringoptional
Requested style preset. Supported values depend on the model.
userstringoptional
A caller-supplied end-user identifier. It is not used for authentication.
user_idstringoptional
Compatibility field accepted by the API but not currently stored or used.
moderationstringoptional
Requested moderation mode. It cannot disable platform safety controls.
streambooleanfalse
V1 does not support partial-image streaming; omit this field or pass false.
partial_imagesinteger0
V1 does not support partial images; omit this field or pass 0.

Current model limits

For Qwen/Qwen-Image-2512 only:

ParameterSupported valuesDefault
size1328x1328, 1664x928, 928x1664, 1104x1472, 1584x10561664x928
n11

V1 adds an “AI-generated” watermark and does not support partial-image streaming.

Query a task

Send a GET request with the returned task ID. Add detail=true to include the effective image_parameters. Poll at a reasonable interval and stop at a terminal status.

StatusMeaningAction
queuedAccepted and waitingQuery again later
runningGeneratingQuery again later
succeededCompletedDownload the image
failedGeneration failedRead error
cancelledCancelled while queuedStop polling
expiredTask or result expiredCreate a new task if needed

Read and download the result

When status=succeeded and file_status=available, the signed URL is in data[0].url and its expiry time is in data[0].url_expires_at. Download it promptly and persist the file in your own storage if needed. After expiry, file_status changes to expired, and the URL is not reissued.

Error handling

For network errors or 5xx responses after task creation, query the original task before submitting another request. This prevents duplicate generation and charges.

沪ICP备2026010432号-1沪公网安备31010402336632号