Skip to main content
Planned protocol reference. Session creation, renewal, sampling and the session stream are not served by the current Talent API sandbox. The examples below cannot yet be run against it. Start with the runnable quickstart and sandbox support matrix.
Live voice and video cannot wait for a check on every output: a listener hears speech as it is made. A session runs one full check at the start, then keeps the use authorized with a short-lived token you renew every minute, sampled checks of what the session produces, and a stream that tells you the moment it must stop.

Start a session

Send the same fields as a check: the talent, the facet, the use, what the model receives, the end user and the model.
Show the disclosure for the whole session and give the model every generation_instructions entry. If your voice provider verifies session tokens, pass it token and every renewed token. See the session token format. Sessions never escalate. Anything that would escalate is a deny, and the session comes back with status: "denied", token: null and reasons. A license that holds every output for release cannot start a session; the reason is session_not_permitted.

Connect to the stream

Open a WebSocket to stream_url. From a client, offer the subprotocols tlp.session.v1 and tlp.session.<token>, with the session token. From a server, you can offer tlp.session.v1 and send your secret key in Authorization instead. Reflections selects tlp.session.v1 and never echoes the token. The stream checks the token once, when it opens. Renewing over REST keeps the session and does not reconnect the stream; you need the newest token only if you reconnect.
If the connection drops, reconnect and read the session with GET /v1/sessions/{session_id}. A termination you missed shows there as status: "terminated" with termination.reason, and in the session.terminated webhook.

Renew every 60 seconds

The token expires 5 minutes after it is issued. Renew it every renew_every.
409 session_not_active means the license was revoked or suspended, its window ended, or the session was terminated. Stop output at once. On a network error, 429 or 5xx, keep retrying: you may continue until the current expires_at, never past it.

Submit samples

sampling says how often Reflections checks what the session produces:
Audio is audio/wav or audio/ogg, frames are image/jpeg, each up to 2 MB. A transcript sample sends kind: "transcript" with the words of one turn in text, such as “Great question. My favourite trail is the ridge loop above the lake.”

Send samples on the stream

Instead of a POST per sample, you can send each sample on the open stream as sample.submit, with the same fields plus a ref of your own. This saves a round trip per sample. The decision comes back on the stream as sample.decided with the same ref; a sample sent with POST gets its decision in the response instead.

Stop within one second

Stop output within one second of any of these:
  • a sample returns decision: "deny", in its response or in sample.decided;
  • session.terminated arrives on the stream or as a webhook;
  • a renewal returns session_not_active;
  • the current token reaches expires_at without a successful renewal.
Stopping means the listener hears nothing more: drop audio already queued in your buffers, not only the model’s next turn. Then call POST /v1/sessions/{session_id}/end. Reflections also terminates the session on its side.
Between samples, a session can produce up to 15 seconds of speech that nobody has checked. A revoked license reaches you as session.terminated within about 2 seconds (p95). If both the stream and renewals fail, the session can run until its token expires, at most 5 minutes. Size your buffers and timeouts so you never go past these bounds.

End the session and report usage

Call end when the user hangs up. Then report the session’s usage with a usage record whose subject is the session ID, in the units and within the time the usage_report obligation names (here, seconds within one day).

Planned test coverage

Sessions, rfl_test_terminate, stream messages and license-revocation helpers are not available in the current sandbox. Use local fixtures to test renewal failure and termination handling; check Sandbox before attempting this flow against the service.

Session stream

Every message on the WebSocket channel.

Session token

Claims and renewal of the session token.

Voice platforms

Voices held at a provider, scripts and sessions.

Handle revocations

What a revocation requires beyond the session.