Skip to main content
POST
Clip Video
Product: Visual Agents Use case: Managed endpoints powering Memories.ai’s open-source video search and editing agents (queries, video clipping/editing, screenplay extraction) Host: https://mavi-backend.memories.ai/serve/api/v2 Auth: Authorization: sk-mavi-... (no Bearer prefix)
This endpoint analyzes a video and automatically detects scene boundaries based on visual content changes. It returns an array of scene segments, each with start and end frame numbers.
This endpoint performs scene detection (automatic segmentation), not manual video clipping. It identifies natural scene transitions in the video and returns the frame ranges for each detected scene.
This is an async endpoint. You must configure a webhook URL in Webhooks Settings before calling this endpoint, otherwise you will not receive the processing results. See Webhooks Configuration Guide for details.
Pricing:
  • $0.02/second of video

Code Examples

Request Body

Response

Returns task information for the video clip creation operation.

Response Parameters

Callback Response Parameters

When the video clipping is complete, a callback will be sent to your configured webhook URL.

Understanding the Callback Response

The callback response contains an array of scene segments identified in the video, each with start and end frame numbers. Response Structure:
How to access the data:
  • Scene segments: callback_response.data.data.data
  • Number of scenes detected: callback_response.data.data.data.length
  • First scene start frame: callback_response.data.data.data[0].start
  • First scene end frame: callback_response.data.data.data[0].end
  • Execution time: callback_response.data.data.exec_time
  • Success status: callback_response.data.success
  • Task ID: callback_response.task_id
Frame Range Format: Each segment represents a continuous scene in the video:
  • start: The frame number where the scene begins (inclusive)
  • end: The frame number where the scene ends (inclusive)
  • Frame numbers are 0-indexed and based on the original video’s FPS
  • Scenes are automatically detected based on visual content changes
Converting frame numbers to seconds: To convert frame numbers to time, you need the video’s FPS (frames per second), which can be obtained via the Get Metadata endpoint.
For example, if the video is 24 FPS:
  • {start: 0, end: 46} → 0s to 1.92s
  • {start: 47, end: 143} → 1.96s to 5.96s

Notes

  • Video clipping is processed asynchronously
  • Returns a task_id that can be used to track the clip creation progress
  • Use the task_id to query the status and results of clip creation
  • Original video remains unchanged

Authorizations

Authorization
string
header
required

Body

application/json
asset_id
string
required

The video asset ID to create a clip from

Example:

"re_657739295220518912"

Response

200 - application/json

Video clip creation initiated successfully

code
string

Response code indicating the result status

Example:

200

msg
string

Response message describing the operation result

Example:

"success"

data
object

Response data object containing task information

success
boolean

Indicates whether the operation was successful

Example:

true

failed
boolean

Indicates whether the operation failed

Example:

false