Overview
Authentication
Send your API key as a bearer token. Public keys (pk_live_…) can start calls and chats and are safe in a browser on your allowed domains. Secret keys (sk_live_…) can also manage assistants and read usage; keep them on your server.
Header
Authorization: Bearer YOUR_API_KEYCreate and revoke keys under Integrations → API Credentials. Errors return a JSON body like { "error": "Plain sentence." } with a matching HTTP status.
Calls
Start a web call
/api/v1/sessionsPublic or secret keyCreates a voice session for a browser and returns a short-lived WebSocket URL for streaming audio (valid for 15 minutes).
Request
curl -X POST https://vokrio.com/api/v1/sessions \
-H "Authorization: Bearer $RELAYA_PUBLIC_KEY" \
-H "Content-Type: application/json" \
-d '{ "assistantId": "d39e860e-…" }'Response · 201
{
"success": true,
"sessionId": "sess_8f2c41a9d03b7e15",
"token": "eyJhbGciOi…",
"websocketUrl": "wss://…/v1/stream?token=…",
"expiresAt": "2026-12-01T10:15:00.000Z"
}Calls
End a call
/api/v1/sessions/{sessionId}/terminatePublic or secret keySignals an active voice session to hang up.
Chat
Start a chat
/api/v1/chat/startPublic or secret keyRequest
{ "assistantId": "d39e860e-…" }Response
{
"sessionId": "chat_075c83d6d8d74024",
"status": "active",
"firstMessage": "Hi, how can I help today?",
"firstOptions": [{ "label": "Book an appointment" }]
}Chat
Send a message
/api/v1/chat/messagePublic or secret keyReplies stream back as server-sent events. Each event is a JSON object: content (text to append), options (buttons to show), or error. The stream ends with [DONE].
Request
{ "sessionId": "chat_075c83d6d8d74024", "message": "Book an appointment" }Response · text/event-stream
data: {"content":"Which service would you like?"}
data: {"options":[{"label":"General Consultation"},{"label":"Specialist"}]}
data: [DONE]Chat
Chat history and end
/api/v1/chat/history/{sessionId}Public or secret key/api/v1/chat/endPublic or secret keyRead the messages of a chat, or end it with { "sessionId": "…" }.
Assistants
Assistants
/api/v1/assistantsSecret key/api/v1/assistantsSecret key/api/v1/assistants/{id}Secret key/api/v1/assistants/{id}Secret key/api/v1/assistants/{id}Secret keyCreate and update assistants with a name and a config object (instructions, model, voice and settings, the same fields as the dashboard).
Create · request
{
"name": "Clinic front desk",
"config": { "systemPrompt": "You are Ava…", "model": "GPT-4.1 mini", "voice": "Deepgram aura-2-asteria-en" }
}Account
Usage
/api/v1/usage?startDate=2026-11-01&endDate=2026-11-30Secret keyResponse
{
"period": { "start": "2026-11-01", "end": "2026-11-30" },
"metrics": { "totalSessions": 50, "totalDurationSeconds": 7700, "llmPromptTokens": 182000, … }
}Account
Webhooks
Relaya can send events such as transcripts and assistant responses to a webhook URL linked to your API client, as they happen. Deliveries are logged in the dashboard, where failed ones can be retried.