Generate Clips
Create engaging video clips from YouTube content using our advanced multimodal AI model.
The Generate Clips endpoint allows you to automatically extract the most engaging segments from any YouTube video or public video URL. Our AI analyzes the video content across multiple dimensions including visual engagement, audio quality, semantic relevance, and viewer retention patterns to identify the most compelling clips.
Overview
This endpoint initiates an asynchronous process to analyze and generate clips from your video. The process involves:
- Video validation and metadata extraction
- Content analysis using our multimodal AI model
- Clip boundary detection and optimization
- Final clip generation and processing
Authentication
All requests must include your API key in the Authorization header.
Authorization: Bearer YOUR_API_KEY
Request Parameters
{ "url": "string", // YouTube or public video URL "minimumTime": number, // Minimum clip duration in seconds "maximumTime": number // Maximum clip duration in seconds }
url
The URL of the video to process. Must be either:
A valid YouTube URL (e.g., https://www.youtube.com/watch?v=...)
A public video URL accessible without authentication
minimumTime
The minimum duration for generated clips in seconds.
Must be between 30 and 600 seconds
Default: 60 seconds
Cannot be greater than maximumTime
maximumTime
The maximum duration for generated clips in seconds.
Must be between minimumTime and 900 seconds
Default: 300 seconds
Recommended: 2-3x minimumTime for optimal results
Response Format
{ "taskId": "string", // Unique identifier for the generation task "remainingHours": { "client": number, // Remaining client hours "internal": number // Remaining internal hours }, "estimatedProcessingTime": number // Estimated processing time in seconds }
taskId
A unique identifier for your clip generation task. Use this ID with the Task Status endpoint to track progress.
remainingHours
Available processing hours for your account:
client: Available hours after immediate deduction for the request
internal: Hours that will remain after successful processing
estimatedProcessingTime
Estimated time in seconds to complete the clip generation. This varies based on video length and complexity.
Error Responses
{ "error": "string", // Detailed error message "status": number, // HTTP status code "code": "string" // Error code for programmatic handling }
Status | Code | Description |
---|---|---|
400 | INVALID_URL | The provided video URL is invalid or inaccessible |
401 | INVALID_API_KEY | The provided API key is invalid or expired |
402 | PAYMENT_REQUIRED | Your account requires payment to continue |
403 | INSUFFICIENT_HOURS | Not enough hours remaining in your quota |
400 | VIDEO_LENGTH_ERROR | Unable to determine video length or video is too short |
400 | VIDEO_TOO_SHORT | Video length is shorter than minimum clip length |
500 | SERVER_ERROR | Internal server error occurred |
Video Requirements
- Video must be publicly accessible without authentication
- Video length must be greater than the specified minimum clip length
- Maximum supported video length is 4 hours
- Supported formats: MP4, MOV, AVI, WebM
- Maximum file size: 2GB
Additional Endpoints
The following additional endpoints are available for managing clip generation tasks:
GET /get-successful-generations
Retrieve a list of your recent successful clip generation tasks
GET /get-clips-from-task/{taskId}
Get all clips generated from a specific task
Code Examples
curl -X POST https://api.joinoverlap.com/generate-clips \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "url": "https://www.youtube.com/watch?v=example", "minimumTime": 60, "maximumTime": 300 }'
Usage Notes & Best Practices
Processing Time
- Processing takes approximately 10-15 seconds per minute of content
- Videos longer than 60 minutes may take additional time for initial processing
- Use webhooks for real-time notifications when processing completes
Usage & Quotas
- Monthly quota of 150 processing hours
- Hours are tracked in two ways:
- Client hours: Deducted immediately upon request
- Internal hours: Deducted upon successful processing
- Failed processing attempts do not count against internal hours
Optimization Tips
- For optimal results, provide videos between 5-60 minutes in length
- Set maximumTime to 2-3x minimumTime for better clip selection
- The API generates 5-10 clips per video based on content quality
- Higher quality source videos result in better clip detection
Error Handling
- Implement exponential backoff for rate limit errors
- Store taskId values securely for status checking
- Monitor remainingHours to avoid quota exhaustion
- Use webhook notifications for reliable status updates