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.
POST /chat/ask
Section titled “POST /chat/ask”Ask a question about a video. Creates or continues a chat session.
Auth: Required
| Body Field | Type | Required | Description |
|---|---|---|---|
question | string | Yes | Your question in natural language |
video_id | string | Yes | The video’s job_id to ask about |
session_id | string | No | Continue an existing session (preserves conversation history) |
modules | string[] | No | Limit context to specific modules |
mode | string | No | Search 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).
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-..." }'Follow-up question
Section titled “Follow-up question”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" }'GET /chat/sessions
Section titled “GET /chat/sessions”List all chat sessions, optionally filtered by video.
Auth: Required
| Query Param | Type | Required | Description |
|---|---|---|---|
video_id | string | No | Filter 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" }]curl https://api.lynxvizion.com/api/chat/sessions \ -H "Authorization: $LVZ_KEY"POST /chat/sessions
Section titled “POST /chat/sessions”Create a new empty chat session.
Auth: Required
| Body Field | Type | Required | Description |
|---|---|---|---|
video_id | string | No | Associated video ID |
title | string | No | Session title |
Response: ChatSessionResponse (201 Created)
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"}'PATCH /chat/sessions/{session_id}
Section titled “PATCH /chat/sessions/{session_id}”Update a session’s title.
Auth: Required
| Path Param | Type | Required | Description |
|---|---|---|---|
session_id | string | Yes | Session ID |
| Body Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | New title |
Response: Updated ChatSessionResponse
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 /chat/sessions/{session_id}
Section titled “DELETE /chat/sessions/{session_id}”Delete a session and all its messages.
Auth: Required
| Path Param | Type | Required | Description |
|---|---|---|---|
session_id | string | Yes | Session ID |
Response:
{ "ok": true }curl -X DELETE https://api.lynxvizion.com/api/chat/sessions/42 \ -H "Authorization: $LVZ_KEY"GET /chat/sessions/{session_id}/messages
Section titled “GET /chat/sessions/{session_id}/messages”List all messages in a session.
Auth: Required
| Path Param | Type | Required | Description |
|---|---|---|---|
session_id | string | Yes | Session 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" }]curl https://api.lynxvizion.com/api/chat/sessions/42/messages \ -H "Authorization: $LVZ_KEY"POST /chat/sessions/{session_id}/messages
Section titled “POST /chat/sessions/{session_id}/messages”Add a message to a session manually (not via the ask endpoint).
Auth: Required
| Path Param | Type | Required | Description |
|---|---|---|---|
session_id | string | Yes | Session ID |
| Body Field | Type | Required | Description |
|---|---|---|---|
role | string | No | user (default) or assistant |
content | string | Yes | Message text |
metadata | string | No | JSON metadata string |
Response: ChatMessageResponse (201 Created)
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?"}'