Endpoints
Trim Video
Description
This endpoint allows users to trim a video from a specified URL based on start and end timestamps. The trimmed video is then uploaded to R2 storage, and the URL of the trimmed video is returned.
Endpoint
Headers
- Content-Type:
application/json
- Authorization: Bearer
<API_KEY>
(required)
Request Body
Responses
Success (200)
Returns the URL of the trimmed video and the number of credits used.
- X-RateLimit-Limit: The rate limit for the user.
- X-RateLimit-Remaining: The remaining number of requests for the user.
Bad Request (400)
Returned if the request is invalid or missing required parameters.
Internal Server Error (500)
Returned if there’s an error during the video trimming process.
Example Request
Example Response
Notes
- The timestamp format should be HH:MM:SS (e.g., 00:01:15 for 1 minute and 15 seconds).
- Credits used are calculated based on the duration of the output video (20 credits per minute, rounded up).
- Output videos are limited to 200MB in size. You can reduce the size of the output video by trimming a smaller portion of the input video.
- The trimmed video is temporarily stored (~24 hours).
Rate Limiting
Rate limit headers (X-RateLimit-Limit
and X-RateLimit-Remaining
) are included in the response to indicate the user’s current rate limit status.