Realtime Agent
Register a realtime agent call
Mint a short-lived, single-use access token for opening a realtime Agent WebSocket connection. This is the recommended way to start a session from a browser or other client-side app: your API key stays server-side, and the browser only ever sees the short-lived token. (Server-side or trusted clients may instead connect to the WebSocket with a raw API key directly.)
Flow:
- Call this endpoint with your API key and the agent_id (plus optional mode and per-call variables). All session configuration is fixed here — it is baked into the returned token.
- Open a WebSocket to wss://api.smallest.ai/atoms/v1/agent/connect?token=<access_token>. No agent_id, mode, or variables query params are needed on the WebSocket — they come from the token.
The token is valid for expires_in seconds (30) and can be used for a single connection. Request a fresh token for each connection.
post/conversation/register-call
Request body
Example request
{
"agent_id": "69da0b4c20c0e03cfa4ee258",
"variables": {
"customer_name": "Tanay",
"account_tier": "gold"
}
}Response
Access token created.
Example response
{
"status": true,
"data": {
"access_token": "wct_9f8c2b1e-4d5a-4e6f-a7b8-c9d0e1f2a3b4",
"expires_in": 30,
"sample_rate": 24000
}
}