HTTP API
The Summarize HTTP API exposes all CLI functionality via REST endpoints. It is built with FastAPI and includes auto-generated interactive documentation at /docs.
Installation
Server dependencies are not included in the base package. Install the server extra in an isolated environment — the server pulls in pydantic via FastAPI, and version skew in shared ~/.local site-packages is the most common cause of startup failures.
Recommended (pipx):
From a cloned repo (development):
venv alternative:
This installs fastapi, uvicorn, and python-multipart. If startup fails with a pydantic version error, see Errors and Troubleshooting.
Starting the Server
By default the server binds to 127.0.0.1:8000. You can customize the host and port:
Interactive Documentation
Once the server is running, open your browser to:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc - OpenAPI JSON:
http://localhost:8000/openapi.json
CORS
Cross-origin requests are disabled by default. To enable CORS, set the SUMMARIZER_CORS_ORIGINS environment variable:
When using *, credentials are automatically disabled for security compliance.
Endpoints Overview
Endpoint Reference
GET /health
Returns the service health status.
GET /providers
Lists all providers configured in summarizer.yaml.
GET /prompts
Lists all available summary prompt types.
GET /config
Returns the loaded configuration with provider api_key values redacted.
POST /summarize
Summarize a video from a URL or file path.
Request body
POST /summarize/upload
Summarize an uploaded video or text file.
The source type is auto-detected from the file extension:
- Text files (
.txt,.md,.vtt,.srt,.csv,.log,.rst,.html,.xml,.json) are processed asTXT - Everything else is processed as
Local File
Override detection by sending a type form field.
POST /summarize/batch
Summarize multiple sources in a single request. Sources are processed sequentially and results are returned in input order.
Request body
Authentication
The API does not implement its own authentication layer. It is designed to run locally or behind a reverse proxy that handles authentication. If you expose it beyond localhost, place it behind a gateway (e.g., Nginx, Traefik, or a cloud API gateway) with token-based or mTLS auth.
Provider API keys are read from:
- The request body (
api_keyfield) - The provider config in
summarizer.yaml - Environment variables (e.g.,
GROQ_API_KEY)
Request Examples
Summarize a YouTube video
Summarize with custom settings
Upload and summarize a local video
Batch summarize multiple videos
List configured providers
Get redacted configuration
Response Format
All summarize endpoints return a SummarizeResponse:
On failure, success is false and error contains the message:
Validation
Request fields are strictly validated:
typemust be one of:YouTube Video,Video URL,Google Drive Video Link,Dropbox Video Link,Local File,TXToutput_formatmust be one of:markdown,json,htmltranscriptionmust be one of:Cloud Whisper,Local Whisperwhisper_modelmust be one of:tiny,base,small,medium,largechunk_size: 100 – 500,000parallel_calls: 1 – 200max_tokens: 1 – 1,000,000speed: greater than 0, up to 10batch.sources: must contain at least 1 item
Requests that include the removed audio_speed field return HTTP 422. Use speed instead. YAML configs with audio-speed or audio_speed also raise a configuration error at merge time.
Invalid values return HTTP 422 with detailed validation error messages.
Upload Limits
The /summarize/upload endpoint accepts files up to 500 MB. Larger files are rejected with HTTP 413. Files are streamed to a temporary location in 1 MB chunks to avoid loading large uploads into memory.
Security Notes
- The
/configendpoint redacts allapi_keyvalues from provider configurations. - The server binds to
127.0.0.1by default to prevent accidental exposure. - CORS is disabled by default.
- If you need to expose the API beyond localhost, use a reverse proxy with authentication.
Async Behavior
Summarization is long-running and I/O-heavy. The API runs each job in a thread pool so that the event loop remains responsive to health checks, docs, and other concurrent requests. Batch requests process sources sequentially within the same request.