Skip to content

Quickstart

This guide takes you from zero to a running realtime avatar session. Budget about 10 minutes.

  • A Protoface account and an API key (sk_live_...). Create one in the dashboard — new accounts get free credits applied automatically (see Limits & quotas).
  • A LiveKit project. Protoface is BYO transport: you own the room and mint the worker token with your own LiveKit API key/secret. A free LiveKit Cloud project works. You’ll need:
    • LIVEKIT_URL (e.g. wss://your-project.livekit.cloud)
    • LIVEKIT_API_KEY
    • LIVEKIT_API_SECRET

Sign up at app.protoface.com, create a key under API keys, and copy it. The full key is shown once at creation — store it somewhere safe.

Terminal window
export PROTOFACE_API_KEY="sk_live_..."

Confirm your key works and find an avatar to use. v0 returns platform demo avatars such as av_demo.

Terminal window
curl https://api.protoface.com/v1/avatars \
-H "Authorization: Bearer $PROTOFACE_API_KEY"

Protoface joins a room you own. You mint a token authorizing our worker to join, using your LiveKit API key and secret. The Protoface SDK never touches your LiveKit credentials.

import { AccessToken } from "livekit-server-sdk";
const ROOM_NAME = "protoface-demo";
const at = new AccessToken(
process.env.LIVEKIT_API_KEY!,
process.env.LIVEKIT_API_SECRET!,
{ identity: "protoface-worker" },
);
at.addGrant({ roomJoin: true, room: ROOM_NAME });
const workerToken = await at.toJwt();

Point Protoface at your room and pass the worker token you just minted.

Terminal window
curl https://api.protoface.com/v1/sessions \
-H "Authorization: Bearer $PROTOFACE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"avatar_id": "av_demo",
"transport": {
"type": "livekit",
"url": "wss://your-project.livekit.cloud",
"room_name": "protoface-demo",
"worker_token": "<WORKER_TOKEN_FROM_STEP_3>"
},
"quality": "mock",
"metadata": { "demo": "quickstart" }
}'

The call returns immediately (under 300 ms p95) with status: "created". The session is queued — a worker claims it asynchronously.

Join the same LiveKit room as a participant from your app or the LiveKit Meet sandbox. Once the worker joins, it publishes a video track and the avatar starts rendering. Push audio into the room and the avatar speaks it back in realtime.

First frame typically lands within a few seconds of create (see the realtime targets).

Terminal window
# Poll
curl https://api.protoface.com/v1/sessions/sess_... \
-H "Authorization: Bearer $PROTOFACE_API_KEY"
# End (idempotent)
curl -X POST https://api.protoface.com/v1/sessions/sess_.../end \
-H "Authorization: Bearer $PROTOFACE_API_KEY"

A session ends on its own when it hits max_duration_seconds, when audio stops for idle_timeout_seconds, or when you call end. See Limits & quotas for the defaults.

The TypeScript examples above use the official SDK:

Terminal window
npm install @protoface/sdk

It works in Node 18+, browsers (server-side only — never ship your key to a browser), and edge runtimes. The SDK retries 429/503 automatically and throws typed errors you can switch on by error.code — see Error reference.