Skip to main content
POST
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 (200 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.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
videoUrl
string<uri>
required

Publicly accessible MP4 URL to trim.

startTimestamp
string
required

Start timecode for the trim in HH:MM:SS or HH:MM:SS.mmm format.

endTimestamp
string
required

End timecode for the trim in HH:MM:SS or HH:MM:SS.mmm format.

requestSource
enum<string>

Optional identifier describing where the API request originated.

Available options:
API,
WEB,
MAKE_DOT_COM,
ZAPIER,
N8N,
PLAYGROUND,
DEFAULT_AUTOMATION,
AGENT_PREVIEW,
AGENT_LIVE,
AUTOPILOT,
STUDIO

Response

Trimmed video returned.

trimmedVideoUrl
string<uri>
required

Temporary download URL for the trimmed video asset.

creditsUsed
integer
required

Credits consumed while processing the request.