Skip to main content
Create a session

Authorizations

Authorization
string
header
required

Production API key created at https://app.protoface.com for https://api.protoface.com; no activation step or environment switch. Pass the full secret shown once at creation as Authorization: Bearer sk_live_…, not the short dashboard identifier. HTTP 401 missing_authorization means the header did not parse; the key was not looked up. A token that passes parsing can return api_key.unknown, api_key.revoked, api_key.expired, or api_key.environment. See https://docs.protoface.com/reference/errors#authentication-codes.

Headers

X-Protoface-Session-Grant
string | null
Idempotency-Key
string | null
Required string length: 1 - 255

Body

application/json

Request body for POST /v1/sessions.

avatar_id
string
required

Stable av_… avatar id. Must reference a platform stock avatar or customer avatar the caller's API key can access.

transport
LiveKitTransportConfig · object
required

Discriminated union of transport configs, keyed by type.

Example:
idle_timeout_seconds
integer
default:30

End the session automatically after this many seconds without received audio. Only applies to transports that observe inbound audio; ignored otherwise. In LiveKit track mode, every received audio frame, including silence, resets this timeout.

Required range: 1 <= x <= 600
max_duration_seconds
integer | null

Optional customer-requested hard ceiling on session duration. The API clamps this to the caller's plan limit and returns the effective value on the Session resource.

Required range: 1 <= x <= 3600
metadata
object

Customer-owned free-form JSON, <= 8 KB. Keys prefixed with _avatar. are managed by Protoface.

quality
enum<string>
default:standard

Video output quality tier: standard for SD (default on all plans) or high for 1080p HD (LiveKit sessions on Launch, Scale, or Enterprise plans).

Available options:
standard,
high

Response

Successful Response

Public session resource — what GET /v1/sessions/{id} returns.

avatar_id
string
required
created_at
string<date-time>
required
id
string
required

sess_… prefixed ULID.

idle_timeout_seconds
integer
required
max_duration_seconds
integer
required
metadata
object
required
quality
enum<string>
required

Video output quality tier: standard for SD (default on all plans) or high for 1080p HD on LiveKit sessions (requires a Launch, Scale, or Enterprise plan).

Available options:
standard,
high
status
enum<string>
required

Public session lifecycle.

Terminal states are ended, failed, canceled. ending is the graceful-drain state while a worker finishes publishing in-flight frames.

Available options:
created,
queued,
starting,
running,
ending,
ended,
failed,
canceled
transport
LiveKitTransportConfig · object
required

BYO LiveKit transport.

The customer owns the room and mints worker_token; we never touch their LiveKit API key or secret. The worker publishes protoface-avatar video and protoface-avatar-audio output tracks.

In track mode, call the lk.clear_buffer RPC for barge-in after stopping or clearing the upstream audio publisher.

Example:
billing_surface
enum<string>
default:api

Service that created the session. Use this to group usage reporting.

Available options:
api,
playground,
embed,
share,
public_demo,
pipecat,
agora,
video_generation
ended_at
string<date-time> | null
failed_at
string<date-time> | null
failure
SessionFailure · object | null

Populated when Session.status == failed.

first_frame_at
string<date-time> | null

Set on session.first_frame.

object
string
default:session
Allowed value: "session"
started_at
string<date-time> | null

Set when worker emits session.starting.

usage
SessionUsage · object

Live usage counters embedded in the Session resource.

Eventually-consistent — lags the latest worker heartbeat by up to one interval. Canonical billing data lives in UsageEvent.