Clip Generation API (Reka Clip)

Usage

We offer two ways to generate clips from your videos:

  • Option 1: 2‑step workflow
    • Submit a job with POST /v1/clips
    • Poll job status with GET /v1/clips/{id} until completed
  • Option 2: Single streaming request
    • Submit a job to POST /v1/clips with stream=true to receive real‑time progress updates (SSE)

Option 1: Submit and poll

1️⃣ Submit a generation job:

Endpoint

  • POST /v1/clips

Headers

  • Content-Type: application/json
  • X-Api-Key: YOUR_API_KEY

Request body

video_urls (array[string], required): URLs of input videos

  • Must contain at least one URL
  • Supports YouTube, Twitch, direct MP4 links

prompt (string, optional): Description of the clip to generate

  • Defaults to Create an engaging short video highlighting the best moments

generation_config (object, optional):

FieldTypeDefaultNotes
templatemoments | compilationmomentsGeneration style
num_generationsinteger (1–3)1Number of clips to generate
min_duration_secondsinteger ≥ 00Minimum clip length
max_duration_secondsinteger (1–600)90Maximum clip length
source_start_timeintegerStart time for source video (seconds)
source_end_timeintegerEnd time for source video (seconds)

rendering_config (object, optional):

FieldTypeDefaultNotes
show_watermarkbooleanfalseDisplay Reka watermark
subtitlesbooleantrueEnable subtitles
aspect_ratio9:16 | 16:9 | 4:5 | 1:19:16Output aspect ratio
resolution240 | 360 | 480 | 720 | 10807201080p may incur HD processing fee
caption_styleobjectOptional subtitle styling configuration (see below)
  • Resolution & HD Processing: The API uses best effort to deliver the requested resolution. If a lower resolution is delivered, the HD fee is not charged.

caption_style (object, optional):

FieldTypeDefaultNotes
desired_font_sizenumber (60–120)120Subtitle font size
text_transforminitial | uppercase | lowercaseuppercaseText casing
text_colorhex string#FFFFFF
highlight_colorhex string#FF7E4F
stroke_colorhex string#000000
positiontop | middle | bottombottomSubtitle position
font_familyBebasNeue | Bangers | RobotoCondensed | Lato | CaptionFontBebasNeue
  • ℹ️ Validation Behavior: Unsupported keys are ignored; invalid or out-of-range values are ignored.

Request example

Bash

$curl -X POST "https://vision-agent.api.reka.ai/v1/clips" \
> -H "X-Api-Key: $REKA_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "video_urls": ["https://www.youtube.com/watch?v=U0Cd8jbj5zg"],
> "prompt": "Create an engaging short video highlighting the best moments",
> "generation_config": {
> "template": "moments",
> "num_generations": 3,
> "min_duration_seconds": 0,
> "max_duration_seconds": 60
> },
> "rendering_config": {
> "subtitles": true,
> "aspect_ratio": "9:16",
> "resolution": 720,
> "caption_style": {
> "desired_font_size": 120,
> "text_transform": "uppercase",
> "text_color": "#FFFFFF",
> "highlight_color": "#FF7E4F",
> "stroke_color": "#000000",
> "position": "middle",
> "font_family": "BebasNeue"
> }
> }
> }'

Python

1import requests, json
2
3BASE_URL = "https://vision-agent.api.reka.ai"
4API_KEY = "YOUR_API_KEY" # or use an environment variable
5
6endpoint_url = f"{BASE_URL}/v1/clips"
7payload = {
8 "video_urls": ["https://www.youtube.com/watch?v=U0Cd8jbj5zg"],
9 "prompt": "Create an engaging short video highlighting the best moments",
10 "generation_config": {
11 "template": "moments",
12 "num_generations": 3,
13 "min_duration_seconds": 0,
14 "max_duration_seconds": 60,
15 },
16 "rendering_config": {
17 "subtitles": True,
18 "aspect_ratio": "9:16",
19 "resolution": 720,
20 "caption_style": {
21 "desired_font_size": 120,
22 "text_transform": "uppercase",
23 "text_color": "#FFFFFF",
24 "highlight_color": "#FF7E4F",
25 "stroke_color": "#000000",
26 "position": "middle",
27 "font_family": "BebasNeue"
28 }
29 },
30}
31headers = {
32 "Content-Type": "application/json",
33 "X-Api-Key": API_KEY,
34}
35
36response = requests.post(endpoint_url, headers=headers, json=payload)
37response.raise_for_status()
38result = response.json()
39print(json.dumps(result, indent=2))
40
41generation_id = result["id"]

Response example (job accepted)

1{
2 "id": "156b59b3-82a2-4619-99c5-954d80d3e254",
3 "status": "queued",
4 "created_at": "2026-01-17T19:23:20.878691+00:00",
5 "updated_at": "2026-01-17T19:23:20.878691+00:00",
6 "generation_config": {
7 "template": "moments",
8 "num_generations": 3,
9 "min_duration_seconds": 0,
10 "max_duration_seconds": 60
11 },
12 "rendering_config": {
13 "subtitles": true,
14 "aspect_ratio": "9:16",
15 "resolution": 720,
16 "caption_style": {
17 "desired_font_size": 120,
18 "text_transform": "uppercase",
19 "text_color": "#FFFFFF",
20 "highlight_color": "#FF7E4F",
21 "stroke_color": "#000000",
22 "position": "middle",
23 "font_family": "BebasNeue"
24 }
25 },
26 "video_urls": [
27 "https://www.youtube.com/watch?v=1vM3Xsiwsao"
28 ],
29 "prompt": "Create an engaging short video highlighting the best moments"
30}

