callBackUrl parameter. After the task is completed, the system will automatically push the results to your specified address.
Callback Mechanism Overview
The callback mechanism eliminates the need to poll the API for task status. The system proactively pushes task completion results to your server.
Callback Timing
The system sends callback notifications in the following situations:- Video extension task successfully completed
- Video extension task failed
- Errors occurred during task processing
Callback Method
- HTTP Method: POST
- Content Type: application/json
- Timeout: 15 seconds
Callback Request Format
After task completion, the system will send a POST request to yourcallBackUrl in the following format:
Status Code Description
Callback status code indicating task processing result:
| Status Code | Description |
|---|---|
| 200 | Success - Request has been processed successfully |
| 400 | Client Error - Request parameters are incorrect or content is inappropriate |
| 500 | Server Error - An unexpected error occurred while processing the request |
Status message providing detailed status description. When code is 400, possible error messages include:
- Get image info failed
- Inappropriate content detected. Please replace the image or video
- Incorrect image format
- Please try again later. You can upgrade to Standard membership to start generating now
- Reached the limit for concurrent generations
- Unsupported width or height. Please adjust the size and try again
- Upload failed due to network reasons, please re-enter
- Your prompt was caught by our AI moderator. Please adjust it and try again!
- Your prompt/negative prompt cannot exceed 2048 characters. Please check if your input is too long
- Your video creation prompt contains NSFW content, which isn’t allowed under our policy. Kindly revise your prompt and generate again
Task ID, consistent with the taskId returned when you submitted the task
Video unique identifier (returned only on success)
Accessible video URL, valid for 14 days (returned only on success)
Cover image URL of the generated video (returned only on success)
Callback Reception Examples
Here are example codes for receiving callbacks in popular programming languages:- Node.js
- Python
- PHP
Best Practices
Callback URL Configuration Recommendations
- Use HTTPS: Ensure callback URL uses HTTPS protocol for secure data transmission
- Verify Source: Verify the legitimacy of the request source in callback processing
- Idempotent Processing: The same task_id may receive multiple callbacks, ensure processing logic is idempotent
- Quick Response: Callback processing should return 200 status code promptly to avoid timeout
- Asynchronous Processing: Complex business logic should be processed asynchronously to avoid blocking callback response
- Timely Download: Video URLs are valid for only 14 days, please download and save promptly
- Extension Management: Properly manage extended video files and cover images
Important Reminders
- Callback URL must be publicly accessible
- Server must respond within 15 seconds, otherwise it will be considered timeout
- After 3 consecutive retry failures, the system will stop sending callbacks
- Video URLs are valid for only 14 days, please download and save to your storage system promptly
- Ensure the stability of callback processing logic to avoid callback failures due to exceptions
- Properly handle content moderation errors to ensure input content complies with platform policies
- Extended videos are usually longer than original videos
- Pay attention to concurrent generation limits to avoid submitting too many tasks simultaneously
Troubleshooting
If you don’t receive callback notifications, please check the following:Network Connection Issues
Network Connection Issues
- Confirm that the callback URL is accessible from the public internet
- Check firewall settings to ensure inbound requests are not blocked
- Verify domain name resolution is correct
Server Response Issues
Server Response Issues
- Ensure server returns HTTP 200 status code within 15 seconds
- Check server logs for error messages
- Verify interface path and HTTP method are correct
Content Format Issues
Content Format Issues
- Confirm that the received POST request body is in JSON format
- Check if Content-Type is application/json
- Verify JSON parsing is correct
Video Processing Issues
Video Processing Issues
- Confirm that video URL is accessible
- Check video download permissions and network connection
- Verify video save path and permissions
- Note the 14-day validity period limitation of video URLs
- Backup videos to long-term storage system promptly
Content Moderation Issues
Content Moderation Issues
- Review content moderation error messages
- Ensure input images or videos do not contain inappropriate content
- Check if prompts comply with platform policies
- Avoid using NSFW-related descriptive words
- Ensure image format is correct and dimensions are appropriate
Concurrency Limit Issues
Concurrency Limit Issues
- Monitor current concurrent task count
- Implement appropriate task queue mechanism
- Consider upgrading to Standard membership for higher concurrency limits
- Reasonably schedule task submission times
Extension Quality Issues
Extension Quality Issues
- Check coherence of extended videos
- Verify if video duration meets expectations
- Evaluate quality and style consistency of extended portions
- Ensure extended videos transition naturally
Extension-Specific Considerations
AI Video Extension Features
AI video extension functionality continues generation based on existing videos with the following characteristics:- Duration Increase: Extended videos will be longer than original videos
- Style Continuation: The system tries to maintain the visual style and motion patterns of the original video
- Smooth Transition: Extended portions will naturally connect with the original video
- Quality Preservation: Extended video quality should be comparable to the original video
- Motion Coherence: Object movement and scene changes will maintain logical coherence
- URL Validity: Generated video URLs are valid for only 14 days
Alternative Approach
If you cannot use the callback mechanism, you can also use polling:Poll Query Results
Use the Get AI Video Details interface to periodically query task status, recommended every 30 seconds.
