OpenAI-compatible chat completions proxy
curl --request POST \
--url https://api.videodb.io/chat/completions \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"model": "gpt-4o-2024-11-20",
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
],
"max_tokens": 100,
"temperature": 0.7,
"stream": false
}
'const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gpt-4o-2024-11-20',
messages: [{role: 'user', content: 'Hello, how are you?'}],
max_tokens: 100,
temperature: 0.7,
stream: false
})
};
fetch('https://api.videodb.io/chat/completions', 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/chat/completions",
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([
'model' => 'gpt-4o-2024-11-20',
'messages' => [
[
'role' => 'user',
'content' => 'Hello, how are you?'
]
],
'max_tokens' => 100,
'temperature' => 0.7,
'stream' => false
]),
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/chat/completions"
payload := strings.NewReader("{\n \"model\": \"gpt-4o-2024-11-20\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"max_tokens\": 100,\n \"temperature\": 0.7,\n \"stream\": false\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/chat/completions")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gpt-4o-2024-11-20\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"max_tokens\": 100,\n \"temperature\": 0.7,\n \"stream\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.videodb.io/chat/completions")
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 \"model\": \"gpt-4o-2024-11-20\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"max_tokens\": 100,\n \"temperature\": 0.7,\n \"stream\": false\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/chat/completions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"model": "gpt-4o-2024-11-20",
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
],
"max_tokens": 100,
"temperature": 0.7,
"stream": false
}'import Foundation
let parameters = [
"model": "gpt-4o-2024-11-20",
"messages": [
[
"role": "user",
"content": "Hello, how are you?"
]
],
"max_tokens": 100,
"temperature": 0.7,
"stream": false
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.videodb.io/chat/completions")!
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/chat/completions");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
request.AddJsonBody("{\n \"model\": \"gpt-4o-2024-11-20\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"max_tokens\": 100,\n \"temperature\": 0.7,\n \"stream\": false\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
using RestSharp;
var options = new RestClientOptions("https://api.videodb.io/chat/completions");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
request.AddJsonBody("{\n \"model\": \"gpt-4o-2024-11-20\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"max_tokens\": 100,\n \"temperature\": 0.7,\n \"stream\": false\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({
model: 'gpt-4o-2024-11-20',
messages: [{role: 'user', content: 'Hello, how are you?'}],
max_tokens: 100,
temperature: 0.7,
stream: false
})
};
fetch('https://api.videodb.io/chat/completions', 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/chat/completions");
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 \"model\": \"gpt-4o-2024-11-20\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"max_tokens\": 100,\n \"temperature\": 0.7,\n \"stream\": false\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/chat/completions");
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 \"model\": \"gpt-4o-2024-11-20\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"max_tokens\": 100,\n \"temperature\": 0.7,\n \"stream\": false\n}");
CURLcode ret = curl_easy_perform(hnd);val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"model\": \"gpt-4o-2024-11-20\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"max_tokens\": 100,\n \"temperature\": 0.7,\n \"stream\": false\n}")
val request = Request.Builder()
.url("https://api.videodb.io/chat/completions")
.post(body)
.addHeader("x-access-token", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute(){
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"model": "gpt-4o-2024-11-20",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! I'm doing well, thank you for asking."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 15,
"total_tokens": 25
}
}Chat Completions
Generate AI chat responses with video context awareness
POST
/
chat
/
completions
OpenAI-compatible chat completions proxy
curl --request POST \
--url https://api.videodb.io/chat/completions \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"model": "gpt-4o-2024-11-20",
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
],
"max_tokens": 100,
"temperature": 0.7,
"stream": false
}
'const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gpt-4o-2024-11-20',
messages: [{role: 'user', content: 'Hello, how are you?'}],
max_tokens: 100,
temperature: 0.7,
stream: false
})
};
fetch('https://api.videodb.io/chat/completions', 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/chat/completions",
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([
'model' => 'gpt-4o-2024-11-20',
'messages' => [
[
'role' => 'user',
'content' => 'Hello, how are you?'
]
],
'max_tokens' => 100,
'temperature' => 0.7,
'stream' => false
]),
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/chat/completions"
payload := strings.NewReader("{\n \"model\": \"gpt-4o-2024-11-20\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"max_tokens\": 100,\n \"temperature\": 0.7,\n \"stream\": false\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/chat/completions")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gpt-4o-2024-11-20\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"max_tokens\": 100,\n \"temperature\": 0.7,\n \"stream\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.videodb.io/chat/completions")
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 \"model\": \"gpt-4o-2024-11-20\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"max_tokens\": 100,\n \"temperature\": 0.7,\n \"stream\": false\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/chat/completions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"model": "gpt-4o-2024-11-20",
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
],
"max_tokens": 100,
"temperature": 0.7,
"stream": false
}'import Foundation
let parameters = [
"model": "gpt-4o-2024-11-20",
"messages": [
[
"role": "user",
"content": "Hello, how are you?"
]
],
"max_tokens": 100,
"temperature": 0.7,
"stream": false
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.videodb.io/chat/completions")!
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/chat/completions");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
request.AddJsonBody("{\n \"model\": \"gpt-4o-2024-11-20\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"max_tokens\": 100,\n \"temperature\": 0.7,\n \"stream\": false\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
using RestSharp;
var options = new RestClientOptions("https://api.videodb.io/chat/completions");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
request.AddJsonBody("{\n \"model\": \"gpt-4o-2024-11-20\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"max_tokens\": 100,\n \"temperature\": 0.7,\n \"stream\": false\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({
model: 'gpt-4o-2024-11-20',
messages: [{role: 'user', content: 'Hello, how are you?'}],
max_tokens: 100,
temperature: 0.7,
stream: false
})
};
fetch('https://api.videodb.io/chat/completions', 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/chat/completions");
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 \"model\": \"gpt-4o-2024-11-20\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"max_tokens\": 100,\n \"temperature\": 0.7,\n \"stream\": false\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/chat/completions");
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 \"model\": \"gpt-4o-2024-11-20\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"max_tokens\": 100,\n \"temperature\": 0.7,\n \"stream\": false\n}");
CURLcode ret = curl_easy_perform(hnd);val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"model\": \"gpt-4o-2024-11-20\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ],\n \"max_tokens\": 100,\n \"temperature\": 0.7,\n \"stream\": false\n}")
val request = Request.Builder()
.url("https://api.videodb.io/chat/completions")
.post(body)
.addHeader("x-access-token", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute(){
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"model": "gpt-4o-2024-11-20",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! I'm doing well, thank you for asking."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 15,
"total_tokens": 25
}
}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.
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')}")
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);
- Requires
collection_idto specify which collection to search - Optional
video_idto focus on a specific video - Supports multi-turn conversations by including message history in the
messagesarray - Returns response in OpenAI-compatible format with
choicesarray
Health Check
Verify API availability
Async Response
Poll async operation results
Authorizations
API key for authentication (sk-xxx format)
Body
application/json
⌘I