# Dub video with AI-generated audio
Source: https://docs.videodb.io/api-reference/ai-generation/dub-video-with-ai-generated-audio
/openapi.yaml post /collection/{collection_id}/generate/video/dub
# Translate video content
Source: https://docs.videodb.io/api-reference/ai-generation/translate-video-content
/openapi.yaml post /collection/{collection_id}/video/{video_id}/translate
# Assets
Source: https://docs.videodb.io/api-reference/assets/index
List and filter assets across collections
Browse and filter all media assets (videos, audio, images) across your collections.
## Endpoints
> **[List Assets](/api-reference/assets/list_assets)**
>
> List and filter all assets
# List all assets across collections
Source: https://docs.videodb.io/api-reference/assets/list-all-assets-across-collections
/openapi.yaml get /assets
# List Assets
Source: https://docs.videodb.io/api-reference/assets/list_assets
GET /assets
List all assets across collections with filtering and pagination
List all media assets across your collections with powerful filtering options. Filter by asset type, duration, size, name pattern, and more.
> [!NOTE]
>
> * Filter by `asset_type`: comma-separated values like `video,audio,image`
> * Sort by `name`, `duration`, `size`, or `created_at`
> * Use `min_duration`/`max_duration` and `min_size`/`max_size` for range filters
> * Use `name_pattern` for regex-based name filtering
> * Filter by `collection_id` to scope to a specific collection
> **[List Videos](/api-reference/videos/list_videos)**
>
> List videos in a collection
> **[List Audio](/api-reference/audio/list_audio)**
>
> List audio in a collection
# Create Audio Transcription
Source: https://docs.videodb.io/api-reference/audio/create_audio_transcription
POST /audio/{audio_id}/transcription/
Generate a transcription for an audio file
Generate a speech-to-text transcription for a specific audio file.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
audio = coll.get_audio("audio_id")
# Generate transcript for audio
audio.generate_transcript()
# Generate with language hint
audio.generate_transcript(language_code="es")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
const audio = await coll.getAudio('audio_id');
// Generate transcript for audio
await audio.generateTranscript();
// Generate with language hint
await audio.generateTranscript(false, 'es');
```
> [!NOTE]
>
> * Transcription is asynchronous; use the GET endpoint to retrieve results
> * Supports different transcription engines via the `engine` parameter
> * Use `callback_url` for webhook notification when transcription completes
> **[Get Transcription](/api-reference/audio/get_audio_transcription)**
>
> Retrieve completed transcription
> **[Video Transcription](/api-reference/videos/transcription/create_video_transcription)**
>
> Transcribe video audio tracks
# Delete Audio File
Source: https://docs.videodb.io/api-reference/audio/delete_audio
DELETE /audio/{audio_id}
Permanently delete an audio file from your collection
Permanently remove an audio file and its metadata from your collection.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
audio = coll.get_audio("a-abc123def")
# Delete audio file
audio.delete()
print("Audio file deleted")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
const audio = await coll.getAudio("a-abc123def");
// Delete audio file
await audio.delete();
console.log("Audio file deleted");
```
> [!WARNING]
>
> This action is irreversible. The audio file and all associated data (transcripts, indexes) will be permanently deleted from your collection.
# Generate audio transcription
Source: https://docs.videodb.io/api-reference/audio/generate-audio-transcription
/openapi.yaml post /audio/{audio_id}/transcription/
# Generate Audio URL
Source: https://docs.videodb.io/api-reference/audio/generate_audio_url
POST /audio/{audio_id}/generate_url
Generate a shareable streaming URL for an audio file
Generate shareable URLs for streaming or downloading audio files.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
audio = coll.get_audio("a-abc123def")
# Generate download/streaming URL
url = audio.generate_url()
print(f"Audio URL: {url}")
# https://cdn.videodb.io/v3/{collection}/{audio}.mp3
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
const audio = await coll.getAudio("a-abc123def");
// Generate download/streaming URL
const url = await audio.generateUrl();
console.log(`Audio URL: ${url}`);
// https://cdn.videodb.io/v3/{collection}/{audio}.mp3
```
> [!NOTE]
>
> * URLs are CDN-hosted and can be shared directly
> * Format is MP3 or original audio format
> * URLs remain valid for extended periods
> * Useful for embedding in web players or sending via email
> **[Streams and Exports](/pages/act/output-and-delivery/streams-and-exports)**
>
> Learn about generating URLs and streaming options
> **[Get Audio Details](/api-reference/audio/get_audio)**
>
> Retrieve audio metadata before generating URLs
# Get audio transcription
Source: https://docs.videodb.io/api-reference/audio/get-audio-transcription
/openapi.yaml get /audio/{audio_id}/transcription/
# Get Audio Details
Source: https://docs.videodb.io/api-reference/audio/get_audio
GET /audio/{audio_id}
Retrieve detailed information about a specific audio file
Retrieve metadata for a specific audio file by its ID.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
# Get audio details
audio = coll.get_audio("a-abc123def")
print(f"ID: {audio.id}")
print(f"Name: {audio.name}")
print(f"Duration: {audio.length}s")
print(f"Collection: {audio.collection_id}")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
// Get audio details
const audio = await coll.getAudio("a-abc123def");
console.log(`ID: ${audio.id}`);
console.log(`Name: ${audio.name}`);
console.log(`Duration: ${audio.length}s`);
console.log(`Collection: ${audio.collectionId}`);
```
> [!NOTE]
>
> * Audio IDs always start with `a-` prefix
> * The `length` property contains duration in seconds
> * Use this to retrieve metadata before generating streams or download URLs
> **[List All Audio](/api-reference/audio/list_audio)**
>
> View all audio files in collection
> **[Generate URL](/api-reference/audio/generate_audio_url)**
>
> Create streaming or download URLs
# Get Audio Transcription
Source: https://docs.videodb.io/api-reference/audio/get_audio_transcription
GET /audio/{audio_id}/transcription/
Retrieve the transcription for an audio file
Retrieve the transcription data for a specific audio file, including word-level timestamps.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
audio = coll.get_audio("audio_id")
# Get full transcript with timestamps
transcript = audio.get_transcript()
# Get transcript for a time range
transcript = audio.get_transcript(start=10, end=60)
# Segment by sentence
transcript = audio.get_transcript(segmenter="sentence", force=True)
# Group every 10 words
transcript = audio.get_transcript(segmenter="word", length=10, force=True)
# Fixed-duration audio segments (e.g., 5-second chunks)
transcript = audio.get_transcript(segmenter="time", length=5, force=True)
# Get plain text transcript
text = audio.get_transcript_text()
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
const audio = await coll.getAudio('audio_id');
// Get full transcript with timestamps
const transcript = await audio.getTranscript();
// Get transcript for a time range
const rangeTranscript = await audio.getTranscript(10, 60);
// Segment by sentence
const sentenceTranscript = await audio.getTranscript(0, audio.length, 'sentence', 1, true);
// Group every 10 words
const wordGroups = await audio.getTranscript(0, audio.length, 'word', 10, true);
// Fixed-duration audio segments
const timeTranscript = await audio.getTranscript(0, audio.length, 'time', 5, true);
// Get plain text transcript
const text = await audio.getTranscriptText();
```
### Audio segmentation
Audio transcription can be segmented independently from any video frame or scene segmentation.
| Parameter | Type | Default | Description |
| :- | :- | :- | :- |
| `segmenter` | str | `"word"` | How to split the transcript: `"word"`, `"sentence"`, or `"time"` |
| `length` | int | `1` | Group size: words for `word`, sentences for `sentence`, or seconds for `time` |
| `start` | float | — | Start time in seconds |
| `end` | float | — | End time in seconds |
> [!NOTE]
>
> * Use `start` and `end` parameters to retrieve a specific time range
> * Use `segmenter="word"` with `length=1` for word-level timestamps
> * SDK helpers return timestamp entries with `start`, `end`, and `text`
> * The raw API response wraps those entries as `data.word_timestamps` plus `data.text`
> * The `engine` parameter selects which transcription engine's output to retrieve
### Raw response shape
```json theme={null}
{
"success": true,
"status": "completed",
"data": {
"text": "Welcome to VideoDB.",
"word_timestamps": [
{"start": 0.2, "end": 0.7, "text": "Welcome"},
{"start": 0.7, "end": 0.9, "text": "to"},
{"start": 0.9, "end": 1.4, "text": "VideoDB."}
]
}
}
```
Silence ranges may be included with `text: "-"`.
> **[Create Transcription](/api-reference/audio/create_audio_transcription)**
>
> Generate a new transcription
> **[Get Audio](/api-reference/audio/get_audio)**
>
> Retrieve audio file details
# Audio
Source: https://docs.videodb.io/api-reference/audio/index
Manage audio files and streams
Manage audio files and generate streaming URLs.
## Endpoints
> **[List Audio](/api-reference/audio/list_audio)**
>
> Get all audio files
> **[Get Audio](/api-reference/audio/get_audio)**
>
> Retrieve audio details
> **[Delete Audio](/api-reference/audio/delete_audio)**
>
> Remove audio file
> **[Generate URL](/api-reference/audio/generate_audio_url)**
>
> Create streaming URL
> **[Update Audio](/api-reference/audio/update_audio)**
>
> Update audio metadata
> **[Create Transcription](/api-reference/audio/create_audio_transcription)**
>
> Generate audio transcription
> **[Get Transcription](/api-reference/audio/get_audio_transcription)**
>
> Retrieve audio transcription
# List All Audio Files
Source: https://docs.videodb.io/api-reference/audio/list_audio
GET /audio/
Retrieve a paginated list of all audio files in your collection
Retrieve all audio files in a collection for browsing and management.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
# List all audio files
audios = coll.get_audios()
for audio in audios:
print(f"{audio.id}: {audio.name} ({audio.length}s)")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
// List all audio files
const audios = await coll.getAudios();
for (const audio of audios) {
console.log(`${audio.id}: ${audio.name} (${audio.length}s)`);
}
```
> [!NOTE]
>
> * Audio IDs have an `a-` prefix (e.g., `a-abc123def`)
> * Each audio file includes duration in seconds via the `length` property
> * Use this to build audio galleries or management interfaces
> **[Collection Management](/pages/ingest/files-and-collections/create-collection)**
>
> Learn about organizing media in collections
> **[Get Audio Details](/api-reference/audio/get_audio)**
>
> Retrieve details for a specific audio file
# Update audio
Source: https://docs.videodb.io/api-reference/audio/update-audio
/openapi.yaml patch /audio/{audio_id}
# Update Audio
Source: https://docs.videodb.io/api-reference/audio/update_audio
PATCH /audio/{audio_id}
Update audio file metadata
Update metadata for a specific audio file, including its name and description.
> [!NOTE]
>
> * Audio IDs start with the prefix `a-`
> * Only provided fields are updated; omitted fields remain unchanged
# Create API Key
Source: https://docs.videodb.io/api-reference/authentication/create_api_key
POST /user/api_key
Generate a new API key for your account
Generate a new API key for authenticating API requests. Each key provides full access to your account resources.
> [!NOTE]
>
> * API keys provide full access to your account; store securely
> * Each new key can be used immediately for authentication
> * You can generate multiple keys for different applications or environments
> * Keep track of keys used to rotate or revoke them when needed
> **[List API Keys](/api-reference/authentication/list_api_keys)**
>
> View all your generated API keys
> **[Delete API Key](/api-reference/authentication/delete_api_key)**
>
> Revoke an API key
# Delete API Key
Source: https://docs.videodb.io/api-reference/authentication/delete_api_key
DELETE /user/api_key/{api_key}
Revoke an API key permanently
Revoke an API key to prevent it from being used for future authentication requests. This action is permanent.
> [!WARNING]
>
> * Deleting an API key is permanent and irreversible
> * Any applications using this key will immediately lose access
> * Ensure no active integrations depend on the key before deleting
> * Any ongoing API calls using this key will fail after deletion
> **[List API Keys](/api-reference/authentication/list_api_keys)**
>
> View all your API keys
> **[Create API Key](/api-reference/authentication/create_api_key)**
>
> Generate a replacement API key
# Get User Info
Source: https://docs.videodb.io/api-reference/authentication/get_user
GET /user
Retrieve current user account information and credits
Retrieve the current user's account details including email and available credits.
> [!NOTE]
>
> * Requires valid API key for authentication via `x-access-token` header
> * Returns user email and current credit balance
> * Use this to check account status before running operations
> **[Create API Key](/api-reference/authentication/create_api_key)**
>
> Generate a new API key for access
> **[List API Keys](/api-reference/authentication/list_api_keys)**
>
> View all your API keys
# Authentication
Source: https://docs.videodb.io/api-reference/authentication/index
Manage API keys and user account information
Manage API keys and retrieve user account details.
## Endpoints
> **[Create API Key](/api-reference/authentication/create_api_key)**
>
> Generate a new API key
> **[List API Keys](/api-reference/authentication/list_api_keys)**
>
> Get all API keys
> **[Get User Info](/api-reference/authentication/get_user)**
>
> Retrieve account details
> **[Delete API Key](/api-reference/authentication/delete_api_key)**
>
> Remove an API key
> **[Set API Key Collections](/api-reference/authentication/set_api_key_collections)**
>
> Scope API key to collections
# List API Keys
Source: https://docs.videodb.io/api-reference/authentication/list_api_keys
GET /user/api_key
Retrieve all API keys for the authenticated user
Retrieve a list of all API keys associated with your account. Useful for auditing which keys are in use.
> [!NOTE]
>
> * Returns all API keys created under your account
> * Includes creation date and last usage timestamp for each key
> * Use `last_used_at` to identify stale or unused keys for cleanup
> * Each key provides full account access; review regularly for security
> **[Create API Key](/api-reference/authentication/create_api_key)**
>
> Generate a new API key
> **[Delete API Key](/api-reference/authentication/delete_api_key)**
>
> Remove a specific API key
# Set API key collection scoping
Source: https://docs.videodb.io/api-reference/authentication/set-api-key-collection-scoping
/openapi.yaml put /user/api-key-collections
# Set API Key Collections
Source: https://docs.videodb.io/api-reference/authentication/set_api_key_collections
PUT /user/api-key-collections
Scope an API key to specific collections
Restrict an API key to only access specific collections. This is useful for creating scoped keys for third-party integrations or limiting access in multi-tenant setups.
> [!NOTE]
>
> * This is a Pro-only feature
> * Pass an empty `collection_ids` array to remove all collection restrictions
> * The scoped key will only be able to access the specified collections
> **[Create API Key](/api-reference/authentication/create_api_key)**
>
> Generate a new API key
> **[List API Keys](/api-reference/authentication/list_api_keys)**
>
> View all API keys
# Create Checkout Session
Source: https://docs.videodb.io/api-reference/billing/create_checkout
POST /billing/checkout
Create a payment checkout session to purchase credits
Initiate a checkout session to purchase credits using your preferred payment method. Returns a checkout URL for the payment flow.
```python Python theme={null}
import requests
payload = {
"amount": 50,
"success_url": "https://yourapp.com/billing/success",
"cancel_url": "https://yourapp.com/billing/cancelled"
}
response = requests.post(
"https://api.videodb.io/billing/checkout",
json=payload,
headers={"x-access-token": "your_api_key"}
)
checkout_data = response.json()
print(f"Checkout URL: {checkout_data.get('checkout_url')}")
print(f"Session ID: {checkout_data.get('id')}")
```
```javascript Node.js theme={null}
const payload = {
amount: 50,
successUrl: "https://yourapp.com/billing/success",
cancelUrl: "https://yourapp.com/billing/cancelled"
};
const response = await fetch("https://api.videodb.io/billing/checkout", {
method: "POST",
headers: {
"x-access-token": "your_api_key",
"Content-Type": "application/json"
},
body: JSON.stringify(payload)
});
const checkoutData = await response.json();
console.log(`Checkout URL: ${checkoutData.checkoutUrl}`);
console.log(`Session ID: ${checkoutData.id}`);
```
> [!NOTE]
>
> * Amount is specified in USD (whole dollars)
> * Success and cancel URLs redirect users after payment completion or cancellation
> * Checkout sessions expire after 24 hours if not completed
> * Credits are added to your account immediately upon successful payment
> **[List Checkouts](/api-reference/billing/list_checkouts)**
>
> View all checkout sessions and their status
> **[Get Usage Statistics](/api-reference/billing/get_usage)**
>
> Monitor credit usage and balance
# Manual Credit Top-up
Source: https://docs.videodb.io/api-reference/billing/create_topup
POST /billing/topup
Manually add credits to your account balance
Manually purchase and add credits to your account balance using your preferred payment method.
```python Python theme={null}
import requests
payload = {
"amount": 100,
"redirect_url": "https://yourapp.com/dashboard"
}
response = requests.post(
"https://api.videodb.io/billing/topup",
json=payload,
headers={"x-access-token": "your_api_key"}
)
result = response.json()
print(f"Payment URL: {result.get('payment_url')}")
print(f"Session ID: {result.get('session_id')}")
```
```javascript Node.js theme={null}
const payload = {
amount: 100,
redirectUrl: "https://yourapp.com/dashboard"
};
const response = await fetch("https://api.videodb.io/billing/topup", {
method: "POST",
headers: {
"x-access-token": "your_api_key",
"Content-Type": "application/json"
},
body: JSON.stringify(payload)
});
const result = await response.json();
console.log(`Payment URL: ${result.paymentUrl}`);
console.log(`Session ID: ${result.sessionId}`);
```
> [!NOTE]
>
> * Amount is specified in USD (whole dollars)
> * Redirect URL is optional and directs users after payment completes
> * Topup credits are added immediately upon successful payment
> * Your payment method must be configured in your account settings
> * Topup is independent of auto-recharge and can be used alongside it
> **[List Checkouts](/api-reference/billing/list_checkouts)**
>
> View all payment checkout sessions
> **[Get Usage Statistics](/api-reference/billing/get_usage)**
>
> Monitor current credit balance and consumption
# Get Auto-Recharge Settings
Source: https://docs.videodb.io/api-reference/billing/get_auto_recharge
GET /billing/auto_recharge
Retrieve automatic credit recharge configuration
Retrieve your current auto-recharge settings, including whether auto-recharge is enabled and the threshold amount.
```python Python theme={null}
import requests
response = requests.get(
"https://api.videodb.io/billing/auto_recharge",
headers={"x-access-token": "your_api_key"}
)
auto_recharge = response.json()
print(f"Enabled: {auto_recharge.get('enabled')}")
print(f"Threshold: {auto_recharge.get('threshold_credits')}")
print(f"Recharge Amount: {auto_recharge.get('recharge_amount')}")
```
```javascript Node.js theme={null}
const response = await fetch("https://api.videodb.io/billing/auto_recharge", {
method: "GET",
headers: {
"x-access-token": "your_api_key"
}
});
const autoRecharge = await response.json();
console.log(`Enabled: ${autoRecharge.enabled}`);
console.log(`Threshold: ${autoRecharge.thresholdCredits}`);
console.log(`Recharge Amount: ${autoRecharge.rechargeAmount}`);
```
> [!NOTE]
>
> * Auto-recharge triggers when your balance falls below the threshold amount
> * Recharge amount is automatically charged to your payment method on file
> * Feature is optional and disabled by default
> * You can enable, disable, or modify settings at any time
> **[Configure Auto-Recharge](/api-reference/billing/set_auto_recharge)**
>
> Enable and modify auto-recharge settings
> **[Get Usage Statistics](/api-reference/billing/get_usage)**
>
> Monitor your current credit balance
# Get Usage Statistics
Source: https://docs.videodb.io/api-reference/billing/get_usage
GET /billing/usage
Retrieve detailed usage statistics and credit consumption
Retrieve detailed usage statistics showing credit consumption across different operations in your account.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
# Get usage statistics
usage_data = conn.check_usage()
print(f"Total Credits Used: {usage_data.get('total_credits_used')}")
print(f"Monthly Credit Limit: {usage_data.get('monthly_limit')}")
print(f"Credits Remaining: {usage_data.get('credits_remaining')}")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
// Get usage statistics
const usageData = await conn.checkUsage();
console.log(`Total Credits Used: ${usageData.totalCreditsUsed}`);
console.log(`Monthly Credit Limit: ${usageData.monthlyLimit}`);
console.log(`Credits Remaining: ${usageData.creditsRemaining}`);
```
> [!NOTE]
>
> * Usage data includes cumulative credits consumed across all operations (video processing, AI generation, storage)
> * Credits reset monthly based on your billing plan
> * Track usage regularly to avoid unexpected bill increases
> * Real-time updates may have slight delays (typically 5-15 minutes)
> **[Billing Overview](/api-reference/billing/index)**
>
> Manage billing and usage information
> **[Get Invoices](/api-reference/billing/list_invoices)**
>
> Retrieve billing invoices and payment records
# Billing
Source: https://docs.videodb.io/api-reference/billing/index
Manage billing and usage information
Monitor usage, manage billing, and configure auto-recharge.
## Endpoints
> **[List Checkouts](/api-reference/billing/list_checkouts)**
>
> Get all checkouts
> **[Get Usage](/api-reference/billing/get_usage)**
>
> Retrieve usage stats
> **[Get Invoices](/api-reference/billing/list_invoices)**
>
> Retrieve invoices
> **[Get Auto-Recharge](/api-reference/billing/get_auto_recharge)**
>
> Check auto-recharge settings
> **[Set Auto-Recharge](/api-reference/billing/set_auto_recharge)**
>
> Configure auto-recharge
> **[Create Checkout](/api-reference/billing/create_checkout)**
>
> Initiate checkout
> **[Top Up Credits](/api-reference/billing/create_topup)**
>
> Add credits to account
# List Checkout Sessions
Source: https://docs.videodb.io/api-reference/billing/list_checkouts
GET /billing/checkouts
Retrieve a list of all checkout sessions and their status
Retrieve all checkout sessions initiated through your account, including their status and payment information.
```python Python theme={null}
import requests
response = requests.get(
"https://api.videodb.io/billing/checkouts",
headers={"x-access-token": "your_api_key"}
)
checkouts = response.json()
for checkout in checkouts.get('checkouts', []):
print(f"Checkout ID: {checkout.get('id')}")
print(f"Amount: ${checkout.get('amount')}")
print(f"Status: {checkout.get('status')}")
print(f"Created: {checkout.get('created_at')}")
print("---")
```
```javascript Node.js theme={null}
const response = await fetch("https://api.videodb.io/billing/checkouts", {
method: "GET",
headers: {
"x-access-token": "your_api_key"
}
});
const data = await response.json();
for (const checkout of data.checkouts || []) {
console.log(`Checkout ID: ${checkout.id}`);
console.log(`Amount: $${checkout.amount}`);
console.log(`Status: ${checkout.status}`);
console.log(`Created: ${checkout.createdAt}`);
console.log("---");
}
```
> [!NOTE]
>
> * Checkout sessions include both completed and abandoned sessions
> * Status values include "completed", "pending", and "expired"
> * Completed checkouts result in credit additions to your account
> * Each checkout session is associated with a specific purchase amount
> **[Create Checkout](/api-reference/billing/create_checkout)**
>
> Initiate a new checkout session to purchase credits
> **[Top Up Credits](/api-reference/billing/create_topup)**
>
> Manually add credits to your account
# List Invoices
Source: https://docs.videodb.io/api-reference/billing/list_invoices
GET /billing/invoices
Retrieve billing invoices and payment records
Retrieve a list of all invoices and payment records for your account, including dates, amounts, and payment status.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
# Get all invoices
invoices = conn.get_invoices()
for invoice in invoices:
print(f"Invoice ID: {invoice.get('id')}")
print(f"Amount: ${invoice.get('amount')}")
print(f"Date: {invoice.get('date')}")
print(f"Status: {invoice.get('status')}")
print("---")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
// Get all invoices
const invoices = await conn.getInvoices();
for (const invoice of invoices) {
console.log(`Invoice ID: ${invoice.id}`);
console.log(`Amount: $${invoice.amount}`);
console.log(`Date: ${invoice.date}`);
console.log(`Status: ${invoice.status}`);
console.log("---");
}
```
> [!NOTE]
>
> * Invoices are generated monthly based on your billing cycle
> * Each invoice includes itemized charges for different operations and features
> * Payment status may be "paid", "pending", or "failed"
> * Invoices are available for the current billing period and all previous periods
> **[Billing Overview](/api-reference/billing/index)**
>
> Manage billing and usage information
> **[Get Usage Statistics](/api-reference/billing/get_usage)**
>
> Check current usage and credit consumption
# Configure Auto-Recharge
Source: https://docs.videodb.io/api-reference/billing/set_auto_recharge
POST /billing/auto_recharge
Enable and configure automatic credit recharge settings
Enable or disable automatic credit recharge and configure the threshold and recharge amounts for your account.
```python Python theme={null}
import requests
payload = {
"enabled": True,
"threshold_credits": 100,
"recharge_amount": 500
}
response = requests.post(
"https://api.videodb.io/billing/auto_recharge",
json=payload,
headers={"x-access-token": "your_api_key"}
)
result = response.json()
print(f"Auto-Recharge Updated: {result.get('success')}")
print(f"New Settings: {result.get('settings')}")
```
```javascript Node.js theme={null}
const payload = {
enabled: true,
thresholdCredits: 100,
rechargeAmount: 500
};
const response = await fetch("https://api.videodb.io/billing/auto_recharge", {
method: "POST",
headers: {
"x-access-token": "your_api_key",
"Content-Type": "application/json"
},
body: JSON.stringify(payload)
});
const result = await response.json();
console.log(`Auto-Recharge Updated: ${result.success}`);
console.log(`New Settings: ${JSON.stringify(result.settings)}`);
```
> [!NOTE]
>
> * Threshold amount determines when auto-recharge triggers
> * Recharge amount is the credit quantity added when threshold is met
> * Requires a valid payment method on file
> * Set `enabled` to `false` to disable auto-recharge without losing your configuration
> * Changes take effect immediately
> **[Get Auto-Recharge Settings](/api-reference/billing/get_auto_recharge)**
>
> Check current auto-recharge configuration
> **[Get Usage Statistics](/api-reference/billing/get_usage)**
>
> Monitor credit consumption and balance
# Create capture session
Source: https://docs.videodb.io/api-reference/capture/create-capture-session
/openapi.yaml post /collection/{collection_id}/capture/session
# Create capture session token
Source: https://docs.videodb.io/api-reference/capture/create-capture-session-token
/openapi.yaml post /capture/session/token
# Create Capture Session
Source: https://docs.videodb.io/api-reference/capture/create_session
POST /collection/{collection_id}/capture/session
Create a new capture session for real-time media ingestion
Create a new capture session within a collection. Capture sessions enable real-time media ingestion from client applications.
> [!NOTE]
>
> * `end_user_id` is required to identify the end user
> * Use `ws_connection_id` to link to an existing WebSocket connection for real-time updates
> * Use `metadata` to attach custom key-value data to the session
> **[Start Session](/api-reference/capture/start_session)**
>
> Start the capture session
> **[Capture SDK Guide](/pages/ingest/capture-sdks/overview)**
>
> Learn about capture SDKs
# Create Session Token
Source: https://docs.videodb.io/api-reference/capture/create_session_token
POST /capture/session/token
Create a temporary token for capture session authentication
Create a temporary authentication token for capture sessions. Use this to generate short-lived tokens for client-side SDK authentication without exposing your API key.
> [!NOTE]
>
> * Tokens are short-lived and expire after the specified duration (default: 24 hours)
> * `user_id` identifies the end user for partner tracking
> * Use these tokens in client-side applications instead of your main API key
> **[Create Session](/api-reference/capture/create_session)**
>
> Create a capture session
> **[Privacy Controls](/pages/ingest/capture-sdks/privacy-controls)**
>
> Capture privacy controls
# Get capture session details
Source: https://docs.videodb.io/api-reference/capture/get-capture-session-details
/openapi.yaml get /collection/{collection_id}/capture/session/{session_id}
# Get capture session with RTSP URLs
Source: https://docs.videodb.io/api-reference/capture/get-capture-session-with-rtsp-urls
/openapi.yaml get /capture/session/{streaming_session_id}
# Get Capture Session
Source: https://docs.videodb.io/api-reference/capture/get_session
GET /collection/{collection_id}/capture/session/{session_id}
Get details of a specific capture session
Retrieve detailed information about a specific capture session.
> [!NOTE]
>
> * Returns full session details including status, channels, and metadata
# Get Streaming Session
Source: https://docs.videodb.io/api-reference/capture/get_streaming_session
GET /capture/session/{streaming_session_id}
Get capture session details with RTSP URLs
Retrieve details of an active streaming session, including RTSP URLs for each channel.
> [!NOTE]
>
> * RTSP URLs are available once the session is in `active` status
> * Each channel has its own RTSP URL for independent streaming
> **[Start Session](/api-reference/capture/start_session)**
>
> Start a capture session
> **[Stop Session](/api-reference/capture/stop_session)**
>
> Stop the capture session
# Capture
Source: https://docs.videodb.io/api-reference/capture/index
Capture SDK session management for real-time media ingestion
Manage capture sessions for real-time media ingestion from client applications using the Capture SDK.
## Endpoints
> **[Create Session](/api-reference/capture/create_session)**
>
> Create a capture session
> **[List Sessions](/api-reference/capture/list_sessions)**
>
> List capture sessions
> **[Get Session](/api-reference/capture/get_session)**
>
> Get session details
> **[Create Token](/api-reference/capture/create_session_token)**
>
> Generate session token
> **[Start Session](/api-reference/capture/start_session)**
>
> Start a capture session
> **[Get Streaming Session](/api-reference/capture/get_streaming_session)**
>
> Get streaming session with RTSP URLs
> **[Stop Session](/api-reference/capture/stop_session)**
>
> Stop a capture session
# List capture sessions
Source: https://docs.videodb.io/api-reference/capture/list-capture-sessions
/openapi.yaml get /collection/{collection_id}/capture/session
# List Capture Sessions
Source: https://docs.videodb.io/api-reference/capture/list_sessions
GET /collection/{collection_id}/capture/session
List capture sessions in a collection
List all capture sessions in a collection, with optional filtering by status.
> [!NOTE]
>
> * Filter by `status`: `created`, `starting`, `active`, `stopped`, `failed`
> * Results are paginated; use `next_page` for additional results
# Start capture session
Source: https://docs.videodb.io/api-reference/capture/start-capture-session
/openapi.yaml post /capture/session/start
# Start Capture Session
Source: https://docs.videodb.io/api-reference/capture/start_session
POST /capture/session/start
Start an existing capture session with channel configuration
Start a previously created capture session with specific channel configurations. Define the audio and video channels to capture.
> [!NOTE]
>
> * `session_id` and `channels` are required
> * Each channel needs a `channel_id` and can be of type `audio` or `video`
> * Set `store` to `true` to persist captured media in VideoDB
> * Use `callback_url` for webhook notifications on session events
> **[Get Streaming Session](/api-reference/capture/get_streaming_session)**
>
> Get RTSP URLs for the session
> **[Stop Session](/api-reference/capture/stop_session)**
>
> Stop the capture session
# Stop capture session
Source: https://docs.videodb.io/api-reference/capture/stop-capture-session
/openapi.yaml post /capture/session/{streaming_session_id}/stop
# Stop Capture Session
Source: https://docs.videodb.io/api-reference/capture/stop_session
POST /capture/session/{streaming_session_id}/stop
Stop an active capture session
Stop an active capture session. This ends the media ingestion and finalizes any stored recordings.
> [!NOTE]
>
> * Stopping a session finalizes all channel recordings
> * Stored media becomes available for indexing and search after processing
> **[Create Session](/api-reference/capture/create_session)**
>
> Create a new capture session
> **[List Sessions](/api-reference/capture/list_sessions)**
>
> View all capture sessions
# Create Collection
Source: https://docs.videodb.io/api-reference/collections/create_collection
POST /collection
Create a new collection to organize videos
Collections organize your media files and provide a scope for search and other operations.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.create_collection(
name="Product Demos",
description="Demo videos for Q1 2024"
)
print(f"Created collection: {coll.id}")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.createCollection(
'Product Demos',
'Demo videos for Q1 2024'
);
console.log(`Created collection: ${coll.id}`);
```
> [!NOTE]
>
> * Collection IDs have a `c-` prefix (e.g., `c-a1b2c3d4`)
> * Use `is_public=True` to make collections accessible via ID without authentication
> * Each account has a "default" collection created automatically
> **[Collection Management Guide](/pages/ingest/files-and-collections/create-collection)**
>
> Complete guide to creating and managing collections
> **[Upload Media](/api-reference/collections/upload_to_collection)**
>
> Add videos, audio, or images to your collection
# Delete Collection
Source: https://docs.videodb.io/api-reference/collections/delete_collection
DELETE /collection/{collection_id}
Permanently remove a collection and all its videos
Permanently delete a collection and all its media files.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection("c-a1b2c3d4")
coll.delete()
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection('c-a1b2c3d4');
await coll.delete();
```
> [!WARNING]
>
> This action is irreversible. All videos, audio files, images, and associated data (transcripts, indexes, thumbnails) in the collection will be permanently deleted.
# Get presigned upload URL
Source: https://docs.videodb.io/api-reference/collections/get-presigned-upload-url
/openapi.yaml get /collection/{collection_id}/upload_url
# Get WebSocket connection URL
Source: https://docs.videodb.io/api-reference/collections/get-websocket-connection-url
/openapi.yaml get /collection/{collection_id}/websocket
# Get Collection
Source: https://docs.videodb.io/api-reference/collections/get_collection
GET /collection/{collection_id}
Retrieve details of a specific collection
Retrieve details for a specific collection by ID. Use `"default"` to get your default collection.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
# Get default collection
coll = conn.get_collection()
# Get specific collection
coll = conn.get_collection("c-a1b2c3d4")
print(f"Collection: {coll.name}")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
// Get default collection
const defaultCollection = await conn.getCollection();
// Get specific collection
const coll = await conn.getCollection('c-a1b2c3d4');
console.log(`Collection: ${coll.name}`);
```
> [!NOTE]
>
> * Pass no arguments or `"default"` to access your default collection
> * Public collections can be accessed by anyone with the collection ID
# Get Upload URL
Source: https://docs.videodb.io/api-reference/collections/get_upload_url
GET /collection/{collection_id}/upload_url
Get a presigned URL for direct file upload
Get a presigned upload URL for directly uploading files to a collection. This is useful for client-side uploads where you want to avoid routing file data through your server.
> [!NOTE]
>
> * The presigned URL expires after a limited time
> * Upload the file directly to the returned URL using a PUT request
> * A video ID is pre-assigned and returned immediately
> **[Upload to Collection](/api-reference/collections/upload_to_collection)**
>
> Standard server-side upload
# Get WebSocket URL
Source: https://docs.videodb.io/api-reference/collections/get_websocket
GET /collection/{collection_id}/websocket
Get a WebSocket connection URL for real-time updates
Get a WebSocket connection URL for receiving real-time updates from a collection. Use this for live notifications about upload progress, transcription completion, and other async events.
> [!NOTE]
>
> * WebSocket URLs are temporary and should be reconnected if the connection drops
> * Use the `ws_connection_id` from the WebSocket handshake in other API calls to receive targeted updates
# Collections
Source: https://docs.videodb.io/api-reference/collections/index
Organize and manage video collections
Collections group videos for organization and scoped operations.
## Endpoints
> **[Create Collection](/api-reference/collections/create_collection)**
>
> Create a new collection
> **[List Collections](/api-reference/collections/list_collections)**
>
> Get all collections
> **[Get Collection](/api-reference/collections/get_collection)**
>
> Retrieve collection details
> **[Update Collection](/api-reference/collections/update_collection)**
>
> Modify collection metadata
> **[Delete Collection](/api-reference/collections/delete_collection)**
>
> Remove a collection
> **[Upload to Collection](/api-reference/collections/upload_to_collection)**
>
> Add media to collection
> **[Search Collection](/api-reference/search-v2/search)**
>
> Search across collection
> **[Get Upload URL](/api-reference/collections/get_upload_url)**
>
> Get presigned upload URL
> **[Get WebSocket](/api-reference/collections/get_websocket)**
>
> Get real-time WebSocket URL
> **[Search by Title](/api-reference/collections/search_title)**
>
> Search media by title
> **[Web Search](/api-reference/collections/search_web)**
>
> Web search in collection
# List Collections
Source: https://docs.videodb.io/api-reference/collections/list_collections
GET /collection
Retrieve all collections in your account
Retrieve all collections in your account, including the default collection.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
collections = conn.get_collections()
for coll in collections:
print(f"{coll.id}: {coll.name}")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const collections = await conn.getCollections();
for (const coll of collections) {
console.log(`${coll.id}: ${coll.name}`);
}
```
> [!NOTE]
>
> Returns all collections you have access to, including public collections you've accessed.
# Legacy Collection Search
Source: https://docs.videodb.io/api-reference/collections/search_collections
POST /collection/{collection_id}/search/
Search across all videos in a collection
Search across all media files in a collection using semantic or keyword search.
> [!NOTE]
>
> ### Legacy Compatibility
>
> This endpoint documents the legacy `coll.search(..., SearchType/IndexType)` API below. For current retrieval, run Understand, index the resulting analyzer artifact, then use semantic search or a structured query. See [Create an Index](/pages/understand/indexing-pipelines/create-an-index) and [Collection Search](/pages/understand/search-and-retrieval/collection-search).
```python Python theme={null}
import videodb
from videodb import SearchType, IndexType
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
# Search spoken content
results = coll.search(
query="product launch",
search_type=SearchType.semantic,
index_type=IndexType.spoken_word
)
for result in results.shots:
print(f"Video: {result.video_id}")
print(f"Match: {result.text}")
print(f"Time: {result.start} - {result.end}")
```
```javascript Node.js theme={null}
import { connect, SearchTypeValues, IndexTypeValues } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
// Search spoken content
const results = await coll.search(
'product launch',
SearchTypeValues.semantic,
IndexTypeValues.spoken
);
for (const result of results.shots) {
console.log(`Video: ${result.videoId}`);
console.log(`Match: ${result.text}`);
console.log(`Time: ${result.start} - ${result.end}`);
}
```
> [!NOTE]
>
> * Videos must be indexed before search works (use `video.index_spoken_words()` or `video.index_scenes()`)
> * Use `IndexType.scene` for visual search across scenes
> * Add metadata during indexing for filtered searches
> **[Collection Search Guide](/pages/understand/search-and-retrieval/collection-search)**
>
> Advanced search with metadata filtering
> **[Video Indexing](/api-reference/videos/indexing/create_video_index)**
>
> Create indexes for searchable content
# Search by Title
Source: https://docs.videodb.io/api-reference/collections/search_title
POST /collection/{collection_id}/search/title/
Search for media by title within a collection
Search for media files by title within a specific collection.
> [!NOTE]
>
> * Searches across video, audio, and image titles in the collection
> * Use this for quick metadata-based lookups without requiring an index
> **[Search Collection](/api-reference/search-v2/semantic-search)**
>
> Semantic search across collection content
> **[Web Search](/api-reference/collections/search_web)**
>
> Web search within collection
# Web Search
Source: https://docs.videodb.io/api-reference/collections/search_web
POST /collection/{collection_id}/search/web/
Perform web search within a collection context
Perform a web-style search within a specific collection.
> [!NOTE]
>
> * Performs web-style search across collection media
> * Returns relevant results based on the search query
> **[Search Collection](/api-reference/search-v2/semantic-search)**
>
> Semantic search across collection content
> **[Title Search](/api-reference/collections/search_title)**
>
> Search by media title
# Update Collection
Source: https://docs.videodb.io/api-reference/collections/update_collection
PATCH /collection/{collection_id}
Modify collection metadata and settings
Update a collection's name, description, or visibility.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.update_collection(
id="c-a1b2c3d4",
name="Q1 2024 Demos",
description="Updated product demos"
)
# Or update via collection object
coll = conn.get_collection("c-a1b2c3d4")
coll.make_public() # Make collection publicly accessible
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const updatedCollection = await conn.updateCollection(
'c-a1b2c3d4',
'Q1 2024 Demos',
'Updated product demos'
);
// Or update via collection object
const coll = await conn.getCollection('c-a1b2c3d4');
await coll.makePublic(); // Make collection publicly accessible
```
> [!NOTE]
>
> Use `make_public()` / `makePublic()` or `make_private()` / `makePrivate()` methods for visibility control.
> **[Public Collections](/pages/ingest/files-and-collections/create-collection#public-collections)**
>
> Learn about sharing collections publicly
# Upload to Collection
Source: https://docs.videodb.io/api-reference/collections/upload_to_collection
POST /collection/{collection_id}/upload
Upload videos, audio, or images to a collection
Upload videos, audio files, or images to a collection from URLs or local files.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
# Upload from URL
url_video = coll.upload(url="https://example.com/video.mp4")
# Upload from local file
file_video = coll.upload(file_path="/path/to/video.mp4")
# Upload with callback for async processing
coll.upload(
url="https://example.com/video.mp4",
callback_url="https://your-server.com/webhook"
)
print(f"Video ID: {url_video.id}")
print(f"Stream URL: {url_video.stream_url}")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
// Upload from URL
const urlVideo = await coll.uploadURL({
url: 'https://example.com/video.mp4'
});
// Upload from local file
const fileVideo = await coll.uploadFile({
filePath: '/path/to/video.mp4'
});
// Upload with callback for async processing
await coll.uploadURL({
url: 'https://example.com/video.mp4',
callbackUrl: 'https://your-server.com/webhook'
});
console.log(`Video ID: ${urlVideo.id}`);
console.log(`Stream URL: ${urlVideo.streamUrl}`);
```
> [!NOTE]
>
> * Supports video, audio, and image files
> * Use `media_type` parameter to specify type explicitly
> * Large files should use `callback_url` for async processing
> **[Upload Guide](/pages/ingest/files-and-collections/upload-video)**
>
> Supported formats and upload methods
> **[Production Patterns](/pages/ingest/files-and-collections/collection-patterns)**
>
> Batch uploads, webhooks, and retry logic
# Compile media content
Source: https://docs.videodb.io/api-reference/compile-media-content
/openapi.yaml post /compile/
# Compile timeline
Source: https://docs.videodb.io/api-reference/compile-timeline
/openapi.yaml post /timeline
# Compile timeline (v2)
Source: https://docs.videodb.io/api-reference/compile-timeline-v2
/openapi.yaml post /timeline_v2
# Create billing checkout session
Source: https://docs.videodb.io/api-reference/create-billing-checkout-session
/openapi.yaml post /billing/checkout
# Create download request
Source: https://docs.videodb.io/api-reference/create-download-request
/openapi.yaml post /download
# Create new API key
Source: https://docs.videodb.io/api-reference/create-new-api-key
/openapi.yaml post /user/api_key
# Create new collection
Source: https://docs.videodb.io/api-reference/create-new-collection
/openapi.yaml post /collection
# Create topup payment
Source: https://docs.videodb.io/api-reference/create-topup-payment
/openapi.yaml post /billing/topup
# Create video index
Source: https://docs.videodb.io/api-reference/create-video-index
/openapi.yaml post /video/{video_id}/index/
# Create video scene index
Source: https://docs.videodb.io/api-reference/create-video-scene-index
/openapi.yaml post /video/{video_id}/index/scene/
# Create video scenes
Source: https://docs.videodb.io/api-reference/create-video-scenes
/openapi.yaml post /video/{video_id}/scenes/
# Create video stream
Source: https://docs.videodb.io/api-reference/create-video-stream
/openapi.yaml post /video/{video_id}/stream/
# Delete API key
Source: https://docs.videodb.io/api-reference/delete-api-key
/openapi.yaml delete /user/api_key/{api_key}
# Delete audio
Source: https://docs.videodb.io/api-reference/delete-audio
/openapi.yaml delete /audio/{audio_id}
# Delete collection
Source: https://docs.videodb.io/api-reference/delete-collection
/openapi.yaml delete /collection/{collection_id}
# Delete download entry
Source: https://docs.videodb.io/api-reference/delete-download-entry
/openapi.yaml delete /download
# Delete image
Source: https://docs.videodb.io/api-reference/delete-image
/openapi.yaml delete /image/{image_id}
# Delete scene index
Source: https://docs.videodb.io/api-reference/delete-scene-index
/openapi.yaml delete /video/{video_id}/index/scene/{scene_index_id}
# Delete video
Source: https://docs.videodb.io/api-reference/delete-video
/openapi.yaml delete /video/{video_id}
# Delete video storage
Source: https://docs.videodb.io/api-reference/delete-video-storage
/openapi.yaml delete /video/{video_id}/storage/
# Describe video frame
Source: https://docs.videodb.io/api-reference/describe-video-frame
/openapi.yaml post /video/{video_id}/frame/{frame_id}/describe/
# Describe video scene
Source: https://docs.videodb.io/api-reference/describe-video-scene
/openapi.yaml post /video/{video_id}/scene/{scene_id}/describe/
# Download compiled timeline
Source: https://docs.videodb.io/api-reference/download-compiled-timeline
/openapi.yaml post /timeline_v2/download
# Create Download Job
Source: https://docs.videodb.io/api-reference/downloads/create_download
POST /download
Create a new video download job to generate a downloadable file
Initiate a download job to convert a stream URL into a downloadable file. This is an asynchronous operation that returns a download ID for tracking progress.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
# Create a download job
result = conn.download(
stream_link="https://stream.videodb.io/v/abc123def",
name="my_export.mp4"
)
print(f"Download ID: {result.get('download_id')}")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
// Create a download job
const result = await conn.download(
'https://stream.videodb.io/v/abc123def',
'my_export.mp4'
);
console.log(`Download ID: ${result.download_id}`);
```
> [!NOTE]
>
> * Download jobs are asynchronous—use the returned `download_id` to check status
> * Provide a stream URL from `generateStream()` or a timeline stream URL
> * The `name` parameter sets the output filename (include file extension)
> * Download URLs expire after 24 hours from completion
> **[Streams and Exports Guide](/pages/act/output-and-delivery/streams-and-exports)**
>
> Learn how to generate streams before downloading
> **[Get Download Status](/api-reference/downloads/get_download)**
>
> Check download progress and retrieve the final URL
# Delete Download Job
Source: https://docs.videodb.io/api-reference/downloads/delete_download
DELETE /download
Cancel or delete a download job
Cancel or delete a download job. Once deleted, the download job record is removed and cannot be recovered.
```python Python theme={null}
import requests
response = requests.delete(
"https://api.videodb.io/download",
headers={"x-access-token": "your_api_key"},
json={"download_id": "download-abc123"}
)
result = response.json()
if result.get('success'):
print("Download job deleted successfully")
else:
print("Failed to delete download job")
```
```javascript Node.js theme={null}
const response = await fetch(
"https://api.videodb.io/download",
{
method: "DELETE",
headers: {
"x-access-token": "your_api_key"
},
body: JSON.stringify({
download_id: "download-abc123"
})
}
);
const result = await response.json();
if (result.success) {
console.log('Download job deleted successfully');
} else {
console.log('Failed to delete download job');
}
```
> [!WARNING]
>
> * Deletion removes the download job record permanently
> * Cannot recover deleted jobs or their associated data
> * If download is still processing, it will be cancelled
> * Already completed downloads will have their records removed from your download history
> **[Get Download Status](/api-reference/downloads/get_download)**
>
> Check download status before deleting
> **[List Downloads](/api-reference/downloads/list_downloads)**
>
> View all downloads before deleting
# Get Download Status
Source: https://docs.videodb.io/api-reference/downloads/get_download
GET /download/{download_id}
Get detailed status and information for a specific download job
Check the status of a specific download job and retrieve the final download URL when ready. Poll this endpoint to track progress.
```python Python theme={null}
import requests
response = requests.get(
"https://api.videodb.io/download/download-abc123",
headers={"x-access-token": "your_api_key"}
)
result = response.json()
data = result.get('data', {})
print(f"Status: {data.get('status')}")
print(f"Name: {data.get('name')}")
if data.get('status') == 'done':
print(f"Download URL: {data.get('download_url')}")
elif data.get('status') == 'error':
print(f"Error: {data.get('error')}")
```
```javascript Node.js theme={null}
const response = await fetch(
"https://api.videodb.io/download/download-abc123",
{
method: "GET",
headers: {
"x-access-token": "your_api_key"
}
}
);
const result = await response.json();
const data = result.data || {};
console.log(`Status: ${data.status}`);
console.log(`Name: ${data.name}`);
if (data.status === 'done') {
console.log(`Download URL: ${data.download_url}`);
} else if (data.status === 'error') {
console.log(`Error: ${data.error}`);
}
```
> [!NOTE]
>
> * Status values: `processing` (in progress), `done` (ready to download), `error` (failed)
> * Download URLs are only available when status is `done`
> * URLs expire 24 hours after generation—regenerate if needed
> * Includes metadata: creation time, filename, completion status
> **[Create Download](/api-reference/downloads/create_download)**
>
> Start a new download job
> **[Update Download](/api-reference/downloads/update_download)**
>
> Retry a failed download
# Downloads
Source: https://docs.videodb.io/api-reference/downloads/index
Manage video download jobs
Create and manage video download jobs.
## Endpoints
> **[Create Download](/api-reference/downloads/create_download)**
>
> Initiate download job
> **[List Downloads](/api-reference/downloads/list_downloads)**
>
> Get all downloads
> **[Get Download](/api-reference/downloads/get_download)**
>
> Retrieve download status
> **[Update Download](/api-reference/downloads/update_download)**
>
> Modify download settings
> **[Delete Download](/api-reference/downloads/delete_download)**
>
> Cancel download job
# List Download Jobs
Source: https://docs.videodb.io/api-reference/downloads/list_downloads
GET /download
Retrieve a list of all video download jobs and their status
Retrieve paginated list of all download jobs in your account. Each entry shows download status, timestamps, and download URLs for completed jobs.
```python Python theme={null}
import requests
response = requests.get(
"https://api.videodb.io/download",
headers={"x-access-token": "your_api_key"},
params={
"page_index": 0,
"count": 50
}
)
result = response.json()
downloads = result.get('data', {}).get('downloads', [])
for download in downloads:
print(f"{download['id']}: {download['name']} - {download['status']}")
```
```javascript Node.js theme={null}
const response = await fetch(
"https://api.videodb.io/download?page_index=0&count=50",
{
method: "GET",
headers: {
"x-access-token": "your_api_key"
}
}
);
const result = await response.json();
const downloads = result.data?.downloads || [];
for (const download of downloads) {
console.log(`${download.id}: ${download.name} - ${download.status}`);
}
```
> [!NOTE]
>
> * Results are paginated with `page_index` and `count` parameters
> * `count` has a maximum of 5,000 items per request
> * Status can be `processing`, `done`, or `error`
> * Completed downloads include a `download_url` valid for 24 hours
> **[Get Download Status](/api-reference/downloads/get_download)**
>
> Get detailed information for a specific download
> **[Create Download](/api-reference/downloads/create_download)**
>
> Start a new download job
# Update Download Job
Source: https://docs.videodb.io/api-reference/downloads/update_download
POST /download/{download_id}
Update or modify a download job configuration
Retry a failed download job. Use this endpoint to re-attempt a download that encountered an error during processing.
```python Python theme={null}
import requests
response = requests.post(
"https://api.videodb.io/download/download-abc123",
headers={"x-access-token": "your_api_key"}
)
result = response.json()
print(f"Download ID: {result.get('download_id')}")
print("Retry initiated")
```
```javascript Node.js theme={null}
const response = await fetch(
"https://api.videodb.io/download/download-abc123",
{
method: "POST",
headers: {
"x-access-token": "your_api_key"
}
}
);
const result = await response.json();
console.log(`Download ID: ${result.download_id}`);
console.log('Retry initiated');
```
> [!NOTE]
>
> * Use this endpoint to retry downloads that are in `error` status
> * Creates a new processing request with the same parameters
> * Returns immediately—use Get Download Status to track progress
> * Failed downloads may have encountered temporary issues (network, timeout)
> **[Get Download Status](/api-reference/downloads/get_download)**
>
> Check the current download status
> **[Delete Download](/api-reference/downloads/delete_download)**
>
> Cancel a download job
# Compile editor timeline
Source: https://docs.videodb.io/api-reference/editor/compile-editor-timeline
/openapi.yaml post /editor
# Compile Editor Timeline
Source: https://docs.videodb.io/api-reference/editor/compile_editor_timeline
POST /editor
Compile a visual editor timeline into a playable stream
Compile a timeline created in the visual editor into a playable stream. The timeline payload includes tracks with clips and their configurations.
> [!NOTE]
>
> * Compilation is asynchronous; the response includes an async response ID
> * The timeline payload should include tracks with clip definitions
> * Use the async response endpoint to poll for completion
> **[Download Timeline](/api-reference/editor/download_editor_timeline)**
>
> Download the compiled output
> **[Create Timeline v2](/api-reference/timeline/create_timeline_v2)**
>
> Programmatic timeline creation
# Download compiled editor timeline
Source: https://docs.videodb.io/api-reference/editor/download-compiled-editor-timeline
/openapi.yaml post /editor/download
# Download Editor Timeline
Source: https://docs.videodb.io/api-reference/editor/download_editor_timeline
POST /editor/download
Download a compiled editor timeline as a file
Generate a download URL for a compiled editor timeline. Provide the stream URL from a previous compilation to get a downloadable file.
> [!NOTE]
>
> * Requires a `stream_url` from a previous compilation
> * The download URL is temporary and should be used promptly
> **[Compile Timeline](/api-reference/editor/compile_editor_timeline)**
>
> Compile an editor timeline first
# Editor
Source: https://docs.videodb.io/api-reference/editor/index
Visual editor timeline compilation and download
Compile and download timelines created in the visual editor.
## Endpoints
> **[Compile Timeline](/api-reference/editor/compile_editor_timeline)**
>
> Compile an editor timeline
> **[Download Timeline](/api-reference/editor/download_editor_timeline)**
>
> Download compiled timeline
# Execute video workflow
Source: https://docs.videodb.io/api-reference/execute-video-workflow
/openapi.yaml post /video/{video_id}/workflow/
# Generate audio stream URL
Source: https://docs.videodb.io/api-reference/generate-audio-stream-url
/openapi.yaml post /audio/{audio_id}/generate_url
# Generate audio using AI
Source: https://docs.videodb.io/api-reference/generate-audio-using-ai
/openapi.yaml post /collection/{collection_id}/generate/audio/
# Generate custom thumbnail
Source: https://docs.videodb.io/api-reference/generate-custom-thumbnail
/openapi.yaml post /video/{video_id}/thumbnail/
# Generate image URL
Source: https://docs.videodb.io/api-reference/generate-image-url
/openapi.yaml post /image/{image_id}/generate_url
# Generate image using AI
Source: https://docs.videodb.io/api-reference/generate-image-using-ai
/openapi.yaml post /collection/{collection_id}/generate/image/
# Generate text using AI
Source: https://docs.videodb.io/api-reference/generate-text-using-ai
/openapi.yaml post /collection/{collection_id}/generate/text/
# Generate video clip
Source: https://docs.videodb.io/api-reference/generate-video-clip
/openapi.yaml post /video/{video_id}/clip
# Generate video transcription
Source: https://docs.videodb.io/api-reference/generate-video-transcription
/openapi.yaml post /video/{video_id}/transcription/
# Generate video using AI
Source: https://docs.videodb.io/api-reference/generate-video-using-ai
/openapi.yaml post /collection/{collection_id}/generate/video/
# Dub Video
Source: https://docs.videodb.io/api-reference/generation/dub_video
POST /collection/{collection_id}/generate/video/dub
Dub a video with AI-generated audio in a different language
Dub a video with AI-generated audio, replacing the original soundtrack with a new language version while preserving the speaker's voice characteristics.
> [!NOTE]
>
> * Dubbing is asynchronous; use `callback_url` for completion notification
> * `language_code` uses ISO 639-1 language codes (e.g., `es`, `fr`, `de`, `hi`)
> * The original audio is replaced with the dubbed version
> **[Translate Video](/api-reference/generation/translate_video)**
>
> Translate video content
> **[Dubbing Guide](/pages/act/generative-media/translation-and-dubbing)**
>
> Learn about dubbing and translation
# Generate Audio with AI
Source: https://docs.videodb.io/api-reference/generation/generate_audio
POST /collection/{collection_id}/generate/audio/
Generate audio, music, and voice content using AI models
Generate music, sound effects, and AI voices from text. The SDK provides specialized methods for each audio type with appropriate parameters.
## Music Generation
Create background music and ambient soundtracks from text prompts.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
music = coll.generate_music(
prompt="Upbeat electronic dance music",
duration=10
)
if music is None:
raise RuntimeError("Expected a generated Audio asset.")
print(music.id)
print(music.generate_url())
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
const music = await coll.generateMusic(
"Upbeat electronic dance music",
10
);
if (!music) {
throw new Error("Expected a generated Audio asset.");
}
console.log(music.id);
console.log(await music.generateUrl());
```
## Sound Effect Generation
Generate sound effects and environmental audio from descriptions.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
sfx = coll.generate_sound_effect(
prompt="Heavy rain with distant thunder",
duration=5
)
if sfx is None:
raise RuntimeError("Expected a generated Audio asset.")
print(sfx.id)
print(sfx.generate_url())
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
const sfx = await coll.generateSoundEffect(
"Heavy rain with distant thunder",
5
);
if (!sfx) {
throw new Error("Expected a generated Audio asset.");
}
console.log(sfx.id);
console.log(await sfx.generateUrl());
```
## Voice Generation
Convert text to natural-sounding speech in multiple voices.
```python Python theme={null}
import videodb
from videodb import GenerationJob
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
voice = coll.generate_voice(
text="Welcome to our video demo",
voice_name="Default",
wait=True,
)
if voice is None or isinstance(voice, GenerationJob):
raise RuntimeError("Expected the Audio asset after waiting.")
print(voice.id)
print(voice.generate_url())
```
```javascript Node.js theme={null}
import { connect, Audio, GenerationJob } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
const voiceCandidate = await coll.generateVoice(
"Welcome to our video demo",
"Default"
);
const voice = voiceCandidate instanceof GenerationJob
? await voiceCandidate.wait()
: voiceCandidate;
if (!(voice instanceof Audio)) {
throw new Error("Expected a generated Audio asset.");
}
console.log(voice.id);
console.log(await voice.generateUrl());
```
> [!NOTE]
>
> * Default duration is 5 seconds for music, 2 seconds for sound effects
> * Audio IDs have an `a-` prefix (e.g., `a-a1b2c3d4`)
> * Voice self-inference can return a job; use `wait=True` or `{ wait: true }` to wait for Audio. Poll intervals and timeouts are measured in seconds.
> **[Generative Media Guide](/pages/act/generative-media/index)**
>
> Learn about all AI generation capabilities
> **[Voiceovers Tutorial](/examples-and-tutorials/content-factory/voiceovers)**
>
> Add narration to silent footage with AI voices
# Generate Image with AI
Source: https://docs.videodb.io/api-reference/generation/generate_image
POST /collection/{collection_id}/generate/image/
Generate images using AI models from text prompts
Create AI-generated images from text descriptions with customizable aspect ratios. For self-inference jobs, these examples wait for the Image asset.
```python Python theme={null}
import videodb
from videodb import GenerationJob
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
image = coll.generate_image(
prompt="Serene mountain landscape with golden sunset",
aspect_ratio="16:9",
wait=True,
)
if image is None or isinstance(image, GenerationJob):
raise RuntimeError("Expected the Image asset after waiting.")
print(image.id)
print(image.generate_url())
```
```javascript Node.js theme={null}
import { connect, GenerationJob, Image } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
const imageCandidate = await coll.generateImage(
"Serene mountain landscape with golden sunset",
"16:9"
);
const image = imageCandidate instanceof GenerationJob
? await imageCandidate.wait()
: imageCandidate;
if (!(image instanceof Image)) {
throw new Error("Expected an Image asset.");
}
console.log(image.id);
console.log(await image.generateUrl());
```
> [!NOTE]
>
> * Supported aspect ratios: `1:1`, `9:16`, `16:9`, `4:3`, `3:4`
> * Default aspect ratio is `1:1` if not specified
> * Self-inference can run asynchronously; use `callback_url` or wait for completion
> * Image IDs have an `img-` prefix (e.g., `img-a1b2c3d4`)
> **[Generative Media Guide](/pages/act/generative-media/index)**
>
> Learn about all AI generation capabilities
> **[Related Endpoint](/api-reference/generation/generate_video)**
>
> Generate Video
# Generate Text with AI
Source: https://docs.videodb.io/api-reference/generation/generate_text
POST /collection/{collection_id}/generate/text/
Generate text content using AI language models for captions, scripts, and summaries
Generate text content using AI language models. Use the basic default, a mini, pro, or ultra built-in, or a self-hosted model name, and get results as plain text or JSON.
```python Python theme={null}
import json
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
# Generate plain text
script_response = coll.generate_text(
prompt="Write a 30-second commercial script for a coffee brand",
model_name="pro",
response_type="text"
)
script = (
script_response
if isinstance(script_response, str)
else script_response.get("output", script_response)
)
print(script)
# Generate JSON response
data_response = coll.generate_text(
prompt="Extract key points from a video summary",
model_name="pro",
response_type="json"
)
json_output = (
data_response
if isinstance(data_response, str)
else data_response.get("output", data_response)
)
data = json.loads(json_output) if isinstance(json_output, str) else json_output
print(data)
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
// Generate plain text
const scriptResult = await coll.generateText(
"Write a 30-second commercial script for a coffee brand",
"pro",
"text"
);
const script = typeof scriptResult === "string"
? scriptResult
: scriptResult.output;
if (typeof script !== "string") {
throw new Error("Expected a text response.");
}
console.log(script);
// Generate JSON response
const jsonResult = await coll.generateText(
"Extract key points from a video summary",
"pro",
"json"
);
const jsonOutput = typeof jsonResult === "string"
? jsonResult
: jsonResult.output;
const data = typeof jsonOutput === "string"
? JSON.parse(jsonOutput)
: jsonOutput;
console.log(data);
```
> [!NOTE]
>
> * Model options: `basic` (default), `mini`, `pro`, and `ultra` built-ins, or a self-hosted model name
> * Response types: `text` for plain text or `json` for JSON-formatted output
> * `generate_text()` returns a string or object; some responses wrap the generated value in `output`. Parse JSON text when structured data is needed
> * Text generation supports `wait` and callback options
> * Useful for generating captions, scripts, summaries, and extracted data
> **[Generative Media Guide](/pages/act/generative-media/index)**
>
> Learn about all AI generation capabilities
> **[Text Prompts Tutorial](/examples-and-tutorials/content-factory/text-prompts)**
>
> Master text prompting strategies for generation
# Generate Video with AI
Source: https://docs.videodb.io/api-reference/generation/generate_video
POST /collection/{collection_id}/generate/video/
Generate videos using AI models from text prompts
Generate short AI-powered video clips from text prompts.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.generate_video(
prompt="A drone flying over a futuristic city",
duration=6
)
if video is None:
raise RuntimeError("Expected a generated Video asset.")
print(video.id)
print(video.stream_url)
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
const video = await coll.generateVideo(
"A drone flying over a futuristic city",
6
);
if (!video) {
throw new Error("Expected a generated Video asset.");
}
console.log(video.id);
console.log(video.streamUrl);
```
> [!NOTE]
>
> * Use Python's `callback_url=` or Node's third positional `callbackUrl` for webhook notification when generation completes
> * Video IDs have an `m-` prefix (e.g., `m-a1b2c3d4`)
> **[Generative Media Guide](/pages/act/generative-media/index)**
>
> Learn about all AI generation capabilities
> **[AI Ad Films Tutorial](/examples-and-tutorials/content-factory/ai-ad-films)**
>
> Create compelling AI-generated advertisements
# AI Generation
Source: https://docs.videodb.io/api-reference/generation/index
Generate media using AI models
Generate images, videos, audio, and text using AI models.
## Endpoints
> **[Generate Image](/api-reference/generation/generate_image)**
>
> Create AI-generated images
> **[Generate Video](/api-reference/generation/generate_video)**
>
> Create AI-generated videos
> **[Generate Audio](/api-reference/generation/generate_audio)**
>
> Create AI-generated audio
> **[Generate Text](/api-reference/generation/generate_text)**
>
> Create AI-generated text
> **[Dub Video](/api-reference/generation/dub_video)**
>
> Dub video with AI audio
> **[Translate Video](/api-reference/generation/translate_video)**
>
> Translate video content
# Translate Video
Source: https://docs.videodb.io/api-reference/generation/translate_video
POST /collection/{collection_id}/video/{video_id}/translate
Translate video content to a different language
Translate a video's spoken transcript for subtitle or text workflows.
> [!NOTE]
>
> * Translation is asynchronous; use `callback_url` for completion notification
> * `target_language` uses ISO 639-1 language codes (e.g., `es`, `fr`, `de`, `hi`)
> * The SDK translation helper returns translated transcript entries and does not create or mutate a video asset
> **[Dub Video](/api-reference/generation/dub_video)**
>
> Dub video with AI audio
> **[Translation Guide](/pages/act/generative-media/translation-and-dubbing)**
>
> Learn about dubbing and translation
# Get all video thumbnails
Source: https://docs.videodb.io/api-reference/get-all-video-thumbnails
/openapi.yaml get /video/{video_id}/thumbnails/
# Get async operation result
Source: https://docs.videodb.io/api-reference/get-async-operation-result
/openapi.yaml get /async-response/{response_id}
# Get audio details
Source: https://docs.videodb.io/api-reference/get-audio-details
/openapi.yaml get /audio/{audio_id}
# Get auto recharge settings
Source: https://docs.videodb.io/api-reference/get-auto-recharge-settings
/openapi.yaml get /billing/auto_recharge
# Get billing checkout history
Source: https://docs.videodb.io/api-reference/get-billing-checkout-history
/openapi.yaml get /billing/checkouts
# Get billing invoices
Source: https://docs.videodb.io/api-reference/get-billing-invoices
/openapi.yaml get /billing/invoices
# Get billing usage information
Source: https://docs.videodb.io/api-reference/get-billing-usage-information
/openapi.yaml get /billing/usage
# Get collection details
Source: https://docs.videodb.io/api-reference/get-collection-details
/openapi.yaml get /collection/{collection_id}
# Get download status/details
Source: https://docs.videodb.io/api-reference/get-download-statusdetails
/openapi.yaml get /download/{download_id}
# Get image details
Source: https://docs.videodb.io/api-reference/get-image-details
/openapi.yaml get /image/{image_id}
# Get scene index details
Source: https://docs.videodb.io/api-reference/get-scene-index-details
/openapi.yaml get /video/{video_id}/index/scene/{scene_index_id}
# Get self-inference generation job status
Source: https://docs.videodb.io/api-reference/get-self-inference-generation-job-status
/openapi.yaml get /job/{job_id}
# Get service information
Source: https://docs.videodb.io/api-reference/get-service-information
/openapi.yaml get /
Returns basic service information
# Get user API keys
Source: https://docs.videodb.io/api-reference/get-user-api-keys
/openapi.yaml get /user/api_key
# Get user collections
Source: https://docs.videodb.io/api-reference/get-user-collections
/openapi.yaml get /collection
# Get user information
Source: https://docs.videodb.io/api-reference/get-user-information
/openapi.yaml get /user
# Get video details
Source: https://docs.videodb.io/api-reference/get-video-details
/openapi.yaml get /video/{video_id}
# Get video index status
Source: https://docs.videodb.io/api-reference/get-video-index-status
/openapi.yaml get /video/{video_id}/index/
# Get video scene index status
Source: https://docs.videodb.io/api-reference/get-video-scene-index-status
/openapi.yaml get /video/{video_id}/index/scene/
# Get video scenes
Source: https://docs.videodb.io/api-reference/get-video-scenes
/openapi.yaml get /video/{video_id}/scenes/
# Get video thumbnail
Source: https://docs.videodb.io/api-reference/get-video-thumbnail
/openapi.yaml get /video/{video_id}/thumbnail/
# Get video transcription
Source: https://docs.videodb.io/api-reference/get-video-transcription
/openapi.yaml get /video/{video_id}/transcription/
# Delete Image
Source: https://docs.videodb.io/api-reference/images/delete_image
DELETE /image/{image_id}
Permanently delete an image from your collection
Permanently deletes an image from a collection. This action is irreversible and cannot be undone.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
coll.delete_image("i-xyz789")
print("Image deleted successfully")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
await coll.deleteImage('i-xyz789');
console.log('Image deleted successfully');
```
> [!WARNING]
>
> * This permanently removes the image and cannot be recovered
> * Ensure you have the correct image ID before proceeding
> * Deletion is immediate and applies to all associated data
> **[List Images](/api-reference/images/list_images)**
>
> View all images before deletion
> **[Get Image Details](/api-reference/images/get_image)**
>
> Verify image details before deleting
# Generate Image URL
Source: https://docs.videodb.io/api-reference/images/generate_image_url
POST /image/{image_id}/generate_url
Generate a shareable URL for an image
Generates a signed, shareable URL for an image. The URL can be used to access the image without authentication.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
image = coll.get_image("i-xyz789")
signed_url = image.generate_url()
print(f"Signed URL: {signed_url}")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
const image = await coll.getImage('i-xyz789');
const signedUrl = await image.generateUrl();
console.log(`Signed URL: ${signedUrl}`);
```
> [!NOTE]
>
> * Returns a signed URL string that can be shared publicly
> * Signed URLs provide temporary access without requiring authentication
> * URLs expire after a certain period (check API documentation for expiration time)
> * Collection ID must be passed as a parameter with the request
> **[Get Image Details](/api-reference/images/get_image)**
>
> Retrieve image information before generating URL
> **[List Images](/api-reference/images/list_images)**
>
> Browse available images
# Get Image Details
Source: https://docs.videodb.io/api-reference/images/get_image
GET /image/{image_id}
Retrieve detailed information about a specific image
Retrieves detailed information about a specific image including its name, URL, and collection association.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
image = coll.get_image("i-xyz789")
print(f"Name: {image.name}")
print(f"URL: {image.url}")
print(f"Collection ID: {image.collection_id}")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
const image = await coll.getImage('i-xyz789');
console.log(`Name: ${image.name}`);
console.log(`URL: ${image.url}`);
console.log(`Collection ID: ${image.collectionId}`);
```
> [!NOTE]
>
> * Requires the `collection_id` parameter to be passed with the request
> * Returns an Image object with properties: id, name, url, and collection\_id
> * Image ID must be valid and belong to the specified collection
> **[List All Images](/api-reference/images/list_images)**
>
> Get all images in your collection
> **[Generate URL](/api-reference/images/generate_image_url)**
>
> Create a shareable signed URL for the image
# Images
Source: https://docs.videodb.io/api-reference/images/index
Manage images and generate URLs
Manage images and generate access URLs.
## Endpoints
> **[List Images](/api-reference/images/list_images)**
>
> Get all images
> **[Get Image](/api-reference/images/get_image)**
>
> Retrieve image details
> **[Delete Image](/api-reference/images/delete_image)**
>
> Remove image
> **[Generate URL](/api-reference/images/generate_image_url)**
>
> Create access URL
> **[Update Image](/api-reference/images/update_image)**
>
> Update image metadata
# List All Images
Source: https://docs.videodb.io/api-reference/images/list_images
GET /image/
Retrieve a paginated list of all images in your collection
Retrieves all images in a collection. Returns a list of image objects with metadata like name, URL, and ID.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
images = coll.get_images()
for image in images:
print(f"Image: {image.name} (ID: {image.id})")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
const images = await coll.getImages();
images.forEach(img => {
console.log(`Image: ${img.name} (ID: ${img.id})`);
});
```
> [!NOTE]
>
> * Returns all images in the collection specified by the `collection_id` parameter
> * Image IDs have an `i-` prefix (e.g., `i-a1b2c3d4`)
> * Each image has properties: id, collection\_id, name, and url
> **[Collection Guide](/pages/ingest/files-and-collections/create-collection)**
>
> Learn how to organize images in collections
> **[Get Image Details](/api-reference/images/get_image)**
>
> Retrieve a specific image
# Update image
Source: https://docs.videodb.io/api-reference/images/update-image
/openapi.yaml patch /image/{image_id}
# Update Image
Source: https://docs.videodb.io/api-reference/images/update_image
PATCH /image/{image_id}
Update image metadata
Update metadata for a specific image, including its name and description.
> [!NOTE]
>
> * Only provided fields are updated; omitted fields remain unchanged
# API Reference
Source: https://docs.videodb.io/api-reference/introduction
REST API for video processing, AI generation, and semantic search
Complete REST API for VideoDB - the serverless video database.
**Base URL:** `https://api.videodb.io`
## Authentication
All requests require an API key in the `x-access-token` header.
```bash theme={null}
curl -H "x-access-token: your_api_key" https://api.videodb.io/collection
```
## API Groups
> **[Authentication](/api-reference/authentication/index)**
>
> API keys and user account
> **[Collections](/api-reference/collections/index)**
>
> Organize media content
> **[Videos](/api-reference/videos/index)**
>
> Core video operations
> **[Streaming & Playback](/api-reference/videos/streaming/index)**
>
> Generate streams and thumbnails
> **[Transcription](/api-reference/videos/transcription/index)**
>
> Speech-to-text transcripts
> **[Scene & Frame Analysis](/api-reference/videos/scenes/index)**
>
> Computer vision analysis
> **[Advanced Operations](/api-reference/videos/advanced/index)**
>
> Video clipping and workflows
> **[Audio](/api-reference/audio/index)**
>
> Audio file management
> **[Images](/api-reference/images/index)**
>
> Image management
> **[AI Generation](/api-reference/generation/index)**
>
> Generate media with AI
> **[Sandbox](/api-reference/sandbox/create_sandbox)**
>
> Dedicated compute lifecycle
> **[Timeline & Compilation](/api-reference/timeline/index)**
>
> Programmatic video editing
> **[Billing](/api-reference/billing/index)**
>
> Usage and billing
> **[Downloads](/api-reference/downloads/index)**
>
> Export video files
> **[Utilities](/api-reference/utilities/index)**
>
> System utilities
> **[Assets](/api-reference/assets/index)**
>
> Browse all media assets
> **[Editor](/api-reference/editor/index)**
>
> Visual editor compilation
> **[Transcode](/api-reference/transcode/index)**
>
> Video format conversion
> **[Meeting](/api-reference/meeting/index)**
>
> Meeting recording
> **[Capture](/api-reference/capture/index)**
>
> Real-time media capture
> **[RTStream](/api-reference/rtstream/index)**
>
> Live stream processing
> **[RTStream Transcription](/api-reference/rtstream/transcription/index)**
>
> Real-time transcription
> **[RTStream Search](/api-reference/rtstream/scene-indexing/search_rtstream)**
>
> Search indexed stream content
> **[RTStream Events](/api-reference/rtstream/events-alerts/index)**
>
> Define event detection templates
## Response Format
All responses follow this structure:
```json theme={null}
{
"success": true,
"data": { }
}
```
## Error Codes
| Code | Description |
| - | - |
| `400` | Invalid request parameters |
| `401` | Invalid or missing API key |
| `404` | Resource not found |
| `429` | Rate limit exceeded |
| `500` | Internal server error |
## SDKs
> **[Python SDK](https://github.com/video-db/videodb-python)**
>
> ```bash theme={null}
> pip install videodb
> ```
> **[Node.js SDK](https://github.com/video-db/videodb-node)**
>
> ```bash theme={null}
> npm install videodb
> ```
# List audios
Source: https://docs.videodb.io/api-reference/list-audios
/openapi.yaml get /audio/
# List download entries
Source: https://docs.videodb.io/api-reference/list-download-entries
/openapi.yaml get /download
# List images
Source: https://docs.videodb.io/api-reference/list-images
/openapi.yaml get /image/
# List videos
Source: https://docs.videodb.io/api-reference/list-videos
/openapi.yaml get /video/
# Get meeting by video
Source: https://docs.videodb.io/api-reference/meeting/get-meeting-by-video
/openapi.yaml get /video/{video_id}/meeting
# Get meeting recording information
Source: https://docs.videodb.io/api-reference/meeting/get-meeting-recording-information
/openapi.yaml get /collection/{collection_id}/meeting/{bot_id}
# Get Meeting
Source: https://docs.videodb.io/api-reference/meeting/get_meeting
GET /collection/{collection_id}/meeting/{bot_id}
Get meeting recording information
Retrieve information about a meeting recording, including its status and video URL.
> [!NOTE]
>
> * Status indicates the current state of the recording (e.g., `recording`, `done`)
> * The `video_url` is available once the recording is complete
> * Use the `bot_id` returned from the record meeting endpoint
> **[Record Meeting](/api-reference/meeting/record_meeting)**
>
> Start a new recording
> **[Get Meeting by Video](/api-reference/meeting/get_meeting_by_video)**
>
> Look up meeting from video ID
# Get Meeting by Video
Source: https://docs.videodb.io/api-reference/meeting/get_meeting_by_video
GET /video/{video_id}/meeting
Get meeting information associated with a video
Retrieve meeting information for a video that was recorded from a meeting. This is useful when you have a video ID and want to look up its meeting context.
> [!NOTE]
>
> * Only returns data for videos that were recorded from meetings
> * Returns meeting metadata including bot details and recording status
> **[Record Meeting](/api-reference/meeting/record_meeting)**
>
> Start a new meeting recording
> **[Get Video](/api-reference/videos/get_video)**
>
> Get video details
# Meeting
Source: https://docs.videodb.io/api-reference/meeting/index
Record and manage meeting recordings
Record meetings from video conferencing platforms and retrieve meeting data.
## Endpoints
> **[Record Meeting](/api-reference/meeting/record_meeting)**
>
> Start recording a meeting
> **[Get Meeting](/api-reference/meeting/get_meeting)**
>
> Get meeting recording info
> **[Get Meeting by Video](/api-reference/meeting/get_meeting_by_video)**
>
> Get meeting info from video ID
# Record a meeting
Source: https://docs.videodb.io/api-reference/meeting/record-a-meeting
/openapi.yaml post /collection/{collection_id}/meeting/record
# Record Meeting
Source: https://docs.videodb.io/api-reference/meeting/record_meeting
POST /collection/{collection_id}/meeting/record
Start recording a meeting from a video conferencing platform
Start recording a meeting by sending a bot to join a video conferencing session. Supports Google Meet, Zoom, and other platforms.
> [!NOTE]
>
> * The bot joins the meeting and records audio/video
> * Set `bot_name` to customize the display name in the meeting
> * Use `bot_image_url` to set a custom avatar for the bot
> * Enable `realtime_stream` for live streaming during the meeting
> * Use `callback_url` for webhook notifications on meeting events
> **[Get Meeting](/api-reference/meeting/get_meeting)**
>
> Check recording status
> **[Meeting Intelligence](/pages/automate/n8n/n8n-workflow-meeting-intelligence)**
>
> Build meeting intelligence workflows
# OpenAI-compatible chat completions proxy
Source: https://docs.videodb.io/api-reference/openai-compatible-chat-completions-proxy
/openapi.yaml post /chat/completions
Proxy endpoint for OpenAI chat completions API with VideoDB billing
# Retry download
Source: https://docs.videodb.io/api-reference/retry-download
/openapi.yaml post /download/{download_id}
# Create collection event
Source: https://docs.videodb.io/api-reference/rtstream/create-collection-event
/openapi.yaml post /rtstream/event
# Create RTStream
Source: https://docs.videodb.io/api-reference/rtstream/create-rtstream
/openapi.yaml post /rtstream/
# Create RTStream alert
Source: https://docs.videodb.io/api-reference/rtstream/create-rtstream-alert
/openapi.yaml post /rtstream/{stream_id}/index/{scene_index_id}/alert
# Create RTStream scene index
Source: https://docs.videodb.io/api-reference/rtstream/create-rtstream-scene-index
/openapi.yaml post /rtstream/{stream_id}/index/scene
# Create RTStream
Source: https://docs.videodb.io/api-reference/rtstream/create_rtstream
POST /rtstream/
Create a new real-time stream connection
Create a new real-time stream by connecting to an RTSP or YouTube stream URL. The stream begins processing immediately.
> [!NOTE]
>
> * `url` is required and must be a valid RTSP or YouTube stream URL
> * `sample_rate` controls the frame sampling rate (default: 30)
> * `media_types` specifies which media to capture: `video`, `audio`, or both
> * Set `store` to `true` to persist stream recordings
> * Enable `enable_transcript` for automatic speech transcription
> **[RTSP Ingest Guide](/pages/ingest/live-streams/rtsp-ingest)**
>
> Learn about RTSP stream ingestion
> **[Stream Lifecycle](/pages/ingest/live-streams/stream-lifecycle)**
>
> Understand stream states
# Create Alert
Source: https://docs.videodb.io/api-reference/rtstream/events-alerts/create_alert
POST /rtstream/{stream_id}/index/{scene_index_id}/alert
Create an alert on a stream scene index
Create an alert that triggers when a detection event matches on a stream's scene index. Alerts can send webhooks or WebSocket notifications.
> [!NOTE]
>
> This singular scene-index endpoint is retained for compatibility. For current RTStream V2, attach alerts to plural `/indexes` as shown in the [RTStream V2 Understand → Index guide](/pages/ingest/live-streams/rtstream-understand-index).
> [!NOTE]
>
> * `event_id` is required - must reference an existing detection event
> * Use `callback_url` for HTTP webhook notifications when the event is detected
> * Use `ws_connection_id` for real-time WebSocket notifications
> **[Create Event](/api-reference/rtstream/events-alerts/create_event)**
>
> Define a detection event first
> **[Alerts Guide](/pages/act/live-action/alerts-and-callbacks)**
>
> Learn about alerts and callbacks
# Create Event
Source: https://docs.videodb.io/api-reference/rtstream/events-alerts/create_event
POST /rtstream/event
Create a detection event for real-time stream monitoring
Create a detection event that defines what to look for in real-time streams. Events are reusable templates that can be attached to stream indexes as alerts.
> [!NOTE]
>
> * `event_prompt` describes the condition to detect in natural language
> * `label` is a short identifier for the event type
> * Events are reusable across multiple stream indexes and alerts
> **[Understand & Index RTStreams](/pages/ingest/live-streams/rtstream-understand-index)**
>
> Set up a stream understanding and index
> **[Event Detection Guide](/pages/act/live-action/event-detection-patterns)**
>
> Learn about event detection
# RTStream Events
Source: https://docs.videodb.io/api-reference/rtstream/events-alerts/index
Define detection events for live streams
Define reusable detection-event templates for real-time stream monitoring.
## Endpoints
> **[Create Event](/api-reference/rtstream/events-alerts/create_event)**
>
> Define a detection event
> **[List Events](/api-reference/rtstream/events-alerts/list_events)**
>
> Get all events
# List Alerts
Source: https://docs.videodb.io/api-reference/rtstream/events-alerts/list_alerts
GET /rtstream/{stream_id}/index/{scene_index_id}/alert
List all alerts on a stream scene index
List all alerts configured on a specific scene index of a real-time stream.
> [!NOTE]
>
> **Legacy scene-index compatibility endpoint.** For current RTStream V2, attach alerts to plural `/indexes` as shown in the [RTStream V2 Understand → Index guide](/pages/ingest/live-streams/rtstream-understand-index).
> [!NOTE]
>
> * Returns all alerts with their event details, callback URLs, and status
> * Alert status is either `enabled` or `disabled`
# List Events
Source: https://docs.videodb.io/api-reference/rtstream/events-alerts/list_events
GET /rtstream/event
List all detection events
List all detection events in your account.
> [!NOTE]
>
> * Returns all events with their IDs, prompts, and labels
> * Events can be reused across multiple alerts and stream indexes
# Update Alert Status
Source: https://docs.videodb.io/api-reference/rtstream/events-alerts/update_alert_status
PATCH /rtstream/{stream_id}/index/{scene_index_id}/alert/{alert_id}/status
Enable or disable an alert
Enable or disable an alert on a stream's scene index.
> [!NOTE]
>
> This singular scene-index endpoint is retained for compatibility. For current RTStream V2, attach alerts to plural `/indexes` as shown in the [RTStream V2 Understand → Index guide](/pages/ingest/live-streams/rtstream-understand-index).
> [!NOTE]
>
> * Request body: `{"action":"enable"}` or `{"action":"disable"}`
> * Disabled alerts stop sending notifications but are not deleted
> * Re-enable with `{"action":"enable"}`
# Export RTStream recording as VideoDB asset
Source: https://docs.videodb.io/api-reference/rtstream/export-rtstream-recording-as-videodb-asset
/openapi.yaml post /rtstream/{stream_id}/export
# Export RTStream
Source: https://docs.videodb.io/api-reference/rtstream/export_rtstream
POST /rtstream/{stream_id}/export
Export an RTStream recording as a VideoDB video asset
Export a recording from a real-time stream as a VideoDB video asset. This creates a standard video that can be indexed, searched, and edited.
> [!NOTE]
>
> * The exported video gets a standard video ID (`m-` prefix)
> * Includes stream URL and player URL for immediate playback
> * The recording must exist (stream must have `store` enabled or have recorded data)
> **[Get Video](/api-reference/videos/get_video)**
>
> Access the exported video
> **[Streams & Exports Guide](/pages/act/output-and-delivery/streams-and-exports)**
>
> Learn about exports
# Get RTStream details
Source: https://docs.videodb.io/api-reference/rtstream/get-rtstream-details
/openapi.yaml get /rtstream/{stream_id}/
# Get RTStream playback URL
Source: https://docs.videodb.io/api-reference/rtstream/get-rtstream-playback-url
/openapi.yaml get /rtstream/{stream_id}/stream
# Get RTStream scene index details
Source: https://docs.videodb.io/api-reference/rtstream/get-rtstream-scene-index-details
/openapi.yaml get /rtstream/{stream_id}/index/{scene_index_id}
# Get RTStream scene records
Source: https://docs.videodb.io/api-reference/rtstream/get-rtstream-scene-records
/openapi.yaml get /rtstream/{stream_id}/index/scene/{scene_index_id}
# Get RTStream transcription data
Source: https://docs.videodb.io/api-reference/rtstream/get-rtstream-transcription-data
/openapi.yaml get /rtstream/{stream_id}/transcription/
# Get RTStream transcription status
Source: https://docs.videodb.io/api-reference/rtstream/get-rtstream-transcription-status
/openapi.yaml get /rtstream/{stream_id}/transcription/status
# Get RTStream
Source: https://docs.videodb.io/api-reference/rtstream/get_rtstream
GET /rtstream/{stream_id}/
Retrieve details of a specific RTStream
Retrieve detailed information about a specific real-time stream, including its configuration and current status.
> [!NOTE]
>
> * Stream IDs start with `rts-`
> * Returns full configuration including URL, sample rate, media types, and status
# Get RTStream Playback URL
Source: https://docs.videodb.io/api-reference/rtstream/get_rtstream_stream
GET /rtstream/{stream_id}/stream
Get a playback URL for an RTStream
Get a playback URL for viewing the real-time stream. Optionally specify a time range for historical playback.
> [!NOTE]
>
> * Omit `start` and `end` for live playback
> * Use Unix timestamps for `start` and `end` to retrieve historical segments
> * `frame_rate` controls the playback frame rate
# RTStream
Source: https://docs.videodb.io/api-reference/rtstream/index
Real-time stream processing, indexing, and search
Manage real-time streams from RTSP sources and YouTube. Connect live video feeds, index content in real-time, and search across streams.
> [!NOTE]
>
> The new RTStream Understand → Index interface is documented in [Understand & Index RTStreams](/pages/ingest/live-streams/rtstream-understand-index). Initial support is limited to continuous VLM understanding with time-based segmentation.
## Core
> **[List RTStreams](/api-reference/rtstream/list_rtstreams)**
>
> Get all RTStreams
> **[Create RTStream](/api-reference/rtstream/create_rtstream)**
>
> Connect a new stream
> **[Get RTStream](/api-reference/rtstream/get_rtstream)**
>
> Retrieve stream details
> **[Update RTStream](/api-reference/rtstream/update_rtstream)**
>
> Modify stream settings
> **[Update Status](/api-reference/rtstream/update_rtstream_status)**
>
> Start or stop a stream
> **[Export RTStream](/api-reference/rtstream/export_rtstream)**
>
> Export recording as asset
> **[Get Stream URL](/api-reference/rtstream/get_rtstream_stream)**
>
> Get playback URL
## Transcription
> **[Get Transcription](/api-reference/rtstream/transcription/get_rtstream_transcription)**
>
> Retrieve transcription data
> **[Manage Transcription](/api-reference/rtstream/transcription/manage_rtstream_transcription)**
>
> Start or stop transcription
> **[Transcription Status](/api-reference/rtstream/transcription/get_rtstream_transcription_status)**
>
> Check transcription status
## Understand & Index
> **[Understand & Index RTStreams](/pages/ingest/live-streams/rtstream-understand-index)**
>
> Set up continuous understanding and indexes
## Search
> **[Search RTStream](/api-reference/rtstream/scene-indexing/search_rtstream)**
>
> Search indexed content
## Events
> **[Create Event](/api-reference/rtstream/events-alerts/create_event)**
>
> Define a detection event
> **[List Events](/api-reference/rtstream/events-alerts/list_events)**
>
> Get all events
# List collection events
Source: https://docs.videodb.io/api-reference/rtstream/list-collection-events
/openapi.yaml get /rtstream/event
# List RTStream alerts
Source: https://docs.videodb.io/api-reference/rtstream/list-rtstream-alerts
/openapi.yaml get /rtstream/{stream_id}/index/{scene_index_id}/alert
# List RTStream scene indexes
Source: https://docs.videodb.io/api-reference/rtstream/list-rtstream-scene-indexes
/openapi.yaml get /rtstream/{stream_id}/index/scene
# List RTStreams
Source: https://docs.videodb.io/api-reference/rtstream/list-rtstreams
/openapi.yaml get /rtstream/
# List RTStreams
Source: https://docs.videodb.io/api-reference/rtstream/list_rtstreams
GET /rtstream/
List all RTStreams with filtering and pagination
List all real-time streams with optional filtering by status, name, and sorting.
> [!NOTE]
>
> * Filter by `status`: `connected` or `stopped`
> * Filter by `name` (substring match)
> * Use `ordering` for sorting (prefix with `-` for descending, e.g., `-created_at`)
> * Results are paginated with `limit` and `offset`
# Create RTStream Scene Index
Source: https://docs.videodb.io/api-reference/rtstream/scene-indexing/create_rtstream_scene_index
POST /rtstream/{stream_id}/index/scene
Create a scene index for real-time visual analysis
Create a scene index on a real-time stream for continuous visual analysis. The index extracts and describes scenes as the stream progresses.
> [!NOTE]
>
> **Legacy compatibility endpoint.** This singular `/index/scene` route is retained for compatibility. Use the [RTStream V2 Understand → Index guide](/pages/ingest/live-streams/rtstream-understand-index) for plural `/indexes`.
> [!NOTE]
>
> * `extraction_type` can be `time` or `transcript`
> * For time-based extraction, set `extraction_config.time` for interval in seconds
> * `prompt` defines what the model should look for in each scene
> * Use `ws_connection_id` to receive real-time index updates via WebSocket
> **[List Scene Indexes](/api-reference/rtstream/scene-indexing/list_rtstream_scene_indexes)**
>
> View all indexes on a stream
> **[Search RTStream](/api-reference/rtstream/scene-indexing/search_rtstream)**
>
> Search indexed content
# Get RTStream Scene Index
Source: https://docs.videodb.io/api-reference/rtstream/scene-indexing/get_rtstream_scene_index
GET /rtstream/{stream_id}/index/{scene_index_id}
Get details of a specific scene index
Retrieve detailed information about a specific scene index on a real-time stream.
> [!NOTE]
>
> This singular `/index/{scene_index_id}` route is retained for compatibility. Use the [RTStream V2 Understand → Index guide](/pages/ingest/live-streams/rtstream-understand-index) for plural `/indexes`.
> [!NOTE]
>
> * Returns full index configuration including extraction type, config, prompt, and status
# Get RTStream Scene Records
Source: https://docs.videodb.io/api-reference/rtstream/scene-indexing/get_rtstream_scene_records
GET /rtstream/{stream_id}/index/scene/{scene_index_id}
Retrieve indexed scene records from a real-time stream
Retrieve the scene records (descriptions and timestamps) generated by a scene index on a real-time stream.
> [!NOTE]
>
> **Legacy compatibility endpoint.** This singular `/index/scene` route is retained for compatibility. Use the [RTStream V2 Understand → Index guide](/pages/ingest/live-streams/rtstream-understand-index) for plural `/indexes`.
> [!NOTE]
>
> * Use `start` and `end` (Unix timestamps) to filter by time range
> * Paginated with `page` and `page_size` (default: 100)
> * Each record includes timestamps and the AI-generated scene description
# RTStream Scene Indexing
Source: https://docs.videodb.io/api-reference/rtstream/scene-indexing/index
Index and search visual content in real-time streams
Create and manage scene indexes for real-time visual analysis on live streams. Index visual content as it streams, search indexed scenes, and configure detection prompts.
> [!NOTE]
>
> **Legacy compatibility endpoint.** This singular `/index/scene` route is retained for compatibility. Use the [RTStream V2 Understand → Index guide](/pages/ingest/live-streams/rtstream-understand-index) for plural `/indexes`.
## Endpoints
> **[Create Scene Index](/api-reference/rtstream/scene-indexing/create_rtstream_scene_index)**
>
> Index stream scenes
> **[List Scene Indexes](/api-reference/rtstream/scene-indexing/list_rtstream_scene_indexes)**
>
> Get all scene indexes
> **[Get Scene Index](/api-reference/rtstream/scene-indexing/get_rtstream_scene_index)**
>
> Retrieve index details
> **[Get Scene Records](/api-reference/rtstream/scene-indexing/get_rtstream_scene_records)**
>
> Retrieve indexed scene data
> **[Update Scene Index](/api-reference/rtstream/scene-indexing/update_rtstream_scene_index)**
>
> Update index prompt
> **[Update Index Status](/api-reference/rtstream/scene-indexing/update_rtstream_scene_index_status)**
>
> Start or stop indexing
> **[Search RTStream](/api-reference/rtstream/scene-indexing/search_rtstream)**
>
> Search indexed content
# List RTStream Scene Indexes
Source: https://docs.videodb.io/api-reference/rtstream/scene-indexing/list_rtstream_scene_indexes
GET /rtstream/{stream_id}/index/scene
List all scene indexes on a real-time stream
List all scene indexes configured on a specific real-time stream.
> [!NOTE]
>
> **Legacy compatibility endpoint.** This singular `/index/scene` route is retained for compatibility. Use the [RTStream V2 Understand → Index guide](/pages/ingest/live-streams/rtstream-understand-index) for plural `/indexes`.
> [!NOTE]
>
> * Returns all scene indexes with their status, prompt, and extraction type
> * A stream can have multiple scene indexes with different prompts
# Search RTStream
Source: https://docs.videodb.io/api-reference/rtstream/scene-indexing/search_rtstream
POST /rtstream/{stream_id}/search
Search indexed content within a real-time stream
Search for specific content within a real-time stream's scene index using semantic search.
> [!NOTE]
>
> * `query` is required; `scene_index_id` (SDK `indexId`) is optional
> * `result_threshold`, `score_threshold`, `dynamic_score_percentage`, and `filter` are optional
> **[Understand & Index RTStreams](/pages/ingest/live-streams/rtstream-understand-index)**
>
> Set up continuous understanding and indexes
> **[Event Detection](/pages/act/live-action/event-detection-patterns)**
>
> Build event detection patterns
# Update RTStream Scene Index
Source: https://docs.videodb.io/api-reference/rtstream/scene-indexing/update_rtstream_scene_index
PATCH /rtstream/{stream_id}/index/scene/{scene_index_id}
Update the prompt of a scene index
Update the prompt used by a scene index on a real-time stream. The new prompt takes effect for subsequent scene descriptions.
> [!NOTE]
>
> **Legacy compatibility endpoint.** This singular `/index/scene` route is retained for compatibility. Use the [RTStream V2 Understand → Index guide](/pages/ingest/live-streams/rtstream-understand-index) for plural `/indexes`.
> [!NOTE]
>
> * Only the `prompt` field can be updated
> * Changes apply to future scene descriptions, not retroactively
# Update RTStream Scene Index Status
Source: https://docs.videodb.io/api-reference/rtstream/scene-indexing/update_rtstream_scene_index_status
PATCH /rtstream/{stream_id}/index/scene/{scene_index_id}/status
Start or stop a scene index on a real-time stream
Start or stop a scene index on a real-time stream.
> [!NOTE]
>
> **Legacy compatibility endpoint.** This singular `/index/scene` route is retained for compatibility. Use the [RTStream V2 Understand → Index guide](/pages/ingest/live-streams/rtstream-understand-index) for plural `/indexes`.
> [!NOTE]
>
> * `action` must be `start` or `stop`
> * Stopping an index pauses scene description generation but retains existing records
# Search RTStream scene index
Source: https://docs.videodb.io/api-reference/rtstream/search-rtstream-scene-index
/openapi.yaml post /rtstream/{stream_id}/search
# Start or stop RTStream
Source: https://docs.videodb.io/api-reference/rtstream/start-or-stop-rtstream
/openapi.yaml patch /rtstream/{stream_id}/status/
# Start or stop RTStream transcription
Source: https://docs.videodb.io/api-reference/rtstream/start-or-stop-rtstream-transcription
/openapi.yaml post /rtstream/{stream_id}/transcription/
# Get RTStream Transcription
Source: https://docs.videodb.io/api-reference/rtstream/transcription/get_rtstream_transcription
GET /rtstream/{stream_id}/transcription/
Retrieve transcription data from a real-time stream
Retrieve transcription records from a real-time stream, including word-level timestamps and pagination support.
> [!NOTE]
>
> * Use `start` and `end` (Unix timestamps) to filter by time range
> * Use `since` for polling - returns only entries newer than the given timestamp
> * Paginated with `page` and `page_size` (max 1000)
> * Includes word-level timestamps for each transcription record
# Get RTStream Transcription Status
Source: https://docs.videodb.io/api-reference/rtstream/transcription/get_rtstream_transcription_status
GET /rtstream/{stream_id}/transcription/status
Check the status of transcription on a real-time stream
Check whether transcription is currently active on a real-time stream.
> [!NOTE]
>
> * Status values: `running`, `stopped`, `not_configured`
> * Returns the engine, language, and timestamps for the transcription configuration
# RTStream Transcription
Source: https://docs.videodb.io/api-reference/rtstream/transcription/index
Manage real-time transcription on live streams
Control and retrieve real-time transcription from live streams. Enable speech-to-text processing on active streams and access transcribed content.
## Endpoints
> **[Get Transcription](/api-reference/rtstream/transcription/get_rtstream_transcription)**
>
> Retrieve transcription data
> **[Manage Transcription](/api-reference/rtstream/transcription/manage_rtstream_transcription)**
>
> Start or stop transcription
> **[Transcription Status](/api-reference/rtstream/transcription/get_rtstream_transcription_status)**
>
> Check transcription status
# Manage RTStream Transcription
Source: https://docs.videodb.io/api-reference/rtstream/transcription/manage_rtstream_transcription
POST /rtstream/{stream_id}/transcription/
Start or stop transcription on a real-time stream
Start or stop the transcription service on a real-time stream.
> [!NOTE]
>
> * `action` must be `start` or `stop`
> * Use `engine` to select the transcription engine (default: `default`)
> * Use `ws_connection_id` to receive real-time transcription updates via WebSocket
> **[Get Transcription](/api-reference/rtstream/transcription/get_rtstream_transcription)**
>
> Retrieve transcription data
> **[Transcription Status](/api-reference/rtstream/transcription/get_rtstream_transcription_status)**
>
> Check transcription status
# Update RTStream
Source: https://docs.videodb.io/api-reference/rtstream/update-rtstream
/openapi.yaml patch /rtstream/{stream_id}/
# Update RTStream alert status
Source: https://docs.videodb.io/api-reference/rtstream/update-rtstream-alert-status
/openapi.yaml patch /rtstream/{stream_id}/index/{scene_index_id}/alert/{alert_id}/status
# Update RTStream scene index prompt
Source: https://docs.videodb.io/api-reference/rtstream/update-rtstream-scene-index-prompt
/openapi.yaml patch /rtstream/{stream_id}/index/scene/{scene_index_id}
# Update RTStream scene index status
Source: https://docs.videodb.io/api-reference/rtstream/update-rtstream-scene-index-status
/openapi.yaml patch /rtstream/{stream_id}/index/scene/{scene_index_id}/status
# Update RTStream
Source: https://docs.videodb.io/api-reference/rtstream/update_rtstream
PATCH /rtstream/{stream_id}/
Update RTStream configuration
Update the configuration of an existing real-time stream, such as its name or sample rate.
> [!NOTE]
>
> * Only provided fields are updated; omitted fields remain unchanged
> * Changes to `sample_rate` take effect immediately on the running stream
# Update RTStream Status
Source: https://docs.videodb.io/api-reference/rtstream/update_rtstream_status
PATCH /rtstream/{stream_id}/status/
Start or stop an RTStream
Start or stop a real-time stream. Use this to control the stream lifecycle without deleting it.
> [!NOTE]
>
> * `action` must be `start` or `stop`
> * Stopping a stream pauses processing but retains its configuration
> * Restarting a stopped stream resumes from the live feed
# Create a Sandbox Compute pool
Source: https://docs.videodb.io/api-reference/sandbox/create-a-sandbox-compute-pool
/openapi.yaml post /sandbox
# Create Sandbox
Source: https://docs.videodb.io/api-reference/sandbox/create_sandbox
POST /sandbox
Create a Sandbox Compute pool
# Get a Sandbox Compute pool
Source: https://docs.videodb.io/api-reference/sandbox/get-a-sandbox-compute-pool
/openapi.yaml get /sandbox/{sandbox_id}
# Get Job
Source: https://docs.videodb.io/api-reference/sandbox/get_job
GET /job/{job_id}
Get self-inference generation job status
# Get Sandbox
Source: https://docs.videodb.io/api-reference/sandbox/get_sandbox
GET /sandbox/{sandbox_id}
Get a Sandbox Compute pool
# List Sandbox Compute pools
Source: https://docs.videodb.io/api-reference/sandbox/list-sandbox-compute-pools
/openapi.yaml get /sandbox
# List Sandboxes
Source: https://docs.videodb.io/api-reference/sandbox/list_sandboxes
GET /sandbox
List Sandbox Compute pools
# Stop a Sandbox Compute pool
Source: https://docs.videodb.io/api-reference/sandbox/stop-a-sandbox-compute-pool
/openapi.yaml post /sandbox/{sandbox_id}/stop
# Stop Sandbox
Source: https://docs.videodb.io/api-reference/sandbox/stop_sandbox
POST /sandbox/{sandbox_id}/stop
Stop a Sandbox Compute pool
# Aggregate
Source: https://docs.videodb.io/api-reference/search-v2/aggregate
Run counts, groups, facets, and metrics over one aggregatable index.
## Endpoints
```http theme={null}
POST /video/{video_id}/aggregate
POST /collection/{collection_id}/aggregate
```
Use `aggregate()` for counts, groups, facets, and metrics.
## Request body
| Field | Type | Required | Description |
| - | -: | -: | - |
| `index_name` | string | no | Optional index name to aggregate. |
| `index_id` | string | no | Optional index ID to aggregate. |
| `group_by` | string | no | Optional aggregatable field to group by. |
| `metric` | string | no | Aggregation metric. Defaults to `count`. |
| `filter` | list/object | no | Filter applied before aggregation. |
| `limit` | integer | no | Maximum returned groups. Defaults to `100`. |
| `sort` | list/string/object | no | Sort aggregate rows when supported. |
`aggregate()` does not accept `return_fields` and does not return `Shot` objects.
## Example
```python theme={null}
response = collection.aggregate(
index_name="objects",
group_by="label",
metric="count",
limit=100,
)
counts = response["results"]
```
## Example with filters
```python theme={null}
response = collection.aggregate(
index_name="objects",
filter=[{"field": "max_score", "op": ">=", "value": 0.8}],
group_by="label",
metric="count",
limit=100,
)
counts = response["results"]
```
## Response
`aggregate()` returns an envelope containing the aggregate rows and any migration warnings:
```json theme={null}
{
"results": [
{"label": "person", "count": 18},
{"label": "car", "count": 7}
],
"warnings": []
}
```
Use `response["results"]` for the aggregate rows. When the server includes warnings, the SDK also emits them as Python `UserWarning` messages.
# Ask
Source: https://docs.videodb.io/api-reference/search-v2/ask
Ask questions over indexed video or collection context.
## Endpoints
```http theme={null}
POST /video/{video_id}/ask
POST /collection/{collection_id}/ask
```
Use `ask()` when you want a generated answer grounded in indexed video context.
## Request body
| Field | Type | Required | Description |
| - | -: | -: | - |
| `question` | string | yes | Question to answer from indexed video context. |
| `top_k` | integer | no | Number of retrieved candidate moments. Defaults to `15`. |
| `mode` | string | no | Search mode used for source retrieval. Defaults to `"default"`. |
| `include_sources` | boolean | no | Include supporting source shots in the response. Defaults to `false`. |
`ask()` does not accept index selectors such as `index_name`, `index_names`, `index_id`, or `index_ids`.
## Example
```python theme={null}
answer = collection.ask(
question="Which brands are mentioned and what is said about them?",
top_k=15,
mode="default",
include_sources=True,
)
print(answer.answer)
for source in answer.sources:
print(source.video_id, source.start, source.end)
```
## Response
Returns an `AskResponse`.
| Attribute | Description |
| - | - |
| `answer` | Generated answer text. |
| `sources` | Supporting `Shot` objects when `include_sources=True`. |
# Search V2 & Ask
Source: https://docs.videodb.io/api-reference/search-v2/index
High-level search, DeepSearch, direct semantic search, structured query, aggregation, and Ask.
VideoDB Search V2 separates intelligent search from direct retrieval methods.
| Capability | Video endpoint | Collection endpoint | Python SDK |
| - | - | - | - |
| High-level search / DeepSearch | `POST /video/{video_id}/search/v2` | `POST /collection/{collection_id}/search/v2` | `video.search(...)`, `collection.search(...)` |
| Semantic search | `POST /video/{video_id}/semantic-search` | `POST /collection/{collection_id}/semantic-search` | `semantic_search(...)` |
| Structured query | `POST /video/{video_id}/query` | `POST /collection/{collection_id}/query` | `query(...)` |
| Aggregation | `POST /video/{video_id}/aggregate` | `POST /collection/{collection_id}/aggregate` | `aggregate(...)` |
| Ask | `POST /video/{video_id}/ask` | `POST /collection/{collection_id}/ask` | `ask(...)` |
> **[High-level Search & DeepSearch](/api-reference/search-v2/search)**
>
> Natural-language retrieval and DeepSearch sessions.
> **[Semantic Search](/api-reference/search-v2/semantic-search)**
>
> Direct vector search over semantic indexes.
> **[Query](/api-reference/search-v2/query)**
>
> Structured filters over one queryable index.
> **[Aggregate](/api-reference/search-v2/aggregate)**
>
> Counts, groups, facets, and metrics.
> **[Ask](/api-reference/search-v2/ask)**
>
> Answer questions using retrieved video context.
# Legacy Search
Source: https://docs.videodb.io/api-reference/search-v2/legacy-search
Use legacy spoken-word and scene-index search behavior during migration.
## Endpoints
```http theme={null}
POST /video/{video_id}/search/
POST /collection/{collection_id}/search/
```
These endpoints are the older search surface for spoken-word and legacy scene indexes.
In the Python SDK, prefer `legacy_search()` when using legacy parameters:
```python theme={null}
from videodb import SearchType, IndexType
results = video.legacy_search(
query="product demo",
search_type=SearchType.semantic,
index_type=IndexType.scene,
scene_index_id="idx_scene_123",
score_threshold=0.3,
)
```
Legacy-shaped parameters include:
* `search_type`
* `index_type`
* `result_threshold`
* `dynamic_score_percentage`
* `scene_index_id`
* `algorithm`
* `sort_docs_on`
* `namespace`
> [!NOTE]
>
> Do not mix legacy parameters with Search V2 parameters. Use `search()` for new high-level Search V2, and `legacy_search()` for legacy spoken-word / scene-index behavior.
For new retrieval flows, use Search V2:
* `search()` / DeepSearch for high-level natural-language retrieval
* `semantic_search()` for direct semantic index search
* `query()` for structured filtering
* `aggregate()` for counts/facets
* `ask()` for generated answers
# Query
Source: https://docs.videodb.io/api-reference/search-v2/query
Run structured filters over one queryable index.
## Endpoints
```http theme={null}
POST /video/{video_id}/query
POST /collection/{collection_id}/query
```
Use `query()` when you know the exact index and filter fields.
## Request body
| Field | Type | Required | Description |
| - | -: | -: | - |
| `index_name` | string | no | Optional index name to query. |
| `index_id` | string | no | Optional index ID to query. |
| `filter` | list/object | no | Explicit filter spec. A top-level list is an implicit AND. |
| `limit` | integer | no | Maximum returned rows/moments. Defaults to `100`. |
| `sort` | list/string/object | no | Sort field and direction. |
| `return_fields` | string/list/dict | no | Select indexes to hydrate under `shot.metadata["indexes"]`. |
Do not pass `index_names` or `index_ids` to `query()`.
## Example
```python theme={null}
results = collection.query(
index_name="objects",
filter=[
{"field": "label", "op": "contains", "value": "cell phone"},
],
limit=100,
sort=[("max_score", "desc")],
return_fields=["objects"],
)
```
## Response
Returns a `SearchResult` containing `Shot` objects.
# High-level Search & DeepSearch
Source: https://docs.videodb.io/api-reference/search-v2/search
Run Search V2 natural-language retrieval on a video or collection.
## Endpoints
```http theme={null}
POST /video/{video_id}/search/v2
POST /collection/{collection_id}/search/v2
```
Use high-level `search()` when VideoDB should plan retrieval across available indexes. Use `mode="deepsearch"` for deeper multi-step retrieval with optional follow-up sessions.
## Request body
| Field | Type | Required | Description |
| - | -: | -: | - |
| `query` | string | yes | Natural-language search request. |
| `top_k` | integer | no | Maximum returned moments. |
| `mode` | string | no | `"default"` or `"deepsearch"`. |
| `filter` | list/object | no | Default-mode structured filter applied where supported by selected indexes. Not supported in DeepSearch. |
| `sort` | list/string/object | no | Default-mode sort applied where supported. Not supported in DeepSearch. |
| `score_threshold` | number | no | Default-mode semantic score threshold where applicable. Not supported in DeepSearch. |
| `return_fields` | string/list/dict | no | Select indexes to hydrate under `shot.metadata["indexes"]`. Use `"all"` to hydrate all. |
| `session_id` | string | no | DeepSearch follow-up session ID. Only valid with `mode="deepsearch"`. |
| `config.include_trace` | boolean | no | Include planner trace for default-mode search. |
> [!NOTE]
>
> High-level Search V2 does not accept `index_name`, `index_names`, `index_id`, or `index_ids`. Use semantic search, query, or aggregate for index-specific calls.
## Example: default search
```python theme={null}
response = collection.search(
query="person talking about Nike while holding a phone",
top_k=10,
mode="default",
return_fields=["scene", "transcript", "brands"],
)
for shot in response:
print(shot.video_id, shot.start, shot.end)
```
## Example: DeepSearch
```python theme={null}
response = collection.search(
query="find the strongest examples of customers reacting negatively to pricing",
mode="deepsearch",
top_k=10,
return_fields="all",
)
followup = collection.search(
query="only include competitor mentions",
mode="deepsearch",
session_id=response.session_id,
top_k=10,
)
```
## Response
`search()` returns a `SearchResponse`.
| Attribute | Description |
| - | - |
| `response_type` | `"shots"`, `"aggregate"`, or `"deepsearch"`. |
| `results` | `SearchResult` for shot/deepsearch responses, or aggregate rows for aggregate responses. |
| `shots` | Convenience list of `Shot` objects for shot/deepsearch responses. |
| `session_id` | DeepSearch session ID, when applicable. |
| `waiting_for` | DeepSearch waiting state, when applicable. |
| `clarification` | DeepSearch clarification, when applicable. |
| `trace` | Planner trace when requested with `config={"include_trace": True}`. |
# Semantic Search
Source: https://docs.videodb.io/api-reference/search-v2/semantic-search
Run direct vector search over semantic indexes.
## Endpoints
```http theme={null}
POST /video/{video_id}/semantic-search
POST /collection/{collection_id}/semantic-search
```
Use semantic search when you know which semantic index or indexes to search directly.
## Request body
| Field | Type | Required | Description |
| - | -: | -: | - |
| `query` | string | yes | Text to search for. |
| `index_names` | string/list | no | Semantic index names to search. |
| `index_ids` | string/list | no | Semantic index IDs to search. |
| `top_k` | integer | no | Maximum returned moments. Defaults to `10`. |
| `score_threshold` | number | no | Minimum similarity score. |
| `filter` | list/object | no | Structured filter over supported fields/vector metadata. |
| `return_fields` | string/list/dict | no | Select indexes to hydrate under `shot.metadata["indexes"]`. |
If `index_names` and `index_ids` are omitted, VideoDB searches all semantic indexes in scope.
> [!NOTE]
>
> The Python SDK argument is `index_names`, not singular `index_name`. Use `index_ids` for ID selection.
## Example
```python theme={null}
results = video.semantic_search(
query="happy reunion outside a shop",
index_names=["scene"],
top_k=10,
score_threshold=0.7,
return_fields=["scene"],
)
for shot in results:
print(shot.start, shot.end, shot.search_score)
```
## Example with index IDs
```python theme={null}
results = collection.semantic_search(
query="person presenting at a podium",
index_ids=["idx_scene_123"],
top_k=20,
)
```
## Response
Returns a `SearchResult` containing `Shot` objects. `SearchResult.compile()` can compile all returned shots into one stream.
# Search within collection
Source: https://docs.videodb.io/api-reference/search-within-collection
/openapi.yaml post /collection/{collection_id}/search/
# Search within video
Source: https://docs.videodb.io/api-reference/search-within-video
/openapi.yaml post /video/{video_id}/search/
# Search by title within collection
Source: https://docs.videodb.io/api-reference/search/search-by-title-within-collection
/openapi.yaml post /collection/{collection_id}/search/title/
# Web search within collection
Source: https://docs.videodb.io/api-reference/search/web-search-within-collection
/openapi.yaml post /collection/{collection_id}/search/web/
# Compile Search Results
Source: https://docs.videodb.io/api-reference/timeline/compile_timeline
POST /compile/
Compile video search results into a single playable stream
Compile search results or a list of videos/scenes into a single playable stream. Useful for creating compilations from search queries or combining specific video segments.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
# Search for videos
search_results = coll.search(query="action scenes")
# Compile search results into a stream
stream_url = search_results.compile()
print(f"Compiled stream: {stream_url}")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = await connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
// Search for videos
const searchResults = await coll.search({ query: 'action scenes' });
// Compile search results into a stream
const streamUrl = await searchResults.compile();
console.log(`Compiled stream: ${streamUrl}`);
```
> [!NOTE]
>
> * Compile is useful for creating highlight reels or compilations from search results
> * Each timeline entry needs video ID and time range (start, end in seconds)
> * Returns a playable stream URL
> * Compile automatically stitches segments together in order
> **[Create Timeline v2](/api-reference/timeline/create_timeline_v2)**
>
> Advanced composition with multiple tracks
> **[Search Collections](/api-reference/search-v2/index)**
>
> Find videos to compile
# Create Timeline (v1)
Source: https://docs.videodb.io/api-reference/timeline/create_timeline
POST /timeline
Create a video composition using the legacy Timeline v1 API
Create a video timeline by adding video clips inline and overlaying audio, images, or text assets on top.
```python Python theme={null}
import videodb
from videodb.editor import Timeline, VideoAsset, AudioAsset
conn = videodb.connect(api_key="your_api_key")
# Create a timeline
timeline = Timeline(conn)
# Add videos inline (sequentially)
video_asset = VideoAsset(asset_id="m-abc123def")
timeline.add_inline(video_asset)
# Add audio overlay (starts at 5 seconds)
audio_asset = AudioAsset(asset_id="a-xyz789")
timeline.add_overlay(start=5, asset=audio_asset)
# Generate stream
stream_url = timeline.generate_stream()
print(f"Stream: {stream_url}")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
import { Timeline, VideoAsset, AudioAsset } from 'videodb';
const conn = await connect({ apiKey: 'your_api_key' });
// Create a timeline
const timeline = new Timeline(conn);
// Add videos inline (sequentially)
const videoAsset = new VideoAsset('m-abc123def');
timeline.addInline(videoAsset);
// Add audio overlay (starts at 5 seconds)
const audioAsset = new AudioAsset('a-xyz789');
timeline.addOverlay(5, audioAsset);
// Generate stream
const streamUrl = await timeline.generateStream();
console.log(`Stream: ${streamUrl}`);
```
> [!NOTE]
>
> * Timeline v1 uses simple inline and overlay operations
> * Video IDs start with `m-`, audio with `a-`, images with `img-`
> * For advanced editing with tracks and effects, use Timeline v2
> * `generate_stream()` returns a playable stream URL
> **[Create Timeline v2](/api-reference/timeline/create_timeline_v2)**
>
> Advanced timeline with tracks and effects
> **[Timeline Guides](/examples-and-tutorials/programmatic-editing/intro-outro)**
>
> Learn timeline composition
# Create Timeline (v2)
Source: https://docs.videodb.io/api-reference/timeline/create_timeline_v2
POST /timeline_v2
Create advanced video compositions with multiple tracks, effects, and assets
Create advanced video compositions with multiple tracks, clips, transitions, and effects. Timeline v2 provides granular control over video editing including cropping, filters, and positioning.
```python Python theme={null}
import videodb
from videodb.editor import Timeline, Track, Clip, VideoAsset
conn = videodb.connect(api_key="your_api_key")
# Create timeline with custom resolution and background
timeline = Timeline(conn)
timeline.resolution = "1920x1080"
timeline.background = "#000000"
# Create a track and add video clips
track = Track()
video_asset = VideoAsset(id="m-abc123def", start=0)
clip = Clip(asset=video_asset, duration=10)
track.add_clip(0, clip)
# Add another clip at 10 seconds
video_asset2 = VideoAsset(id="m-xyz789", start=0)
clip2 = Clip(asset=video_asset2, duration=8)
track.add_clip(10, clip2)
timeline.add_track(track)
# Generate the stream
stream_url = timeline.generate_stream()
print(f"Stream: {stream_url}")
```
```javascript Node.js theme={null}
import { connect, EditorTimeline, Track, Clip, EditorVideoAsset } from 'videodb';
const conn = await connect({ apiKey: 'your_api_key' });
// Create timeline with custom resolution and background
const timeline = new EditorTimeline(conn);
timeline.resolution = '1920x1080';
timeline.background = '#000000';
// Create a track and add video clips
const track = new Track();
const videoAsset = new EditorVideoAsset({ id: 'm-abc123def', start: 0 });
const clip = new Clip({ asset: videoAsset, duration: 10 });
track.addClip(0, clip);
// Add another clip at 10 seconds
const videoAsset2 = new EditorVideoAsset({ id: 'm-xyz789', start: 0 });
const clip2 = new Clip({ asset: videoAsset2, duration: 8 });
track.addClip(10, clip2);
timeline.addTrack(track);
// Generate the stream
const streamUrl = await timeline.generateStream();
console.log(`Stream: ${streamUrl}`);
```
> [!NOTE]
>
> * Timeline v2 supports multiple tracks for layering videos, audio, images, and text
> * Clips define what asset plays and for how long (duration)
> * Default resolution is 1280x720, default background is black
> * Supports transitions, filters, cropping, and positioning on clips
> * Download the generated timeline with the Download endpoint
> **[Download Timeline](/api-reference/timeline/download_timeline)**
>
> Export timeline as video file
> **[Editor Guides](/examples-and-tutorials/programmatic-editing/intro-outro)**
>
> Learn advanced video composition
# Download Timeline Video
Source: https://docs.videodb.io/api-reference/timeline/download_timeline
POST /timeline_v2/download
Download a Timeline composition as a video file
Download a generated timeline stream as a downloadable video file in MP4 format. After creating a timeline, use this endpoint to export it for sharing or offline use.
```python Python theme={null}
import videodb
from videodb.editor import Timeline, Track, Clip, VideoAsset
conn = videodb.connect(api_key="your_api_key")
# Create and generate a timeline (see Create Timeline v2)
timeline = Timeline(conn)
track = Track()
video_asset = VideoAsset(id="m-abc123def", start=0)
clip = Clip(asset=video_asset, duration=10)
track.add_clip(0, clip)
timeline.add_track(track)
# Generate the stream
stream_url = timeline.generate_stream()
# Download the timeline as a video file
download_result = timeline.download_stream(stream_url)
print(f"Download URL: {download_result.get('download_url')}")
print(f"Status: {download_result.get('status')}")
```
```javascript Node.js theme={null}
import { connect, EditorTimeline, Track, Clip, EditorVideoAsset } from 'videodb';
const conn = await connect({ apiKey: 'your_api_key' });
// Create and generate a timeline (see Create Timeline v2)
const timeline = new EditorTimeline(conn);
const track = new Track();
const videoAsset = new EditorVideoAsset({ id: 'm-abc123def', start: 0 });
const clip = new Clip({ asset: videoAsset, duration: 10 });
track.addClip(0, clip);
timeline.addTrack(track);
// Generate the stream
const streamUrl = await timeline.generateStream();
// Download the timeline as a video file
const downloadResult = await timeline.downloadStream(streamUrl);
console.log(`Download URL: ${downloadResult.downloadUrl}`);
console.log(`Status: ${downloadResult.status}`);
```
> [!NOTE]
>
> * Download requires a valid stream URL from a generated timeline
> * Downloads are processed asynchronously and return a download URL
> * Video format is MP4 with standard codec support
> * Downloaded files can be shared, archived, or used in other applications
> * Check the status field to track download progress
> **[Create Timeline v2](/api-reference/timeline/create_timeline_v2)**
>
> Generate timeline to download
> **[Connection API](/api-reference/authentication)**
>
> API authentication and connection
# Timeline & Compilation
Source: https://docs.videodb.io/api-reference/timeline/index
Create and compile video timelines
Create video timelines and compile them into streams or downloads.
## Endpoints
> **[Create Timeline](/api-reference/timeline/create_timeline)**
>
> Create timeline (v1)
> **[Create Timeline v2](/api-reference/timeline/create_timeline_v2)**
>
> Create timeline (v2)
> **[Download Timeline](/api-reference/timeline/download_timeline)**
>
> Export timeline as file
> **[Compile Timeline](/api-reference/timeline/compile_timeline)**
>
> Generate stream from timeline
> [!NOTE]
>
> See also the [Editor](/api-reference/editor/index) endpoints for visual editor timeline compilation.
# Get transcode job status
Source: https://docs.videodb.io/api-reference/transcode/get-transcode-job-status
/openapi.yaml get /transcode/{job_id}
# Get Transcode Status
Source: https://docs.videodb.io/api-reference/transcode/get_transcode_status
GET /transcode/{job_id}
Check the status of a transcode job
Check the status of an ongoing transcode job.
> [!NOTE]
>
> * Poll this endpoint to track transcode progress
> * The job ID is returned when starting a transcode job
> **[Start Transcode](/api-reference/transcode/start_transcode)**
>
> Start a new transcode job
# Transcode
Source: https://docs.videodb.io/api-reference/transcode/index
Transcode video files to different formats
Transcode video files to optimize them for different use cases and playback requirements.
## Endpoints
> **[Start Transcode](/api-reference/transcode/start_transcode)**
>
> Start a transcode job
> **[Get Status](/api-reference/transcode/get_transcode_status)**
>
> Check transcode job status
# Start transcode job
Source: https://docs.videodb.io/api-reference/transcode/start-transcode-job
/openapi.yaml post /transcode
# Start Transcode
Source: https://docs.videodb.io/api-reference/transcode/start_transcode
POST /transcode
Start a video transcode job
Start a transcode job for a video. Transcoding optimizes the video format for better compatibility and playback performance.
> [!NOTE]
>
> * The SDK takes a downloadable source URL and requires `callback_url` / `callbackUrl`; use `get_transcode_details` / `getTranscodeDetails` to track status
> * Transcoding is asynchronous; use the status endpoint to track progress
> * The transcoded video replaces the original format
> **[Get Transcode Status](/api-reference/transcode/get_transcode_status)**
>
> Check job progress
> **[Transcoding Guide](/pages/ingest/transcoding/when-to-transcode)**
>
> When and why to transcode
# Update auto recharge settings
Source: https://docs.videodb.io/api-reference/update-auto-recharge-settings
/openapi.yaml post /billing/auto_recharge
# Update collection
Source: https://docs.videodb.io/api-reference/update-collection
/openapi.yaml patch /collection/{collection_id}
# Upload media to collection
Source: https://docs.videodb.io/api-reference/upload-media-to-collection
/openapi.yaml post /collection/{collection_id}/upload
# Chat Completions
Source: https://docs.videodb.io/api-reference/utilities/create_chat
POST /chat/completions
Generate AI chat responses with video context awareness
Generate AI-powered chat responses with awareness of your video content. This endpoint enables interactive conversations about videos in your collections, combining video intelligence with conversational AI.
```python Python theme={null}
import requests
import json
payload = {
"messages": [
{
"role": "user",
"content": "Summarize the key moments in this video"
}
],
"collection_id": "default",
"video_id": "m-xyz789"
}
response = requests.post(
"https://api.videodb.io/chat/completions",
json=payload,
headers={"x-access-token": "your_api_key"}
)
chat_response = response.json()
print(f"Response: {chat_response.get('choices')[0].get('message').get('content')}")
```
```javascript Node.js theme={null}
const payload = {
messages: [
{
role: "user",
content: "Summarize the key moments in this video"
}
],
collectionId: "default",
videoId: "m-xyz789"
};
const response = await fetch(
"https://api.videodb.io/chat/completions",
{
method: "POST",
headers: {
"x-access-token": "your_api_key",
"Content-Type": "application/json"
},
body: JSON.stringify(payload)
}
);
const chatResponse = await response.json();
const content = chatResponse.choices[0].message.content;
console.log("Response:", content);
```
> [!NOTE]
>
> * Requires `collection_id` to specify which collection to search
> * Optional `video_id` to focus on a specific video
> * Supports multi-turn conversations by including message history in the `messages` array
> * Returns response in OpenAI-compatible format with `choices` array
> **[Health Check](/api-reference/utilities/health_check)**
>
> Verify API availability
> **[Async Response](/api-reference/utilities/get_async_response)**
>
> Poll async operation results
# Get Async Response
Source: https://docs.videodb.io/api-reference/utilities/get_async_response
GET /async-response/{response_id}
Retrieve results from asynchronous operations
Retrieves the results of long-running asynchronous operations such as transcoding, processing, or indexing. Use this endpoint to poll the status and final results of async requests that were initiated with a callback or that return a response ID.
```python Python theme={null}
import requests
response_id = "async-response-id-123"
response = requests.get(
f"https://api.videodb.io/async-response/{response_id}",
headers={"x-access-token": "your_api_key"}
)
result = response.json()
print(f"Status: {result.get('status')}")
print(f"Result: {result.get('result')}")
```
```javascript Node.js theme={null}
const responseId = "async-response-id-123";
const response = await fetch(
`https://api.videodb.io/async-response/${responseId}`,
{
method: "GET",
headers: {
"x-access-token": "your_api_key"
}
}
);
const result = await response.json();
console.log("Status:", result.status);
console.log("Result:", result.result);
```
> [!NOTE]
>
> * `response_id` is returned by async operations and included in the URL path
> * Check the `status` field to determine if processing is complete
> * Results are available once status is "completed" or "done"
> * Typical status values: "pending", "processing", "completed", "failed"
> **[Health Check](/api-reference/utilities/health_check)**
>
> Verify API status
> **[Chat Completions](/api-reference/utilities/create_chat)**
>
> Generate AI chat responses
# API Health Check
Source: https://docs.videodb.io/api-reference/utilities/health_check
GET /
Check API status and service availability
Checks the status of the VideoDB API and verifies service availability. Returns a simple health status response to confirm the API is operational.
```python Python theme={null}
import requests
response = requests.get(
"https://api.videodb.io/",
headers={"x-access-token": "your_api_key"}
)
status = response.json()
print(f"API Status: {status}")
```
```javascript Node.js theme={null}
const response = await fetch("https://api.videodb.io/", {
method: "GET",
headers: {
"x-access-token": "your_api_key"
}
});
const status = await response.json();
console.log("API Status:", status);
```
> [!NOTE]
>
> * No request body required
> * Returns a simple status response confirming API availability
> * Useful for monitoring and connectivity verification
> * No authentication required (but include API key if available)
> **[Async Response](/api-reference/utilities/get_async_response)**
>
> Retrieve results from async operations
> **[Chat Completions](/api-reference/utilities/create_chat)**
>
> Generate AI chat responses with video context
# Utilities
Source: https://docs.videodb.io/api-reference/utilities/index
System utilities and async operations
System utilities, health checks, and async operation tracking.
## Endpoints
> **[Health Check](/api-reference/utilities/health_check)**
>
> Check API status
> **[Async Response](/api-reference/utilities/get_async_response)**
>
> Poll async operation status
> **[Chat](/api-reference/utilities/create_chat)**
>
> Interactive chat interface
# Create Video Clip
Source: https://docs.videodb.io/api-reference/videos/advanced/create_video_clip
POST /video/{video_id}/clip
Extract a clip from a video with optional transcoding
Generate video clips automatically from a text prompt using AI-powered content understanding.
```javascript Node.js theme={null}
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',
'basic'
);
// Result contains clip information with stream URL
console.log(`Clip created: ${result.streamUrl}`);
```
> [!NOTE]
>
> * 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
# Execute Video Workflow
Source: https://docs.videodb.io/api-reference/videos/advanced/create_video_workflow
POST /video/{video_id}/workflow/
Execute complex multi-step video processing workflows
Apply complex video processing workflows such as adding subtitles, overlays, or other transformations.
```python Python theme={null}
import videodb
from videodb import SubtitleStyle
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]
# Add subtitles to video
subtitle_style = SubtitleStyle(
background_color="#000000",
text_color="#FFFFFF"
)
stream_url = video.add_subtitle(subtitle_style)
print(f"Video with subtitles: {stream_url}")
```
```javascript Node.js theme={null}
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];
// Add subtitles to video
const streamUrl = await video.addSubtitle({
backgroundColor: '#000000',
textColor: '#FFFFFF'
});
console.log(`Video with subtitles: ${streamUrl}`);
```
> [!NOTE]
>
> * Supports multiple workflow types (subtitles currently implemented)
> * Workflows modify video stream without changing original
> * Subtitle style customization includes colors, positioning, and fonts
> * Returns new stream URL with applied workflow
> * Original video remains unchanged
# Get Reframe Status
Source: https://docs.videodb.io/api-reference/videos/advanced/get_reframe_status
GET /video/{video_id}/reframe/{reframe_id}
Check the status of a video reframe job
Check the status of an ongoing reframe job. Returns the current status and result data when complete.
> [!NOTE]
>
> * Status values: `processing`, `done`, `failed`
> * Poll this endpoint to track progress, or use `callback_url` when starting the reframe job
> * When status is `done`, the response includes the reframed video data
> **[Reframe Video](/api-reference/videos/advanced/reframe_video)**
>
> Start a new reframe job
# Advanced Operations
Source: https://docs.videodb.io/api-reference/videos/advanced/index
Complex video processing workflows
Advanced video processing operations for clipping and workflows.
## Endpoints
> **[Clip Video](/api-reference/videos/advanced/create_video_clip)**
>
> Create video clips
> **[Run Workflow](/api-reference/videos/advanced/create_video_workflow)**
>
> Execute processing workflow
> **[Reframe Video](/api-reference/videos/advanced/reframe_video)**
>
> Reframe to different aspect ratio
> **[Get Reframe Status](/api-reference/videos/advanced/get_reframe_status)**
>
> Check reframe job progress
# Reframe Video
Source: https://docs.videodb.io/api-reference/videos/advanced/reframe_video
POST /video/{video_id}/reframe
Reframe a video to a different aspect ratio
Reframe a video to a different aspect ratio (e.g., 16:9 to 9:16 for vertical content). The system intelligently tracks subjects to keep them in frame.
> [!NOTE]
>
> * Reframing is asynchronous; use the [Get Reframe Status endpoint](/api-reference/videos/advanced/get_reframe_status) to track progress
> * `target` accepts `"vertical"`, `"square"`, `"landscape"`, or a custom `{"width": number, "height": number}` object
> * `mode` accepts `"simple"` or `"smart"`
> * Use `callback_url` for webhook notification when reframing completes
> **[Get Reframe Status](/api-reference/videos/advanced/get_reframe_status)**
>
> Check reframe job progress
> **[Aspect Ratio Guide](/pages/act/programmable-editing/aspect-ratio-control)**
>
> Learn about aspect ratio control
# Delete scene collection
Source: https://docs.videodb.io/api-reference/videos/delete-scene-collection
/openapi.yaml delete /video/{video_id}/scenes/{scene_collection_id}/
# Delete video index
Source: https://docs.videodb.io/api-reference/videos/delete-video-index
/openapi.yaml post /video/{video_id}/index/delete
# Delete Video
Source: https://docs.videodb.io/api-reference/videos/delete_video
DELETE /video/{video_id}
Delete a video and its metadata from VideoDB
Permanently delete a video from VideoDB. This removes all associated metadata, indexes, and transcripts.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
# Get video
video = coll.get_videos()[0]
# Delete the video
video.delete()
print("Video deleted successfully")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
// Get video
const videos = await coll.getVideos();
const video = videos[0];
// Delete the video
await video.delete();
console.log('Video deleted successfully');
```
> [!WARNING]
>
> * This operation is irreversible
> * Deletes all video data including: video file, metadata, transcript, indexes, thumbnails, and generated streams
> * Associated scene collections and indexes are also removed
> * The video ID cannot be reused
# Delete Video Storage
Source: https://docs.videodb.io/api-reference/videos/delete_video_storage
DELETE /video/{video_id}/storage/
Permanently delete the video file from storage
Delete only the video file from storage while keeping the video metadata, indexes, and transcripts. This reduces storage costs when you no longer need the original file.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
# Get video
video = coll.get_videos()[0]
# Remove storage while keeping metadata
video.remove_storage()
print("Video storage deleted (metadata retained)")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
// Get video
const videos = await coll.getVideos();
const video = videos[0];
// Remove storage while keeping metadata
await video.removeStorage();
console.log('Video storage deleted (metadata retained)');
```
> [!WARNING]
>
> * This operation is irreversible and cannot restore the video file
> * After removal, you cannot generate new streams or thumbnails from the video
> * Existing generated streams and thumbnails remain available
> * Video metadata, indexes, and transcripts are preserved
> * Used for cost optimization when original file is no longer needed
# Get reframe job status
Source: https://docs.videodb.io/api-reference/videos/get-reframe-job-status
/openapi.yaml get /video/{video_id}/reframe/{reframe_id}
# Get scene collection details
Source: https://docs.videodb.io/api-reference/videos/get-scene-collection-details
/openapi.yaml get /video/{video_id}/scenes/{scene_collection_id}/
# Get Video Details
Source: https://docs.videodb.io/api-reference/videos/get_video
GET /video/{video_id}
Retrieve detailed metadata for a specific video
Retrieve complete metadata for a specific video including duration, transcript status, thumbnail, and stream URLs.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
# Get video from collection
video = coll.get_videos()[0]
print(f"Video ID: {video.id}")
print(f"Name: {video.name}")
print(f"Duration: {video.length} seconds")
print(f"Stream URL: {video.stream_url}")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
// Get video from collection
const videos = await coll.getVideos();
const video = videos[0];
console.log(`Video ID: ${video.id}`);
console.log(`Name: ${video.name}`);
console.log(`Duration: ${video.length} seconds`);
console.log(`Stream URL: ${video.streamUrl}`);
```
> [!NOTE]
>
> * Video IDs start with the prefix `v-`
> * Each video maintains its own stream URL for playback
> * Video metadata includes length in seconds, name, description, and thumbnail URL
> * Videos belong to a collection and inherit collection-level access controls
# Videos
Source: https://docs.videodb.io/api-reference/videos/index
Core video operations and management
Core video management endpoints for listing, retrieving, and deleting videos.
## Endpoints
> **[List Videos](/api-reference/videos/list_videos)**
>
> Get all videos
> **[Get Video](/api-reference/videos/get_video)**
>
> Retrieve video details
> **[Delete Video](/api-reference/videos/delete_video)**
>
> Remove a video
> **[Delete Video Storage](/api-reference/videos/delete_video_storage)**
>
> Remove video from storage
> **[Update Video](/api-reference/videos/update_video)**
>
> Update video metadata
# Create Scene Index
Source: https://docs.videodb.io/api-reference/videos/indexing/create_scene_index
POST /video/{video_id}/index/scene/
Create a visual search index by analyzing video frames
Create an AI-powered index of scenes in the video with descriptions, enabling visual search and scene understanding.
> [!NOTE]
>
> This is a supported legacy singular `/video/.../index` endpoint. For current work, use [Understand](/pages/understand/indexing-pipelines/understanding-artifacts) → [`video.index()`](/pages/understand/indexing-pipelines/create-an-index), then [`get_index()`, `list_indexes()`, or `delete_index()`](/pages/understand/indexing-pipelines/view-indexes).
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]
# Index scenes for visual search
scene_index_id = video.index_scenes()
print(f"Scene index created: {scene_index_id}")
```
```javascript Node.js theme={null}
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];
// Index scenes for visual search
const sceneIndexId = await video.indexScenes();
console.log(`Scene index created: ${sceneIndexId}`);
```
> [!NOTE]
>
> * Analyzes video frames and creates AI descriptions for scenes
> * Supports shot-based and time-based extraction strategies
> * Can use custom prompts to guide scene description
> * Generates visual embeddings for semantic search
> * Returns scene index ID for later retrieval and searching
> * Extraction configuration controls frame sampling and scene detection
# Create Spoken Word Index
Source: https://docs.videodb.io/api-reference/videos/indexing/create_video_index
POST /video/{video_id}/index/
Create a semantic search index from video transcription
Create a semantic search index for spoken words in the video, enabling intelligent search across video transcripts.
> [!NOTE]
>
> This is a supported legacy singular `/video/.../index` endpoint. For current work, use [Understand](/pages/understand/indexing-pipelines/understanding-artifacts) → [`video.index()`](/pages/understand/indexing-pipelines/create-an-index), then [`get_index()`, `list_indexes()`, or `delete_index()`](/pages/understand/indexing-pipelines/view-indexes).
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]
# Index spoken words for semantic search
video.index_spoken_words()
print("Indexing complete. Video is now searchable.")
```
```javascript Node.js theme={null}
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];
// Index spoken words for semantic search
await video.indexSpokenWords();
console.log('Indexing complete. Video is now searchable.');
```
> [!NOTE]
>
> * Automatically generates transcript if not already created
> * Creates semantic embeddings for all spoken words
> * Enables powerful search capabilities on video content
> * Indexing is asynchronous; progress can be tracked with callbacks
> * Index remains in place even if video storage is deleted
> * Use language\_code parameter for non-English videos (optional)
# Delete Scene Index
Source: https://docs.videodb.io/api-reference/videos/indexing/delete_scene_index
DELETE /video/{video_id}/index/scene/{scene_index_id}
Delete a scene index from a video
Remove a scene index from a video, freeing up resources used by that index.
> [!NOTE]
>
> This is a supported legacy singular `/video/.../index` endpoint. For current work, use [Understand](/pages/understand/indexing-pipelines/understanding-artifacts) → [`video.index()`](/pages/understand/indexing-pipelines/create-an-index), then [`get_index()`, `list_indexes()`, or `delete_index()`](/pages/understand/indexing-pipelines/view-indexes).
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]
# Delete scene index
video.delete_scene_index("scene_index_id")
print("Scene index deleted")
```
```javascript Node.js theme={null}
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];
// Delete scene index
await video.deleteSceneIndex('scene_index_id');
console.log('Scene index deleted');
```
> [!WARNING]
>
> * Deleting a scene index is irreversible
> * All scene records and visual embeddings are removed
> * You can create a new index to replace it if needed
> * Existing scene collections are not affected by deleting the index
# Delete Video Index
Source: https://docs.videodb.io/api-reference/videos/indexing/delete_video_index
POST /video/{video_id}/index/delete
Delete an existing video index
Delete an existing index from a video. You can delete spoken word indexes, scene indexes, or all indexes at once.
> [!NOTE]
>
> This is a supported legacy singular `/video/.../index` endpoint. For current work, use [Understand](/pages/understand/indexing-pipelines/understanding-artifacts) → [`video.index()`](/pages/understand/indexing-pipelines/create-an-index), then [`get_index()`, `list_indexes()`, or `delete_index()`](/pages/understand/indexing-pipelines/view-indexes).
> [!NOTE]
>
> * `index_type` can be `spoken_word`, `scene`, or `all`
> * This operation is irreversible; you will need to re-index the video to search it again
> * Use `model_name` to target a specific model's index when deleting scene indexes
> **[Create Index](/api-reference/videos/indexing/create_video_index)**
>
> Index video content
> **[Get Index](/api-reference/videos/indexing/get_video_index)**
>
> Retrieve index details
# Get Scene Index Details
Source: https://docs.videodb.io/api-reference/videos/indexing/get_scene_index
GET /video/{video_id}/index/scene/{scene_index_id}
Retrieve details of a specific scene index
Retrieve all scene records from a specific scene index including descriptions and visual embeddings.
> [!NOTE]
>
> This is a supported legacy singular `/video/.../index` endpoint. For current work, use [Understand](/pages/understand/indexing-pipelines/understanding-artifacts) → [`video.index()`](/pages/understand/indexing-pipelines/create-an-index), then [`get_index()`, `list_indexes()`, or `delete_index()`](/pages/understand/indexing-pipelines/view-indexes).
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]
# Get scene index records
scene_records = video.get_scene_index("scene_index_id")
for record in scene_records:
print(f"Scene: {record['scene_id']}")
print(f"Description: {record['description']}")
print(f"Time: {record['start']}s - {record['end']}s")
```
```javascript Node.js theme={null}
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];
// Get scene index records
const sceneRecords = await video.getSceneIndex('scene_index_id');
for (const record of sceneRecords) {
console.log(`Scene: ${record.sceneId}`);
console.log(`Description: ${record.description}`);
console.log(`Time: ${record.start}s - ${record.end}s`);
}
```
> [!NOTE]
>
> * Returns list of scene records with AI-generated descriptions
> * Each record includes start/end timestamps and visual embeddings
> * Scene IDs follow the pattern `sc-` prefix
> * Can be used to search for specific scenes by description
> * Useful for creating visual navigation interfaces
# Get Video Index
Source: https://docs.videodb.io/api-reference/videos/indexing/get_video_index
GET /video/{video_id}/index/
Retrieve the status of a video index
Retrieve metadata and status of a video index.
> [!NOTE]
>
> This is a supported legacy singular `/video/.../index` endpoint. For current work, use [Understand](/pages/understand/indexing-pipelines/understanding-artifacts) → [`video.index()`](/pages/understand/indexing-pipelines/create-an-index), then [`video.get_index()`, `video.list_indexes()`, or `video.delete_index()`](/pages/understand/indexing-pipelines/view-indexes).
> [!NOTE]
>
> * `index_type` is required and can be `spoken_word` or `scene`
> * Returns index metadata and status for the requested type
> * Requires index to be created first with create-index endpoint
> * `engine` is optional and defaults to `default`
# Indexing & Search
Source: https://docs.videodb.io/api-reference/videos/indexing/index
Index videos and search across content
These are supported legacy singular `/video/.../index` endpoints. For current work, use [Understand](/pages/understand/indexing-pipelines/understanding-artifacts) → [`video.index()`](/pages/understand/indexing-pipelines/create-an-index), then [`get_index()`, `list_indexes()`, or `delete_index()`](/pages/understand/indexing-pipelines/view-indexes).
## Endpoints
> **[Create Index](/api-reference/videos/indexing/create_video_index)**
>
> Index spoken words
> **[Get Index](/api-reference/videos/indexing/get_video_index)**
>
> Retrieve index details
> **[Create Scene Index](/api-reference/videos/indexing/create_scene_index)**
>
> Index visual content
> **[List Scene Indexes](/api-reference/videos/indexing/list_scene_indexes)**
>
> Get all scene indexes
> **[Get Scene Index](/api-reference/videos/indexing/get_scene_index)**
>
> Retrieve scene index
> **[Delete Scene Index](/api-reference/videos/indexing/delete_scene_index)**
>
> Remove scene index
> **[Search](/api-reference/videos/indexing/search_video_index)**
>
> Search indexed content
> **[Delete Index](/api-reference/videos/indexing/delete_video_index)**
>
> Delete a video index
# List Scene Indexes
Source: https://docs.videodb.io/api-reference/videos/indexing/list_scene_indexes
GET /video/{video_id}/index/scene/
Retrieve all scene indexes for visual search
Retrieve all scene indexes created for a video.
> [!NOTE]
>
> This is a supported legacy singular `/video/.../index` endpoint. For current work, use [Understand](/pages/understand/indexing-pipelines/understanding-artifacts) → [`video.index()`](/pages/understand/indexing-pipelines/create-an-index), then [`get_index()`, `list_indexes()`, or `delete_index()`](/pages/understand/indexing-pipelines/view-indexes).
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]
# List all scene indexes
indexes = video.list_scene_index()
for index in indexes:
print(f"Index ID: {index['scene_index_id']}")
print(f"Name: {index.get('name', 'Unnamed')}")
print(f"Status: {index.get('status')}")
```
```javascript Node.js theme={null}
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];
// List all scene indexes
const indexes = await video.listSceneIndex();
for (const index of indexes) {
console.log(`Index ID: ${index.sceneIndexId}`);
console.log(`Name: ${index.name || 'Unnamed'}`);
console.log(`Status: ${index.status}`);
}
```
> [!NOTE]
>
> * Returns all scene indexes associated with a video
> * Each index contains metadata including ID, name, and creation status
> * Scene indexes allow different indexing strategies for the same video
> * Use returned IDs to retrieve specific index details or delete indexes
# Search Video
Source: https://docs.videodb.io/api-reference/videos/indexing/search_video_index
POST /video/{video_id}/search/
Search video content by spoken words or visual scenes
Search for specific content within a video using semantic search on transcripts or visual indexes.
> [!NOTE]
>
> This is a supported legacy `POST /video/{video_id}/search/` endpoint. For current retrieval, use [Search V2 direct methods](/pages/understand/search-and-retrieval/natural-language-query): `semantic_search()`, `query()`, or `aggregate()`.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]
# Search a legacy index
results = video.legacy_search("customer reviews discussion")
shots = results.get_shots()
print(f"Found {len(shots)} matches")
for shot in shots:
print(f"Time: {shot.start:.2f}s - {shot.end:.2f}s")
print(f"Text: {shot.text}")
```
```javascript Node.js theme={null}
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];
// Search a legacy index
const results = await video.legacySearch('customer reviews discussion');
const shots = results.getShots();
console.log(`Found ${shots.length} matches`);
for (const shot of shots) {
console.log(`Time: ${shot.start.toFixed(2)}s - ${shot.end.toFixed(2)}s`);
console.log(`Text: ${shot.text}`);
}
```
> [!NOTE]
>
> * Requires index to be created first (create-index endpoint)
> * Returns matched segments with timestamps and relevance scores
> * Supports semantic search on transcribed text
> * Can filter results by score threshold and result count
> * Search results include exact timestamp ranges for video navigation
# List Videos
Source: https://docs.videodb.io/api-reference/videos/list_videos
GET /video/
Retrieve a paginated list of all videos in a collection
Retrieve all videos from a collection with full metadata for each video including duration, thumbnails, and stream URLs.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
# Get all videos
videos = coll.get_videos()
for video in videos:
print(f"Video: {video.name} ({video.id})")
print(f"Duration: {video.length}s")
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
// Get all videos
const videos = await coll.getVideos();
for (const video of videos) {
console.log(`Video: ${video.name} (${video.id})`);
console.log(`Duration: ${video.length}s`);
}
```
> [!NOTE]
>
> * Returns all videos within a specific collection
> * Each video object contains complete metadata (ID, name, duration, stream URL, thumbnail)
> * Videos are organized at the collection level
> * Video list includes only videos belonging to the authenticated user's collections
# Reframe video to different aspect ratio
Source: https://docs.videodb.io/api-reference/videos/reframe-video-to-different-aspect-ratio
/openapi.yaml post /video/{video_id}/reframe
# Delete Scene Collection
Source: https://docs.videodb.io/api-reference/videos/scenes/delete_scene_collection
DELETE /video/{video_id}/scenes/{scene_collection_id}/
Delete a scene collection from a video
Delete a specific scene collection from a video. This removes all scene data within the collection.
> [!NOTE]
>
> * This operation is irreversible
> * Scene collection IDs start with `sc-`
> * Re-extract scenes to recreate the collection
> **[Get Scene Collection](/api-reference/videos/scenes/get_scene_collection)**
>
> Retrieve scene collection details
> **[Extract Scenes](/api-reference/videos/scenes/extract_video_scenes)**
>
> Extract new scenes from video
# Describe Video Frame
Source: https://docs.videodb.io/api-reference/videos/scenes/describe_video_frame
POST /video/{video_id}/frame/{frame_id}/describe/
Generate AI description of a specific video frame
Generate an AI-powered description of a specific video frame's visual content.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]
# Get scene collection
scene_collection = video.get_scene_collection("scene_collection_id")
# Get a frame from a scene
scene = scene_collection.scenes[0]
frame = scene.frames[0]
# Describe the frame
description = frame.describe()
print(f"Frame description: {description}")
print(f"Frame time: {frame.frame_time}s")
# Describe with custom prompt
custom_desc = frame.describe(prompt="List all objects visible")
# Describe with custom model configuration
description = frame.describe(
prompt="Describe this frame in detail",
model_name="pro",
model_config={"temperature": 0.5}
)
```
```javascript Node.js theme={null}
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];
// Get scene collection
const sceneCollection = await video.getSceneCollection('scene_collection_id');
// Get a frame from a scene
const scene = sceneCollection.scenes[0];
const frame = scene.frames[0];
// Describe the frame
const description = await frame.describe();
console.log(`Frame description: ${description}`);
console.log(`Frame time: ${frame.frameTime}s`);
// Describe with custom prompt
const customDesc = await frame.describe('List all objects visible');
// Describe with custom model configuration
const detailed = await frame.describe(
'Describe this frame in detail',
'pro',
{ temperature: 0.5 }
);
```
> [!NOTE]
>
> * Generates detailed visual description using AI vision models
> * Can use custom prompts to focus description on specific aspects
> * Pass `model_name` separately from `model_config`
> * Overwrites existing frame description
> * Frame IDs start with `fr-` prefix
> * Each frame includes timestamp (frame\_time) in the video
> * Useful for generating captions or accessibility descriptions
# Describe Video Scene
Source: https://docs.videodb.io/api-reference/videos/scenes/describe_video_scene
POST /video/{video_id}/scene/{scene_id}/describe/
Generate AI description of a video scene
Generate an AI-powered description of a video scene's visual content.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]
# Get scene collection
scene_collection = video.get_scene_collection("scene_collection_id")
# Describe a specific scene
scene = scene_collection.scenes[0]
description = scene.describe()
print(f"Scene description: {description}")
# Describe with custom prompt
custom_desc = scene.describe(prompt="Focus on people and their actions")
# Describe with custom model configuration
description = scene.describe(
prompt="Describe this scene in detail",
model_name="pro",
model_config={"temperature": 0.5}
)
```
```javascript Node.js theme={null}
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];
// Get scene collection
const sceneCollection = await video.getSceneCollection('scene_collection_id');
// Describe a specific scene
const scene = sceneCollection.scenes[0];
const description = await scene.describe();
console.log(`Scene description: ${description}`);
// Describe with custom prompt
const customDesc = await scene.describe('Focus on people and their actions');
// Describe with custom model configuration
const detailed = await scene.describe(
'Describe this scene in detail',
'pro',
{ temperature: 0.5 }
);
```
> [!NOTE]
>
> * Generates description using AI vision models
> * Can use custom prompts to guide description focus
> * Pass `model_name` separately; use the optional `model_config` dict for settings such as `temperature` (0.0-1.0)
> * Overwrites existing scene description
> * Requires scene to be part of extracted scene collection
> * Scene IDs start with `sc-` prefix
# Extract Video Scenes
Source: https://docs.videodb.io/api-reference/videos/scenes/extract_video_scenes
POST /video/{video_id}/scenes/
Extract and analyze scenes from video content
Extract scenes from a video using shot detection or time-based segmentation, with automatic frame sampling and descriptions.
```python Python theme={null}
import videodb
from videodb import SceneExtractionType
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]
# Extract scenes using shot-based detection (default)
scene_collection = video.extract_scenes()
for scene in scene_collection.scenes:
print(f"Scene: {scene.id}")
print(f"Time: {scene.start}s - {scene.end}s")
print(f"Description: {scene.description}")
# Extract with time-based segmentation (every 10 seconds)
config = {"time": 10, "frame_count": 2}
scenes = video.extract_scenes(
extraction_type=SceneExtractionType.time_based,
extraction_config=config
)
```
```javascript Node.js theme={null}
import { connect, SceneExtractionType } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
const videos = await coll.getVideos();
const video = videos[0];
// Extract scenes using shot-based detection (default)
const sceneCollection = await video.extractScenes();
for (const scene of sceneCollection.scenes) {
console.log(`Scene: ${scene.id}`);
console.log(`Time: ${scene.start}s - ${scene.end}s`);
}
// Extract with time-based segmentation (every 10 seconds)
const scenes = await video.extractScenes({
extractionType: SceneExtractionType.timeBased,
extractionConfig: { time: 10, frame_count: 2 }
});
```
> [!NOTE]
>
> * Two extraction types: shot-based (detects camera cuts) and time-based (fixed intervals)
> * Shot-based default threshold is 20 (lower = more sensitive to changes)
> * Time-based allows specifying interval (in seconds) and frames per segment
> * Returns SceneCollection with Scene objects including frames and metadata
> * Extracted frames can be used for visual search and thumbnail generation
# Get Scene Collection
Source: https://docs.videodb.io/api-reference/videos/scenes/get_scene_collection
GET /video/{video_id}/scenes/{scene_collection_id}/
Retrieve details of a specific scene collection
Retrieve the details and scenes within a specific scene collection, including scene timestamps and descriptions.
> [!NOTE]
>
> * Use `offset` and `limit` parameters for pagination
> * Scene collection IDs start with `sc-`
> * Each scene includes start/end timestamps and optional descriptions
> **[Update Scene Collection](/api-reference/videos/scenes/update_scene_collection)**
>
> Modify scene data
> **[Extract Scenes](/api-reference/videos/scenes/extract_video_scenes)**
>
> Extract scenes from video
# Get Video Scenes
Source: https://docs.videodb.io/api-reference/videos/scenes/get_video_scenes
GET /video/{video_id}/scenes/
Retrieve detected scenes from video analysis
Retrieve a previously extracted scene collection by its ID.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]
# Get a specific scene collection
scene_collection = video.get_scene_collection("scene_collection_id")
print(f"Scenes in collection: {len(scene_collection.scenes)}")
for scene in scene_collection.scenes:
print(f"Scene {scene.id}: {scene.start}s - {scene.end}s")
for frame in scene.frames:
print(f" Frame {frame.id} at {frame.frame_time}s")
```
```javascript Node.js theme={null}
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];
// Get a specific scene collection
const sceneCollection = await video.getSceneCollection('scene_collection_id');
console.log(`Scenes: ${sceneCollection.scenes.length}`);
for (const scene of sceneCollection.scenes) {
console.log(`Scene ${scene.id}: ${scene.start}s - ${scene.end}s`);
for (const frame of scene.frames) {
console.log(` Frame ${frame.id} at ${frame.frameTime}s`);
}
}
```
> [!NOTE]
>
> * Scene collection IDs follow the pattern `sc-` prefix
> * Returns SceneCollection containing multiple Scene objects
> * Each scene includes all extracted frames with URLs
> * Frames are ordered and can be displayed as galleries
> * Use scene IDs or frame IDs to get specific elements
# Scene & Frame Analysis
Source: https://docs.videodb.io/api-reference/videos/scenes/index
Extract and analyze video scenes and frames
Extract scenes and analyze frames using computer vision.
## Endpoints
> **[Extract Scenes](/api-reference/videos/scenes/extract_video_scenes)**
>
> Extract scenes from video
> **[Get Scenes](/api-reference/videos/scenes/get_video_scenes)**
>
> Retrieve scene data
> **[Describe Scene](/api-reference/videos/scenes/describe_video_scene)**
>
> Generate scene description
> **[Describe Frame](/api-reference/videos/scenes/describe_video_frame)**
>
> Analyze specific frame
> **[Get Scene Collection](/api-reference/videos/scenes/get_scene_collection)**
>
> Retrieve scene collection
> **[Update Scene Collection](/api-reference/videos/scenes/update_scene_collection)**
>
> Modify scene collection
> **[Delete Scene Collection](/api-reference/videos/scenes/delete_scene_collection)**
>
> Remove scene collection
# Update Scene Collection
Source: https://docs.videodb.io/api-reference/videos/scenes/update_scene_collection
PATCH /video/{video_id}/scenes/{scene_collection_id}/
Update scenes within a scene collection
Update the scenes within an existing scene collection. Use this to modify scene boundaries or descriptions.
> [!NOTE]
>
> * The `scenes` array is required and replaces the existing scenes in the collection
> * Each scene object should include the scene boundaries and optional description
> **[Get Scene Collection](/api-reference/videos/scenes/get_scene_collection)**
>
> Retrieve scene collection details
> **[Delete Scene Collection](/api-reference/videos/scenes/delete_scene_collection)**
>
> Remove a scene collection
# Create Custom Thumbnail
Source: https://docs.videodb.io/api-reference/videos/streaming/create_video_thumbnail
POST /video/{video_id}/thumbnail/
Generate a custom thumbnail from a specific video frame
Generate a custom thumbnail image from a specific timestamp in the video.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]
# Generate thumbnail from specific timestamp (in seconds)
thumbnail = video.generate_thumbnail(time=5.0)
# thumbnail is an Image object
print(f"Thumbnail URL: {thumbnail.url}")
print(f"Thumbnail ID: {thumbnail.id}")
```
```javascript Node.js theme={null}
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 thumbnail from specific timestamp (in seconds)
const thumbnail = await video.generateThumbnail(5.0);
// thumbnail is an Image object
console.log(`Thumbnail URL: ${thumbnail.url}`);
console.log(`Thumbnail ID: ${thumbnail.id}`);
```
> [!NOTE]
>
> * Time parameter is in seconds, can be a float (e.g., 2.5 for 2.5 seconds into video)
> * Returns an Image object with URL and metadata
> * Generated thumbnails are stored and can be retrieved later
> * Time value should be within video duration (0 to video.length)
> * Multiple thumbnails can be generated at different timestamps
# Generate Video Stream
Source: https://docs.videodb.io/api-reference/videos/streaming/generate_video_stream
POST /video/{video_id}/stream/
Generate a streamable URL for video playback with optional timeline customization
Generate a streamable URL for the entire video or create a custom stream from specific timeline segments.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]
# Get full stream URL (returns existing if available)
stream_url = video.generate_stream()
# Create stream from custom timeline (in seconds)
# Format: [(start, end), (start, end), ...]
timeline = [(0, 30), (60, 90)]
custom_stream_url = video.generate_stream(timeline=timeline)
print(f"Stream URL: {stream_url}")
print(f"Custom stream: {custom_stream_url}")
```
```javascript Node.js theme={null}
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];
// Get full stream URL (returns existing if available)
const streamUrl = await video.generateStream();
// Create stream from custom timeline (in seconds)
// Format: [[start, end], [start, end], ...]
const timeline = [[0, 30], [60, 90]];
const customStreamUrl = await video.generateStream(timeline);
console.log(`Stream URL: ${streamUrl}`);
console.log(`Custom stream: ${customStreamUrl}`);
```
> [!NOTE]
>
> * Returns a pre-existing stream URL if available (no re-processing needed)
> * Timeline allows creating videos with multiple segments automatically stitched
> * Timeline format: list of (start\_time, end\_time) tuples in seconds
> * Stream URLs are HLS format and work with most video players
> * Stream URLs remain valid as long as the video is stored
# Get Video Thumbnail
Source: https://docs.videodb.io/api-reference/videos/streaming/get_video_thumbnail
GET /video/{video_id}/thumbnail/
Retrieve the default thumbnail image for a video
Retrieve the default thumbnail URL for a video. This is automatically generated when the video is uploaded.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]
# Get default thumbnail URL (no time parameter)
thumbnail_url = video.generate_thumbnail()
print(f"Thumbnail URL: {thumbnail_url}")
```
```javascript Node.js theme={null}
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];
// Get default thumbnail URL (no time parameter)
const thumbnailUrl = await video.generateThumbnail();
console.log(`Thumbnail URL: ${thumbnailUrl}`);
```
> [!NOTE]
>
> * Returns thumbnail as a URL string (not an Image object)
> * Thumbnail is auto-generated from the video at upload time
> * Thumbnail URL can be used directly in img tags for web display
> * If stored in video.thumbnail\_url, this method returns cached version
> * For custom thumbnails at specific timestamps, use create-thumbnail endpoint
# Streaming & Playback
Source: https://docs.videodb.io/api-reference/videos/streaming/index
Generate streams and manage thumbnails
Generate streaming URLs and manage video thumbnails.
## Endpoints
> **[Create Thumbnail](/api-reference/videos/streaming/create_video_thumbnail)**
>
> Generate a thumbnail
> **[List Thumbnails](/api-reference/videos/streaming/list_video_thumbnails)**
>
> Get all thumbnails
> **[Get Thumbnail](/api-reference/videos/streaming/get_video_thumbnail)**
>
> Retrieve thumbnail details
> **[Generate Stream](/api-reference/videos/streaming/generate_video_stream)**
>
> Create streaming URL
# List Video Thumbnails
Source: https://docs.videodb.io/api-reference/videos/streaming/list_video_thumbnails
GET /video/{video_id}/thumbnails/
Retrieve all custom thumbnails created for a video
Retrieve all custom thumbnails that have been generated for a video at different timestamps.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]
# Get all thumbnails
thumbnails = video.get_thumbnails()
for thumbnail in thumbnails:
print(f"Thumbnail ID: {thumbnail.id}")
print(f"URL: {thumbnail.url}")
```
```javascript Node.js theme={null}
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];
// Get all thumbnails
const thumbnails = await video.getThumbnails();
for (const thumbnail of thumbnails) {
console.log(`Thumbnail ID: ${thumbnail.id}`);
console.log(`URL: ${thumbnail.url}`);
}
```
> [!NOTE]
>
> * Returns list of Image objects for each generated custom thumbnail
> * Only includes custom thumbnails created with create-thumbnail endpoint
> * Each Image object contains ID, URL, and metadata
> * Default auto-generated thumbnail is not included in this list
> * Use to manage multiple thumbnails created at different video timestamps
# Create Video Transcription
Source: https://docs.videodb.io/api-reference/videos/transcription/create_video_transcription
POST /video/{video_id}/transcription/
Generate a transcription for a video with speech recognition and speaker diarization
Generate a complete transcription of the video's audio content using automatic speech recognition.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]
# Generate transcript
result = video.generate_transcript()
if isinstance(result, dict) and result.get('success'):
print("Transcript generated successfully")
else:
print("Transcript generation started or already exists")
# Generate transcript with language hint
video.generate_transcript(language_code="en")
```
```javascript Node.js theme={null}
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 transcript
const result = await video.generateTranscript();
console.log(result);
// Generate transcript with language hint
await video.generateTranscript(false, 'en');
```
> [!NOTE]
>
> * Generates timestamped transcript with word-level timing information
> * Includes automatic speaker diarization when available
> * Returns success confirmation; retrieve actual transcript with get-transcription
> * Processing time depends on video duration
> * Transcript is cached after first generation (use force: true to regenerate)
> * Optional `language_code` parameter hints the transcription engine about the spoken language for better accuracy
# Get Video Transcription
Source: https://docs.videodb.io/api-reference/videos/transcription/get_video_transcription
GET /video/{video_id}/transcription/
Retrieve the transcription for a video
Retrieve the timestamped transcription for a video. Supports multiple segmentation types and time ranges.
```python Python theme={null}
import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]
# Get full transcript with word-level timestamps
transcript = video.get_transcript()
for segment in transcript:
print(f"{segment['start']:.2f}s - {segment['text']}")
# Get plain text transcript
text = video.get_transcript_text()
print(f"Full text: {text}")
# Segment by sentence instead of word
transcript = video.get_transcript(segmenter="sentence")
# Group every 10 words
transcript = video.get_transcript(segmenter="word", length=10)
# Fixed-duration audio segments (e.g., 5-second chunks)
transcript = video.get_transcript(segmenter="time", length=5)
# Get transcript for a specific time range
transcript = video.get_transcript(start=10, end=60)
```
```javascript Node.js theme={null}
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];
// Get full transcript with timestamps
const transcript = await video.getTranscript();
for (const word of transcript.wordTimestamps) {
console.log(`${word.start.toFixed(2)}s - ${word.word}`);
}
// Get plain text transcript
const text = await video.getTranscriptText();
console.log(`Full text: ${text}`);
// Segment by sentence instead of word
const sentenceTranscript = await video.getTranscript(0, video.length, 'sentence');
// Group every 10 words
const wordGroups = await video.getTranscript(0, video.length, 'word', 10);
// Fixed-duration audio segments
const timeTranscript = await video.getTranscript(0, video.length, 'time', 5);
// Get transcript for a specific time range
const rangeTranscript = await video.getTranscript(10, 60);
```
### Parameters
| Parameter | Type | Default | Description |
| :- | :- | :- | :- |
| `segmenter` | str | `"word"` | How to split the transcript: `"word"`, `"sentence"`, or `"time"` |
| `length` | int | `1` | Seconds when `segmenter` is `time` |
| `start` | float | — | Start time in seconds (must be >= 0) |
| `end` | float | — | End time in seconds (must be >= start) |
| `force` | bool | `false` | Force re-fetch from server, bypassing cache |
> [!NOTE]
>
> * Python returns a list of segment dicts; Node.js returns a `Transcript` object with segments in `wordTimestamps`
> * The raw API response wraps this as `data.word_timestamps` plus `data.text`
> * Transcription segmentation is audio/text-based and is independent of visual scene segmentation
> * Invalid segmenter values raise a `ValueError`
> * Negative `start`/`end` or `start > end` raise a `ValueError`
> * Generates transcript automatically if not already created
### Raw response shape
When completed, the server returns transcript text and timestamped entries:
```json theme={null}
{
"success": true,
"status": "completed",
"data": {
"text": "I need to leave now.",
"word_timestamps": [
{"start": 0.4, "end": 0.8, "text": "I"},
{"start": 0.8, "end": 1.2, "text": "need"},
{"start": 1.2, "end": 1.6, "text": "to"},
{"start": 1.6, "end": 2.1, "text": "leave"},
{"start": 2.1, "end": 2.8, "text": "now."}
]
}
}
```
Silence ranges may be included with `text: "-"`.
# Transcription
Source: https://docs.videodb.io/api-reference/videos/transcription/index
Generate and retrieve video transcripts
Create and retrieve video transcriptions.
## Endpoints
> **[Create Transcription](/api-reference/videos/transcription/create_video_transcription)**
>
> Generate transcript
> **[Get Transcription](/api-reference/videos/transcription/get_video_transcription)**
>
> Retrieve transcript
# Update scene collection
Source: https://docs.videodb.io/api-reference/videos/update-scene-collection
/openapi.yaml patch /video/{video_id}/scenes/{scene_collection_id}/
# Update video
Source: https://docs.videodb.io/api-reference/videos/update-video
/openapi.yaml patch /video/{video_id}
# Update Video
Source: https://docs.videodb.io/api-reference/videos/update_video
PATCH /video/{video_id}
Update video metadata such as name and description
Update metadata for a specific video, including its name and description.
> [!NOTE]
>
> * Video IDs start with the prefix `m-`
> * Only provided fields are updated; omitted fields remain unchanged
# Bloom
Source: https://docs.videodb.io/examples-and-tutorials/ai-copilots/bloom
Open-source, local-first screen recorder with AI processing - record, upload to VideoDB, and query with natural language
[Bloom - Local-First Screen Recorder](https://www.youtube.com/embed/RjIYRNRTlx4)
> **[Bloom on GitHub](https://github.com/video-db/bloom)**
>
> Complete source code, installation guide, and configuration
## What Is It?
Your local-first screen recorder, built for AI workflows.
Bloom records on your machine (no lock-in), automatically uploads to VideoDB for transcription and indexing, then lets you search any moment with natural language. It's Loom meets agent-ready infrastructure.
> [!TIP]
>
> **The Power**: Your recordings become queryable data. Search "when did I mention the deadline?" or "show me the deployment steps" — get timestamped clips with context.
## When to Use Bloom
Bloom shines in scenarios where you need recordings to become searchable data:
* **Sales demos**: Record product demos once, search forever. "Show me when we explained the pricing model to enterprise clients last month."
* **Bug reproduction**: Capture exact steps that trigger issues, then let teammates search "when did the error first appear?"
* **Tutorial learning**: Following along with video courses? Record your implementation so AI assistants can reference both the tutorial and your work.
* **Async team updates**: Record your screen while explaining complex work. Teammates can search the recording instead of watching the whole thing.
* **Personal knowledge base**: Capture important calls and workshops. Search months later when you need to remember "what did we decide about the API design?"
## Why You Need This
**Local-First**
### No Lock-In
Your files stay on your machine:
* Record locally, no forced cloud upload
* Pay only for AI processing (when you need it)
* Export and own your recordings
* No subscription, no storage limits
**AI-Ready**
### Make Recordings Searchable
Transform video into queryable data:
* Automatic transcription of spoken words
* Visual embeddings for scene understanding
* Metadata extraction from content
* Natural language search across all recordings
**Agent Integration**
### Built for Agents
Access recordings from AI workflows:
* Query via VideoDB API
* Compatible with Claude Code and agent frameworks
* Structured data output for automation
* Shareable links for team access
## How It Works
**1. Record Locally**
Capture screen, microphone, system audio, and camera with a floating control bar. Multi-monitor support lets you choose which display to record.
**2. Upload to VideoDB (Optional but Powerful)**
As you record, Bloom can sync chunks to VideoDB Cloud in real-time. Why? Processing video on your local machine would drain battery and CPU. By streaming to VideoDB, the heavy lifting—transcription, visual indexing, embedding generation—happens server-side while you keep working. You keep the local file, VideoDB keeps the intelligence.
**3. Process with AI**
VideoDB indexes spoken words, generates transcripts, and creates subtitled streams. Visual embeddings make every frame searchable.
**4. Query Anywhere**
Search your recordings with natural language. "Show me when I explained the architecture" returns timestamped clips with full context.
**5. Share or Integrate**
One-click shareable links, VideoDB Chat for questions, or API access for agent frameworks. Download MP4 files anytime.
## Key Features
> **Recording & Capture**
>
> **Complete Desktop Capture**
>
> * Screen recording with multi-monitor support
> * Microphone and system audio capture
> * Draggable camera bubble overlay
> * Display picker to choose which screen
> * Global keyboard shortcut: `Cmd+Shift+R`
> * Always-on-top floating control bar
> **Library Management**
>
> **Organize Your Recordings**
>
> * Browse all recordings with search
> * Sort by date (newest/oldest)
> * Rename recordings in-place
> * Delete with confirmation
> * Download recordings as MP4
> * Keyboard navigation (arrow keys, delete key)
> **AI Processing**
>
> **Automatic Intelligence**
>
> * Transcription of spoken words via VideoDB
> * Subtitle generation for video playback
> * HLS streaming with in-app player
> * Visual indexing for scene search
> * Metadata extraction from content
> **Sharing & Integration**
>
> **Connect with Workflows**
>
> * One-click shareable links for any recording
> * VideoDB Chat to query recordings with AI
> * Download MP4 files for offline use
> * API access for agent frameworks
> * Integration with Claude Code and other tools
> **Developer Experience**
>
> **Open Source & Customizable**
>
> * Full UI source code available (MIT license)
> * System tray integration with status indicator
> * Light/dark theme support
> * Permission management for mic, screen, camera
> * Local SQLite database for metadata
## Tech Stack
Built for performance and reliability:
> **Electron 39.7**
>
> Desktop application shell
> **Node.js 18+**
>
> JavaScript runtime
> **VideoDB SDK 0.2.4**
>
> Recording and AI processing
> **SQLite (sql.js)**
>
> Local metadata storage
> **HLS.js**
>
> In-app video playback
> **Universal Binary**
>
> Apple Silicon + Intel support
## Getting Started
> [!NOTE]
>
> **Prerequisites**
>
> * macOS 12+ or Windows 10+ (Linux support coming soon)
> * [VideoDB API key](https://console.videodb.io/auth?utm_source=docs_videodb_io\&utm_medium=docs_link\&utm_campaign=console_auth\&utm_content=docs_link\&id=docs) (free tier available)
**1. Install Bloom**
**Automated installation** (recommended):
```bash theme={null}
curl -fsSL https://artifacts.videodb.io/bloom/install | bash
```
**Manual installation:**
* **Apple Silicon (M1/M2/M3/M4)**: [bloom-2.2.0-arm64.dmg](https://artifacts.videodb.io/bloom/bloom-2.2.0-arm64.dmg)
* **Apple Intel**: [bloom-2.2.0-x64.dmg](https://artifacts.videodb.io/bloom/bloom-2.2.0-x64.dmg)
* **Windows**: [bloom-2.2.0-x64.exe](https://artifacts.videodb.io/bloom/bloom-2.2.0-x64.exe)
For manual install: mount the DMG and drag Bloom to Applications, then run:
```bash theme={null}
xattr -cr /Applications/Bloom.app
```
**2. Launch and Register**
1. Launch Bloom from Applications or Spotlight
2. Enter your VideoDB API key ([get one free](https://console.videodb.io/auth?utm_source=docs_videodb_io\&utm_medium=docs_link\&utm_campaign=console_auth\&utm_content=docs_link\&id=docs))
3. Grant system permissions when prompted
**3. Grant Permissions**
Bloom needs access to:
* **Microphone** - For voice recording
* **Screen Recording** - For screen capture
* **Camera** (optional) - For camera bubble overlay
Grant these in **System Settings > Privacy & Security**.
**4. Start Recording**
1. Press `Cmd+Shift+R` or click the Bloom icon in system tray
2. Choose your display from the picker
3. Toggle camera, mic, and system audio as needed
4. Click **Start Recording**
> [!WARNING]
>
> **macOS Permissions Required**
>
> Grant in **System Settings > Privacy & Security**:
>
> * Microphone (for voice recording)
> * Screen Recording (for screen capture)
> * Camera (for camera overlay, optional)
## Configuration
All features are configurable through the Bloom interface:
| Feature | Customizable |
| - | - |
| Recording sources | Enable/disable mic, system audio, camera |
| Display selection | Choose which screen to record |
| Camera position | Drag camera bubble anywhere on screen |
| Keyboard shortcut | Default: `Cmd+Shift+R` |
| Theme | Light or dark mode |
| Storage location | Local database at `~/Library/Application Support/bloom/` |
## Privacy & Data
> [!TIP]
>
> **Local Recording** - Files saved on your machine first, cloud upload is optional
> [!TIP]
>
> **No Lock-In** - Download recordings anytime, export as MP4
> [!TIP]
>
> **Encrypted Storage** - API keys encrypted, credentials protected
> [!TIP]
>
> **User Control** - Delete recordings locally and from cloud independently
***
> **[Complete Setup Guide on GitHub](https://github.com/video-db/bloom)**
>
> Detailed installation instructions, troubleshooting guide, and development setup
## Related Tutorials
> **[Pair Programmer](/examples-and-tutorials/ai-copilots/pair-programmer)**
>
> AI coding assistant with screen and audio context
> **[Focusd](/examples-and-tutorials/ai-copilots/focusd)**
>
> AI-powered productivity tracking with automatic insights
> **[Call.md](/examples-and-tutorials/ai-copilots/call-md)**
>
> Real-time AI meeting assistant with live intelligence
# Call.md
Source: https://docs.videodb.io/examples-and-tutorials/ai-copilots/call-md
Turn meetings into live agent loops - real-time AI meeting assistant with dual-channel transcription and intelligent automation
[Call.md - AI Meeting Assistant](https://www.youtube.com/embed/n24NPxYofRc)
> **[Call.md on GitHub](https://github.com/video-db/call.md)**
>
> Complete source code, installation guide, and configuration
## What Is It?
Your AI meeting assistant, live during every call.
Most meeting tools transcribe after the fact. Call.md is different: it understands your meeting as it happens, giving you AI-powered suggestions, conversation metrics, and automatic tool triggers in real-time. It's like having an AI copilot who watches your meeting, tracks engagement, and whispers helpful context right when you need it.
After the call ends, it generates three-part summaries (overview, key points, action items) and can automatically update your CRM or project management tools through workflow webhooks.
If you've used Otter.ai or Fireflies.ai, think of Call.md as the same idea but built for agent automation—not just passive transcription, but active intelligence during and after meetings.
> [!TIP]
>
> **The Power**: During calls, AI generates contextual suggestions, monitors conversation balance, and automatically triggers your MCP tools when information needs arise — all in real-time.
## Why You Need This
**Live Intelligence**
### During the Meeting
Get real-time assistance while you talk:
* AI-generated suggestions (things to say, questions to ask)
* Conversation metrics (talk ratio, pace, questions asked)
* MCP tools triggered automatically from conversation context
* Coaching nudges when conversation needs steering
**Meeting Intelligence**
### Post-Meeting Analysis
Comprehensive summaries after every call:
* Three-part AI summary (overview, key points, action items)
* Full transcript with dual-channel separation
* Conversation metrics and engagement statistics
* Markdown export with complete meeting intelligence
**Agent Integration**
### MCP Automation
Connect your agent ecosystem:
* Auto-triggers MCP tools during conversations
* Results appear inline during meetings
* Workflow webhooks to n8n, Zapier, CRMs
* Agent-ready structured output
## How It Works
**1. Dual-Channel Transcription**
Captures your mic (labeled "you") and system audio (labeled "them") separately. This separation powers all downstream intelligence.
> [!TIP]
>
> **Why Dual-Channel Matters**: Separating "you" (microphone) from "them" (system audio) isn't just for attribution. It enables Call.md to track conversation balance, detect when one person is dominating, measure your speaking pace independently, and generate insights like "You asked 3 questions but the client asked 0—they might not be engaged." Single-channel transcription can't do this.
**1. Live Assist**
Every 20 seconds, AI analyzes recent transcript and generates contextual suggestions: things to say, questions to ask.
**2. Conversation Metrics**
Real-time tracking of talk ratio, speaking pace (WPM), questions asked, and monologue detection. No LLM required — pure statistics.
**3. MCP Auto-Triggering**
Intent detector scans conversation for information needs (active or passive). When detected, automatically calls relevant MCP tools and displays results inline.
**4. Post-Meeting Intelligence**
When the meeting ends, generates three parallel summaries: narrative overview, key points by topic, and action items. Sends to workflow automation platforms.
## Key Features
> **Recording & Transcription**
>
> **Real-Time Speech-to-Text**
>
> * Separate channels for you and them
> * Live transcription powered by VideoDB
> * Recording history with full transcripts
> * Screen, mic, and system audio capture
> **Live Assist**
>
> **AI-Generated Suggestions**
>
> * Contextual things to say
> * Questions to ask
> * Updates every 20 seconds
> * Based on recent conversation context
> **Conversation Metrics**
>
> **Track Engagement**
>
> * Talk ratio (you vs them)
> * Speaking pace and question count
> * Engagement score
> * Monologue detection (45s threshold)
> **MCP Integration**
>
> **Model Context Protocol**
>
> * Auto-triggers tools from conversation
> * Runs every 20 seconds
> * Max 3 tool calls per run
> * Results display inline during meetings
> * Supports stdio and HTTP servers
> **MCP Auto-Triggering Example**
>
> **How it works in practice:**
>
> During a sales call, the client mentions "Can you send me pricing for the enterprise plan?" The MCP intent detector recognizes this as an information need, automatically calls your CRM tool to fetch the pricing doc, and displays it inline. You see the result immediately and can reference it without breaking flow.
>
> Or: A customer says "I'm seeing error code 502." The MCP agent searches your knowledge base tool, finds relevant docs, and shows them to you in real-time—before you even finish taking notes.
>
> This happens automatically every 20 seconds based on conversation context. You configure which MCP tools are available; the agent decides when to call them.
> **Post-Meeting Summaries**
>
> **Three-Part AI Analysis**
>
> * Short overview (3-5 sentence narrative)
> * Key points by topic (attributed to participants)
> * Action items (3-10 concrete next steps)
> * Generated in parallel for speed
> **Workflow Webhooks**
>
> **Automation Integration**
>
> * Auto-send to n8n, Zapier, CRMs
> * Triggered when meeting ends
> * Structured data payload
> * Agent-ready output format
> **Meeting Preparation**
>
> **Setup Wizard**
>
> * AI-generated probing questions
> * Dynamic discussion checklist
> * Google Calendar integration
> * Sync upcoming meetings
> **Bookmarking**
>
> **Mark Important Moments**
>
> * Quick bookmark during calls
> * Review later with context
> * Share with team
## Tech Stack
Built for performance and reliability:
> **Electron 34**
>
> Desktop application shell
> **React 19 + TypeScript 5.8**
>
> Modern UI with full type safety
> **tRPC 11**
>
> Type-safe API layer
> **Drizzle + SQLite**
>
> Local offline-first storage
> **VideoDB SDK (0.2.4)**
>
> Recording and transcription
> **MCP SDK (1.0.0)**
>
> Model Context Protocol integration
> **OpenAI SDK (6.19.0)**
>
> LLM calls via VideoDB API
> **Tailwind + shadcn/ui**
>
> Beautiful, modern interface
## Getting Started
> [!NOTE]
>
> **Prerequisites**
>
> * macOS 12+ (Monterey or later) or Windows 10+
> * [VideoDB API key](https://console.videodb.io/auth?utm_source=docs_videodb_io\&utm_medium=docs_link\&utm_campaign=console_auth\&utm_content=docs_link\&id=docs) (free tier available)
**1. Install Call.md**
**macOS** (Apple Silicon & Intel):
```bash theme={null}
curl -fsSL https://artifacts.videodb.io/call.md/install | bash
```
*Currently available for macOS and Windows — Linux support coming soon*
**2. Launch and Register**
1. Launch Call.md from Applications or Spotlight
2. Enter your VideoDB API key ([get one free](https://console.videodb.io/auth?utm_source=docs_videodb_io\&utm_medium=docs_link\&utm_campaign=console_auth\&utm_content=docs_link\&id=docs))
3. Grant system permissions when prompted
**3. Configure Recording**
Configure preferences:
* Enable microphone capture
* Enable system audio capture
* Select screen to record
* Optionally connect Google Calendar
**4. Start Your First Meeting**
1. Click "New Meeting" from home screen
2. Optionally run Meeting Setup wizard
3. Click "Start Recording"
4. Watch live transcription and intelligence
> [!WARNING]
>
> **macOS Permissions Required**
>
> Grant in **System Preferences > Privacy & Security**:
>
> * Microphone (for voice recording)
> * Screen Recording (for screen capture)
## Configuration
All features are configurable through Settings:
| Feature | Customizable |
| - | - |
| Live Assist | Enable/disable, configure timing |
| Conversation Metrics | Set thresholds for talk ratio alerts |
| MCP Servers | Add stdio/HTTP servers, manage connections |
| Workflow Webhooks | Configure n8n, Zapier, or custom endpoints |
| Google Calendar | Connect/disconnect calendar sync |
### MCP Server Setup
Connect MCP servers in **Settings → MCP Servers**:
1. Click **Add Server**
2. Choose transport: **stdio** (local) or **http** (remote)
3. Configure connection details
4. Click **Connect**
The MCP agent runs automatically during meetings, detects information needs from conversation, and triggers relevant tools. Results appear inline in the **MCP Results** panel.
## Privacy & Data
> [!TIP]
>
> **Local Database** - All data stored in SQLite at `~/Library/Application Support/call-md/`
> [!TIP]
>
> **Secure Storage** - API keys encrypted, credentials protected
> [!TIP]
>
> **User Control** - Delete recordings anytime, export transcripts
> [!TIP]
>
> **Transcription via VideoDB** - AI features require internet connectivity
***
> **[Complete Setup Guide on GitHub](https://github.com/video-db/call.md)**
>
> Detailed installation instructions, configuration options, and troubleshooting guide
## Related Tutorials
> **[Bloom](/examples-and-tutorials/ai-copilots/bloom)**
>
> Screen recorder with AI search for async video documentation
> **[Pair Programmer](/examples-and-tutorials/ai-copilots/pair-programmer)**
>
> AI coding assistant with real-time screen and audio context
> **[Focusd](/examples-and-tutorials/ai-copilots/focusd)**
>
> AI-powered productivity tracking with automatic time insights
# Chess Lens
Source: https://docs.videodb.io/examples-and-tutorials/ai-copilots/chess-lens
Real-time chess coaching from a clearly visible board, with instant engine tips and AI explanations in a floating desktop overlay
> **[Chess Lens on GitHub](https://github.com/video-db/chess-lens)**
>
> Complete source code, installers, and troubleshooting
## What Is It?
Chess Lens is a real-time chess coach that works directly from your screen.
It watches a visible chess board, reconstructs the position in FEN notation, and shows the best move and evaluation in a floating overlay. A plain-language coaching explanation and drill question follow in the background, so you get a fast engine tip first and deeper guidance moments later.
Because Chess Lens reads the board from screen capture, it can work with chess.com, lichess, ChessBase, or another chess client that displays a clear board.
> [!TIP]
>
> **The Experience**: Keep playing in your preferred chess app while a draggable, always-on-top coach updates as the board position changes.
## What You Get
**Instant Tips**
### See the Engine Move First
Chess Lens shows the best move and evaluation as soon as the chess engine responds, without waiting for the longer coaching explanation.
**AI Coaching**
### Understand the Position
A plain-language explanation and drill question arrive in the background and update the overlay when ready.
**Game History**
### Revisit Past Sessions
Chess Lens keeps a local history of sessions. When analysis is available, you can review the recording from VideoDB, coaching tips, key moments, win probability, and the post-game summary.
## How It Works
**1. Capture the Board**
Chess Lens starts a VideoDB capture session and watches the chess board shown on your screen.
**2. Recognize the Position**
A vision model converts the visible board into FEN notation, a square-by-square representation used by chess software. Both white and black perspectives are supported.
**3. Calculate the Best Move**
The chess engine evaluates the position and returns a best move and score for the overlay.
**4. Add Coaching Context**
An AI-generated explanation and drill question are prepared in the background, then added to the existing engine tip.
> [!NOTE]
>
> Analysis refreshes when a new board position is confirmed. If the board is hidden or cannot be read for several frames, the overlay asks you to bring it back into view.
## Key Features
> **Works Across Chess Apps**
>
> Chess Lens reads the board from the screen instead of depending on a specific chess website or client integration.
> **Automatic Board Detection**
>
> Detects a clearly visible board from either the white or black perspective and updates when the position changes.
> **Floating Coaching Overlay**
>
> A transparent, draggable, always-on-top window shows the board, current tip, coaching explanation, drill question, chat, and no-board state.
> **Session Review**
>
> Browse past games and review available recordings, move history, win probability, key moments, coaching tips, and AI-generated post-session recaps.
> **Local-First History**
>
> Session history and analysis metadata are stored in a local SQLite database. Screen recordings are captured through VideoDB, and model requests are processed outside the device.
## Getting Started
> [!NOTE]
>
> **Prerequisites**
>
> * macOS 12+ or 64-bit Windows 10+
> * A [VideoDB API key](https://console.videodb.io/auth?utm_source=docs_videodb_io\&utm_medium=docs_link\&utm_campaign=console_auth\&utm_content=docs_link\&id=docs)
> * Screen Recording permission on macOS
> * Microphone permission only if you enable audio recording or transcription
**macOS**
```bash theme={null}
curl -fsSL https://raw.githubusercontent.com/video-db/chess-lens/main/scripts/install.sh | bash
```
Start Chess Lens from Applications or Spotlight after installation.
**Windows**
Run in PowerShell:
```powershell theme={null}
irm https://raw.githubusercontent.com/video-db/chess-lens/main/scripts/install.ps1 | iex
```
Start Chess Lens from the Start Menu after installation.
**From Source**
Requires Node.js 18+:
```bash theme={null}
git clone https://github.com/video-db/chess-lens.git
cd chess-lens
npm install
npm run dev
```
**1. Add Your Details**
On first launch, enter your name and VideoDB API key. You can get a key from [console.videodb.io](https://console.videodb.io/auth?utm_source=docs_videodb_io\&utm_medium=docs_link\&utm_campaign=console_auth\&utm_content=docs_link\&id=docs).
**2. Grant Screen Access**
On macOS, allow Screen Recording in **System Settings > Privacy & Security** so Chess Lens can see the board.
**3. Open a Chess Board**
Start a game in your preferred chess website or desktop client. Keep the complete board visible and large enough to read.
**4. Follow the Overlay**
Chess Lens detects position changes and updates the floating coach with the latest engine tip and explanation.
## If the Board Is Not Detected
* Make sure the full board is visible and not covered by dialogs or other windows.
* Bring the chess tab or app back into focus.
* Increase the board size if the pieces and squares are difficult to read.
* On macOS, confirm that Screen Recording permission is enabled.
* Allow a few seconds for the first tip when a new position appears.
***
> **[Complete Setup Guide on GitHub](https://github.com/video-db/chess-lens)**
>
> Installation, development commands, and detailed troubleshooting
## Related Tutorials
> **[Focusd](/examples-and-tutorials/ai-copilots/focusd)**
>
> Turn desktop activity into useful summaries and work insights
> **[Pair Programmer](/examples-and-tutorials/ai-copilots/pair-programmer)**
>
> Give coding agents real-time screen and audio context
> **[Capture SDK Overview](/pages/ingest/capture-sdks/overview)**
>
> Learn how to build screen-aware desktop applications
# Focusd - Productivity and Personal Work Memory
Source: https://docs.videodb.io/examples-and-tutorials/ai-copilots/focusd
AI-powered desktop app that records your screen, understands what you're doing, and builds your personal work memory
> **[Focusd on GitHub](https://github.com/video-db/focusd)**
>
> Complete source code, installation guide, and demo download
## What Is It?
Your personal productivity oracle.
You know that sinking feeling at 5 PM when you wonder "where did my day go?" Or when you bill clients and can't remember what you worked on Tuesday morning? Or when you want to optimize your workflow but have no data about where time actually goes?
Focusd solves this by running invisibly all day, watching your screen and understanding context—not just "you used Chrome," but "what you were reading in Chrome and which project it relates to." No manual timers. No app-switching. No logging. Just automatic, intelligent tracking that tells you where your time went, what you accomplished, and how to improve tomorrow.
> [!TIP]
>
> **The Insight**: "You spent 2.3 hours on the authentication refactor, switching between VSCode (67%) and documentation (33%). You were blocked for 23 minutes waiting for builds. Consider optimizing your build pipeline."
> **Platform Support**: macOS and Windows (Linux support coming soon)
## Why It's Different
**Zero Manual Work**
### Automatic Everything
Forget manual time tracking. Focusd:
* Records continuously in background
* Understands context from your screen
* Detects when you switch projects
* Identifies productive vs idle time
* Generates summaries automatically
**AI Understanding**
### Smart Analysis
Not just "you used Chrome for 3 hours."
Focusd knows:
* *What* you were reading in Chrome
* *Which* project you were working on
* *Why* you switched contexts
* *How* productive each session was
**Actionable Insights**
### Real Improvements
Daily recaps include:
* Session summaries with context
* App usage breakdown by project
* Productivity patterns identified
* Specific suggestions to improve
## The 5-Layer Pipeline
Focusd transforms raw screen captures into structured insights through intelligent summarization:
**1. L0: Raw Events**
Screen indexed every \~3 seconds. Extracts app names, page titles, visible content.
**2. L1: Activity Segments**
Events grouped into time-based chunks (e.g., 5-minute windows).
**3. L2: Micro-Summaries**
Each segment summarized by LLM: *what you did, which app, productive or not*.
**4. L3: Session Summaries**
Micro-summaries roll up into session overviews with app stats and project breakdown.
**5. L4: Daily Summary**
Everything consolidates into a headline, highlights, and actionable suggestions.
> [!NOTE]
>
> **Why 5 Layers?**
>
> This hierarchical approach balances cost, accuracy, and latency. Layer 0 captures everything (cheap, fast). Layers 1-2 group and summarize in small batches (moderate cost). Layers 3-4 synthesize larger contexts (higher cost but fewer calls).
>
> The result: near-instant activity tracking at the bottom, actionable insights at the top, and a reasonable API bill. Without this structure, running LLM calls on every screen capture would be prohibitively expensive.
## Key Features
> **Live Activity Timeline**
>
> Real-time feed of what you're doing, updated every few seconds. See your work unfold as it happens.
> **🤖 AI Session Summaries**
>
> Automatic overviews of each work session:
>
> * What you worked on
> * Which apps you used
> * Projects and time breakdown
> * Productivity assessment
> **🔍 Drill Down Analysis**
>
> Select any time range for detailed breakdown:
>
> * App usage percentages
> * Project time distribution
> * Context from screen captures
> **📈 Dashboard Analytics**
>
> Visual insights:
>
> * Total tracked time
> * Productive time percentage
> * Top applications used
> * Project distribution
> **Daily Recap**
>
> End-of-day report with:
>
> * Headline summary
> * Session highlights
> * Productivity insights
> * Tomorrow's suggestions
> **🕐 History Browser**
>
> Browse past days with full summaries and activity data. Understand your weekly and monthly patterns.
## Who It's For
> **Freelancers**
>
> Track client projects automatically. Generate accurate time reports without manual logging.
> **Developers**
>
> Understand where coding time goes. Identify interruptions, context switches, and optimize your flow.
> **Knowledge Workers**
>
> See how much time you spend in meetings vs deep work. Find patterns in your most productive hours.
> **Remote Workers**
>
> Stay accountable without micromanagement. Get insights into your work patterns and share summaries with your team.
## Tech Stack
Built with modern desktop technologies for performance and reliability:
> **Electron + React**
>
> Desktop app shell with React UI
> **TypeScript**
>
> Type-safe throughout
> **SQLite**
>
> Local data storage for privacy
> **VideoDB SDK**
>
> Screen capture and AI indexing
> **OpenAI**
>
> LLM for summarization pipeline
> **Recharts**
>
> Dashboard visualizations
## Getting Started
> [!NOTE]
>
> **Prerequisites**
>
> * macOS 12+ (Apple Silicon or Intel) or Windows 10+
> * Node.js 18+
> * [VideoDB API key](https://console.videodb.io/auth?utm_source=docs_videodb_io\&utm_medium=docs_link\&utm_campaign=console_auth\&utm_content=docs_link\&id=docs)
**1. Clone and Install**
```bash theme={null}
git clone https://github.com/video-db/focusd.git
cd focusd
npm install
```
**2. Configure API Key**
Copy `.env.sample` to `.env` and add your VideoDB API key.
**3. Run Development Mode**
Run `npm run dev` to start the app in development mode.
**4. Grant Permissions**
macOS will prompt for Screen Recording permission. Grant it in System Settings.
**5. Start Tracking**
Hit the record button. Wait a few minutes, then check your live timeline and dashboard!
> [!WARNING]
>
> **System Permissions**
>
> Required in **System Settings > Privacy & Security**:
>
> * Screen Recording (mandatory)
> * System Audio Recording (optional, for audio context)
## Configuration
All settings adjustable from the Settings page:
| Setting | Default | Purpose |
| - | - | - |
| `segment_flush_mins` | 5 min | How often events group into segments |
| `micro_summary_mins` | 10 min | Frequency of segment summarization |
| `session_summary_mins` | 30 min | Session-level summary generation |
| `idle_threshold_mins` | 5 min | Inactivity threshold before pausing |
Tweak these to balance between insight granularity and performance.
## Privacy First
> [!TIP]
>
> **Local Storage** - All data stored in SQLite on your machine (`~/Library/Application Support/VideoDB Focusd/`)
> [!TIP]
>
> **Encrypted Keys** - API keys stored in macOS Keychain via Electron's safeStorage
> [!TIP]
>
> **No Cloud Storage** - Summaries generated, then stored locally. Screen captures processed and discarded.
> [!TIP]
>
> **Full Control** - Delete all data anytime: `rm -rf ~/Library/Application\ Support/VideoDB\ Focusd/`
***
> **[Complete Setup Guide on GitHub](https://github.com/video-db/focusd)**
>
> Detailed installation instructions, configuration guide, and troubleshooting help
## Related Tutorials
> **[Bloom](/examples-and-tutorials/ai-copilots/bloom)**
>
> Screen recorder for creating searchable video documentation
> **[Pair Programmer](/examples-and-tutorials/ai-copilots/pair-programmer)**
>
> Transform Claude Code into a context-aware AI coding assistant
> **[Capture SDK Overview](/pages/ingest/capture-sdks/overview)**
>
> Learn how to build screen capture apps with VideoDB
# Overview
Source: https://docs.videodb.io/examples-and-tutorials/ai-copilots/index
Plug video understanding into your agents — meetings, recordings, tutorials, cameras, and desktop perception
## The Context Transfer Problem
You are surrounded by videos — meetings, recordings, tutorials, channels, cameras, and even your desktop. The real bottleneck isn't processing power or model capability. It's **context transfer**.
Your agents are blind to the visual world you navigate every day. They can't see your Zoom calls, understand your Loom recordings, or follow along as you watch a tutorial. VideoDB changes that.
## Built for Agents
VideoDB is built from the ground up for agents. Your AI assistants can now acquire context from:
* **Meetings** — Understand discussions, decisions, and action items
* **Recordings** — Search and reference Loom-style videos, demos, and walkthroughs
* **Desktop perception** — See what you see in real-time
* **Tutorials** — Watch and learn alongside you
* **Cameras** — Monitor physical environments and events
Real-time understanding of your environment changes how you act in the real world.
## What's Possible
Imagine **Claude Code** with complete understanding of your meetings and Loom recordings. Start a sharing session and watch a tutorial together — your agent follows along, ready to help implement what you're learning.
Imagine **OpenClaw-style agents** recording demos of any app, capturing their autonomous workflows for review and debugging.
Imagine **research agents** navigating the internet, producing informative video summaries that cut through the noise — saving you from misinformation and clickbait.
## Install VideoDB Skills
Add video capabilities to your agent in seconds:
```bash theme={null}
npx skills add video-db/skills
```
Then run the setup command in your agent:
```
/videodb setup
```
The setup guides you through obtaining a VideoDB API key (includes \$20 free credits, no credit card required), installing the SDK, and verifying the connection.
> **[View Skills Repository](https://github.com/video-db/skills)**
>
> Complete installation guide and skill documentation
## Example Workflows
> **[Pair Programmer](/examples-and-tutorials/ai-copilots/pair-programmer)**
>
> AI coding assistant with real-time screen and audio context
> **[OpenClaw Monitoring](/examples-and-tutorials/ai-copilots/openclaw-monitoring)**
>
> CCTV for AI agents — monitor, record, and search autonomous agent activity
> **[Call.md](/examples-and-tutorials/ai-copilots/call-md)**
>
> Real-time AI meeting assistant with dual-channel transcription
> **[Bloom](/examples-and-tutorials/ai-copilots/bloom)**
>
> Local-first screen recorder with AI processing and natural language search
> **[Focusd](/examples-and-tutorials/ai-copilots/focusd)**
>
> Productivity tracking with automatic session summaries
> **[Record & Replay](/examples-and-tutorials/ai-copilots/open-record-replay)**
>
> Turn a demonstrated desktop workflow into a reusable agent skill
> **[Chess Lens](/examples-and-tutorials/ai-copilots/chess-lens)**
>
> Real-time chess coaching from a clearly visible board on your screen
## Architecture

API keys never touch the desktop. Tokens are short-lived. Enterprise-ready security.
## Related Documentation
> **[Capture SDK Overview](/pages/ingest/capture-sdks/overview)**
>
> Full architecture and capabilities
> **[Real-Time Context](/pages/ingest/capture-sdks/realtime-context)**
>
> How real-time AI context works
> **[Privacy Controls](/pages/ingest/capture-sdks/privacy-controls)**
>
> User consent and data protection
> **[Storage & Search](/pages/ingest/capture-sdks/storage-and-search)**
>
> Persist and search captured content
> **[MCP Server](/pages/mcp/index)**
>
> Connect VideoDB to Claude and other agents
> **[Director Framework](/pages/build-with-agents/director/index)**
>
> Build custom AI agents with VideoDB
# Record & Replay
Source: https://docs.videodb.io/examples-and-tutorials/ai-copilots/open-record-replay
Record a desktop workflow once and compile it into a reusable skill that an AI agent can follow later
> **[Record & Replay on GitHub](https://github.com/video-db/open-record-replay)**
>
> Complete source code, installation guide, and troubleshooting
## What Is It?
Record & Replay turns a workflow you perform on your desktop into instructions an AI agent can reuse. It supports macOS and Windows.
You demonstrate the task once while the app records the desktop interactions. It then combines the action log with optional visual context from VideoDB and compiles the result into a structured, human-readable agent skill.
The result is not a fixed macro. The generated skill describes the task, starting state, inputs, actions, and checks an agent needs to repeat it. Values such as search terms, dates, choices, and file paths can become inputs instead of being copied as fixed values.
> [!TIP]
>
> **The Idea**: Show the workflow once, let Record & Replay turn the demonstration into a reusable skill, then give that skill to your agent for future runs.
## Why Use Record & Replay?
**Teach by Showing**
### Demonstrate the Real Workflow
Perform the task in the app you already use. Record & Replay captures desktop accessibility events and can include screen video as visual reference.
**Create Reusable Skills**
### Move Beyond One-Off Recordings
The compiler turns the demonstration into `SKILL.md` and `SKILL.json` files with steps, expected inputs, verification guidance, and an execution strategy.
**Flexible Capture**
### Keep Recording Without Video
Native accessibility hooks capture workflows on macOS and Windows. If full screen capture is unavailable, Record & Replay can still compile from accessibility events alone.
## How It Works
**1. Start a Recording**
Ask your agent to start recording a named workflow. A short lead-in can give you time to switch from the agent to the app where the task will happen.
**2. Demonstrate the Task**
Complete the workflow yourself. Native accessibility hooks capture the actions and interface metadata. When screen capture is available, VideoDB adds visual context.
**3. Compile the Skill**
The compiler combines the event log and available visual context, identifies reusable inputs, and generates structured and human-readable skill files.
**4. Use It with an Agent**
By default, the generated `SKILL.md` is installed in `~/.codex/skills/`. You can point the installer at another global skills directory for agents that consume the same skill format.
> [!NOTE]
>
> **Human-in-the-loop recording**: You perform the demonstration yourself. Record & Replay creates the skill, but it does not include a standalone replay engine—the agent that consumes the skill performs the workflow later.
## What the Skill Contains
> **Workflow Steps**
>
> A readable sequence of actions that explains how to complete the demonstrated workflow.
> **Reusable Inputs**
>
> Values such as search queries, dates, dropdown choices, and file paths can be represented as inputs rather than copied as fixed values.
> **Verification Guidance**
>
> The generated skill includes checks and guidance that help the consuming agent confirm whether the workflow succeeded.
> **Execution Guidance**
>
> Each structured skill records a preferred execution strategy, such as browser, desktop app, terminal, file system, or a hybrid workflow.
## Getting Started
> [!NOTE]
>
> **Prerequisites**
>
> * Python 3.10+
> * [uv](https://docs.astral.sh/uv/) package manager
> * A [VideoDB API key](https://console.videodb.io/auth?utm_source=docs_videodb_io\&utm_medium=docs_link\&utm_campaign=console_auth\&utm_content=docs_link\&id=docs)
**1. Clone and Install**
```bash theme={null}
git clone https://github.com/video-db/open-record-replay.git
cd open-record-replay
uv sync
```
**2. Add Your API Key**
Create a `.env` file in the project root:
```env theme={null}
VIDEODB_API_KEY=your_VIDEODB_API_KEY
```
**3. Configure Your MCP Client**
Add the server to your MCP client configuration:
```json theme={null}
{
"mcpServers": {
"videodb-record-replay": {
"command": "uv",
"args": ["run", "python", "server.py"],
"cwd": "/path/to/open-record-replay"
}
}
}
```
**4. Restart the Client**
Restart your MCP client so the Record & Replay tools and skill resources become available.
## Record Your First Workflow
Recording is guided by your agent:
1. Ask the agent to record a named workflow.
2. Switch to the target app and perform the task.
3. Return to the MCP client and ask the agent to stop recording.
4. Ask it to compile the recording into a skill.
5. Confirm the global `SKILL.md` path reported by the agent.
> [!TIP]
>
> Use a short lead-in before the workflow begins and trim the end of the recording if you need time to switch back to your MCP client. This keeps navigation to and from the client out of the generated instructions.
## Platform Notes
> **macOS**
>
> Screen Recording, Microphone, Accessibility, and Input Monitoring permissions may be required. Run the permission helper before recording:
>
> ```bash theme={null}
> uv run python scripts/smoke_macos_hook.py --prompt-permissions
> ```
> **Windows**
>
> Record & Replay uses Windows UI Automation. No additional setup is required beyond the standard installation.
***
> **[Complete Setup Guide on GitHub](https://github.com/video-db/open-record-replay)**
>
> Tool reference, skill output details, platform setup, and troubleshooting
## Related Tutorials
> **[Pair Programmer](/examples-and-tutorials/ai-copilots/pair-programmer)**
>
> Give coding agents real-time screen and audio context
> **[OpenClaw Monitoring](/examples-and-tutorials/ai-copilots/openclaw-monitoring)**
>
> Record, inspect, and search autonomous agent activity
> **[Capture SDK Overview](/pages/ingest/capture-sdks/overview)**
>
> Learn how VideoDB desktop capture works
# OpenClaw Monitoring
Source: https://docs.videodb.io/examples-and-tutorials/ai-copilots/openclaw-monitoring
CCTV for AI agents — record every session, watch runs live, and search agent activity with natural language
[OpenClaw Monitoring - CCTV for AI Agents](https://www.youtube.com/embed/dnGWaFeo2FA)
> **[OpenClaw Monitoring on GitHub](https://github.com/video-db/openclaw-monitoring)**
>
> Complete source code, installation guide, and configuration examples
## What Is It?
Your AI agent just did something on a remote server. Do you know what?
Right now, most people running agents are doing this: Send task → Wait → Get "Success" in Slack → Hope for the best. That's not monitoring. That's faith.
And faith breaks down fast. Your agent could have:
* Gotten stuck on a CAPTCHA and retried 47 times
* Navigated to the wrong site and filled forms with test data
* Completed the task correctly but missed a validation step
* Encountered an error you'll never see because logs don't capture visual context
**VideoDB Monitoring** turns your OpenClaw agent into an observable, auditable worker. Every run becomes a live stream (watch in real-time), a replayable recording (shareable URL, not a dead video file), and a searchable archive (find "when did it open the spreadsheet?"). Think of it as a dashcam for your AI agent, or CCTV for computer-use agents.
> [!NOTE]
>
> **Platform Support**: OpenClaw Monitoring is platform-agnostic—it runs on any system that supports Node.js 18+ and TypeScript. Works on macOS, Windows, and Linux.
## Why Teams Need It
**Full Visibility**
### See Everything
* **Live stream** — watch your agent work in real-time
* **Replayable recordings** — shareable URL, not a dead video file
* **Full session capture** — screen and audio recorded continuously
* Catch issues before they become incidents
**Searchable History**
### Find Any Moment
* **Searchable moments** — find "when did it open the spreadsheet?"
* AI-generated summaries of agent sessions
* Timestamped results with auto-generated clips
* Full transcripts of audio content
**Compliance Ready**
### Audit Everything
* Complete visual audit trail of agent actions
* **Webhook alerts** — get notified when something looks off
* Replay failures to see exactly where things went wrong
* Meet regulatory requirements with searchable evidence
> [!WARNING]
>
> **Why Logs Aren't Enough**
>
> Traditional logging captures what your code does. But autonomous agents interact with visual interfaces—browsers, desktop apps, forms—where the "ground truth" is what's on screen, not what's in a log file.
>
> You can log "clicked button #submit" but you can't log "the submit button was disabled because the CAPTCHA wasn't solved yet" unless you see the screen. Visual monitoring captures this reality, giving you the same view the agent had when it made decisions.
## How It Works
**1. Screen Capture**
A monitor daemon (`monitor.ts`) runs alongside your OpenClaw agent, continuously capturing the screen. Recordings stream directly to VideoDB.
**2. On-Demand Indexing**
Indexing is separate from recording — you only pay for it when needed. When triggered, VideoDB processes recordings with:
* **Visual indexing** — scene descriptions, active apps, URLs, and error detection
* **Transcript** — speech-to-text from system audio
* **Audio indexing** — semantic indexing of audio content
**3. Search & Summarize**
Query agent history using natural language. Get timestamped results, auto-generated clips, and session summaries. The agent can even use its own recordings — "summarize what you did in the last 2 hours."
**4. Two Setup Options**
**Option 1**: Install as an OpenClaw skill — the agent handles recording, indexing, and search automatically.
**Option 2**: Use VideoDB's indexing APIs directly for post-recording analysis, summaries, and search.
## CLI Commands
The `videodb.ts` CLI tool provides these commands:
| Command | What It Does |
| - | - |
| `start-indexing` | Start all indexing (visual + audio + transcript) |
| `stop-indexing` | Stop all indexing |
| `start-visual-index` | Start visual scene indexing |
| `stop-visual-index` | Stop visual scene indexing |
| `start-audio-index` | Start audio indexing |
| `stop-audio-index` | Stop audio indexing |
| `start-transcript` | Start transcript extraction |
| `stop-transcript` | Stop transcript extraction |
| `search` | Natural language search across indexed recordings |
| `summary` | Generate an AI summary of agent activity |
| `transcript` | Get full transcript of audio content |
| `stream` | Get a playable stream URL for a specific time range |
## Real-World Scenarios
> **Debugging Failed Runs**
>
> An agent task failed overnight. Instead of digging through logs, search "when did the error first appear" and get a video clip of exactly what happened — the commands run, the error messages, and the state of the screen.
> **Compliance Auditing**
>
> Need proof of what your AI agents did and when? OpenClaw Monitoring provides timestamped, searchable visual records that serve as a full audit trail of agent actions.
> **Security Monitoring**
>
> Catch agents going off-script or accessing unexpected domains. Webhook alerts notify you when something looks off, giving you video evidence of unexpected behavior.
> **QA & Testing**
>
> Review agent workflows before pushing to production. Record test sessions, then search for edge cases, errors, or unexpected behaviors. Share specific clips with your team.
> **Agent Self-Reporting**
>
> Your agent can use its own recordings: "Summarize what you did in the last 2 hours", "Make a highlight video of today's work and post it to YouTube", or "Find the moment when you encountered the error."
## Tech Stack
> **TypeScript**
>
> Monitor daemon and CLI tooling (`monitor.ts`, `videodb.ts`)
> **Python + Flask**
>
> Backend server for session management and Cloudflare tunneling
> **VideoDB SDK**
>
> Media streaming, AI indexing, and semantic search
> **OpenClaw**
>
> Autonomous agent framework with skill system
## Getting Started
> [!NOTE]
>
> **Prerequisites**
>
> * [OpenClaw](https://openclaw.ai/) installed and running
> * Node.js 18+
> * [VideoDB API key](https://console.videodb.io/auth?utm_source=docs_videodb_io\&utm_medium=docs_link\&utm_campaign=console_auth\&utm_content=docs_link\&id=docs)
**1. Install the Skill**
Point your OpenClaw agent at the repo:
```text theme={null}
please install https://github.com/video-db/openclaw-monitoring skill and set it up
```
Or install manually:
```bash theme={null}
git clone https://github.com/video-db/openclaw-monitoring.git
mkdir -p ~/.openclaw/workspace/skills/videodb-monitoring
cp -r openclaw-monitoring/videodb-monitoring-skill/* ~/.openclaw/workspace/skills/videodb-monitoring/
cd ~/.openclaw/workspace/skills/videodb-monitoring
npm install
```
**2. Set Your API Key**
```bash theme={null}
openclaw config set skills.entries.videodb-monitoring.env.VIDEODB_API_KEY 'sk-xxx'
```
Get your API key at [console.videodb.io](https://console.videodb.io/auth?utm_source=docs_videodb_io\&utm_medium=docs_link\&utm_campaign=console_auth\&utm_content=docs_link\&id=docs).
**3. Start the Monitor**
```bash theme={null}
cd ~/.openclaw/workspace/skills/videodb-monitoring
nohup npx tsx monitor.ts > ~/.videodb/logs/monitor.log 2>&1 & disown
openclaw gateway restart
```
**4. Use It**
Ask your agent:
* "Do X on the browser and send me the recording"
* "What did I do in the last hour?"
* "Find when I opened the spreadsheet"
> [!WARNING]
>
> **Cost Note**: VideoDB ingestion is billed at **\$0.084 / hour** of captured content. Indexing is on-demand — you only pay for it when you trigger it. See the [Capture SDK overview](/pages/ingest/capture-sdks/overview) for details.
## Try Without Setup
Skip installation and try indexing against a hosted live OpenClaw session at [matrix.videodb.io](https://matrix.videodb.io):
```bash theme={null}
git clone https://github.com/video-db/openclaw-monitoring.git
cd openclaw-monitoring
echo "VIDEO_DB_API_KEY=your_api_key_here" > .env
uv run try_without_setup.py
```
This connects to the public agent's live streams, starts indexing, and prints events to your terminal. Press `Ctrl+C` to stop and search the indexed content.
## Privacy & Security
> [!TIP]
>
> **API Key Security** — Keys stored locally via OpenClaw config, never transmitted except to VideoDB
> [!TIP]
>
> **On-Demand Indexing** — AI processing runs only when you trigger it, keeping costs controlled
> [!TIP]
>
> **Visual Audit Trail** — Complete recordings provide verifiable evidence of agent activity
> [!TIP]
>
> **Secure Tunneling** — Cloudflare Tunnel for webhook delivery without exposing ports
***
> **[Complete Setup Guide on GitHub](https://github.com/video-db/openclaw-monitoring)**
>
> Full installation instructions, advanced setup, and troubleshooting
## Related Tutorials
> **[Pair Programmer](/examples-and-tutorials/ai-copilots/pair-programmer)**
>
> AI coding assistant with real-time screen and audio context
> **[FocusD](/examples-and-tutorials/ai-copilots/focusd)**
>
> AI-powered productivity tracking with automatic time insights
# Pair Programmer
Source: https://docs.videodb.io/examples-and-tutorials/ai-copilots/pair-programmer
Turn your coding agent into a screen aware, voice aware, context rich collaborator
[Pair Programmer - Screen Aware AI Coding Assistant](https://www.youtube.com/embed/dIvZoZr3DyM)
> **[Pair Programmer on GitHub](https://github.com/video-db/pair-programmer)**
>
> Complete source code, installation guide, and configuration examples
## What Is It?
Pair Programmer is an **agentic skill** that gives your AI coding assistant real time perception.
It captures:
* **Screen** for visual context like terminals, editors, browser tabs, errors, and UI state
* **Microphone** for your spoken intent, ideas, and debugging notes
* **System audio** for tutorials, meetings, demos, and anything else your computer is playing
Once captured, that context becomes searchable.
So instead of re explaining what was on screen, copy pasting logs, or summarizing a 20 minute debugging session, you can ask:
* *What was I doing when the auth flow broke?*
* *What did I say about the database migration?*
* *Show me what was on screen when the test failed*
* *What happened in the last 10 minutes?*
> [!TIP]
>
> **The Missing Piece**: This is the missing perception layer for coding agents. Works with Claude Code, Cursor, Codex, and other skill compatible agents.
**Why this changes everything**: Most coding agents operate in a text-only world. They can read your files and write code, but they can't see your terminal output, your browser's error messages, your Figma mockups, or hear you explaining the problem out loud. That means you spend half your time copy-pasting context, describing what's on screen, or re-explaining what you already said 5 minutes ago.
Pair Programmer closes this gap. It gives your agent the same sensory context you have—screen, mic, system audio—making collaboration feel natural instead of fragmented.
## Why This Is Useful
**Context Aware**
### Stay Grounded
Most coding agents can write code. Very few can stay grounded in the same context as you.
Pair Programmer helps your agent stay on the same page by giving it access to what you saw, what you said, and what your machine was playing.
**Natural Search**
### Ask in Plain Language
Search your session in natural language:
* "What was I working on when I mentioned the auth bug?"
* "What did I say in the last 5 minutes?"
* "Show me what was on screen when the test failed"
No more copy-pasting or repeated explanations.
**Real-Time Recording**
### Continuous Capture
A lightweight overlay shows recording status, active channels, and elapsed time.
Record your screen, mic, and system audio in real time, then search what happened when you need it.
## Use Cases
Pair Programmer is perfect for:
* **Debugging sessions** — Track what you tried and where it went wrong
* **Tutorial driven development** — Build while following video tutorials
* **Bug reproduction** — Capture exact steps that triggered the issue
* **Meeting follow ups** — Search conversations and screen activity
* **Architecture walkthroughs** — Review code with full context
* **Voice first coding workflows** — Speak your thoughts and code together
## Getting Started with Pair Programmer
The most common workflow:
1. **Start recording when you begin work** — just run `/pair-programmer record` and choose your screen. Let it capture in the background.
2. **Work normally** — code, debug, browse Stack Overflow, watch tutorials. Don't think about the recording.
3. **Ask for context when you need it** — stuck on a bug? Run `/pair-programmer search "when did the build error first appear?"` Your agent sees the exact moment with full terminal output and code context.
4. **Let your agent act on spoken instructions** — said "refactor this function to use async/await" into your mic 5 minutes ago? Run `/pair-programmer act` and your agent will do it, using your own words as the spec.
5. **Stop recording when done** — run `/pair-programmer stop`. All context is saved and searchable.
Over time, you'll develop your own patterns—maybe you record only during debugging sessions, or maybe you keep it running all day for complete work memory.
## Installation
> [!NOTE]
>
> **Prerequisites**
>
> * Node.js 18+
> * macOS 12+ or Windows 10+
> * [VideoDB API key](https://console.videodb.io/auth?utm_source=docs_videodb_io\&utm_medium=docs_link\&utm_campaign=console_auth\&utm_content=docs_link\&id=docs) (free, no credit card required)
If you have an older version installed, remove it first before upgrading.
**Option 1: NPX**
### Install with npx (Recommended)
```bash theme={null}
npx skills add video-db/pair-programmer
```
**Option 2: Marketplace**
### Install from marketplace
```bash theme={null}
/plugin marketplace add video-db/pair-programmer
/plugin install pair-programmer
```
## Setup
**1. Get API Key**
Get a free VideoDB API key from [console.videodb.io](https://console.videodb.io/auth?utm_source=docs_videodb_io\&utm_medium=docs_link\&utm_campaign=console_auth\&utm_content=docs_link\&id=docs)
No credit card required.
**2. Set API Key**
Export your API key in your shell:
```bash theme={null}
export VIDEO_DB_API_KEY=your-key
```
Or add it to a `.env` file in your project root
**3. Run Setup**
Install dependencies and complete local setup:
```bash theme={null}
/pair-programmer setup
```
## Quick Start
**1. Start Recording**
Start recording your screen, mic, and system audio:
```bash theme={null}
/pair-programmer record
```
A source picker will open so you can choose what to capture. Once recording starts, a lightweight overlay shows recording status, active channels, and elapsed time.
**2. Work Normally**
Continue your coding session. Pair Programmer captures everything in the background.
**3. Search Your Session**
Search your session in natural language:
```bash theme={null}
/pair-programmer search "what was I working on when I mentioned the auth bug?"
```
```bash theme={null}
/pair-programmer search "what did I say in the last 5 minutes?"
```
```bash theme={null}
/pair-programmer search "show me what was on screen when the test failed"
```
**4. Get Summary**
Get a summary of recent activity:
```bash theme={null}
/pair-programmer what-happened
```
**5. Stop Recording**
Stop recording when you're done:
```bash theme={null}
/pair-programmer stop
```
## Commands
| Command | Description |
| - | - |
| `/pair-programmer record` | Start recording and open the source picker |
| `/pair-programmer stop` | Stop the active recording |
| `/pair-programmer search ""` | Search screen, mic, and audio context using natural language |
| `/pair-programmer what-happened` | Summarize recent activity |
| `/pair-programmer setup` | Install dependencies and complete local setup |
| `/pair-programmer config` | Update indexing and recording settings |
## Real-World Examples
> **Debugging Complex Issues**
>
> You're chasing a bug across multiple files and terminals. Instead of documenting every step, just keep coding. Later, run:
>
> ```bash theme={null}
> /pair-programmer search "what was on screen when the test failed"
> ```
>
> Get instant context about terminal output, error messages, and which files you had open.
> **Learning From Tutorials**
>
> Following a video tutorial while coding? Pair Programmer captures both the tutorial (system audio) and your implementation (screen).
>
> ```bash theme={null}
> /pair-programmer search "build me the project from the video I was just watching"
> ```
>
> Your agent sees what was on screen and heard what was being said in the tutorial.
> **Pair Programming Sessions**
>
> In a meeting discussing code? Pair Programmer captures your screen and the conversation.
>
> ```bash theme={null}
> /pair-programmer what-happened
> ```
>
> Get a summary of what was discussed, what code was reviewed, and action items.
> **Voice-Driven Development**
>
> Speaking your thoughts while coding? Your microphone captures your debugging notes and ideas.
>
> ```bash theme={null}
> /pair-programmer search "what did I say about the database migration?"
> ```
>
> Find moments where you verbally explained your thinking.
## How It Works
Pair Programmer uses VideoDB's Capture SDK to:
1. **Record** — Continuously capture screen, microphone, and system audio
2. **Process** — Stream to VideoDB for real-time AI indexing
3. **Search** — Query across all captured context with natural language
4. **Retrieve** — Get timestamped results with relevant clips
All context is searchable in real-time, giving your coding agent full perception of your workflow.
***
> **[Complete Setup Guide on GitHub](https://github.com/video-db/pair-programmer)**
>
> Detailed installation instructions, troubleshooting tips, and configuration examples
## Related Tutorials
> **[Bloom](/examples-and-tutorials/ai-copilots/bloom)**
>
> Local-first screen recorder with AI-ready search and indexing
> **[Focusd Productivity Tracker](/examples-and-tutorials/ai-copilots/focusd)**
>
> AI-powered productivity tracking with automatic time insights
> **[Call.md](/examples-and-tutorials/ai-copilots/call-md)**
>
> Real-time AI meeting assistant with live coaching
# AI-Generated Ads
Source: https://docs.videodb.io/examples-and-tutorials/content-factory/ai-ad-films
Generate professional product advertisements from raw footage
> **Automatically Creating a professional quality advertisement from product videography B-Roll**
[](https://colab.research.google.com/github/video-db/videodb-cookbook/blob/main/examples/Voiceover_Ad_Films.ipynb)
## Overview
Creating professional product advertisements typically requires a team: copywriters for the script, voice actors for the narration, and editors to stitch it all together.
**VideoDB** streamlines this into a single, automated workflow.
In this tutorial, we will:
1. **Upload** raw product footage (a jewelry shoot).
2. **Analyze** the visual content automatically.
3. **Generate** a professional ad script based on the visuals.
4. **Synthesize** a high-quality voiceover.
5. **Publish** the final commercial.
## Setup
### Installing VideoDB
```python Python theme={null}
!pip install videodb
```
```javascript Node.js theme={null}
npm install videodb
```
### API Key
> [!NOTE]
>
> You only need your VideoDB API Key. Get your API key from [VideoDB Console](https://console.videodb.io/auth?utm_source=docs_videodb_io\&utm_medium=docs_link\&utm_campaign=console_auth\&utm_content=docs_link\&id=docs). Free for first 50 uploads, no credit card required.
## Implementation
### Step 1: Connect to VideoDB
Establish a connection to your VideoDB project.
```python Python theme={null}
import videodb
# Set your API key
api_key = "your_api_key"
# Connect to VideoDB
conn = videodb.connect(api_key=api_key)
coll = conn.get_collection()
```
```javascript Node.js theme={null}
import { connect } from 'videodb';
// Connect to VideoDB
const conn = await connect({ apiKey: process.env.VIDEO_DB_API_KEY });
const coll = await conn.getCollection();
```
### Step 2: Upload Product Footage
We'll upload a raw video clip of a jewelry product shoot from YouTube.
```python Python theme={null}
# Upload a video by URL
video = coll.upload(url='https://www.youtube.com/watch?v=2DcAMbmmYNM')
```
```javascript Node.js theme={null}
// Upload a video by URL
const video = await coll.uploadURL({ url: 'https://www.youtube.com/watch?v=2DcAMbmmYNM' });
```
### Step 3: Analyze Visuals
To write a relevant script, we first need to understand what's in the video. The analyzer creates detailed timestamped descriptions of the visual content.
```python Python theme={null}
print("Analyzing visual scenes... this might take a moment.")
scene_understanding = video.understand(
analyzers=[
{
"type": "vlm",
"name": "scene",
"config": {
"prompt": "Describe the scene in detail, focusing on the product, craftsmanship, lighting, camera movement, and mood.",
"schema": {
"scene_description": "string",
},
},
},
],
)
scene_understanding.wait_until_complete()
scene_analyzer = scene_understanding.get_analyzer("scene")
```
```javascript Node.js theme={null}
const sceneUnderstanding = await video.understand([
{
type: "vlm",
name: "scene",
config: {
prompt: "Describe the scene in detail, focusing on the product, craftsmanship, lighting, camera movement, and mood.",
schema: {
scene_description: "string",
},
},
},
]);
await sceneUnderstanding.waitUntilComplete();
const sceneAnalyzer = await sceneUnderstanding.getAnalyzer("scene");
```
Let's view the descriptions of the first three scenes from the video.
```python Python theme={null}
import json
scene_output = scene_analyzer.get_output()
scenes = [
{
"start": scene["start"],
"end": scene["end"],
"description": scene["data"]["scene_description"],
}
for scene in scene_output["scenes"]
]
print(json.dumps(scenes[:3], indent=2))
```
```javascript Node.js theme={null}
const sceneOutput = await sceneAnalyzer.getOutput();
const scenes = sceneOutput.scenes.map((scene) => ({
start: scene.start,
end: scene.end,
description: scene.data.scene_description,
}));
console.log(JSON.stringify(scenes.slice(0, 3), null, 2));
```
### Step 4: Generate Ad Script
Now we use VideoDB's text generation to write the commercial. We feed the visual descriptions into the prompt to ensure the script perfectly matches the mood of the footage.
```python Python theme={null}
# Construct a prompt with the scene context
scene_context = "\n".join([f"- {scene['description']}" for scene in scenes])
prompt = f"""
Here is a visual description of a jewelry product video:
{scene_context}
Write a short, elegant, and luxurious voiceover script for this video advertisement.
- Tone: Sophisticated, calming, premium.
- Length: Short (approx 20 seconds of speech).
- Content: Focus on beauty, craftsmanship, and elegance.
- Format: Return ONLY the raw narration text.
"""
# Generate script
text_response = coll.generate_text(
prompt=prompt,
model_name="pro")
ad_script = text_response["output"]
print("--- Generated Ad Script ---")
print(ad_script)
```
```javascript Node.js theme={null}
// Construct a prompt with the scene context
const sceneContext = scenes.map(scene => `- ${scene.description}`).join('\n');
const prompt = `
Here is a visual description of a jewelry product video:
${sceneContext}
Write a short, elegant, and luxurious voiceover script for this video advertisement.
- Tone: Sophisticated, calming, premium.
- Length: Short (approx 20 seconds of speech).
- Content: Focus on beauty, craftsmanship, and elegance.
- Format: Return ONLY the raw narration text.
`;
// Generate script
const adScriptResult = await coll.generateText(prompt, "pro", "text");
const adScript = typeof adScriptResult === "string"
? adScriptResult
: adScriptResult.output;
if (typeof adScript !== "string") {
throw new Error("Expected a text response for the ad script.");
}
console.log("--- Generated Ad Script ---");
console.log(adScript);
```
### Step 5: Generate Voiceover
We'll turn the script into audio.
```python Python theme={null}
# Generate speech directly as a VideoDB Audio Asset
audio = coll.generate_voice(
text=ad_script,
voice_name="Default")
```
```javascript Node.js theme={null}
// Generate speech directly as a VideoDB Audio Asset
import { Audio, GenerationJob } from 'videodb';
const audioCandidate = await coll.generateVoice(
adScript,
"Default"
);
const audio = audioCandidate instanceof GenerationJob
? await audioCandidate.wait()
: audioCandidate;
if (!(audio instanceof Audio)) {
throw new Error("Expected generated voice audio.");
}
```
### Step 6: Compose the Advertisement
We'll overlay the generated voiceover onto the original video using the Timeline editor.
```python Python theme={null}
from videodb.editor import Timeline, Track, Clip, VideoAsset, AudioAsset
# Create a timeline
timeline = Timeline(conn)
# 1. Video Track (Background)
video_track = Track()
video_asset = VideoAsset(id=video.id)
video_clip = Clip(asset=video_asset, duration=float(video.length))
video_track.add_clip(0, video_clip)
timeline.add_track(video_track)
# 2. Audio Track (Voiceover Overlay)
audio_track = Track()
audio_asset = AudioAsset(id=audio.id)
audio_clip = Clip(asset=audio_asset, duration=float(audio.length))
audio_track.add_clip(0, audio_clip)
timeline.add_track(audio_track)
```
```javascript Node.js theme={null}
import { EditorTimeline, Track, Clip, EditorVideoAsset, EditorAudioAsset } from 'videodb';
// Create a timeline
const timeline = new EditorTimeline(conn);
// 1. Video Track (Background)
const videoTrack = new Track();
const videoAsset = new EditorVideoAsset({ id: video.id });
const videoClip = new Clip({ asset: videoAsset, duration: parseFloat(video.length) });
videoTrack.addClip(0, videoClip);
timeline.addTrack(videoTrack);
// 2. Audio Track (Voiceover Overlay)
const audioTrack = new Track();
const audioAsset = new EditorAudioAsset({ id: audio.id });
const audioClip = new Clip({ asset: audioAsset, duration: parseFloat(audio.length) });
audioTrack.addClip(0, audioClip);
timeline.addTrack(audioTrack);
```
### Step 7: Review and Share
Generate the stream URL to watch your AI-created commercial.
```python Python theme={null}
from videodb import play_stream
stream_url = timeline.generate_stream()
play_stream(stream_url)
```
```javascript Node.js theme={null}
const streamUrl = await timeline.generateStream();
console.log(streamUrl);
```
**Output:**
[AI-Generated Product Advertisement](https://www.youtube.com/embed/NPvxczplmW0)
### Conclusion
You have successfully automated the production of a product advertisement.
By replacing multiple external tools with VideoDB's unified SDK, you can now build scalable video generation engines that turn raw footage into polished content automatically.
> **[Explore Full Notebook](https://colab.research.google.com/github/video-db/videodb-cookbook/blob/main/examples/Voiceover_Ad_Films.ipynb)**
>
> Open the complete implementation in Google Colab with all code examples.
## Related Tutorials
> **[Faceless Video Creator](/examples-and-tutorials/content-factory/faceless-video-creator)**
>
> Generate complete videos from scripts without camera
> **[AI Voiceovers](/examples-and-tutorials/content-factory/voiceovers)**
>
> Add professional narration to silent footage
# AI Storyteller for Kids
Source: https://docs.videodb.io/examples-and-tutorials/content-factory/ai-storyteller-kids
Generate complete animated educational videos for kids with AI scripts, voiceovers, and captions
[](https://colab.research.google.com/github/video-db/videodb-cookbook/blob/main/editor/creative/ai_storyteller_for_kids.ipynb)
## The Idea
Ever wished you could create fun, educational videos for kids with just a single topic? Tell the system "explain the solar system" and get back a complete animated video with:
* Kid-friendly voiceover narration
* Fun background music
* Loopable animated backgrounds
* Timed subject videos (cartoons of planets, stars, etc.)
* Animated captions that kids can follow along
This workflow takes a topic and magically transforms it into a complete learning video. All powered by **VideoDB's Editor SDK** — pure automation magic.
## Setup
### Install Dependencies
```bash theme={null}
pip install videodb
```
### Connect to VideoDB
```python theme={null}
import os
import math
import videodb
from videodb import play_stream
from videodb.editor import (
Timeline, Track, Clip,
VideoAsset, AudioAsset, TextAsset, CaptionAsset,
Fit, Position, Offset, Transition,
Font, Border,
CaptionAnimation, CaptionAlignment, CaptionBorderStyle,
FontStyling, Positioning, BorderAndShadow,
)
# Connect to VideoDB
api_key = "your_api_key"
conn = videodb.connect(api_key=api_key)
coll = conn.get_collection()
```
## Implementation
### Step 1: Generate Script and Title
```python theme={null}
import json
# Define the learning topic
topic = "Explain the solar system"
script_prompt = f"""You are a friendly children's educational content writer.
Write a fun, simple explanation about: "{topic}"
Requirements:
- Target audience: 5-year-old children
- Length: 250 words
- Use simple words and short sentences
- Make it fun and engaging
Return a JSON with:
- "title": A fun, catchy title for the video (max 5 words)
- "script": The complete narration script
Example format:
{{"title": "The Amazing Sun!", "script": "Hey friends! Today we're going to learn about..."}}
"""
script_response = coll.generate_text(
prompt=script_prompt,
model_name="pro",
response_type="json"
)
# Handle nested output structure
if 'output' in script_response and isinstance(script_response['output'], dict):
video_title = script_response["output"]["title"]
video_script = script_response["output"]["script"]
else:
video_title = script_response["title"]
video_script = script_response["script"]
```
### Step 2: Generate Background Prompts
```python theme={null}
bg_prompt = f"""Based on this children's educational video topic: "{topic}"
Create prompts for background media.
Return JSON with:
- "background_video_prompt": Detailed prompt for generating background video
- "music_prompt": Prompt for generating background music
Example: {{"background_video_prompt": "...", "music_prompt": "..."}}
"""
bg_response = coll.generate_text(
prompt=bg_prompt,
model_name="pro",
response_type="json"
)
# Handle nested output structure
if isinstance(bg_response, dict) and "output" in bg_response:
background_video_prompt = bg_response["output"]["background_video_prompt"]
music_prompt = bg_response["output"]["music_prompt"]
else:
background_video_prompt = bg_response["background_video_prompt"]
music_prompt = bg_response["music_prompt"]
```
### Step 3: Generate All Assets
```python theme={null}
# Generate voiceover from script
voiceover = coll.generate_voice(
text=video_script,
voice_name="Default"
)
# Generate background music (loopable)
bg_music = coll.generate_music(
prompt=music_prompt,
duration=10
)
# Generate background video (loopable)
bg_video = coll.generate_video(
prompt=background_video_prompt,
duration=5
)
```
### Step 4: Generate Timed Transcript
```python theme={null}
# Generate and fetch timestamped transcript
print("📝 Generating transcript with timestamps...")
voiceover.generate_transcript()
transcript = voiceover.get_transcript(segmenter=videodb.Segmenter.time, length=5)
import base64
def format_srt_time(seconds):
total_ms = int(round(float(seconds) * 1000))
hours, remainder = divmod(total_ms, 3_600_000)
minutes, remainder = divmod(remainder, 60_000)
secs, milliseconds = divmod(remainder, 1_000)
return f"{hours:02}:{minutes:02}:{secs:02},{milliseconds:03}"
srt = "\n".join(
f"{number}\n"
f"{format_srt_time(segment['start'])} --> {format_srt_time(segment['end'])}\n"
f"{segment['text']}\n"
for number, segment in enumerate(transcript, start=1)
)
srt_src = base64.b64encode(srt.encode("utf-8")).decode("utf-8")
# Calculate total video duration (intro + voiceover + outro)
voiceover_length_float = float(voiceover.length)
intro_duration = 5
outro_duration = 5
total_duration = intro_duration + voiceover_length_float + outro_duration
print(f"✅ Transcript ready! {len(transcript)} segments")
print(f"\n⏱️ Video breakdown:")
print(f" - Intro: {intro_duration}s")
print(f" - Voiceover: {voiceover_length_float}s")
print(f" - Outro: {outro_duration}s")
print(f" - Total: {total_duration}s")
import json
print(json.dumps(transcript, indent=2))
```
### Step 5: Configure Reusable Captions
```python theme={null}
# Configure reusable captions from the timed transcript
caption_asset = CaptionAsset(
src=srt_src,
animation=CaptionAnimation.karaoke,
primary_color="&H00FFFFFF",
secondary_color="&H0000FFFF",
back_color="&H80000000",
position=Positioning(
alignment=CaptionAlignment.bottom_center,
margin_l=20,
margin_r=20,
margin_v=30,
),
font=FontStyling(
name="Clear Sans",
size=52,
bold=True,
),
border=BorderAndShadow(
style=CaptionBorderStyle.outline_and_shadow,
outline=4,
outline_color="&H00000000",
shadow=2,
),
)
print("✅ Reusable caption style ready!")
```
### Step 6: Build the Complete Video
```python theme={null}
# Use the actual length of each background asset for looping
timeline = Timeline(conn)
timeline.background = "#0a0a1a"
timeline.resolution = "1280x720"
bg_video_actual_length = bg_video.length
video_loops = math.ceil(total_duration / bg_video_actual_length)
music_loops = math.ceil(total_duration / 10)
# Track 1: Looped background video
bg_video_track = Track()
for i in range(video_loops):
start = i * bg_video_actual_length
remaining = total_duration - start
dur = min(bg_video_actual_length, remaining)
if dur <= 0:
break
bg_video_track.add_clip(
start=start,
clip=Clip(
asset=VideoAsset(id=bg_video.id, volume=0),
duration=dur,
fit=Fit.cover,
opacity=0.7,
),
)
# Track 2: Looped background music
bg_music_track = Track()
for i in range(music_loops):
start = i * 10
remaining = total_duration - start
dur = min(10, remaining)
bg_music_track.add_clip(
start=start,
clip=Clip(asset=AudioAsset(id=bg_music.id, volume=0.5), duration=dur),
)
# Track 3: Voiceover and captions (start after intro)
vo_track = Track()
vo_track.add_clip(
start=intro_duration,
clip=Clip(
asset=AudioAsset(id=voiceover.id, volume=1.0),
duration=voiceover_length_float,
),
)
vo_track.add_clip(
start=intro_duration,
clip=Clip(asset=caption_asset, duration=voiceover_length_float),
)
# Track 4: Title card
title_track = Track()
title_track.add_clip(
start=0,
clip=Clip(
asset=TextAsset(
text=video_title,
font=Font(family="Quicksand", size=96, color="#FFD700"),
border=Border(color="#000000", width=6),
),
duration=intro_duration,
position=Position.center,
transition=Transition(in_="fade", out="fade", duration=0.8),
),
)
# Track 5: Outro card
outro_track = Track()
outro_track.add_clip(
start=intro_duration + voiceover_length_float,
clip=Clip(
asset=TextAsset(
text="Happy Learning!",
font=Font(family="Quicksand", size=88, color="#90EE90"),
border=Border(color="#000000", width=6),
),
duration=outro_duration,
position=Position.center,
transition=Transition(in_="fade", out="fade", duration=0.8),
),
)
timeline.add_track(bg_video_track)
timeline.add_track(bg_music_track)
timeline.add_track(vo_track)
timeline.add_track(title_track)
timeline.add_track(outro_track)
print("✅ Timeline built!")
stream = timeline.generate_stream()
play_stream(stream)
```
### Step 7: Generate Subject Video Prompts
```python theme={null}
# Group the timed transcript into pairs for a visual subject prompt per pair
transcript_pairs = []
for i in range(0, len(transcript), 2):
pair = {
"start": float(transcript[i]["start"]),
"end": float(transcript[i + 1]["end"]) if i + 1 < len(transcript) else float(transcript[i]["end"]),
"text": transcript[i]["text"] + " " + (transcript[i + 1]["text"] if i + 1 < len(transcript) else ""),
}
transcript_pairs.append(pair)
subject_prompt = f"""You are creating visual prompts for a children's educational video about: "{topic}"
For each PAIR of narration lines below, create ONE video generation prompt that captures the essence of both lines.
Transcript pairs:
{json.dumps(transcript_pairs, indent=2)}
Requirements for each video prompt:
- Style: Cartoonish, whimsical, colorful, kid-friendly
- NO text in the videos
- NO complex actions
- Focus on a SINGLE subject that represents both lines
- Think fun and simple — like a storybook illustration come to life
- Slight motion is okay (spinning, floating, twinkling, bouncing)
Return a JSON object with a "videos" array containing ONE item per PAIR, in the SAME ORDER:
{{
"videos": [
{{"subject": "", "prompt": "