Skip to navigation

Metadata Tagging

For chat over text, images and short videos, use the OpenAI-compatible Chat Completions API.

The Vision API tags videos with metadata in two ways, quick tagging and indexed tagging.

Default output fields

By default, both return these 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 tune the outputs for your use case.

Quick tagging

Quick tagging suits short videos, for example under 30 seconds. It processes each video ad hoc and does not store it.

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 generates tags for videos you have already uploaded and indexed. It suits 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 you use indexed tagging, check that your video is 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

Large batch jobs get discounted pricing:

  • 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