Skip to content

Chat

The Chat router provides an AI agent that answers questions about your analyzed videos. It uses full analysis context with BERT-compressed segment data and maintains conversation history via sessions.

The agent is powered by Google Gemini 2.5 Flash via OpenRouter.


Ask a question about a video. Creates or continues a chat session.

Auth: Required

Body FieldTypeRequiredDescription
questionstringYesYour question in natural language
video_idstringYesThe video’s job_id to ask about
session_idstringNoContinue an existing session (preserves conversation history)
modulesstring[]NoLimit context to specific modules
modestringNoSearch mode: vector (default) or brute_force

Response:

{
"answer": "The video shows a person presenting at a podium from **0:15** to **2:30**. They discuss quarterly revenue targets and show three charts...",
"session_id": "42",
"feedback_id": "f8a7b6c5-..."
}

The first call without session_id creates a new session automatically. Subsequent calls with the returned session_id maintain conversation history (last 10 messages).

Terminal window
curl -X POST https://api.lynxvizion.com/api/chat/ask \
-H "Authorization: $LVZ_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": "What are the main topics discussed in this video?",
"video_id": "a1b2c3d4-..."
}'
Terminal window
curl -X POST https://api.lynxvizion.com/api/chat/ask \
-H "Authorization: $LVZ_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": "At what timestamp do they mention the budget?",
"video_id": "a1b2c3d4-...",
"session_id": "42"
}'

List all chat sessions, optionally filtered by video.

Auth: Required

Query ParamTypeRequiredDescription
video_idstringNoFilter by video ID or job ID

Response: ChatSessionResponse[]

[
{
"id": "42",
"user_id": "550e8400-...",
"video_id": "1",
"job_id": "a1b2c3d4-...",
"video_name": "my-video.mp4",
"title": "What are the main topics discussed...",
"message_count": 6,
"last_message": "The budget is mentioned at 3:45...",
"created_at": "2025-01-15T10:10:00",
"updated_at": "2025-01-15T10:15:00"
}
]
Terminal window
curl https://api.lynxvizion.com/api/chat/sessions \
-H "Authorization: $LVZ_KEY"

Create a new empty chat session.

Auth: Required

Body FieldTypeRequiredDescription
video_idstringNoAssociated video ID
titlestringNoSession title

Response: ChatSessionResponse (201 Created)

Terminal window
curl -X POST https://api.lynxvizion.com/api/chat/sessions \
-H "Authorization: $LVZ_KEY" \
-H "Content-Type: application/json" \
-d '{"video_id": "1", "title": "Analysis Discussion"}'

Update a session’s title.

Auth: Required

Path ParamTypeRequiredDescription
session_idstringYesSession ID
Body FieldTypeRequiredDescription
titlestringYesNew title

Response: Updated ChatSessionResponse

Terminal window
curl -X PATCH https://api.lynxvizion.com/api/chat/sessions/42 \
-H "Authorization: $LVZ_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "Q1 Revenue Discussion"}'

Delete a session and all its messages.

Auth: Required

Path ParamTypeRequiredDescription
session_idstringYesSession ID

Response:

{ "ok": true }
Terminal window
curl -X DELETE https://api.lynxvizion.com/api/chat/sessions/42 \
-H "Authorization: $LVZ_KEY"

List all messages in a session.

Auth: Required

Path ParamTypeRequiredDescription
session_idstringYesSession ID

Response: ChatMessageResponse[]

[
{
"id": "1",
"session_id": "42",
"role": "user",
"content": "What are the main topics discussed?",
"metadata": null,
"created_at": "2025-01-15T10:10:00"
},
{
"id": "2",
"session_id": "42",
"role": "assistant",
"content": "The video covers three main topics...",
"metadata": "{\"feedback_id\": \"f8a7b6c5-...\"}",
"created_at": "2025-01-15T10:10:05"
}
]
Terminal window
curl https://api.lynxvizion.com/api/chat/sessions/42/messages \
-H "Authorization: $LVZ_KEY"

Add a message to a session manually (not via the ask endpoint).

Auth: Required

Path ParamTypeRequiredDescription
session_idstringYesSession ID
Body FieldTypeRequiredDescription
rolestringNouser (default) or assistant
contentstringYesMessage text
metadatastringNoJSON metadata string

Response: ChatMessageResponse (201 Created)

Terminal window
curl -X POST https://api.lynxvizion.com/api/chat/sessions/42/messages \
-H "Authorization: $LVZ_KEY" \
-H "Content-Type: application/json" \
-d '{"role": "user", "content": "Can you summarize the key findings?"}'