Metadata Tagging

The Vision API supports two approaches for generating metadata tags for your videos: quick tagging and indexed tagging.

Default Output Fields

By default, both approaches can return the following fields:

  • Description: string
  • Violence: boolean
  • Profanity: boolean
  • AdultContent: boolean
  • Drugs: boolean
  • Alcohol: boolean
  • Gambling: boolean
  • Political: boolean
  • ExpectedCTR: number (0–100)
  • ViralityScore: number (0–100)
  • Keyword: array of strings
  • MoodTone: array of strings

You can add, remove, and customize output fields. Contact us to optimize outputs for your use case.

Quick Tagging

Quick tagging is suitable for short videos (e.g., under 30 seconds). Videos are processed ad-hoc and videos are not stored.

Endpoint

  • POST /v1/qa/quicktag

Request

Bash

curl -X POST https://vision-agent.api.reka.ai/v1/qa/quicktag \
-H "X-Api-Key: YOUR_API_KEY" \
-F "video=@/path/to/your/video.mp4"

Python

import requests
import json
import os
import time
def send_reka_tag_request(video_path: str, api_key: str):
if not video_path:
raise ValueError("video path is required")
headers = {
"X-API-Key": api_key,
}
endpoint_url = f"{BASE_URL}/v1/qa/quicktag"
print(f"{endpoint_url=}")
print(f"{headers=}")
start_time = time.time()
with open(video_path, 'rb') as f:
try:
# The dictionary key 'file' matches the FastAPI parameter name
files = {'video': (os.path.basename(video_path), f, 'video/mp4')}
print(f"{files=}")
# Send the POST request
response = requests.post(endpoint_url, files=files, headers=headers, timeout=120)
duration = time.time() - start_time
print(f"Request took {duration:.2f} seconds")
try:
response.raise_for_status()
except requests.HTTPError as e:
try:
err_json = response.json()
print("Error JSON:\n", json.dumps(err_json, indent=4))
except ValueError:
print("Error Text:", response.text)
raise e
return response
except requests.exceptions.RequestException as e:
print(f"An error occurred during the quick tag request: {e}")
return None

Parameters

  • video_id (optional): ID of the video to analyze
  • video_url (optional): URL of the video to analyze (either video_id or video_url is required)

Indexed Tagging

Indexed tagging allows you to generate tags for previously uploaded and indexed videos. Indexed tagging is more suitable for longer videos.

Bash

curl -X POST https://vision-agent.api.reka.ai/v1/qa/indexedtag \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"video_id": "550e8400-e29b-41d4-a716-446655440000",
}'

Python

import requests
import json
import time
def send_indexed_tag_request(video_id: str, api_key: str):
if not video_id:
raise ValueError("video_id is required")
# Form payload (NOT JSON)
form_data = {
"video_id": video_id,
}
headers = {
"X-API-Key": api_key,
}
endpoint_url = f"{BASE_URL}/v1/qa/indexedtag"
print(f"{endpoint_url=}")
print(f"{headers=}")
print(f"{form_data=}")
start_time = time.time()
try:
# No stream=True; endpoint returns the final string
response = requests.post(endpoint_url, data=form_data, headers=headers, timeout=120)
duration = time.time() - start_time
print(f"Request took {duration:.2f} seconds")
try:
response.raise_for_status()
except requests.HTTPError as e:
# Try to show any error payload
try:
err_json = response.json()
print("Error JSON:\n", json.dumps(err_json, indent=4))
except ValueError:
print("Error Text:", response.text)
raise e
return response
except requests.exceptions.RequestException as e:
print(f"An error occurred during the indexed tag request: {e}")
return None

Prerequisites

Before using Indexed Tagging, ensure your video has been successfully indexed:

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

Endpoint

  • POST /v1/qa/indexedtag

Request

curl -X POST https://vision-agent.api.reka.ai/v1/qa/indexedtag \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"video_id": "550e8400-e29b-41d4-a716-446655440000",
}'

Parameters

  • video_id (required): ID of the previously indexed video

Pricing

Discounted pricing is available for large-volume batch processing:

  • Quick tagging input: $0.004 per input video minute
  • Indexed tagging input: $0.03 per input video minute
  • Outputs (both): $2 per 1M output tokens