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 Generation Callbacks

When you submit a video generation task to the Runway API, you can use the callBackUrl parameter to set a callback URL. The system will automatically push the results to your specified address when the task is completed.

Callback Mechanism Overview#

The callback mechanism eliminates the need to poll the API for task status. The system will proactively push task completion results to your server.

Callback Timing#

The system will send callback notifications in the following situations:
AI video generation task completed successfully
AI video generation task failed
Errors occurred during task processing

Callback Method#

HTTP Method: POST
Content Type: application/json
Timeout Setting: 15 seconds

Callback Request Format#

When the task is completed, 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": {
    "task_id": "ee603959-debb-48d1-98c4-a6d1c717eba6",
    "video_id": "485da89c-7fca-4340-8c04-101025b2ae71",
    "video_url": "https://file.com/k/xxxxxxx.mp4",
    "image_url": "https://file.com/m/xxxxxxxx.png"
  }
}

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_idstringYesGenerated video ID for identification and tracking
data.video_urlstringNoAccessible video URL, valid for 14 days. Empty on failure
data.image_urlstringNoCover image URL of the generated video. Empty on failure

Status Code Details#

Status CodeDescription
200Success - Video generation completed successfully
400Client Error - Inappropriate content, format error, quota limit, or other client-side issues
500Server Error - Internal server error during video generation

Common Error Messages#

Common error messages include:
"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."
"Your prompt was caught by our AI moderator. Please adjust it and try 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 your 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 a 200 status code as quickly as possible to avoid timeout
5.
Asynchronous Processing: Complex business logic should be processed asynchronously to avoid blocking callback response
6.
Immediate Download: Video URLs are valid for only 14 days, download and save files immediately upon success
Important Reminders
Callback URL must be a publicly accessible address
Server must respond within 15 seconds, otherwise it will be considered a timeout
If 3 consecutive retries fail, the system will stop sending callbacks
Video URLs expire after 14 days - download immediately upon receiving callback
Please ensure the stability of callback processing logic to avoid callback failures due to exceptions
Handle both video_url and image_url fields for complete media management
Pay attention to error messages for specific failure reasons (content moderation, format issues, quotas)

Troubleshooting#

If you do not receive callback notifications, please check the following:
Network Connection Issues
Server Response Issues
Content Format Issues
Video Processing Issues
Content Moderation Issues

Alternative Solution#

If you cannot use the callback mechanism, you can also use polling:
Poll Query Results
Use the get AI video details endpoint to regularly query task status. We recommend querying every 30 seconds.
Previous
Runway API Quickstart
Next
AI Video Extension Callbacks
Built with