For AI agents: a documentation index is available at the root level at /llms.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Mint a **short-lived, single-use access token** for opening a realtime
[Agent WebSocket](/atoms/api-reference/api-reference/realtime-agent/realtime-agent)
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:
1. 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.
2. 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.
Authentication
AuthorizationBearer
API key from the console ApiKey collection, sent as Bearer token. Also accepts session cookies for browser-based auth.
Request
This endpoint expects an object.
agent_idstringRequired
The Atoms agent to connect to.
modeenumOptionalDefaults to webcall
Session mode. webcall = full voice pipeline (audio in +
audio out). chat = text-only pipeline. Defaults to webcall.
Allowed values:
variablesmap from strings to strings or doubles or booleansOptional
Per-call prompt variables that override the agent's
`defaultVariables` for this session only. Values must be
`string`, `number`, or `boolean`. Reserved system-variable
keys (`call_id`, `conversation_type`, `agent_number`,
`user_number`, `current_date`, `current_time`, `current_day`,
`agent_gender`, `default_language`, `supported_languages`,
`timezone`) are populated by the server and stripped if
supplied.
Response
Access token created.
statusboolean
dataobject
Errors
400
Bad Request Error
401
Unauthorized Error
404
Not Found Error
500
Internal Server Error
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.
Per-call prompt variables that override the agent’s
defaultVariables for this session only. Values must be
string, number, or boolean. Reserved system-variable
keys (call_id, conversation_type, agent_number,
user_number, current_date, current_time, current_day,
agent_gender, default_language, supported_languages,
timezone) are populated by the server and stripped if
supplied.