Video Q&A

Video Q&A

The Vision API provides powerful question-answering capabilities for your videos. Once a video has been indexed, you can ask natural language questions about its content and receive AI-powered answers.

Prerequisites

Before using Video Q&A, ensure your video has been successfully indexed:

  1. Upload a video with index=true
  2. Check indexing status - it should be "indexed"
  3. Wait for processing if status is "indexing"

Ask Questions

Use the /qa/chat endpoint to ask questions about your videos:

$curl -X POST https://vision-agent.api.reka.ai/qa/chat \
> -H "X-Api-Key: YOUR_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "video_id": "550e8400-e29b-41d4-a716-446655440000",
> "question": "What is happening in this video?",
> "context": "Focus on the main events",
> "model": "reka-core"
> }'

Request Parameters

  • video_id (required): ID of the video to analyze
  • question (required): Your question about the video
  • context (optional): Additional context to guide the analysis
  • model (optional): AI model to use (default: “reka-core”)

Streaming Responses

For real-time responses, use the /qa/stream endpoint:

$curl -X POST https://vision-agent.api.reka.ai/qa/stream \
> -H "X-Api-Key: YOUR_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "video_id": "550e8400-e29b-41d4-a716-446655440000",
> "question": "What is happening in this video?",
> "context": "Focus on the main events",
> "model": "reka-core"
> }'

This returns a Server-Sent Events (SSE) stream with real-time updates.

Response Format

Chat Response

1{
2 "answer": "The video shows a person walking on the beach during sunset.",
3 "confidence": 0.85,
4 "video_id": "550e8400-e29b-41d4-a716-446655440000",
5 "question": "What is happening in this video?",
6 "timestamp": 1640995200
7}

Stream Response

1{
2 "event": "qa_stream",
3 "data": {
4 "status": "processing",
5 "answer": "The video shows a person walking...",
6 "confidence": 0.85,
7 "video_id": "550e8400-e29b-41d4-a716-446655440000",
8 "question": "What is happening in this video?"
9 }
10}

Question Examples

Here are some example questions you can ask:

  • General: “What is happening in this video?”
  • Specific: “What color is the car in the video?”
  • Temporal: “What happens at the beginning of the video?”
  • Analytical: “How many people are in the scene?”
  • Descriptive: “Describe the setting and atmosphere”

Best Practices

  1. Be specific in your questions for better answers
  2. Use context to guide the AI’s focus
  3. Check indexing status before asking questions
  4. Use streaming for long videos or complex questions
  5. Provide relevant context to improve answer quality

Error Handling

  • Video not found: Ensure the video_id is correct
  • Video not indexed: Wait for indexing to complete
  • Indexing failed: Re-upload the video with index=true