cURL
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 chat responses with video context awareness
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')}")
collection_id
video_id
messages
choices
API key for authentication (sk-xxx format)
gpt-4o-2024-11-20
"gpt-4o-2024-11-20"
Show child attributes
100
0.7
false
Chat completion response
"chatcmpl-123"
"chat.completion"
1677652288