Introduction
The OpenShorts API provides a RESTful interface for transforming long-form videos into viral-ready short clips. Built with FastAPI, it offers both synchronous and asynchronous endpoints for video processing, AI effects, subtitles, voice dubbing, and social media distribution.Base URL
VITE_API_URL environment variable.
Authentication
OpenShorts uses API key-based authentication via HTTP headers. Different endpoints require different API keys:Gemini API Key (Required)
Used for core video processing, AI effects, and thumbnail generation.ElevenLabs API Key (Optional)
Required only for voice dubbing features.Upload-Post API Key (Optional)
Required only for social media distribution.API keys are never stored server-side. The frontend encrypts and stores them in localStorage, sending them via headers only when needed.
Request/Response Format
All endpoints accept and return JSON unless otherwise specified (file uploads usemultipart/form-data).
Standard Response Format
Error Response Format
Rate Limits & Concurrency
The server enforces concurrency limits via theMAX_CONCURRENT_JOBS environment variable (default: 5). Additional jobs are queued and processed sequentially.
- Job Retention: 1 hour (3600 seconds)
- Max File Size: 2048 MB (2 GB)
- Concurrent Jobs: Configurable via
MAX_CONCURRENT_JOBSenv var
Job Lifecycle
Processing jobs follow this state machine:- queued - Job accepted, waiting for worker slot
- processing - Worker executing video analysis and clip extraction
- completed - All clips generated successfully
- failed - Processing error (check logs for details)
/api/status/{job_id} endpoint to poll job progress.
Core Workflow
Quick Start Example
Error Codes
| Status Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Created successfully |
| 202 | Accepted (async processing started) |
| 400 | Bad request (missing parameters or invalid input) |
| 404 | Resource not found (job_id, clip, or file) |
| 413 | Payload too large (exceeds 2GB limit) |
| 500 | Internal server error (check logs) |
SDKs & Libraries
Currently, OpenShorts provides a raw REST API. Community SDKs are welcome!Next Steps
- Process Videos - Submit videos for clip extraction
- Check Status - Poll job progress
- Apply Effects - AI-powered video enhancements
- Add Subtitles - Burn subtitles with custom styling