Quickstart

Your first audio or video call in about 5 minutes with only your App Key. No backend needed.

API v1 is in early access. We announce breaking changes by email before they ship.

Set in your dashboard vs. set in code

SettingWhere
App Key, its bindings (package name, bundle ID, website, signing certificate) and Quick-mode capsDashboard: Console → Projects → Quick mode
Who the user is (user id, display name)Code: init / setUser in the app
Call lengthCode: max_duration_seconds when you create the call, or the project default
Daily spend cap of a projectDashboard: Console → Projects
Token lifetime (server tokens)Code: ttl_seconds, within the project limit

What you need

  • A console account. A new account starts with ₹100 welcome credit ($1.2 for USD accounts), about 250 minutes of 1:1 video, so you can follow this page without a recharge.
  • A Flutter app (Android first) or a web page.
  • That is all: no backend is needed for Quick mode.

Flutter: add your App Key, make a call in 5 minutes

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 (Android) and bundle ID (iOS). Your App Key is shown there.
  2. Install the package from pub.dev (the console download is only a fallback).
    terminal
    flutter pub add titli_video_sdk
    
    # or in pubspec.yaml
    dependencies:
      titli_video_sdk: ^0.2.0
  3. Init with the App Key, then start or join a call. That is all: no server, no tokens.
    lib/main.dart
    import 'package:titli_video_sdk/titli_video_sdk.dart';
    
    // 1. 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');
    
    // 2. Start a video call (you are the caller and the payer)...
    final call = await TitliVideo.startCall(type: TitliCallType.video);
    // share call.callId with the other person your own way (push, your chat, Titli Chat)
    
    // 3. ...and on the other phone, join it.
    await TitliVideo.joinCall(callId);

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). Quick mode: bindings, caps and error codes · Read the Client API (Quick mode).

Available onnpmpub.devJitPackSwift Package ManagerGitHub

Flutter on Android needs the CAMERA, RECORD_AUDIO and INTERNET permissions and minSdkVersion 21 or higher. Native apps: see the iOS, Android (Kotlin) and React Native SDK pages (beta), each with the same three steps and a prebuilt call screen.

Web: the same three steps

  1. In the console, open Projects → Quick mode and add your website address (origin). Copy the App Key.
  2. Add the script:
    index.html
    <!-- titli-call.js from npm (titli-video-sdk), served by jsDelivr; it defines TitliVideo. With a bundler: npm i titli-video-sdk -->
    <script src="https://cdn.jsdelivr.net/npm/titli-video-sdk@0.2.0/titli-call.js"></script>
    <div id="stage"></div>
  3. Init with the App Key, then start or join a call:
    app.js
    // 1. Once, on page load: your App Key and your own user id
    TitliVideo.init({ appKey: 'tak_…', userId: 'user-42', userName: 'Asha' });
    
    // 2. Start a video call into a container on your page
    const call = await TitliVideo.startCall({ type: 'video', container: '#stage' });
    // share call.callId with the other person
    
    // 3. In the other browser
    await TitliVideo.joinCall(callId, { container: '#stage' });

Ending a call

A call ends when everyone leaves (30 seconds later: a quick reconnect inside that window continues the same call), when its time limit is reached, or when your balance reaches zero. In Quick mode the console's caps also apply: the longest call, minutes per user per day and a daily spend cap for the project (Projects → Quick mode). The SDK reports why a call ended with a message you can show your user.

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.

For this flow you need a backend server you control. API keys live there, never in your app.

1. Create a project and key

In the console, open Projects and create one. You get an App ID (app_…), a key ID (tk_…) and key secret (ts_…, shown once) and a webhook secret (whsec_…). A project can hold two active keys, so you can rotate without downtime.

2. On your server: create a call and mint tokens

terminal
API=https://api-videosdk.titliapp.com
AUTH="$TITLI_KEY_ID:$TITLI_KEY_SECRET"   # optional server tokens: server only, never in the app

# 1. Create the call (type: "video" or "audio")
curl -s -u "$AUTH" -H 'Content-Type: application/json' \
  -d '{"type":"video","payer_end_user_id":"user_1001"}' \
  $API/v1/calls

# 2. Mint one join token per participant
curl -s -u "$AUTH" -H 'Content-Type: application/json' \
  -d '{"end_user_id":"user_1001","role":"user","name":"Ravi"}' \
  $API/v1/calls/<call_id>/tokens
# -> { "token": "eyJ…", "livekit_url": "wss://…", "expires_at": "…" }

Send each person their own token and the livekit_url; never send one person's token to another. Tokens expire after 10 minutes by default (ttl_seconds, from 30 up to your project's limit, normally 3600); that only limits when they can join, not how long they stay. notifyHost in the Node sample is your own push or socket message to the other person.

3. In the app: join with the token

lib/call_screen.dart
import 'package:titli_video_sdk/titli_video_sdk.dart';

// Production hardening (optional): token + livekit_url minted on your server
// (POST /v1/calls/{id}/tokens). In Quick mode use TitliVideo.init + startCall instead.
final call = await TitliCall.connect(
  url: livekitUrl,
  token: token,
  video: true, // false for an audio call
);

// Prebuilt call screen: video tiles, mute, camera flip, hang up.
Navigator.of(context).push(MaterialPageRoute(
  builder: (_) => TitliCallScreen(call: call, title: 'Asha'),
));

4. End the call and keep the receipt

terminal
curl -s -u "$AUTH" -X POST $API/v1/calls/<call_id>/end
curl -s -u "$AUTH" $API/v1/calls/<call_id>/receipt

The server also ends a call by itself 30 seconds after everyone has left, when max_duration_seconds is reached, or when your balance reaches zero.

5. Webhooks (optional)

Set a webhook URL on the project in the console (Projects) to receive call.started, call.ended, participant.joined, participant.left and balance.low. See Webhooks.

If something does not work

SymptomCheck
AK-401 (APP_KEY_INVALID)Quick mode: the App Key is missing, mistyped, rotated away or switched off. Copy it again from Projects → Quick mode.
AB-403 (APP_NOT_ALLOWED)Quick mode: this package name, bundle ID, website or signing certificate is not on the App Key's list. Add it in Projects → Quick mode.
QM-403 (QUICK_MODE_OFF)Quick mode is switched off for the project. Switch it on in Projects → Quick mode.
QC-402 or UM-429Quick mode: the project's daily spend cap, or this user's minutes for today, are used up. Raise the cap in the console or wait for tomorrow.
401 invalid_api_keyServer tokens: the username is the key ID (tk_…), the password the secret (ts_…), both from the same project, with no stray spaces or newlines.
402 insufficient_balanceThe balance must cover the next minute of all your live calls plus this one. Recharge, or set free seconds for your users.
409 call_ended when getting a tokenThe call ended or expired (nobody joined within an hour). Start a new call.
429 concurrency_limitCalls nobody joined still count for up to an hour. End the ones you will not use.
The app cannot connectServer tokens: the token expired (10 minutes by default): mint it right before joining, and use the livekit_url from the same answer.
No camera in an audio callBy design: an audio call can publish only the microphone.
A third person cannot joinCalls hold 2 people by default. Support can raise it for your account.
The call ended on its ownRead end_reason on the call (GET /v1/calls/{id}, or the SDK's end event) or in the call.ended webhook.
No webhooks arriveThe URL must be public HTTPS with a valid certificate and answer 2xx within 8 seconds. The console's webhook log shows every attempt and why it failed.

Every error code, with the next step and a message you can show your users: Error codes.

Start free