When a job is successfully submitted, the initial status will be queued.

Make sure to save the id — you’ll use it to check generation status.

2️⃣ Check generation status

  • GET /v1/clips/{id}

Returns job metadata and, when status is completed, an output array with generated clips.

Request example

Bash

$GEN_ID="YOUR_GENERATION_ID"
$curl -X GET "https://vision-agent.api.reka.ai/v1/clips/${GEN_ID}" \
> -H "X-Api-Key: $REKA_API_KEY" \
> -H "Content-Type: application/json" | jq .

Python

1url = f"{BASE_URL}/v1/clips/{generation_id}"
2headers = {"X-Api-Key": API_KEY}
3
4resp = requests.get(url, headers=headers)
5resp.raise_for_status()
6status = resp.json()
7print(json.dumps(status, indent=2))

Response example (processing)

1{
2 "id": "be22635b-8d25-4c7a-b885-b1dcba82973d",
3 "status": "processing",
4 "created_at": "2026-01-18T19:10:13.36329+00:00",
5 "updated_at": "2026-01-18T19:10:13.36329+00:00",
6 "generation_config": {
7 "template": "moments",
8 "num_generations": 3,
9 "min_duration_seconds": 0,
10 "max_duration_seconds": 60
11 },
12 "rendering_config": {
13 "subtitles": true,
14 "aspect_ratio": "9:16"
15 },
16 "video_urls": [
17 "https://www.youtube.com/watch?v=x6-vh91YnuY"
18 ],
19 "prompt": "Create an engaging short video highlighting the best moments",
20 "output": [],
21 "error_message": null
22}

Note: The status field indicates the current stage of the generation job, which happens to be processing in the above example.

Job lifecycle

A job will transition through the following states:

Once the status is completed, the response will include generated clip outputs, as shown below.

Response example (completed)

1{
2 "id": "156b59b3-82a2-4619-99c5-954d80d3e254",
3 "status": "completed",
4 "created_at": "2026-01-17T19:23:20.878691+00:00",
5 "updated_at": "2026-01-17T19:27:03.650333+00:00",
6 "generation_config": {
7 "template": "moments",
8 "num_generations": 3,
9 "min_duration_seconds": 0,
10 "max_duration_seconds": 60
11 },
12 "rendering_config": {
13 "subtitles": true,
14 "aspect_ratio": "9:16"
15 },
16 "video_urls": [
17 "https://www.youtube.com/watch?v=1vM3Xsiwsao"
18 ],
19 "prompt": "Create an engaging short video highlighting the best moments",
20 "output": [
21 {
22 "title": "Marcelo's Wild Family Party Stories",
23 "video_url": "https://guardian-user-uploads-prod.cdn.reka.ai/org-a10e5eec-1028-49fa-9144-ef676e3328e1/reels/2ab608e5b0d7704b521aae004d1d7b2c",
24 "caption": "When your cousins make you do the most unhinged things at family parties 😭💀 Marcelo's comedy is unmatched!",
25 "hashtags": [
26 "#MarceloHernandez",
27 "#StandUp",
28 "#Comedy",
29 "#FamilyParty",
30 "#Cousins",
31 "#LiveComedy",
32 "#Funny",
33 "#Relatable",
34 "#Netflix",
35 "#AmericanBoy"
36 ],
37 "ai_score": 82
38 },
39 {
40 "title": "The Ultimate Test Fail Story",
41 "video_url": "https://guardian-user-uploads-prod.cdn.reka.ai/org-a10e5eec-1028-49fa-9144-ef676e3328e1/reels/53b91df6844880cf225d617dc0e2b282",
42 "caption": "POV: You feel like a genius on a test but forget to write your NAME 💀 Marcelo's story is too relatable!",
43 "hashtags": [
44 "#MarceloHernandez",
45 "#TestFail",
46 "#Epic",
47 "#Relatable",
48 "#Comedy",
49 "#StoryTime",
50 "#Funny",
51 "#Netflix",
52 "#AmericanBoy",
53 "#LateNight"
54 ],
55 "ai_score": 88
56 },
57 {
58 "title": "Marcelo's Viral Sebastian Maniscalco Impression Tutorial",
59 "video_url": "https://guardian-user-uploads-prod.cdn.reka.ai/org-a10e5eec-1028-49fa-9144-ef676e3328e1/reels/702d8d67dff7cae2c2b06dedead0de05",
60 "caption": "When someone asks you to break down your viral SNL impression 😂 Marcelo's Sebastian is TOO accurate!",
61 "hashtags": [
62 "#MarceloHernandez",
63 "#SebastianManiscalco",
64 "#SNLImpression",
65 "#Viral",
66 "#Tutorial",
67 "#Comedy",
68 "#Impression",
69 "#BehindTheScenes",
70 "#TalkShow",
71 "#Perfect"
72 ],
73 "ai_score": 92
74 }
75 ],
76 "error_message": null
77}

