How to add live hosts to your social app: the Live Hosts API

Your users make 1:1 video or voice calls with verified hosts from the Titli host network. You do not run hosts, wallets or payouts, and you do not need a backend: with your App Key the app lists hosts and starts the call with one SDK call. Your prepaid balance is billed per second while the call is connected. Server calls are optional hardening.

How it works

The Live Hosts API is launching now and invite-only. It is off for every account until we switch it on: ask support (console → Support) or contact us, and we turn it on for approved apps. Availability of hosts varies by time of day.

  1. Your app lists the hosts who are online (optional) and shows them.
  2. Your app starts a call with a specific host, or with any available host. The SDK creates the call and joins it.
  3. The host joins it on our side. Your user sees the host on the call screen; gifts work there too.
  4. Optional, with a server endpoint: webhooks tell your server when the call connects and when it ends, with a signed receipt.

You never receive a host's phone number or any contact detail, and the host never sees your company name. The host sees the display name you send. Product overview and safety: Live Hosts API. Full reference: Live Hosts API reference.

Prerequisites

  • A console account with Live Hosts enabled, and your App Key (Projects → Quick mode). No backend is needed.
  • Some prepaid balance, or free minutes on your account (see billing).
  • An app with one of our SDKs. If not, start with the Flutter, iOS, Android or React Native guide.

Quick mode: add your App Key, start a host call

No backend needed: add your App Key in the app and start calling. A server is optional, for production hardening.

  1. 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.
  2. Install the package for your platform, as in the platform guides above.
  3. Init with the App Key, then start a host call. Leaving the call ends it. The gift button on the call screen works without any handler.
Dart
// after TitliVideo.init(appKey: 'tak_…', userId: 'user-42', userName: 'Rahul')
final hosts = await TitliVideo.liveHosts.hosts();   // optional: who is online
final call = await TitliVideo.liveHosts.startCall(type: TitliCallType.video); // any free host, or hostRef: 'h_9f2a'
Navigator.push(context, MaterialPageRoute(builder: (_) => TitliCallScreen(call: call)));

Leave out the host to call any available host. TitliVideo.liveHosts.get, end and list read and end this user's own calls; directHosts lists the hosts you can call directly. The rate, the errors and the call states are the same as below. The App Key is publishable, not a secret: it can only reach the app-facing routes, it is bound to your package name, bundle ID or website, and spend and usage caps fence it. The binding is a deterrent, not a lock (a determined attacker can copy an app's identity), so the caps are what limit the damage. For strict control, add server tokens (production hardening below).

Live Hosts pricing, stats and hiding hosts stay server-only (or in the console under Live Hosts): the app never sees your rates.

Follow the call

A call moves through connecting (host being reached), ringing (host matched), connected (billing), ending and ended. In the app, the call screen follows it for you and TitliVideo.liveHosts.get reads it. On a server, poll GET /v1/live-hosts/calls/:id or use the two webhooks (optional; they need a server endpoint), which arrive at your project's webhook URL with the usual Titli-Signature header:

  • live_host.call.connected carries the call. Billing starts at call.connected_at.
  • live_host.call.ended carries the call, the receipt and its signature. The receipt is null if the call never connected.

To hang up from the app, leave the call or call TitliVideo.liveHosts.end; from a server, call POST /v1/live-hosts/calls/:id/end. For the host it looks like the caller hung up. Once ended, end_reason says why, for example end_user_left, host_ended, host_no_answer, balance_zero or max_duration. Signature checking is covered in Webhooks and signed receipts.

Billing

  • One all-inclusive rate per call type: video from ₹12 per minute and audio from ₹8 per minute (USD accounts: from $0.1297 and $0.0865). Host time and call minutes are in that one rate; there is no separate call-minute charge. Your account's own rates are shown in the console.
  • Billed per second, only while connected. Billing starts when the host's media is flowing into the room and your user is in it. Ringing, a host who does not answer, and calls that never connect cost nothing.
  • Debited live every 5 seconds. When the balance cannot pay for the next few seconds the call ends gracefully (balance_zero); the balance never goes below zero.
  • Limits: an optional daily cap per account, a concurrency limit (default 5 calls at once) and a time limit per call (max_seconds, default 2 hours).
  • Volume tiers and free minutes can be set per account: up to 5 tiers per call type, monthly free minutes and one-time granted minutes (for example for a trial, on request). Free time is never charged.

