New: booking confirmation emails for every agent, from your own mail server. Try it free

API reference

Start calls and chats, manage assistants and read usage from your own code.

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_KEY

Create 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

POST/api/v1/sessionsPublic or secret key

Creates 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

POST/api/v1/sessions/{sessionId}/terminatePublic or secret key

Signals an active voice session to hang up.

Chat

Start a chat

POST/api/v1/chat/startPublic or secret key

Request

{ "assistantId": "d39e860e-…" }

Response

{
  "sessionId": "chat_075c83d6d8d74024",
  "status": "active",
  "firstMessage": "Hi, how can I help today?",
  "firstOptions": [{ "label": "Book an appointment" }]
}

Chat

Send a message

POST/api/v1/chat/messagePublic or secret key

Replies 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

GET/api/v1/chat/history/{sessionId}Public or secret key
POST/api/v1/chat/endPublic or secret key

Read the messages of a chat, or end it with { "sessionId": "…" }.

Assistants

Assistants

GET/api/v1/assistantsSecret key
POST/api/v1/assistantsSecret key
GET/api/v1/assistants/{id}Secret key
PUT/api/v1/assistants/{id}Secret key
DELETE/api/v1/assistants/{id}Secret key

Create 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

GET/api/v1/usage?startDate=2026-11-01&endDate=2026-11-30Secret key

Response

{
  "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.