Get your API key
Create an account
Sign up at reactor.inc.
Create an API key
Open the Dashboard, click your user icon, then navigate to API Keys to create a new key.
- JavaScript
- Python
JavaScript
How it works
Your server exchanges the API key for a short-lived token, which the browser uses to connect. Tokens are valid for up to 6 hours by default, or shorter if you setexpires_after. If a token leaks, it
expires on its own and the blast radius is limited to that token’s validity window.Generate a token
Exchange your API key for a short-lived token by making aPOST request to the /tokens endpoint with your API key in the Reactor-API-Key header:Default (6-hour expiry)
Custom expiry
expires_after to get the full 6 hours; pass it (in seconds) to shorten the lifetime. Values at or above the ceiling are silently clamped.The server still returns 200, so always check expires_at (a Unix epoch timestamp) on the response to confirm the actual expiry.Server-side proxy
Set up an API route on your server that calls the/tokens endpoint and returns the token to your frontend:app/page.tsx
Adopting an existing session. If your backend creates a session and hands the
sessionId to a
client, the token that client connects with must belong to the same account that owns the session.
Mint it through the same /tokens flow. See
Sessions.