API reference
Serve voice calls
- SSE
- GET https://api.inorbit.hr/v1/coordinator/runners/{runner_id}/voice/eventsAccept: text/event-stream; one data: line of JSON per event
- WebSocket
- wss://api.inorbit.hr/v1/ws{"type":"call","id":"1","method":"iohr.coordinator.v1.CoordinatorService/ServeVoice","body":{…}}
- MQTT 5
- wss://api.inorbit.hr/v1/mqttsubscribe to coordinator/runners/{runner_id}/voice/events
A runner holds this stream open to answer voice calls, as server-sent events: open when a call takes the runner, a turn for each spoken turn (a newer seq cancels the one before), close when the call ends, and a heartbeat every 15 s. Only the runner's own user. Nothing said is stored or logged.
Needs scope coordinator:read.
bearerAuthorizationBearer <JWT>An access token from the identity provider: a person's, or a customer's from the client credentials grant with an API key (developers.inorbit.hr). The gateway verifies it; the audience is iohr-api.
runner_id*stringThe runner's id, rnr_ and a ULID.
account_id?stringThe account; empty is the caller's own.
A stream of iohr.coordinator.v1.ServeVoiceResponse events, one JSON object per data:; a failure is an error event carrying Problem
text/event-stream- response
iohr.coordinator.v1.ServeVoiceResponse
close?iohr.coordinator.v1.VoiceLeaseClose
heartbeat?iohr.coordinator.v1.VoiceBeat
open?iohr.coordinator.v1.VoiceLeaseOpen
turn?iohr.coordinator.v1.VoiceLeaseTurn
import { ApiError, Public } from "@inorbithr/sdk";// Reads INORBIT_TOKEN, or INORBIT_KEY_ID and INORBIT_KEY_SECRET.const api = Public.fromEnv();try { for await (const event of api.coordinator.serveVoice("<runner_id>")) { console.log(event); }} catch (e) { if (!(e instanceof ApiError)) throw e; console.error(`${e.code}: ${e.problem} (request id ${e.raw.requestId})`); process.exitCode = 1;}npm install @inorbithr/sdk. Calls the package's public surface; an operation newer than your package needs the next release or a client generated for your account. The SDKs.
{ "close": { "lease_id": "string", "reason": "string" }, "heartbeat": {}, "open": { "instructions": "string", "lease_id": "string", "model": "string", "thread_id": "string" }, "turn": { "lease_id": "string", "seq": "string", "text": "string" }}