Skip to main content
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
}
'
{
  "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')}")
  • 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

Authorizations

x-access-token
string
header
required

API key for authentication (sk-xxx format)

Body

application/json
model
enum<string>
required
Available options:
gpt-4o-2024-11-20
Example:

"gpt-4o-2024-11-20"

messages
object[]
required
max_tokens
integer
Example:

100

temperature
number
Example:

0.7

stream
boolean
Example:

false

Response

200 - application/json

Chat completion response

id
string
Example:

"chatcmpl-123"

object
string
Example:

"chat.completion"

created
integer
Example:

1677652288

model
string
Example:

"gpt-4o-2024-11-20"

choices
object[]
usage
object