Authorization header:
- An API key (
rk_...) is a long-lived secret. It works on every endpoint your key’s roles allow. Keep it on a server. - A session token is a short-lived JWT that you mint from an API key with
POST /tokens. It works only on/sessionsand/clips, and only for the models and sessions you name. Give it to a browser, a mobile app, or any client you do not control.
API keys
Create an API key
Create keys in the Dashboard: click your user icon, then open API Keys. The full key appears only once, when you create it, so store it in a secret manager. Each key is bound to one account: the account that was selected when you created it. To create a key for a team, switch to the team first. See API keys and billing. A key acts with your roles in that account, or with a subset you choose when you create it. If you lose a role later, keys that relied on it lose it too.You cannot create an API key with the Platform API using another API key or a session token. A
credential that leaked cannot be used to create a replacement for itself. The
reactor auth login
command creates a key for the CLI through a browser sign-in; that key expires after 90 days.Send an API key
rk_ prefix. Older clients may send the key in a
Reactor-API-Key header instead. The API reads that header only when there is no Authorization
header. Do not use it in new code.
Some endpoints accept only an API key: everything outside /sessions and /clips, including
/me, /accounts, /models, /projects, POST /tokens, and POST /files.
Revoke an API key
Revoke keys in the Dashboard. A key can also revoke itself:$USER_ID is the id from GET /me. Revocation takes effect at once, and it also invalidates
every session token minted from the key.
Session tokens
A session token lets a client start sessions without holding your API key. It can call these endpoints and nothing else:POST /sessions, to start a session on a model the token allows.- Every
/sessions/{session_id}/...endpoint, for sessions the token created or was bound to. That covers reading and ending a session, WebRTC signaling, uploads, and step results. GET /clips, for recordings of those sessions, also after a session ends.
403, except POST /tokens and POST /files.
Those two endpoints return 401.
Mint a session token
Send your API key toPOST /tokens. With no body, the token can start up to 5 sessions on any model
your key may use, for 1 hour:
jwt, not token. expires_at is a Unix timestamp in seconds. An empty constraints
object means the defaults apply, including the limit of 5 sessions.
Limit what a token can do
Before you hand a token to a client, limit it to what that client needs. Pass oneauthorization_details entry:
reactor/helios, and that session
ends after 10 minutes.
The response repeats
authorization_details in canonical form: model names are resolved, sorted,
and deduplicated. It includes max_sessions when you supply a limit or bind sessions.
Otherwise, it omits max_sessions, and the default limit of 5 sessions applies.
Use a session token
Send the token exactly as you would an API key:Share a session with another client
A token can act only on the sessions it started. To let a second client join a session that already exists, mint a separate token for that client and bind the session to it:- Each bound session must be open and must belong to your key’s account and user.
- Each bound session must run a model listed in
resources.models.match. - Bound sessions count toward
max_sessions. When you omitmax_sessions, the limit equals the number of bound sessions, so the token cannot start new sessions. Setmax_sessionshigher to let it start more.
403. The three cases
look the same, so the endpoint never reveals whether a session ID exists.
Errors
A session token that has expired, or whose API key was revoked, returns
401 on every call. A
session token used outside its limits returns 403: another session, a model it does not allow, or
a new session beyond max_sessions. Other endpoints reject session tokens with 403, except
POST /tokens and POST /files, which return 401.
Accounts and roles
Every request acts in one account: the account the API key is bound to. Session tokens inherit it. To act in another account, use a key created in that account. What a credential may do depends on its roles in that account:
Each endpoint page names the roles it needs. A credential without them gets
403.
Next steps
Mint a session token
The full
POST /tokens reference, with a playground.Client authentication
Mint tokens from a server and hand them to the JavaScript, Python, and mobile SDKs.