Option 2: Streaming in one request

Set stream: true to receive Server-Sent Events (SSE) with progress updates until completion.

Request example

Bash

$curl -N -X POST "https://vision-agent.api.reka.ai/v1/clips" \
> -H "X-Api-Key: $REKA_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "video_urls": [
> "https://demo-videos-bucket-reka.s3.eu-west-2.amazonaws.com/evYsMdBrFXc.mp4"
> ],
> "prompt": "Create an engaging short video highlighting the best moments",
> "generation_config": {
> "template": "moments",
> "num_generations": 1
> },
> "rendering_config": {
> "subtitles": true,
> "aspect_ratio": "9:16",
> "resolution": 720,
> "caption_style": {
> "desired_font_size": 120,
> "text_transform": "uppercase",
> "text_color": "#FFFFFF",
> "highlight_color": "#FF7E4F",
> "stroke_color": "#000000",
> "position": "middle",
> "font_family": "BebasNeue"
> }
> },
> "stream": true
> }'

Python

1import requests, json
2from typing import Generator, Dict, Any
3
4endpoint_url = f"{BASE_URL}/v1/clips"
5payload = {
6 "video_urls": ["https://demo-videos-bucket-reka.s3.eu-west-2.amazonaws.com/evYsMdBrFXc.mp4"],
7 "prompt": "Create an engaging short video highlighting the best moments",
8 "generation_config": {
9 "template": "moments",
10 "num_generations": 1,
11 "min_duration_seconds": 0,
12 "max_duration_seconds": 90,
13 },
14 "rendering_config": {
15 "subtitles": True,
16 "aspect_ratio": "9:16",
17 "resolution": 1080,
18 "caption_style": {
19 "desired_font_size": 120,
20 "text_transform": "uppercase",
21 "text_color": "#FFFFFF",
22 "highlight_color": "#FF7E4F",
23 "stroke_color": "#000000",
24 "position": "middle",
25 "font_family": "BebasNeue"
26 }
27 },
28 "stream": True,
29}
30headers = {
31 "Content-Type": "application/json",
32 "X-Api-Key": API_KEY,
33}
34
35def stream_events(response) -> Generator[Dict[str, Any], None, None]:
36 last_data = None
37 for line in response.iter_lines():
38 if not line:
39 continue
40 decoded = line.decode("utf-8")
41 if decoded.startswith("data: "):
42 try:
43 data = json.loads(decoded[6:])
44 if data != last_data:
45 yield data
46 last_data = data
47 except json.JSONDecodeError:
48 pass
49
50with requests.post(endpoint_url, headers=headers, json=payload, stream=True) as r:
51 r.raise_for_status()
52 for event in stream_events(r):
53 print(json.dumps(event, indent=2))

Streaming event example

1{
2 "id": "ada0bc6f-3540-4bb2-baa0-308e9fcf1d06",
3 "status": "preprocessing",
4 "created_at": "2026-01-18T19:28:49.839838+00:00",
5 "updated_at": "2026-01-18T19:29:33.202844+00:00",
6 "generation_config": {
7 "template": "moments",
8 "num_generations": 1,
9 "min_duration_seconds": 0,
10 "max_duration_seconds": 90
11 },
12 "rendering_config": {
13 "subtitles": true,
14 "aspect_ratio": "9:16"
15 },
16 "video_urls": [
17 "https://www.youtube.com/watch?v=9JbE_HtiewI"
18 ],
19 "prompt": "Create an engaging short video highlighting the best moments"
20}

Note: The status field indicates the current stage of the generation job, which in the above case is preprocessing. See Job Lifecycle for more details on status progression.

Error response example

1{
2 "id": "11add419-fc2e-4491-98fd-e0b362103ff1",
3 "status": "failed",
4 "created_at": "2026-01-18T19:23:05.649501+00:00",
5 "updated_at": "2026-01-18T19:24:16.798044+00:00",
6 "generation_config": {
7 "template": "moments",
8 "num_generations": 1,
9 "min_duration_seconds": 0,
10 "max_duration_seconds": 90
11 },
12 "rendering_config": {
13 "subtitles": true,
14 "aspect_ratio": "9:16"
15 },
16 "video_urls": [
17 "https://www.youtube.com/watch?v=x6-vh91YnuY"
18 ],
19 "prompt": "Create an engaging short video highlighting the best moments",
20 "error_message": "This preview of Reka Clip is limited to videos with a maximum duration of 2 hours.\nPlease contact us if you need support for longer videos!"
21}

If a generation fails, the job enters a terminal failed state and includes an error_message describing the cause.

Resources:

For some code examples in Python, node.js, and C#, check out Reka AI’s Github.

To see an example of integrating Reka Clip with n8n, refer to our custom-built n8n template.

To try this API through a no-code interface, check out Reka Clip, where you can submit a Youtube or Twitch link and generate clips instantly.