KIE.AI
English
  • English
  • Chinese
English
  • English
  • Chinese
Support
English
  • English
  • Chinese
MarketVeo3.1 APISuno API4o Image APIFlux Kontext APIRunway API
Luma APIFile Upload APICommon API
MarketVeo3.1 APISuno API4o Image APIFlux Kontext APIRunway API
Luma APIFile Upload APICommon API
  1. Runway API
  • Runway API Quickstart
  • AI Video Generation Callbacks
  • AI Video Extension Callbacks
  • Aleph Video Generation Callbacks
  • Generate AI Video
    POST
  • Get AI Video Details
    GET
  • Extend AI Video
    POST
  • Generate Aleph Video
    POST
  • Get Aleph Video Details
    GET
English
  • English
  • Chinese
Support
English
  • English
  • Chinese
MarketVeo3.1 APISuno API4o Image APIFlux Kontext APIRunway API
Luma APIFile Upload APICommon API
MarketVeo3.1 APISuno API4o Image APIFlux Kontext APIRunway API
Luma APIFile Upload APICommon API
  1. Runway API

AI Video Extension Callbacks

When you submit a video extension task to the Runway API, you can set a callback address through the 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 your callBackUrl in the following format:
Success Callback
Failure Callback
{
  "code": 200,
  "msg": "All generated successfully.",
  "data": {
    "image_url": "https://file.com/m/xxxxxxxx.png",
    "task_id": "ee603959-debb-48d1-98c4-a6d1c717eba6",
    "video_id": "485da89c-7fca-4340-8c04-101025b2ae71",
    "video_url": "https://file.com/k/xxxxxxx.mp4"
  }
}

Status Code Description#

Parameter Description#

ParameterTypeRequiredDescription
codeintegerYesCallback status code indicating task processing result
msgstringYesStatus message providing detailed status description
data.task_idstringYesTask ID, consistent with the taskId returned when you submitted the task
data.video_idstringNoVideo unique identifier (returned only on success)
data.video_urlstringNoAccessible video URL, valid for 14 days (returned only on success)
data.image_urlstringNoCover image URL of the generated video (returned only on success)

Status Code Details#

Status CodeDescription
200Success - Request has been processed successfully
400Client Error - Request parameters are incorrect or content is inappropriate
500Server Error - An unexpected error occurred while processing the request

Common Error Messages#

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

Callback Reception Examples#

Here are example codes for receiving callbacks in popular programming languages:
Node.js
Python
PHP

Best Practices#

Callback URL Configuration Recommendations
1.
Use HTTPS: Ensure callback URL uses HTTPS protocol for secure data transmission
2.
Verify Source: Verify the legitimacy of the request source in callback processing
3.
Idempotent Processing: The same task_id may receive multiple callbacks, ensure processing logic is idempotent
4.
Quick Response: Callback processing should return 200 status code promptly to avoid timeout
5.
Asynchronous Processing: Complex business logic should be processed asynchronously to avoid blocking callback response
6.
Timely Download: Video URLs are valid for only 14 days, please download and save promptly
7.
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
Server Response Issues
Content Format Issues
Video Processing Issues
Content Moderation Issues
Concurrency Limit Issues
Extension Quality Issues

Extension-Specific Considerations#

AI Video Extension Features
AI video extension functionality continues generation based on existing videos with the following characteristics:
1.
Duration Increase: Extended videos will be longer than original videos
2.
Style Continuation: The system tries to maintain the visual style and motion patterns of the original video
3.
Smooth Transition: Extended portions will naturally connect with the original video
4.
Quality Preservation: Extended video quality should be comparable to the original video
5.
Motion Coherence: Object movement and scene changes will maintain logical coherence
6.
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.
Previous
AI Video Generation Callbacks
Next
Aleph Video Generation Callbacks
Built with