Async Tasks / Async Tasks
Async Tasks API
Image and video generation use the unified /v1/tasks interface. Video models use asynchronous invocation (create a task to get a task_id, then poll for the result), while image models (such as wan2.6-t2i) use synchronous invocation, returning the result directly without polling. Video generation typically takes 1-5 minutes.
HTTP Invocation Workflow
1
Create task and get task_idPOST
https://nexusflow.vip/v1/tasks2
Poll result by task_idGET
https://nexusflow.vip/v1/tasks/{task_id}Note:
- After successful creation, use the returned
id(i.e., task_id) to query results. Do not create duplicate tasks; just poll to retrieve results. - Image models (such as wan2.6-t2i) are synchronous; the creation request returns the result directly, no polling needed.
- Video models polling recommended interval 10-15 seconds.
- task_id query validity period 24 hours; it cannot be queried after expiration.
- Output file URL validity period 24 hours; please download and save immediately after retrieval.
- Only image and video models support the
/v1/tasksinterface; chat models use/v1/chat/completions.
Step 1: Create Task
Example Model:
wan2.6-t2iRequest Parameters
Request Example
Step 1 Response: Get task_id
After successful creation, task information is returned (HTTP 202). The id serves as the task_id for subsequent polling queries.
Step 2: Poll Result by task_id
GET
https://nexusflow.vip/v1/tasks/{task_id}Query Request
Image task execution succeeded
Task Execution Failed
Response Parameters
Query Task List
GET
https://nexusflow.vip/v1/tasks?limit=20Retrieve the current user's recent task list. Use the limit parameter to control the number of results returned (default 20, maximum 100).
Best Practices
Smart Polling Intervals
Poll image tasks every 5-10 seconds and video tasks every 10-15 seconds. Avoid sub-second polling to reduce unnecessary requests.
Separate Sync and Async
Chat requests go to /v1/chat/completions, image/video to /v1/tasks, reducing mutual interference.
Download Results Promptly
Output URLs are valid for 24 hours. Download and save files immediately after task completion.
Handle Failures and Retries
When a task fails, check the error field to determine the cause. Parameter errors require fixing before retrying; upstream timeouts can be retried by creating a new task.
HappyHorse API
View HappyHorse Video Generation dedicated documentation
Rate Limits
View limits and optimization tips for high concurrency
Full Pricing
View pricing for all models