Example at the list rate: a video call connected for 7 minutes 30 seconds is 450 seconds. 450 ÷ 60 × ₹12 = ₹90.00. These reports are server-only (they use the project key) and are also in the console: GET /v1/live-hosts/pricing returns your current rates, tiers and free minutes left; GET /v1/live-hosts/stats gives calls, minutes and spend grouped by day, end user, host or type; and GET /v1/live-hosts/calls/:id/receipt returns the Ed25519-signed receipt of an ended, connected call.

Errors to handle

HTTPCodeWhen
402insufficient_balanceBalance below one minute at your Live Hosts rate (plus one minute for each call already running)
403live_hosts_disabledLive Hosts is not enabled for your account
403end_user_blockedThis end user is blocked
409host_unavailableThe chosen host is busy, offline or no longer available
409no_host_available"any" and nobody is free right now
409end_user_busyThis end user is already on a Live Hosts call
429daily_cap_reachedToday's Live Hosts spending cap is reached (resets at midnight in your account time zone)
429concurrency_limitToo many Live Hosts calls at once for your account (default 5) or on our side
503lines_busyEvery Live Hosts line is in use right now; retry in a minute
503partner_pausedLive Hosts is paused; try later
503partner_unavailable, media_unavailableA dependency did not answer; retry in a few seconds

Good practice

  • The App Key can live in the app; a project key secret never does. If you add a server, keep the key there.
  • Reuse a stable user id per user: per-user stats, blocks and abuse controls use it.
  • Call any available host when you do not need a specific one, and retry no_host_available a little later.
  • Set the Quick-mode daily spend cap and each user's daily minutes in the console, so one user or one copied key cannot run up your balance.
  • Decide what a call costs your user in your own coins or wallet. We bill your prepaid balance; your users' money stays in your system. If you charge users per minute from a wallet, run the debit on a server you trust (production hardening): the app should not be trusted to debit its own user's wallet.

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 create the call on your server with the project key (HTTP Basic key_id:key_secret, base URL https://api-videosdk.titliapp.com) and hand the app a join token. Use them when every call must pass your own server-side checks first.

Server step 1: List hosts (optional)

terminal
curl -s "$API/v1/live-hosts/hosts?language=hi&limit=20" -u "$KEY_ID:$KEY_SECRET"
Response
{ "hosts": [ { "host_ref": "h_9f2a", "name": "Asha", "photo_url": "https://…", "age": 24, "languages": ["hi","en"], "status": "online",
               "audio_available": true, "video_available": true } ],
  "available_count": 1, "paused": false }

Query: type (audio or video: only hosts who take that type), language (for example hi) and limit (1 to 100, default 50). Online hosts come first. busy hosts are on a call and cannot be called right now, so show them as unavailable. The list is cached for about 3 seconds. paused: true means Live Hosts is paused and the list is empty until it resumes.

host_ref is an opaque, stable id of a host for your account only. It is not a Titli user id and cannot be used anywhere else.

Server step 2: Create the call on your server

Create the call only after your own checks (login, your coins, age gates), and never put the key secret in the app.

terminal
curl -s $API/v1/live-hosts/calls -u "$KEY_ID:$KEY_SECRET" -H 'Content-Type: application/json' \
  -d '{"end_user_id":"user_123","end_user_name":"Rahul","host_ref":"any","type":"video"}'
201 Created
{ "call_id": "…", "id": "…", "object": "live_host_call", "status": "connecting", "room": "lh_…",
  "livekit_url": "wss://…", "token": "eyJ…", "identity": "eu_user_123",
  "host": { "host_ref": "h_9f2a", "name": "Asha", "photo_url": "…", "age": 24, "languages": ["hi","en"] },
  "rate": { "currency": "INR", "per_minute": 12 }, "max_seconds": 7200,
  "billed_seconds": 0, "cost": 0, "end_reason": null, "created_at": "…" }

Body: end_user_id (required; your own stable id for the user), end_user_name (optional, up to 40 characters; what the host sees, default "Guest"), host_ref (one from the list, or "any" for any available host) and type ("video" by default, or "audio"). Send livekit_url and token to your app. The token is valid for one hour to join, so join right away.

Server step 3: Join from your app with the token

Dart
final call = await TitliCall.connect(url: livekitUrl, token: token, video: true);
// then
TitliCallScreen(call: call)

No SDK change is needed: a Live Hosts call is an ordinary room for the app. The host appears as the remote participant, with the host's name as the participant name.

Next steps

Free SDK. Pay only for the minutes you use.

Create a free account: it starts with ₹100 welcome credit, about 250 minutes of 1:1 video, so your first call needs no recharge. Questions? Message us on WhatsApp and a person replies.

Start free