Domainless Streaming API

Self-hosted video streaming infrastructure. Upload, transcode, and deliver HLS video at any scale.

https://api.stream.domainless.fun/api

Authentication

JWT Bearer Token

Register or log in to receive a JWT token. Include it in requests:

Authorization: Bearer <token>

API Key

Generate API keys from your dashboard. Use for server-to-server integration:

X-API-Key: <your-api-key>

Video endpoints accept either JWT or API Key authentication.

Auth

POST /auth/register Public
Create a new account.
Request Body
{ "email": "you@example.com", "password": "...", "companyName": "Acme Inc" }
Response
{ "token": "eyJ...", "user": { "id": 1, "email": "...", "companyName": "..." } }
POST /auth/login Public
Log in with existing credentials.
Request Body
{ "email": "you@example.com", "password": "..." }
Response
{ "token": "eyJ...", "user": { "id": 1, "email": "...", "companyName": "..." } }
GET /auth/me JWT
Get the current authenticated user.
Response
{ "user": { "id": 1, "email": "...", "companyName": "..." } }

Videos

POST /videos/upload JWT / API Key
Upload a video file. Transcoding to HLS begins automatically.
Request
Content-Type: multipart/form-data

file: (binary)
title: "My Video"
description: "Optional description"
Response
{
  "video": {
    "id": "a1b2c3...",
    "title": "My Video",
    "status": "processing",
    "created_at": "2026-04-08T..."
  }
}
Status Values

uploadingprocessingready or error

GET /videos JWT / API Key
List your uploaded videos.
Query Params
?page=0&limit=20  (max limit: 100)
Response
{ "videos": [...], "page": 0, "limit": 20 }
GET /videos/:id JWT / API Key
Get a single video's details including transcode status and view count.
Response
{
  "video": {
    "id": "a1b2c3...",
    "title": "My Video",
    "status": "ready",
    "view_count": 42,
    "duration_seconds": 180.5,
    "qualities": ["360p", "720p", "1080p"]
  }
}
DELETE /videos/:id JWT / API Key
Delete a video and all its transcoded files.
Response
{ "ok": true }

Streaming

GET /stream/:id/manifest Public
Get the HLS master playlist for a video. Redirects to the .m3u8 file.
Usage with HLS.js
const hls = new Hls();
hls.loadSource('https://api.stream.domainless.fun/api/stream/VIDEO_ID/manifest');
hls.attachMedia(videoElement);
GET /stream/:id/embed Public
Returns a self-contained HTML page with an HLS video player. Use in an iframe.
Embed Code
<iframe src="https://api.stream.domainless.fun/api/stream/VIDEO_ID/embed"
  width="640" height="360" frameborder="0" allowfullscreen></iframe>
GET /stream/:id/thumbnail Public
Get the auto-generated thumbnail for a video.
POST /stream/:id/view Public
Log a view for analytics. Fire-and-forget beacon endpoint. Returns 204.

API Keys

POST /keys JWT
Generate a new API key. The key is returned once — store it securely.
Request Body
{ "name": "Production Server" }
Response
{ "id": 1, "key": "sk_live_...", "name": "Production Server", "createdAt": "..." }
GET /keys JWT
List your API keys (key values are masked).
Response
{ "keys": [{ "id": 1, "name": "Production Server", "prefix": "sk_live_a1b2", "createdAt": "..." }] }
DELETE /keys/:id JWT
Revoke an API key permanently.

Usage & Analytics

GET /usage/summary JWT
Get aggregate usage stats for the last 30 days.
Query Params
?days=30
Response
{ "views": 1234, "bandwidth": 5678901234, "videoCount": 12 }
GET /usage/daily JWT
Get daily breakdown of views and bandwidth.
Response
{ "days": [{ "date": "2026-04-08", "views": 50, "bandwidth": 123456789 }, ...] }
GET /usage/videos JWT
Get top videos ranked by view count.
Query Params
?days=30&limit=10