Score short-form videos programmatically. Upload, analyze, get results.
Sign in to generate API keys and manage credits.
Pass your API key via the X-API-Key header, or a JWT via Authorization: Bearer <token>:
curl -H "X-API-Key: gl_xxxxxxxxxxxx" https://greenlit.live/api/health
Anonymous usage (no API key or JWT) uses IP-based rate limiting at 10/day. Authenticated requests deduct 1 credit per analysis.
https://greenlit.live/api
Create a new account. Returns a JWT and 10 free credits.
curl -X POST https://greenlit.live/api/auth/signup \ -H "Content-Type: application/json" \ -d '{"email": "[email protected]", "password": "12345678"}'
{
"token": "eyJ...",
"user": { "id": 1, "email": "[email protected]", "credits": 10 }
}
Sign in with email and password. Returns a JWT (7-day expiry).
curl -X POST https://greenlit.live/api/auth/login \ -H "Content-Type: application/json" \ -d '{"email": "[email protected]", "password": "12345678"}'
{
"token": "eyJ...",
"user": { "id": 1, "email": "[email protected]", "credits": 7 }
}
Returns current user profile, credits balance, and API keys. Requires JWT.
curl https://greenlit.live/api/auth/me \ -H "Authorization: Bearer eyJ..."
{
"user": { "id": 1, "email": "[email protected]", "credits": 7 },
"keys": [{ "id": 1, "key_prefix": "gl_a1b2", "created_at": "..." }]
}
Generate a new API key linked to your account. Requires JWT. Max 3 keys per user.
curl -X POST https://greenlit.live/api/keys \ -H "Authorization: Bearer eyJ..."
{
"api_key": "gl_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"prefix": "gl_a1b2",
"message": "Save this key now — it cannot be retrieved again."
}
Upload a video file as multipart form data. Deducts 1 credit. Returns a job ID for polling.
| Parameter | Type | Description |
|---|---|---|
| videorequired | file | Video file (MP4, MOV, WebM). Max 100 MB, max 2 min. |
curl -X POST https://greenlit.live/api/analyze \ -H "X-API-Key: gl_xxxxxxxxxxxx" \ -F "video=@my_short.mp4"
{
"job_id": "abc123",
"status": "processing",
"poll_url": "/api/jobs/abc123"
}
| Header | Example | Description |
|---|---|---|
| X-Credits-Remaining | 9 | Credits left after this request |
// 402 Payment Required { "detail": "No credits remaining. Buy 100 credits for $1.", "credits": 0 }
Poll this endpoint until status is "completed" or "failed". Recommended interval: 1.5s.
curl https://greenlit.live/api/jobs/abc123 \ -H "X-API-Key: gl_xxxxxxxxxxxx"
{
"job_id": "abc123",
"status": "completed",
"progress": 100,
"result": {
"score": 73,
"dimensions": {
"technical": { "score": 8.5, "max": 10, "breakdown": {...} },
"audio": { "score": 16, "max": 20, "breakdown": {...} },
"visual": { "score": 19, "max": 30, "breakdown": {...} },
"content": { "score": 29, "max": 40, "breakdown": {...} }
},
"issues": [
{ "severity": "warning", "message": "Audio loudness below target" }
],
"transcript": { "text": "...", "language": "en" }
}
}
Returns server status. No authentication required.
{ "status": "ok" }
Each video is scored on a 0-100 scale across four weighted dimensions:
| Dimension | Weight | What's Measured |
|---|---|---|
| Technical | 10 pts | Resolution, FPS, codec, bitrate, duration, file size |
| Audio | 20 pts | LUFS loudness, true peak, silence gaps, clipping |
| Visual | 30 pts | Black/frozen frames, keyframe quality (Gemini AI) |
| Content | 40 pts | Hook clarity, pacing (WPS), narrative arc, info density (Gemini AI) |
| Method | Limit | How |
|---|---|---|
| Anonymous (web) | 3 per browser + 10/day per IP | localStorage + backend IP limit |
| Authenticated | 1 credit per analysis | Prepaid credits, atomic deduction |
When credits are exhausted, the API returns 402 Payment Required.
{
"detail": "File too large: 150.0MB (max 100MB)"
}
| Status | Meaning | Common Cause |
|---|---|---|
| 400 | Bad Request | Invalid file type, too large, too long |
| 401 | Unauthorized | Missing or invalid API key / JWT |
| 402 | Payment Required | No credits remaining |
| 404 | Not Found | Job ID doesn't exist |
| 409 | Conflict | Email already registered / max keys |
| 429 | Rate Limited | IP rate limit (anonymous) |
| 500 | Server Error | Pipeline failure (check job status) |