Skip to content

Mint Session Stream Token

POST
/v1/sessions/{session_id}/events/token
curl --request POST \
--url https://agents.lumalabs.ai/v1/sessions/example/events/token \
--header 'Authorization: Bearer <token>'

Mint a single-use handle for this session's event stream.

Header-authenticated by construction: a ?token= credential is only honoured on GET /events/stream (stream_token_from_request), so a handle can never mint its next handle and outlive its 60 seconds.

session_id
required
Session Id
string

Successful Response

Media typeapplication/json
SessionStreamTokenResponse

A one-shot credential for GET /v1/sessions/{id}/events/stream?token=.

Opaque by design — it is a handle, not a token with claims — so a copy in an access log or a Referer header carries nothing. Fetch-based SSE with an Authorization header is the default; this is the fallback for hosts that can only open a native EventSource.

object
expires_in
required
Expires In

Seconds until the token expires. Redemption also ends it.

integer
token
required
Token

Opaque, single-use, valid for this session's event stream only.

string
Examplegenerated
{
"expires_in": 1,
"token": "example"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}