API Reference

June 17, 2026 · View on GitHub

Vidify provides both a REST API (FastAPI server) and a CLI interface.

REST API

Start the server:

uvicorn server.app:app --host 0.0.0.0 --port 9000

Interactive docs at http://localhost:9000/docs (Swagger UI).

Endpoints

GET /health

Health check.

{"ok": true}

POST /analyze

Run video analysis (brief or detailed).

curl -X POST http://localhost:9000/analyze \
  -H 'Content-Type: application/json' \
  -d '{
    "source_type": "youtube",
    "uri": "https://www.youtube.com/watch?v=XXXX",
    "mode": "detailed",
    "cache_root": "./cache",
    "llm_base_url": "http://localhost:8000/v1",
    "llm_model": "qwen3.5-9b",
    "max_frames": 128,
    "whisper_model": "small"
  }'
FieldTypeDefaultDescription
source_typeyoutube|url|localrequiredVideo source type
uristringrequiredYouTube URL, HTTP URL, or local path
modebrief|quick|detaileddetailedAnalysis depth (quick is a legacy alias for brief)
cache_rootstring./cacheCache directory
llm_base_urlstringhttp://localhost:8000/v1vLLM endpoint
llm_modelstringqwen3.5-9bModel name
max_framesint (1-128)128Max frames to sample
whisper_modelstringsmallWhisper model size
direct_modelboolfalseUse local model loading
model_pathstringnullPath for direct model; required when direct_model is true

POST /index

Build FAISS semantic index (requires prior analysis or auto-generates one).

curl -X POST http://localhost:9000/index \
  -H 'Content-Type: application/json' \
  -d '{
    "source_type": "youtube",
    "uri": "https://www.youtube.com/watch?v=XXXX",
    "cache_root": "./cache",
    "llm_base_url": "http://localhost:8000/v1",
    "llm_model": "qwen3.5-9b",
    "embed_base_url": "http://localhost:8000/v1",
    "embed_model": "qwen-embed",
    "chunk_sec": 20
  }'
FieldTypeDefaultDescription
embed_base_urlstringhttp://localhost:8000/v1Embedding API endpoint
embed_modelstringqwen-embedEmbedding model name
chunk_secint (5-120)20Time chunk size in seconds

POST /ask

Question-answering over indexed video content.

curl -X POST http://localhost:9000/ask \
  -H 'Content-Type: application/json' \
  -d '{
    "source_type": "youtube",
    "uri": "https://www.youtube.com/watch?v=XXXX",
    "cache_root": "./cache",
    "question": "What are the key conclusions?",
    "top_k": 5,
    "llm_base_url": "http://localhost:8000/v1",
    "llm_model": "qwen3.5-9b",
    "embed_base_url": "http://localhost:8000/v1",
    "embed_model": "qwen-embed"
  }'
FieldTypeDefaultDescription
questionstringrequiredNatural-language question
top_kint (1-20)5Number of chunks to retrieve

POST /highlights

Detect and export highlight clips.

curl -X POST http://localhost:9000/highlights \
  -H 'Content-Type: application/json' \
  -d '{
    "source_type": "youtube",
    "uri": "https://www.youtube.com/watch?v=XXXX",
    "cache_root": "./cache",
    "llm_base_url": "http://localhost:8000/v1",
    "llm_model": "qwen3.5-9b",
    "max_clips": 5,
    "also_make_reel": true
  }'
FieldTypeDefaultDescription
max_clipsint (1-20)5Maximum highlight clips
also_make_reelbooltrueConcatenate clips into reel

POST /analysis

Retrieve cached analysis results.

curl -X POST http://localhost:9000/analysis \
  -H 'Content-Type: application/json' \
  -d '{
    "source_type": "youtube",
    "uri": "https://www.youtube.com/watch?v=XXXX",
    "cache_root": "./cache"
  }'

GET /

Web GUI for video upload and analysis.

POST /upload

Upload a local video file through the web interface.


CLI

python -m agent.main analyze SOURCE_TYPE URI [OPTIONS]

Arguments

ArgumentValuesDescription
SOURCE_TYPEyoutube, url, localVideo source type
URIstringYouTube URL, HTTP URL, or file path

Options

OptionDefaultDescription
--modedetailedbrief, quick, detailed, highlights, index, ask, report, live, audit
--cache-root./cacheCache directory
--questionQuestion for ask mode
--max-frames128Maximum frames to sample
--interactivefalseInteractive prompt mode
--direct-modelfalseUse local model loading
--model-pathModel path for direct loading
--include-web-searchfalseEnable web search enhancement
--google-api-keyGoogle Custom Search API key
--google-search-engine-idGoogle Custom Search engine ID

Examples

# Detailed analysis of a YouTube video
python -m agent.main analyze youtube "https://www.youtube.com/watch?v=..." --mode detailed

# Brief analysis with web search
python -m agent.main analyze youtube "https://www.youtube.com/watch?v=..." --mode brief --include-web-search

# Question-answering (runs index + ask)
python -m agent.main analyze youtube "https://www.youtube.com/watch?v=..." --mode ask \
    --question "What are the main arguments?"

# Local video with direct model
python -m agent.main analyze local /path/to/video.mp4 --mode detailed --direct-model \
    --model-path /path/to/qwen3.5

# Generate report
python -m agent.main analyze youtube "https://www.youtube.com/watch?v=..." --mode report