Skip to main content

Asynchronous Processing

Video generation is a computationally intensive process that can take several minutes to complete. The VibePeak API uses an asynchronous task-based architecture to handle this efficiently.

How It Works

1

Submit Request

Send a POST request to create a slideshow. The API validates your request and returns immediately with a task ID.
2

Task Queued

Your video generation task is added to the processing queue. You receive a 202 Accepted response with the task details.
3

Processing

The system processes your images, applies AI enhancements, generates narration, and creates the final video.
4

Completion

Once complete, you can retrieve the video URL via polling or webhook notification.

Task Lifecycle

Tasks progress through the following statuses:

Submitting a Task

When you create a slideshow, you’ll receive an immediate response:

Polling for Status

Check the task status by polling the tasks endpoint:

Response Headers

When creating a task, the API returns helpful headers for async workflows:

Polling Best Practices

Video generation typically takes 4-10 minutes. Polling too frequently wastes resources and may trigger rate limiting.
The API returns a Retry-After: 30 header - we recommend polling every 30 seconds for video generation tasks.
We recommend the following polling strategy:
Recommended intervals:
  • Default: Poll every 30 seconds (matches Retry-After header)
  • Video generation typically completes in 4-10 minutes
  • Maximum wait: 20 minutes before timing out

Using Webhooks Instead

For production applications, we recommend using webhooks instead of polling. Webhooks provide:
  • Real-time notifications - No delay between completion and notification
  • Reduced API calls - No need for repeated polling requests
  • Better scalability - Handle more concurrent tasks efficiently

Video URL Expiration

Video URLs expire after 7 days. Download or store the video before expiration.
The expires_at field in the task result indicates when the video URL will become invalid. Make sure to:
  1. Download the video to your own storage, or
  2. Re-request the task status to get a fresh URL (if the video is still available)

Handling Failures

If a task fails, the response will include error details:
Common failure reasons:
  • Invalid or inaccessible image URLs
  • Unsupported image formats
  • Images too small or corrupted
  • Internal processing errors
For failed tasks, review the error message, fix the issue, and submit a new request.