Quick Start
Authenticate with your API key and make your first API call in a few minutes.
Base URL
All API requests are made over HTTPS against:
https://litvideo-api.litmedia.ai
Every endpoint is served under the /v1/ prefix. Status endpoints use GET; creation endpoints use POST with a JSON body.
Common headers
| Header | Value | Required | Description |
|---|---|---|---|
| Authorization | string | Required | Your API key, formatted as Bearer <API_KEY>. |
| Content-Type | string | Required for POST | Always application/json. |
| Lang | string | Optional | Language for model descriptions and error messages. Defaults to EN. |
Authentication
The Open API authenticates every request with a bearer token. Create an API key in the API Portal, then send it on each call:
Authorization: Bearer lvsk-xxxxxxxxxxxxxxxx
Requests with a missing or invalid key are rejected before routing:
{
"code": 10001,
"msg": "auth error",
"data": null
}
Treat API keys like passwords. Keep them server-side and rotate them from the API Portal if a key leaks.
Your first request
There is no Models API. Pick a static model code from the Models page — e.g. "litai-5" for video — and send it directly to a generation endpoint:
curl -X POST "https://litvideo-api.litmedia.ai/v1/videos" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer lvsk-xxxxxxxxxxxxxxxx" \
-d '{
"model": "litai-5",
"prompt": "A neon-lit city street at night, cinematic drone shot",
"duration": 5,
"quality": "720p",
"ratio": "16:9"
}'
A successful response returns the unique task_id used for polling (tsk_ + 32 random hex characters):
{
"code": 200,
"msg": "success",
"data": {
"task_id": "tsk_9f2c8a17b34d6e05a1c2d3e4f5067890"
}
}
Response envelope
Every endpoint returns the same JSON envelope:
| Field | Type | Description |
|---|---|---|
| code | int | 200 means success. Any other value is an error. |
| msg | string | "success" on success, otherwise a human-readable error message. |
| data | object | array | Payload. Shape depends on the endpoint. |
Some numeric fields are delivered as strings (e.g. "is_hot": "1"). Normalize with Number(x) before comparing.