Task lifecycle
The documented unified video route accepts a JSON request and returns an asynchronous task. The exact fields depend on the selected model: some routes use seconds plus output.ratio; others accept native provider-shaped settings.
A safe client flow is: validate the model capability, submit once with an idempotency key, persist the task object, poll the original task, then retrieve the delivered content URL.
Minimal request
curl -X POST "https://xinfeng.best/draw/api/v1/videos" \
-H "Authorization: Bearer $XINFENG_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: my-video-request-001" \
-d '{
"model": "wan3.0-video",
"prompt": "A slow aerial shot over a mountain lake at sunrise",
"seconds": 5,
"output": {"ratio": "720p-16:9"}
}'Store the returned task ID and any request ID or poll URL. Do not treat a network timeout as proof that the request was rejected.
Poll and retrieve
curl "https://xinfeng.best/draw/api/v1/videos/$TASK_ID" \
-H "Authorization: Bearer $XINFENG_API_KEY"When the task reports a completed or delivered state, use the content URL from that response. If the response supplies a retained content URL, prefer the server-issued value rather than constructing a path manually.
Retry rules
- A clear pre-submit validation error can be corrected and retried.
- A timeout or gateway error after submission is ambiguous: query the original task first.
- A terminal failure should be inspected before creating a new job; repeated automatic retries can multiply provider work.
- Never replace a model or downgrade a reference silently to make a request pass.
Where to verify model rules
Use the public catalog on this hub for a readable snapshot, then use the authenticated /v1/models and capability endpoints to confirm what your key can submit. The OpenAPI document is the source for request shape and status codes.