Create AutoClip job
/v1/autoclipFinds the strongest moments in a long video you own and turns each one into a vertical short, cropped to the speaker and captioned. The job runs in the background and every finished clip becomes a project on your account, so you can export clips through the same export endpoint as anything else.
- energy mode only works with edit_level clips, because captions and cropping both need speech.
- Credits are charged for the clips you asked for when the job starts, and stay spent if the job finds fewer.
- Credits:
- 1 video credit per requested clip, charged when the job starts
- Rate limit:
- Heavy tier, 2/s and 10/min
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| asset_id | body | string | Yes | A video asset you own to pull clips from. Between 1 minute and 3 hours long. |
| clip_count | body | integer | No | How many clips to look for. 2 to 20.default 5 |
| clip_length | body | integer | No | Target clip length in seconds. Clips still end on natural sentence boundaries.default 60306090 |
| edit_level | body | string | No | How much editing to apply: clips cuts only, captions adds subtitles, cropped reframes to vertical, full does both.default fullclipscaptionscroppedfull |
| formats | body | string[] | No | Layouts to render each clip in. 1 to 5 unique values.default ["streamer"]streamersplitblack-boxtitle-subtitlesfull-video |
| prompt | body | string | No | Steer what counts as a good moment, for example focus on product demos. Max 500 characters. |
| mode | body | string | No | How moments are found. speech reads the transcript, energy follows audio intensity for footage with little dialogue.default speechspeechenergy |
| language | body | string | No | Spoken language of the source. Defaults to automatic detection, which can pick the wrong language on videos with a dubbed audio track.enafarhybebnbsbgcazhhrcsdanlettlfifrkadeelguhehihuiditjaknkkkolvltmkmsmrnenofaplptparorusrskslessvtatethtrukurvi |
Request
curl -X POST "https://api.crayo.ai/v1/autoclip" \
-H "Authorization: Bearer $CRAYO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"asset_id": "cm7x1k2p40001abcd",
"clip_count": 5,
"clip_length": 60,
"edit_level": "full"
}'Response
{
"success": true,
"autoclip": {
"id": "cm7x1m8880001abcd",
"status": "queued",
"clip_count": 5,
"credits_charged": 5
}
}Errors
- 400UNKNOWN_FIELDThe body carries a field this endpoint does not accept.
- 400VALIDATION_ERRORThe asset is not a video, the source is too short or too long, or an option is out of range.
- 401MISSING_API_KEYNo Authorization header was sent, or it does not carry a crayo_sk_ key.
- 401UNAUTHORIZEDThe key sent is malformed, expired, or revoked.
- 402INSUFFICIENT_CREDITSYour video balance is below clip_count.
- 404NOT_FOUNDNo asset with that id belongs to your account.
- 429JOB_LIMIT_REACHEDYou already have 3 AutoClip jobs running.
- 429RATE_LIMITEDOver the rate limit. Wait Retry-After seconds.
- 500SERVER_ERRORSomething failed on our side. Retry with backoff.