curl --request POST \
--url https://api.humain.ai/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"mode": "text"
}'{
"session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"agent_url": "https://api.humain.ai",
"detected_language": "tr"
}Open a session
Creates a new conversation session for the authenticated kiosk. Returns a
session_id and an agent_url — every subsequent real-time call for this session
(WebSocket text, WebRTC voice, session end) goes to agent_url, not necessarily the
host that served this request.
The mode field determines which interaction pattern is available:
text— WebSocket messaging (see WebSocket streaming)voice— WebRTC real-time audiovoip— SIP / VoIP telephony bridge
curl --request POST \
--url https://api.humain.ai/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"mode": "text"
}'{
"session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"agent_url": "https://api.humain.ai",
"detected_language": "tr"
}Authorizations
Device credential issued from the Humain admin panel under Kiosk → Credentials → Issue new credential.
Format: hk_live_ (production) or hk_test_ (sandbox) followed by 43 base64url
characters (32 random bytes). The raw token is shown only once at creation time and
is never stored in plain text.
Body
Response
Session created
Base URL for every real-time call on this session — the WebSocket
(GET {agent_url}/v1/sessions/{sid}/ws), WebRTC signalling
(POST {agent_url}/v1/sessions/{sid}/webrtc/offer and .../ice), and
POST {agent_url}/v1/sessions/{sid}/end. Do not assume it equals the host that
served this request. Treat it as opaque — in most deployments it is the same
public API host behind a reverse proxy.
"https://api.humain.ai"