Skip to main content
POST
/
video
/
{video_id}
/
clip
Generate video clip
curl --request POST \
  --url https://api.videodb.io/video/{video_id}/clip \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "prompt": "Create a clip about the introduction",
  "content_type": "spoken",
  "model_name": "basic",
  "scene_index_id": "idx-12345",
  "callback_url": "https://webhook.example.com/callback"
}
'
{
  "success": true,
  "status": "processing",
  "data": {
    "id": "job-123",
    "output_url": "https://api.videodb.io/async-response/job-123"
  }
}
Generate video clips automatically from a text prompt using AI-powered content understanding.
import { connect } from 'videodb';

const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
const videos = await coll.getVideos();
const video = videos[0];

// Generate clip using prompt
const result = await video.clip(
  'Show all the key moments',
  'highlights',
  'default'
);

// Result contains clip information with stream URL
console.log(`Clip created: ${result.streamUrl}`);
  • Uses AI to identify and extract relevant segments based on prompt
  • Content type guides the type of clips to extract (e.g., “highlights”, “summaries”)
  • Returns SearchResult object with clip stream URL
  • Model name allows selecting different AI models for clip generation
  • Clipped video maintains original quality and format

Authorizations

x-access-token
string
header
required

API key for authentication (sk-xxx format)

Path Parameters

video_id
string
required
Example:

"m-12345"

Body

application/json
prompt
string
required
Example:

"Create a clip about the introduction"

content_type
string
default:spoken
Example:

"spoken"

model_name
string
default:basic
Example:

"basic"

scene_index_id
string
Example:

"idx-12345"

callback_url
string
Example:

"https://webhook.example.com/callback"

Response

200 - application/json

Clip generation started

success
boolean
Example:

true

status
enum<string>
Available options:
processing,
done,
failed
Example:

"processing"

data
object