Create RTStream scene index
curl --request POST \
--url https://api.videodb.io/rtstream/{stream_id}/index/scene \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"extraction_type": "time",
"extraction_config": {
"time": 10,
"frame_count": 5
},
"prompt": "Describe the scene",
"model_name": "GPT4o",
"model_config": {},
"name": "My Scene Index",
"ws_connection_id": "conn-123"
}
'const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
extraction_type: 'time',
extraction_config: {time: 10, frame_count: 5},
prompt: 'Describe the scene',
model_name: 'GPT4o',
model_config: {},
name: 'My Scene Index',
ws_connection_id: 'conn-123'
})
};
fetch('https://api.videodb.io/rtstream/{stream_id}/index/scene', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.videodb.io/rtstream/{stream_id}/index/scene",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'extraction_type' => 'time',
'extraction_config' => [
'time' => 10,
'frame_count' => 5
],
'prompt' => 'Describe the scene',
'model_name' => 'GPT4o',
'model_config' => [
],
'name' => 'My Scene Index',
'ws_connection_id' => 'conn-123'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.videodb.io/rtstream/{stream_id}/index/scene"
payload := strings.NewReader("{\n \"extraction_type\": \"time\",\n \"extraction_config\": {\n \"time\": 10,\n \"frame_count\": 5\n },\n \"prompt\": \"Describe the scene\",\n \"model_name\": \"GPT4o\",\n \"model_config\": {},\n \"name\": \"My Scene Index\",\n \"ws_connection_id\": \"conn-123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.videodb.io/rtstream/{stream_id}/index/scene")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"extraction_type\": \"time\",\n \"extraction_config\": {\n \"time\": 10,\n \"frame_count\": 5\n },\n \"prompt\": \"Describe the scene\",\n \"model_name\": \"GPT4o\",\n \"model_config\": {},\n \"name\": \"My Scene Index\",\n \"ws_connection_id\": \"conn-123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.videodb.io/rtstream/{stream_id}/index/scene")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"extraction_type\": \"time\",\n \"extraction_config\": {\n \"time\": 10,\n \"frame_count\": 5\n },\n \"prompt\": \"Describe the scene\",\n \"model_name\": \"GPT4o\",\n \"model_config\": {},\n \"name\": \"My Scene Index\",\n \"ws_connection_id\": \"conn-123\"\n}"
response = http.request(request)
puts response.read_body$headers=@{}
$headers.Add("x-access-token", "<api-key>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api.videodb.io/rtstream/{stream_id}/index/scene' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"extraction_type": "time",
"extraction_config": {
"time": 10,
"frame_count": 5
},
"prompt": "Describe the scene",
"model_name": "GPT4o",
"model_config": {},
"name": "My Scene Index",
"ws_connection_id": "conn-123"
}'import Foundation
let parameters = [
"extraction_type": "time",
"extraction_config": [
"time": 10,
"frame_count": 5
],
"prompt": "Describe the scene",
"model_name": "GPT4o",
"model_config": [],
"name": "My Scene Index",
"ws_connection_id": "conn-123"
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.videodb.io/rtstream/{stream_id}/index/scene")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"x-access-token": "<api-key>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))using RestSharp;
var options = new RestClientOptions("https://api.videodb.io/rtstream/{stream_id}/index/scene");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
request.AddJsonBody("{\n \"extraction_type\": \"time\",\n \"extraction_config\": {\n \"time\": 10,\n \"frame_count\": 5\n },\n \"prompt\": \"Describe the scene\",\n \"model_name\": \"GPT4o\",\n \"model_config\": {},\n \"name\": \"My Scene Index\",\n \"ws_connection_id\": \"conn-123\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);using RestSharp;
var options = new RestClientOptions("https://api.videodb.io/rtstream/{stream_id}/index/scene");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
request.AddJsonBody("{\n \"extraction_type\": \"time\",\n \"extraction_config\": {\n \"time\": 10,\n \"frame_count\": 5\n },\n \"prompt\": \"Describe the scene\",\n \"model_name\": \"GPT4o\",\n \"model_config\": {},\n \"name\": \"My Scene Index\",\n \"ws_connection_id\": \"conn-123\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
extraction_type: 'time',
extraction_config: {time: 10, frame_count: 5},
prompt: 'Describe the scene',
model_name: 'GPT4o',
model_config: {},
name: 'My Scene Index',
ws_connection_id: 'conn-123'
})
};
fetch('https://api.videodb.io/rtstream/{stream_id}/index/scene', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.videodb.io/rtstream/{stream_id}/index/scene");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-access-token: <api-key>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"extraction_type\": \"time\",\n \"extraction_config\": {\n \"time\": 10,\n \"frame_count\": 5\n },\n \"prompt\": \"Describe the scene\",\n \"model_name\": \"GPT4o\",\n \"model_config\": {},\n \"name\": \"My Scene Index\",\n \"ws_connection_id\": \"conn-123\"\n}");
CURLcode ret = curl_easy_perform(hnd);CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.videodb.io/rtstream/{stream_id}/index/scene");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-access-token: <api-key>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"extraction_type\": \"time\",\n \"extraction_config\": {\n \"time\": 10,\n \"frame_count\": 5\n },\n \"prompt\": \"Describe the scene\",\n \"model_name\": \"GPT4o\",\n \"model_config\": {},\n \"name\": \"My Scene Index\",\n \"ws_connection_id\": \"conn-123\"\n}");
CURLcode ret = curl_easy_perform(hnd);val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"extraction_type\": \"time\",\n \"extraction_config\": {\n \"time\": 10,\n \"frame_count\": 5\n },\n \"prompt\": \"Describe the scene\",\n \"model_name\": \"GPT4o\",\n \"model_config\": {},\n \"name\": \"My Scene Index\",\n \"ws_connection_id\": \"conn-123\"\n}")
val request = Request.Builder()
.url("https://api.videodb.io/rtstream/{stream_id}/index/scene")
.post(body)
.addHeader("x-access-token", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute(){
"success": true,
"data": {
"rtstream_index_id": "scene-idx-12345",
"extraction_type": "time",
"status": "running",
"prompt": "Describe the scene",
"name": "My Scene Index"
}
}Create RTStream Scene Index
Create a scene index for real-time visual analysis
POST
/
rtstream
/
{stream_id}
/
index
/
scene
Create RTStream scene index
curl --request POST \
--url https://api.videodb.io/rtstream/{stream_id}/index/scene \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"extraction_type": "time",
"extraction_config": {
"time": 10,
"frame_count": 5
},
"prompt": "Describe the scene",
"model_name": "GPT4o",
"model_config": {},
"name": "My Scene Index",
"ws_connection_id": "conn-123"
}
'const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
extraction_type: 'time',
extraction_config: {time: 10, frame_count: 5},
prompt: 'Describe the scene',
model_name: 'GPT4o',
model_config: {},
name: 'My Scene Index',
ws_connection_id: 'conn-123'
})
};
fetch('https://api.videodb.io/rtstream/{stream_id}/index/scene', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.videodb.io/rtstream/{stream_id}/index/scene",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'extraction_type' => 'time',
'extraction_config' => [
'time' => 10,
'frame_count' => 5
],
'prompt' => 'Describe the scene',
'model_name' => 'GPT4o',
'model_config' => [
],
'name' => 'My Scene Index',
'ws_connection_id' => 'conn-123'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.videodb.io/rtstream/{stream_id}/index/scene"
payload := strings.NewReader("{\n \"extraction_type\": \"time\",\n \"extraction_config\": {\n \"time\": 10,\n \"frame_count\": 5\n },\n \"prompt\": \"Describe the scene\",\n \"model_name\": \"GPT4o\",\n \"model_config\": {},\n \"name\": \"My Scene Index\",\n \"ws_connection_id\": \"conn-123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.videodb.io/rtstream/{stream_id}/index/scene")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"extraction_type\": \"time\",\n \"extraction_config\": {\n \"time\": 10,\n \"frame_count\": 5\n },\n \"prompt\": \"Describe the scene\",\n \"model_name\": \"GPT4o\",\n \"model_config\": {},\n \"name\": \"My Scene Index\",\n \"ws_connection_id\": \"conn-123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.videodb.io/rtstream/{stream_id}/index/scene")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"extraction_type\": \"time\",\n \"extraction_config\": {\n \"time\": 10,\n \"frame_count\": 5\n },\n \"prompt\": \"Describe the scene\",\n \"model_name\": \"GPT4o\",\n \"model_config\": {},\n \"name\": \"My Scene Index\",\n \"ws_connection_id\": \"conn-123\"\n}"
response = http.request(request)
puts response.read_body$headers=@{}
$headers.Add("x-access-token", "<api-key>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api.videodb.io/rtstream/{stream_id}/index/scene' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"extraction_type": "time",
"extraction_config": {
"time": 10,
"frame_count": 5
},
"prompt": "Describe the scene",
"model_name": "GPT4o",
"model_config": {},
"name": "My Scene Index",
"ws_connection_id": "conn-123"
}'import Foundation
let parameters = [
"extraction_type": "time",
"extraction_config": [
"time": 10,
"frame_count": 5
],
"prompt": "Describe the scene",
"model_name": "GPT4o",
"model_config": [],
"name": "My Scene Index",
"ws_connection_id": "conn-123"
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.videodb.io/rtstream/{stream_id}/index/scene")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"x-access-token": "<api-key>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))using RestSharp;
var options = new RestClientOptions("https://api.videodb.io/rtstream/{stream_id}/index/scene");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
request.AddJsonBody("{\n \"extraction_type\": \"time\",\n \"extraction_config\": {\n \"time\": 10,\n \"frame_count\": 5\n },\n \"prompt\": \"Describe the scene\",\n \"model_name\": \"GPT4o\",\n \"model_config\": {},\n \"name\": \"My Scene Index\",\n \"ws_connection_id\": \"conn-123\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);using RestSharp;
var options = new RestClientOptions("https://api.videodb.io/rtstream/{stream_id}/index/scene");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
request.AddJsonBody("{\n \"extraction_type\": \"time\",\n \"extraction_config\": {\n \"time\": 10,\n \"frame_count\": 5\n },\n \"prompt\": \"Describe the scene\",\n \"model_name\": \"GPT4o\",\n \"model_config\": {},\n \"name\": \"My Scene Index\",\n \"ws_connection_id\": \"conn-123\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
extraction_type: 'time',
extraction_config: {time: 10, frame_count: 5},
prompt: 'Describe the scene',
model_name: 'GPT4o',
model_config: {},
name: 'My Scene Index',
ws_connection_id: 'conn-123'
})
};
fetch('https://api.videodb.io/rtstream/{stream_id}/index/scene', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.videodb.io/rtstream/{stream_id}/index/scene");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-access-token: <api-key>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"extraction_type\": \"time\",\n \"extraction_config\": {\n \"time\": 10,\n \"frame_count\": 5\n },\n \"prompt\": \"Describe the scene\",\n \"model_name\": \"GPT4o\",\n \"model_config\": {},\n \"name\": \"My Scene Index\",\n \"ws_connection_id\": \"conn-123\"\n}");
CURLcode ret = curl_easy_perform(hnd);CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.videodb.io/rtstream/{stream_id}/index/scene");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-access-token: <api-key>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"extraction_type\": \"time\",\n \"extraction_config\": {\n \"time\": 10,\n \"frame_count\": 5\n },\n \"prompt\": \"Describe the scene\",\n \"model_name\": \"GPT4o\",\n \"model_config\": {},\n \"name\": \"My Scene Index\",\n \"ws_connection_id\": \"conn-123\"\n}");
CURLcode ret = curl_easy_perform(hnd);val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"extraction_type\": \"time\",\n \"extraction_config\": {\n \"time\": 10,\n \"frame_count\": 5\n },\n \"prompt\": \"Describe the scene\",\n \"model_name\": \"GPT4o\",\n \"model_config\": {},\n \"name\": \"My Scene Index\",\n \"ws_connection_id\": \"conn-123\"\n}")
val request = Request.Builder()
.url("https://api.videodb.io/rtstream/{stream_id}/index/scene")
.post(body)
.addHeader("x-access-token", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute(){
"success": true,
"data": {
"rtstream_index_id": "scene-idx-12345",
"extraction_type": "time",
"status": "running",
"prompt": "Describe the scene",
"name": "My Scene Index"
}
}Create a scene index on a real-time stream for continuous visual analysis. The index extracts and describes scenes as the stream progresses.
extraction_typecan betimeortranscript- For time-based extraction, set
extraction_config.timefor interval in seconds promptdefines what the model should look for in each scene- Use
ws_connection_idto receive real-time index updates via WebSocket
List Scene Indexes
View all indexes on a stream
Search RTStream
Search indexed content
Authorizations
API key for authentication (sk-xxx format)
Path Parameters
Example:
"rts-12345"
Body
application/json
Available options:
time, transcript Example:
"time"
Show child attributes
Show child attributes
Example:
"Describe the scene"
Example:
"GPT4o"
Example:
"My Scene Index"
Example:
"conn-123"
⌘I