Live Streams API Beta
Let your users watch Titli hosts who are live right now, from inside your own app. You do not run hosts, wallets or payouts: your app joins with your App Key, plays the live in viewer mode, and we bill your prepaid balance per second of viewing.
Beta, available on request. Live Streams is off for every account until we switch it on, and it is rolled out account by account. Ask support (console → Support) to enable it. This page covers live video only; audio rooms are not offered yet.
Your user watches, chats and sends gifts; the host sees them in her normal live viewer list. Your app joins a live with your App Key (no backend needed) and plays it with any of our SDKs in viewer mode, and we bill your prepaid balance per second of viewing, plus the gifts your users send. A server with your API key is optional, for production hardening.
Set in your dashboard vs. set in code
| Setting | Where |
|---|---|
| App Key, its bindings (package name, bundle ID, website, signing certificate) and Quick-mode caps | Dashboard: Console → Projects → Quick mode |
| Live Streams on for your account | Ask support (console → Support) |
| Pause Live Streams, gifts off in live streams, a lower viewer limit | Dashboard: Console → Live streams → Settings |
| Gifts on or off, gift markup and per-gift prices | Dashboard: Console → Gifts (or the server-only gifts settings routes) |
| Daily spend cap of a project | Dashboard: Console → Projects |
| Who watches (user id, display name) | Code: init / setUser in the app, or end_user_id and name when your server joins |
| Webhook URL and secret | Dashboard: Console → Projects |
Quick mode: watch a live with only your App Key
No backend needed. Your app lists the lives, joins one, plays it, chats, sends gifts and reports with the same App Key it uses for calls.
- Get your App Key. In the console, open Projects → Quick mode and add your app's package name, bundle ID or website. Your App Key is shown there. Live Streams must also be switched on for your account (see the note above).
- Install the package for your platform, from its public registry (see the Client API (Quick mode)).
- Init with the App Key, then list and watch. That is all: no server, no tokens.
// Once, at app start: your App Key and your own user id. No server needed.
await TitliVideo.init(appKey: 'tak_…', userId: 'user-42', userName: 'Asha');
// Lives on air now
final lives = await TitliVideo.liveStreams.list();
final ref = lives['data'][0]['stream_ref'];
// Join and play in viewer mode (no camera or microphone prompt). The gift sheet works without a handler.
final call = await TitliVideo.liveStreams.watch(ref, onLiveEvent: (e) => debugPrint(e.type));
await Navigator.of(context).push(MaterialPageRoute(builder: (_) => TitliCallScreen(call: call)));
// Chat, gifts and report from the app
await TitliVideo.liveStreams.comment(ref, 'Hello!');
await TitliVideo.liveStreams.sendGift(ref, 'g_rose', count: 1);
await TitliVideo.liveStreams.report(ref, 'abuse');// titli-call.js from npm (titli-video-sdk) defines TitliVideo
TitliVideo.init({ appKey: 'tak_…', userId: 'user-42', userName: 'Asha' });
const { data } = await TitliVideo.liveStreams.list();
const ref = data[0].stream_ref;
// Join and play into a container; closing the viewer also leaves the live
const session = await TitliVideo.liveStreams.watch(ref, { container: '#stage', onLiveEvent: (e) => console.log(e.type, e) });
// Read and post chat, send a gift, report
const chat = await TitliVideo.liveStreams.comments(ref); // { cursor, data: [...] }
await TitliVideo.liveStreams.comment(ref, 'Hello!');
await TitliVideo.liveStreams.sendGift(ref, 'g_rose', 1);
await TitliVideo.liveStreams.report(ref, 'abuse');
await TitliVideo.liveStreams.leave(ref); // when your user closes the screenIn the app (TitliVideo.liveStreams) | What it does |
|---|---|
list() | The lives on air now. |
watch(ref) | Joins the live for the signed-in user and plays it in viewer mode. Leaving the screen closes the viewer session and its billing. |
token(ref) | A fresh 10-minute viewer token for an open session (watch renews for you). |
leave(ref) | Ends the viewer session and its billing at once. |
comments(ref), comment(ref, text) | Read the chat (pass the previous cursor as after) and post a message. |
sendGift(ref, giftId, count) | Sends a gift to the host. The gift list is TitliVideo.gifts.list(); see Gifts in Quick mode. |
report(ref, reason) | Reports the live to moderation. |
Each one calls the matching route below under /v1/client/live-streams with the App Key; the parameters and answers are the same as in the REST reference, the end user is always the signed-in user, and your private money figures (your cost, rates, what you keep) are left out. Viewing and gifts are billed to your prepaid balance exactly as with a server, and your Quick-mode caps (console → Projects → Quick mode) limit how much one app can spend.
Stays on your server only: your rates and free minutes (GET /v1/live-streams/pricing), stats (GET /v1/live-streams/stats) and viewer receipts (GET /v1/live-streams/viewers/:viewer_id/receipt). They carry your prices and costs, which an app must never see, so the App Key cannot reach them. Read them in the console, or with a project key from a server when you add one.
Concepts
| Term | Meaning |
|---|---|
| Live stream | A Titli host's live video that is on air now. Only free, public lives are offered. |
stream_ref | Opaque, stable ID of one live for your account. Another account gets a different ref for the same live. It stops resolving when the live ends. |
host_ref | Opaque ID of the host for your account (the same reference as in Live Hosts). |
| End user | Your user who watches, identified by your stable end_user_id. name is what the host sees in her viewer list and chat (default "Guest"). |
| Viewer session | One end user watching one stream, from join to leave. A renewed token keeps the session. |
| Room | The media room your app joins with livekit_url + token. The host appears as the participant ls_host. Other viewers are hidden. |
Privacy: you never receive a host's phone number, Titli user ID or any contact detail. The host never sees your company name, only the display name you send. Viewers from other apps watching the same live never see your users, and you never see theirs.
Production hardening (optional): server tokens
You do not need a server to start: Quick mode works with the App Key alone. Add a server when you want strict control over every call (who joins which call, for how long, in which role): keep the project key on your server and mint a short-lived join token per person there. The app uses the same SDK and hands it a token instead of the App Key. Both ways can run side by side.
The steps below do the same as Quick mode from your server, so the key and every decision stay with you.
With a server: list lives and join as a viewer
Base URL https://api-videosdk.titliapp.com. Auth is the same as the rest of /v1: HTTP Basic key_id:key_secret, server to server only (see Authentication).
1. List the lives on air (your server)
curl -s "$API/v1/live-streams?type=video" -u "$KEY_ID:$KEY_SECRET"2. Join one for your end user (your server)
Never put the key secret in the app.
curl -s $API/v1/live-streams/$STREAM_REF/join -u "$KEY_ID:$KEY_SECRET" -H 'Content-Type: application/json' \
-d '{"end_user_id":"user_123","name":"Rahul"}'The answer (201) carries livekit_url, token (valid 10 minutes) and room. Send livekit_url and token to your app.
3. Play it in the app
Use the SDK you already use. A viewer token puts the SDK in viewer mode: no camera or microphone prompt, the host's video full screen, chat and gifts as events. See SDK snippets.
4. Renew the token, then leave
Renew every few minutes while your user watches (POST …/token), and call POST …/leave when they close the screen. A user who just disappears is closed for you within about 30 seconds.
5. Listen for webhooks
stream.started, stream.ended, viewer.kicked, viewer.ended, gift.sent and gift.failed (below).
SDK snippets: viewer mode with a server token
No separate SDK or build is needed. The token decides the mode: a viewer token is subscribe-only, so the SDK never asks for the camera or microphone. In the snippets, r is your own backend's answer carrying livekitUrl and token from the join call.
<!-- titli-call.js is the browser helper from npm (titli-video-sdk); it opens the viewer screen: no camera or microphone prompt -->
<script src="https://cdn.jsdelivr.net/npm/livekit-client@2.15.6/dist/livekit-client.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/titli-video-sdk@0.2.0/titli-call.js"></script>
<div id="stage" style="height:80vh"></div>
<script type="module">
const r = await fetch('/api/watch', { method: 'POST', body: JSON.stringify({ streamRef }) }).then((x) => x.json());
const session = await TitliCall.join(r.livekitUrl, r.token, {
container: '#stage',
onLiveEvent: (e) => console.log(e.type, e), // chat, gift, host_away, host_back, viewers, ended, kicked
onDisconnected: ({ reason }) => console.log('left', reason),
});
</script>import { TitliCall, TitliCallScreen } from 'titli-video-sdk-react-native';
<TitliCallScreen url={r.livekitUrl} token={r.token} onLiveEvent={(e) => console.log(e.type, e)} />
// Or the core API
await TitliCall.join(r.livekitUrl, r.token);// pubspec.yaml: titli_video_sdk. A viewer token joins in viewer mode.
final r = await myBackend.post('/api/watch', {'streamRef': streamRef});
final call = await TitliCall.connect(url: r['livekitUrl'], token: r['token'],
onLiveEvent: (e) => debugPrint('${e.type}'));
await Navigator.of(context).push(MaterialPageRoute(
builder: (_) => TitliCallScreen(call: call),
));// Prebuilt: no permission screen for a viewer token
TitliCallScreen(url = r.livekitUrl, token = r.token, onClose = { finish() })
// Or the core API
val call = TitliCall.join(context, r.livekitUrl, r.token, TitliCallOptions(),
object : TitliCallListener {
override fun onLiveEvent(event: TitliLiveEvent) { /* Chat, Gift, HostAway, HostBack, Viewers, Ended, Kicked */ }
})// Prebuilt view: no permission prompt for a viewer token
TitliCallView(url: r.livekitUrl, token: r.token, onEnded: { _ in dismiss() },
onLiveEvent: { event in print(event.type) })
// Or the core API
let call = try await TitliCall.join(url: r.livekitUrl, token: r.token)
call.onLiveEvent = { event in /* .chat, .gift, .hostAway, .hostBack, .viewers, .ended, .kicked */ }The console has the same snippets with your API base filled in, under Live streams → Quickstart.
REST reference
Errors use the usual shape {"error":{"code","message"}}. Money is in your billing currency (INR or USD), in major units.
These are the server routes (HTTP Basic with a project key). Your app reaches the same routes with the App Key under /v1/client/live-streams, with the same parameters, except pricing, stats and receipts, which stay server-only. Every parameter of every route is in the tables.
List lives
/v1/live-streamsQuery: type (video; audio and all are reserved for audio rooms, which come later), limit (1–100, default 50).
| Parameter | Type | Required | Default | Allowed values | What it means | Example |
|---|---|---|---|---|---|---|
type | string | optional (query) | all | video, audio, all | Which lives to list. Audio rooms are not offered yet, so today only video lives come back. | video |
limit | integer | optional (query) | 50 | 1–100 (a bigger number is treated as 100) | How many lives to return at most. | 20 |
| Field | Type | What it means |
|---|---|---|
data | array | The lives on air: stream_ref, type, title, viewers, started_at, host { host_ref, name, photo_url, age, languages }. |
paused | boolean | true while Live Streams is paused (the list is then empty). |
type | string or null | The type filter that was used (null = all). |
{ "data": [ { "stream_ref": "ls_8fK2…", "type": "video", "title": "Good evening!", "viewers": 41,
"started_at": "2026-11-27T14:02:11Z",
"host": { "host_ref": "h_3Qe…", "name": "Riya", "photo_url": "https://…", "age": 24, "languages": ["hi", "en"] } } ],
"paused": false, "type": "video" }viewers counts everyone watching (Titli viewers and partner viewers). paused: true means Live Streams is paused right now (by us or by Titli) and the list is empty.
Join as a viewer
/v1/live-streams/:stream_ref/joinBody: end_user_id (required, your stable ID, max 128 of A-Z a-z 0-9 _ . : @ -), name (optional, max 40).
| Parameter | Type | Required | Default | Allowed values | What it means | Example |
|---|---|---|---|---|---|---|
ref | string | required (in the path) | – | 4–64 of <code>A-Z a-z 0-9 _ -</code> | The stream_ref of the live, from the list. | ls_8fK2a9 |
end_user_id | string | required | – | 1–128 of <code>A-Z a-z 0-9 _ . : @ -</code> | Your stable ID for the person watching. In Quick mode the SDK fills it with the signed-in user (it must be that user). | user_123 |
name | string | optional | Guest | up to 40 characters; control characters and <code>< ></code> are removed | The name the host sees in her viewer list and chat. In Quick mode the SDK sends the user name you gave to init. | Rahul |
| Field | Type | What it means |
|---|---|---|
viewer_id | string | ID of the viewer session (the same one while it stays open). |
token | string | Viewer token for the room, valid 10 minutes. Subscribe-only: no camera or microphone. |
livekit_url | string | The media server URL to connect to. |
room | string | The room name. |
identity | string | This viewer's identity in the room. |
expires_at | string (ISO time) | When the token stops working. Renew it before then. |
stream | object | stream_ref, status (waiting or live), type, title, host { host_ref, name, photo_url }. |
gifts | object | enabled and version of the gift list: show a gift button, refresh a cached list. |
{ "viewer_id": "6b0c…", "token": "eyJ…", "livekit_url": "wss://…", "room": "ls_…", "identity": "lv_…",
"expires_at": "2026-11-27T14:12:11Z",
"stream": { "stream_ref": "ls_8fK2…", "status": "live", "type": "video", "title": "…",
"host": { "host_ref": "…", "name": "Riya", "photo_url": "…" } } }stream.statusiswaitingfor a moment after the first viewer joins a live (we are connecting to it), thenlive.- Joining again with the same
end_user_idwhile the session is open returns the sameviewer_idand a fresh token. - Refused when: the account is not enabled, a kill switch is on, a limit is reached, the balance is zero (unless you have free minutes left), the end user was kicked from this live or blocked by this host, or the live is gone. See Errors.
Renew a token
/v1/live-streams/:stream_ref/tokenBody: end_user_id. A fresh 10-minute token for an open session (same answer as join). 403 not_viewer if the session has ended.
| Parameter | Type | Required | Default | Allowed values | What it means | Example |
|---|---|---|---|---|---|---|
ref | string | required (in the path) | – | 4–64 of <code>A-Z a-z 0-9 _ -</code> | The stream_ref of the live, from the list. | ls_8fK2a9 |
end_user_id | string | required | – | 1–128 of <code>A-Z a-z 0-9 _ . : @ -</code> | Your stable ID for the person watching. In Quick mode the SDK fills it with the signed-in user (it must be that user). | user_123 |
| Field | Type | What it means |
|---|---|---|
viewer_id | string | ID of the viewer session (the same one while it stays open). |
token | string | Viewer token for the room, valid 10 minutes. Subscribe-only: no camera or microphone. |
livekit_url | string | The media server URL to connect to. |
room | string | The room name. |
identity | string | This viewer's identity in the room. |
expires_at | string (ISO time) | When the token stops working. Renew it before then. |
stream | object | stream_ref, status (waiting or live), type, title, host { host_ref, name, photo_url }. |
Leave
/v1/live-streams/:stream_ref/leaveBody: end_user_id. Ends the session and its billing at once. Answer: { "ok": true, "viewer": {…} } (viewer is null if there was no open session).
| Parameter | Type | Required | Default | Allowed values | What it means | Example |
|---|---|---|---|---|---|---|
ref | string | required (in the path) | – | 4–64 of <code>A-Z a-z 0-9 _ -</code> | The stream_ref of the live, from the list. | ls_8fK2a9 |
end_user_id | string | required | – | 1–128 of <code>A-Z a-z 0-9 _ . : @ -</code> | Your stable ID for the person watching. In Quick mode the SDK fills it with the signed-in user (it must be that user). | user_123 |
| Field | Type | What it means |
|---|---|---|
ok | boolean | Always true. |
viewer | object or null | The ended viewer session (id, status, joined_at, left_at, billed_seconds, end_reason, …), or null if none was open. |
Report a live
/v1/live-streams/:stream_ref/reportBody: end_user_id, reason (max 60, e.g. nudity, abuse, minor, spam, other), details (optional, max 1000). It lands in Titli's moderation queue. Answer: { "ok": true }.
| Parameter | Type | Required | Default | Allowed values | What it means | Example |
|---|---|---|---|---|---|---|
ref | string | required (in the path) | – | 4–64 of <code>A-Z a-z 0-9 _ -</code> | The stream_ref of the live, from the list. | ls_8fK2a9 |
end_user_id | string | required | – | 1–128 of <code>A-Z a-z 0-9 _ . : @ -</code> | Your stable ID for the person watching. In Quick mode the SDK fills it with the signed-in user (it must be that user). | user_123 |
reason | string | required | – | up to 60 characters, for example <code>nudity</code>, <code>abuse</code>, <code>minor</code>, <code>spam</code>, <code>other</code> | Why the user reports this live. | abuse |
details | string | optional | empty | up to 1000 characters | More words from your user. | Rude language in chat |
| Field | Type | What it means |
|---|---|---|
ok | boolean | Always true: the report is in the moderation queue. |
Stats
/v1/live-streams/statsQuery: group (day, stream, end_user, tier), from, to (ISO, default the last 30 days), limit, format=csv.
| Parameter | Type | Required | Default | Allowed values | What it means | Example |
|---|---|---|---|---|---|---|
group | string | optional (query) | day | day, stream, end_user, tier | What one row adds up. | stream |
from | string (ISO time) | optional (query) | to minus 30 days | ISO 8601 time, before <code>to</code> | Start of the window. | 2026-11-01T00:00:00Z |
to | string (ISO time) | optional (query) | now | ISO 8601 time | End of the window. | 2026-11-30T00:00:00Z |
limit | integer | optional (query) | 100 | 1–1000 | How many rows at most. | 50 |
format | string | optional (query) | JSON | csv | Send csv for a CSV file with field-name headers. | csv |
| Field | Type | What it means |
|---|---|---|
group, from, to | string | What you asked for. |
data | array | One row per key: key, viewers, sessions, minutes, free_seconds, view_spend, gifts, gift_spend, stream_fee, spend, last_at (and streams, peak_viewers for day and stream). |
totals | object | The rows added up, plus viewers and peak_viewers. |
currency, timezone | string | Your billing currency and time zone. |
Per row: viewers, sessions, minutes, free_seconds, view_spend, gifts, gift_spend, stream_fee, spend, last_at (and streams, peak_viewers for day and stream). totals add up the rows. The console downloads the same as CSV.
Comments
Read the chat
/v1/live-streams/:stream_ref/commentsQuery: after (the cursor from the previous answer). The first call (no after) returns the recent chat (about the last 30 items). Poll at most once a second; your app gets the same items live as data messages.
| Parameter | Type | Required | Default | Allowed values | What it means | Example |
|---|---|---|---|---|---|---|
ref | string | required (in the path) | – | 4–64 of <code>A-Z a-z 0-9 _ -</code> | The stream_ref of the live, from the list. | ls_8fK2a9 |
after | string | optional (query) | none (the recent chat) | up to 200 characters: the <code>cursor</code> of the previous answer | Return only what came after this point. | c_19f2 |
| Field | Type | What it means |
|---|---|---|
status | string | The live's state, for example live. |
end_reason | string or null | Why the live ended, once it has. |
viewers | integer | Everyone watching now. |
host_away | boolean | The host's video is paused. |
cursor | string | Pass it as after next time. |
data | array | Chat and gift items: type, id, at, from { name, role, end_user_id }, text or gift. |
{ "status": "live", "end_reason": null, "viewers": 41, "host_away": false, "cursor": "…",
"data": [ { "type": "chat", "id": "m1", "at": "…", "from": { "name": "Riya", "role": "host" }, "text": "Hi all" },
{ "type": "gift", "id": "g1", "at": "…", "from": { "name": "Rahul", "role": "partner", "end_user_id": "user_123" },
"gift": { "gift_id": "g_rose", "name": "Rose", "icon_url": "…", "count": 1 } } ] }from.role is host, viewer (a Titli viewer) or partner (a viewer from a partner app). from.end_user_id is present only for your own end users.
Send a comment
/v1/live-streams/:stream_ref/commentsBody: end_user_id, text (1–200 characters), client_id (optional, your message ID). Answer: 201 { "message_id" }.
| Parameter | Type | Required | Default | Allowed values | What it means | Example |
|---|---|---|---|---|---|---|
ref | string | required (in the path) | – | 4–64 of <code>A-Z a-z 0-9 _ -</code> | The stream_ref of the live, from the list. | ls_8fK2a9 |
end_user_id | string | required | – | 1–128 of <code>A-Z a-z 0-9 _ . : @ -</code> | Your stable ID for the person watching. In Quick mode the SDK fills it with the signed-in user (it must be that user). | user_123 |
text | string | required | – | 1–200 characters (control characters are removed) | The chat message. | Hello! |
client_id | string | optional | a new UUID | up to 64 characters | Your own ID for the message. | m-1042 |
| Field | Type | What it means |
|---|---|---|
message_id | string or null | ID of the posted message. |
The end user must be watching (403 not_viewer otherwise). Titli's chat filter, mutes and rate limits apply: 403 muted, 429 rate_limited.
Gifts
Viewers can send gifts to the host while they watch. Live Streams uses the same gift catalog, the same prices and the same send rules as Live Hosts calls. This is the short version; the gift list, your own prices, hiding gifts, stats and every error are in the Gifts API reference.
Gift list
/v1/giftsYour gift list: { "enabled", "reason", "currency", "version", "max_count", "gifts": [ { "gift_id", "name", "icon_url", "animation_url", "category", "cost", "price", "you_keep", "min_price", "max_price", "hidden", "currency" } ] }. cost is what one gift costs you, price is what you charge your user, and min_price is the gift list price: your price cannot be below it. GET /v1/live-streams/gifts still answers as an alias.
The same list from the Live Streams path (an alias, which also follows the Live streams gift switch):
| Parameter | Type | Required | Default | Allowed values | What it means | Example |
|---|---|---|---|---|---|---|
| No parameters. | ||||||
| Field | Type | What it means |
|---|---|---|
enabled | boolean | Whether gifts can be sent now. |
reason | string or null | off_by_you or not_available when gifts are off, otherwise null. |
currency | string | Your billing currency. |
max_count | integer | The most gifts one send may carry. |
version | string or null | Changes whenever the list or one of your prices changes: your cache key. |
gifts | array | The gifts: gift_id, name, icon_url, animation_url, category, price, hidden, currency, and in server answers also cost, you_keep, min_price, max_price, price_source, price_needs_review. |
data | array | The same list again (kept for older clients). |
Send a gift
/v1/live-streams/:stream_ref/giftsBody: end_user_id, gift_id, count (1 to max_count, 99 by default; default 1), client_request_id (required, your unique ID for this gift, max 64 of A-Z a-z 0-9 _ . : -), expected_price (the price of one gift in your list; optional, but always send it).
| Parameter | Type | Required | Default | Allowed values | What it means | Example |
|---|---|---|---|---|---|---|
ref | string | required (in the path) | – | 4–64 of <code>A-Z a-z 0-9 _ -</code> | The stream_ref of the live, from the list. | ls_8fK2a9 |
end_user_id | string | required | – | 1–128 of <code>A-Z a-z 0-9 _ . : @ -</code> | Your stable ID for the person watching. In Quick mode the SDK fills it with the signed-in user (it must be that user). | user_123 |
gift_id | string | required | – | 1–80 of <code>A-Z a-z 0-9 _ -</code>, an ID from the gift list | Which gift to send. | g_rose |
count | integer | optional | 1 | 1 to <code>max_count</code> of the gift list (99 unless set otherwise for your account) | How many of this gift to send in one go. | 1 |
client_request_id | string | required | – | 1–64 of <code>A-Z a-z 0-9 _ . : -</code> | Your unique ID for this gift. Repeating it never charges twice. The SDKs make one for you. | 8f1c2f0e-6a5b-4d0e-9a51-0c1e6f4f2b7d |
expected_price | number | optional | – | above 0, in your billing currency | The price of one gift you showed your user. If it is not the current price, nothing is sent (409 gift_price_changed). Always send it. | 15 |
| Field | Type | What it means |
|---|---|---|
id | string | ID of the send. |
object | string | Always gift. |
status | string | sent, pending or refused. |
surface | string | call (a Live Hosts call) or stream (a live stream). |
gift_id, name, count | string, string, integer | The gift and how many. |
end_user_id | string | Who sent it. |
call_id | string | The Live Hosts call it was sent in (surface call only). |
stream_ref, stream_id | string | The live it was sent in (surface stream only). |
host | object | host_ref and name of the host who got it. |
cost, unit_cost | number | Your cost for the send and for one gift (server answers only; left out in Quick mode). |
price, unit_price, you_keep | number | Your price for the send and for one gift, and what stays with you (you_keep is left out in Quick mode). |
currency | string | INR or USD. |
client_request_id | string | Your ID for this gift, as sent. |
error | string or null | The refusal code of a refused gift, otherwise null. |
created_at, decided_at | string (ISO time) | When it was asked for and when it was decided. |
replay | boolean | true when this answers a repeat of an earlier client_request_id. |
balance | number | Your balance after the send (server answers only). |
receipt, receipt_signature | object, string | The signed receipt of a sent gift. |
{ "id": "…", "object": "gift", "status": "sent", "surface": "stream", "gift_id": "g_rose", "name": "Rose", "count": 1,
"end_user_id": "user_123", "stream_ref": "ls_8fK2…", "host": { "host_ref": "h_3Qe…", "name": "Riya" },
"cost": …, "price": …, "you_keep": …, "currency": "INR", "client_request_id": "8f1c…", "replay": false, "balance": …,
"receipt": { … }, "receipt_signature": "…" }- The gift's cost is debited from your balance before the gift is sent. If it cannot be delivered (the user was kicked, the live ended, the gift is no longer offered) you get the error with
"refunded": trueand the amount goes back to your balance at once. - You collect your own
pricefrom your user in your app; we bill only thecost. With a server, take the price from your own gift list there, never from the app. - Every sent gift carries a signed
receiptandreceipt_signature.
Idempotency
client_request_id makes a gift safe to retry. Sending the same client_request_id again returns the first result with "replay": true and never charges twice. Reusing it for a different gift is 409 gift_idempotency_conflict.
| HTTP | Meaning |
|---|---|
201 | Sent. |
200 | Replay of an earlier request with the same client_request_id ("replay": true). |
202 | "status": "pending": the gift is not confirmed yet. We keep asking, and the amount stays held until the gift is confirmed (webhook gift.sent) or definitely refused (webhook gift.failed with "refunded": true, the amount goes back to your balance). Nothing is refunded just because time passed. |
Retrying with the same client_request_id is always safe. Generate it once per gift in your app (a UUID is fine) and reuse it for every retry of that gift. After a timeout, a 429 or a 5xx without "refunded": true, keep your user’s payment and repeat the request with the same ID; give the money back only when the answer has "refunded": true, is a 4xx refusal, or gift.failed arrives.
Kick, block and mute
Hosts can kick, block and mute your users exactly as they do Titli viewers.
- Kick: the host removes the end user from this live. The app gets the
kickeddata message (reason: "kicked") and is removed from the room; the session ends with end reasonkicked; you get theviewer.kickedwebhook withaction: "kick". Joining the same live again is refused with403 kicked. - Block: the same, with
reason: "blocked", end reasonblockedandaction: "block". Joins to this host's lives are refused with403 blocked. - Mute: the end user keeps watching but cannot chat. Only that end user gets
muted/unmuted; a comment sent while muted is403 muted. - A gift sent after a kick is refused and refunded (
"refunded": true).
Respect kicked and blocked in your app: close the viewer screen and do not offer that live again to that user.
Pause and kill switch
Live Streams can be switched off at once, for everyone or for one account, by us or by Titli.
- New joins are refused:
503 kill_switch(switched off for everyone or for your account),503 partner_paused(Titli has paused Live Streams for now) or403 calls_disabled(new sessions are switched off for your account). - Open sessions end with end reason
kill_switch. The app gets theendeddata message and the room closes; viewing is billed only up to that moment. - The list answers
"paused": truewith an emptydatawhile Live Streams is paused.
Treat these as temporary: hide the live section while paused is true and retry later. Do not retry a 503 in a tight loop.
Data messages in the app
The SDKs deliver these as live events (onLiveEvent). With raw LiveKit, they are reliable data messages on topic titli.live, JSON:
type | Fields | Meaning |
|---|---|---|
chat | id, at, from{name, role, end_user_id?}, text | A chat message in the live |
gift | id, at, from{…}, gift{gift_id, name, icon_url, count} | A gift in the live (from anyone) |
host_away / host_back | The host's video paused / came back (viewing is not billed while she is away) | |
viewers | count | Total viewers, at most every 5 seconds |
muted / unmuted | Sent only to the end user the host muted / unmuted | |
kicked | reason (kicked or blocked) | Sent only to that end user, who is then removed from the room |
ended | reason | The live is over; the room closes |
Your app only receives your own end users' details; viewers from other apps appear as plain names.
Webhooks
Delivered to your project's webhook URL with the usual Titli-Signature: t=…,v1=… header. Verification, retries and replay work as for every other event: see Webhooks.
| Event | Payload | When |
|---|---|---|
stream.started | { stream } | The first of your viewers' live started playing (media is flowing). |
stream.ended | { stream } with stream.end_reason, peak_viewers and the stream fee if you have one | The live ended, or stopped being offered. |
viewer.kicked | { viewer, action: "kick"|"block", receipt, receipt_signature } | A host kicked or blocked one of your end users. |
viewer.ended | { viewer, receipt, receipt_signature } with viewer.end_reason and end_code | We ended a viewer's session ourselves: your balance ran out (balance_zero) or Live Streams was switched off for your account (kill_switch). Sessions your user ends, or the host ends, send no webhook. |
gift.sent | { gift, receipt, receipt_signature } | A gift was sent (including one that was pending). |
gift.failed | { gift, refunded: true } | A gift that was pending was refused. The amount is back in your balance: give your user the money back. |
balance.low, balance.zero | As for calls (see Webhooks) | Your prepaid balance is running low, or is used up. |
Billing and receipts
Default prices. Your own price card is in your console (Live streams) and in the pricing endpoint below.
| Quality | Per viewer-minute | Per 1,000 minutes | USD accounts, per 1,000 minutes |
|---|---|---|---|
| Audio room | ₹0.03 | ₹30 | $0.32 |
| SD video (up to 480p) | ₹0.06 | ₹60 | $0.65 |
| HD video (720p) | ₹0.12 | ₹120 | $1.30 |
| Full HD video (1080p) | ₹0.27 | ₹270 | $2.92 |
- 10,000 free viewer-minutes every month, used before any paid minute.
- Volume discounts on every quality, by your viewer-minutes in the month: 10% off from 1,00,000, 20% off from 10,00,000, 30% off from 50,00,000.
- Gifts: each gift has a cost to you, shown in your console and the API. You set your price and you keep the difference (see Gifts).
- No setup fee, no monthly minimum, no stream fee.
Example: 100 viewers watching for one hour in SD cost 100 × 60 × ₹0.06 = ₹360.
Viewer minutes
- Viewing is billed at your viewer-minute rate, after your free minutes and volume tiers, per second for each viewer.
- Quality tiers:
audio(audio rooms),sd(video up to 480p),hd(720p),fhd(1080p). Video is delivered today as one mobile-friendly layer, billed assd;price_card.billed_tierin the pricing endpoint says which tier applies now. A viewer session keeps the tier and rate it started with. - Billing runs only while the viewer is in the room and the host's video is flowing. A viewer still connecting, a host who stepped away, and a token that is never used cost nothing.
- Your balance is debited live every 5 seconds. When it cannot pay for the next few seconds of all your viewers, their sessions end (
balance_zero); the balance never goes below zero. - A viewer can join with zero balance while you have at least one free minute left.
Stream fee (optional)
Off by default. Accounts that want a predictable bill can have a flat rate per stream-minute while at least one of their viewers watches that stream. If it is on for you, the rate is shown in your console.
Gifts
Each gift has a cost to you, shown in your console and in GET /v1/gifts (cost). It is debited when the gift is sent, and refunded automatically if the gift cannot be delivered. A pending gift stays debited until it is confirmed or refused. You set your own price for your users (it cannot be below the gift list price) and you keep the difference. See Gifts: billing.
Volume discounts and free minutes
Volume discounts are a percentage off every quality once your viewer-minutes in the month pass a threshold (all your viewers together, free minutes included). Monthly free minutes are used first, then any granted free minutes.
Your own switches
In the console (Live streams, Settings) you can pause Live Streams for your app, switch gifts off (the gift list is then empty and sending is refused with 403 gifts_disabled), and set a lower viewer limit than your account's to cap spend. They take effect at once.
Receipts
- Each ended viewer session and each gift adds a
usageline to your ledger and statement, with a signed receipt. - The receipt's
cost_breakdownshows, for viewing, the free and paid seconds per rate; for gifts, the count and the cost per gift. - Receipts are signed with Ed25519, the same key as call receipts.
/v1/live-streams/viewers/:viewer_id/receiptThe signed receipt of an ended viewer session.
| Parameter | Type | Required | Default | Allowed values | What it means | Example |
|---|---|---|---|---|---|---|
id | string (UUID) | required (in the path) | – | a <code>viewer_id</code> of your account | The viewer session whose receipt you want. | 6b0c2e7a-1f3d-4c55-9a0e-2b7d9c1e4f60 |
| Field | Type | What it means |
|---|---|---|
receipt | object | The receipt of the ended session, with cost_breakdown. |
signature | string | Ed25519 signature of the receipt. |
algorithm | string | Always Ed25519. |
key_id | string | The signing key (see GET /v1/receipts/public-key). |
Your rates
/v1/live-streams/pricingYour price card (price_card: a rate per quality tier with its volume discounts, billed_tier, free monthly minutes, whether gifts are on, viewer limit) and status (current rate, minutes used this period, next discount, free minutes left). It also carries your account fields enabled, paused, rates and tier_period (monthly or lifetime: the period your minute discounts count over).
| Parameter | Type | Required | Default | Allowed values | What it means | Example |
|---|---|---|---|---|---|---|
| No parameters. | ||||||
| Field | Type | What it means |
|---|---|---|
currency | string | Your billing currency. |
enabled, paused, self_paused | boolean | Live Streams is on for your account; paused by us; paused by you. |
rates | object | Your rate per viewer-minute (view), per stream-minute (stream) and per quality tier. |
rate_view_per_minute, rate_stream_per_minute | number | The same two rates as plain numbers. |
gifts_enabled | boolean | Whether gifts are on in Live Streams. |
max_viewers | integer | Your concurrent viewer limit. |
status | object | period, minutes_used, current_rate_per_minute, next_tier, free { monthly_minutes, monthly_left_minutes, grants_left_minutes }. |
price_card, tier_period | object, string | Your price card and the period your discounts count over (when shown for your account). |
Limits
- Concurrent viewers per account: 100 by default (ask support to raise it). Beyond it, joins get
429 capacity. - Platform limits, shared by all accounts, may refuse a join with
503 capacity: relayed lives and total partner viewers. - One open session per end user per live. Viewer tokens live 10 minutes; renew while watching.
- Video is a single quality layer (about 500–800 kbps), chosen for mobile viewers.
- Comments: 1–200 characters, polled at most once a second. Gifts:
count1–99 per request.
Errors
| HTTP | code | When |
|---|---|---|
| 400 | invalid_request / invalid_stream_ref / invalid_client_request_id | Bad body or query |
| 400 | gift_unavailable | That gift is not offered, or you hid it |
| 402 | balance_zero | Balance is zero (join, without free minutes) |
| 402 | insufficient_balance | Your balance is too low for this gift. Nothing is sent or charged |
| 403 | live_streams_disabled | Live Streams is not enabled for your account |
| 403 | calls_disabled | New sessions are switched off for your account |
| 403 | kicked | The host removed this end user from this live (rejoining this live is refused) |
| 403 | blocked | This host blocked this end user, or the end user is blocked on your account |
| 403 | not_viewer | The end user is not watching this live (join first) |
| 403 | gift_not_in_session | A gift from an end user who is not watching this live (join first) |
| 403 | muted | The host muted this end user's chat |
| 403 | gifts_disabled | Gifts are switched off for your account (by us, or by you in the console) |
| 409 | stream_unavailable | The live has ended or is no longer offered |
| 409 | gift_idempotency_conflict | client_request_id was used for a different gift |
| 409 | gift_price_changed / gift_host_unavailable | Your price changed since you showed it (with expected_price), or the host cannot receive the gift. See Gifts: errors |
| 409 | no_receipt | The viewer session is still open, or it never connected, so there is no receipt yet |
| 429 | capacity | Your account's concurrent viewer limit (default 100) |
| 429 | rate_limited | Too many requests or messages |
| 503 | capacity | Our relay or total viewer capacity is full right now; retry in a minute |
| 503 | kill_switch | Live Streams is switched off right now (for everyone or for your account) |
| 503 | partner_paused | Titli has paused Live Streams for now |
| 503 | partner_unavailable | A dependency did not answer; retry in a few seconds |
End reasons
| Scope | end_reason |
|---|---|
| Viewer session | left, left_room (left the room and did not come back within 30 s), never_connected (a token never used within 2 minutes), kicked, blocked, removed (Titli removed the viewer), balance_zero, kill_switch, and every stream end reason. |
| Stream | host_ended, admin_terminated, unavailable (the live stopped qualifying, for example a PK battle or paid entry started), pool_off, vendor_off, host_excluded, host_gone (the host's video stopped for a minute), no_viewers, relay_failed, operator_ended, vendor_ended (you ended it for your app), kill_switch, error. |
Content rules
These are part of your agreement.
- 18+ only. Gate Live Streams behind your own age check.
- No recording, restreaming or redistribution of any stream, in whole or in part, by you or your users. Viewer tokens are personal to one end user; never share them or use them server side to capture media. Every view is logged with your account, the end user and the times.
- Report and block are required. Your app must let users report a live (
POST …/report) and stop seeing a host. Keep the host's and other viewers' names as we send them; do not add your own overlays over the host's video that hide the "Titli" mark of the SDK viewer screen. - You are responsible for your app's store policies on user-generated live content. See also Acceptable use.