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
| Setting | Where |
|---|---|
| App Key, its bindings (package name, bundle ID, website, signing certificate) and Quick-mode caps | Dashboard: Console → Projects → Quick mode |
| Who the user is (user id, display name) | Code: init / setUser in the app |
| Call length | Code: max_duration_seconds when you create the call, or the project default |
| Daily spend cap of a project | Dashboard: 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.
- 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.
- 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 - 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
- In the console, open Projects → Quick mode and add your website address (origin). Copy the App Key.
- 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> - 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
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": "…" }// server.js (Node 20+), optional production hardening: create a call and hand tokens to your app
import { TitliClient } from 'titli-video-sdk/server'; // npm i titli-video-sdk
const titli = new TitliClient({
keyId: process.env.TITLI_KEY_ID,
keySecret: process.env.TITLI_KEY_SECRET,
});
app.post('/api/calls', requireLogin, async (req, res) => {
const call = await titli.createCall({ type: 'video', payerEndUserId: req.user.id });
const me = await titli.token(call.id, { endUserId: req.user.id, name: req.user.name });
const host = await titli.token(call.id, { endUserId: req.body.hostId, role: 'host' });
// Each person gets only their own token: deliver the host's to the host (push, socket, ...).
await notifyHost(req.body.hostId, { callId: call.id, url: host.livekit_url, token: host.token });
res.json({ callId: call.id, url: me.livekit_url, token: me.token });
});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
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'),
));<script src="https://cdn.jsdelivr.net/npm/livekit-client@2.15.6/dist/livekit-client.umd.js"></script>
<script type="module">
const { Room, RoomEvent, Track } = LivekitClient;
// Production hardening (optional): token + livekit_url minted on your server.
// Quick mode needs no server: TitliVideo.init({ appKey }) + startCall (see the web SDK page).
const room = new Room({ adaptiveStream: true, dynacast: true });
room.on(RoomEvent.TrackSubscribed, (track) => {
document.querySelector('#stage').append(track.attach());
});
await room.connect(livekitUrl, token);
await room.localParticipant.setMicrophoneEnabled(true);
await room.localParticipant.setCameraEnabled(true);
</script>4. End the call and keep the receipt
curl -s -u "$AUTH" -X POST $API/v1/calls/<call_id>/end
curl -s -u "$AUTH" $API/v1/calls/<call_id>/receiptThe 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
| Symptom | Check |
|---|---|
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-429 | Quick 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_key | Server 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_balance | The 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 token | The call ended or expired (nobody joined within an hour). Start a new call. |
429 concurrency_limit | Calls nobody joined still count for up to an hour. End the ones you will not use. |
| The app cannot connect | Server 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 call | By design: an audio call can publish only the microphone. |
| A third person cannot join | Calls hold 2 people by default. Support can raise it for your account. |
| The call ended on its own | Read end_reason on the call (GET /v1/calls/{id}, or the SDK's end event) or in the call.ended webhook. |
| No webhooks arrive | The 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.