Vulavula Logo
Live API

Live API (Realtime)

The Live API streams audio over a WebSocket connection and returns incremental transcription (and, optionally, translation) results as the audio arrives — no need to wait for the full recording before you get text back.

Early beta — Enterprise only

The Live API is in early beta and is currently available only to Enterprise customers. If you'd like access, contact us at [email protected].

Migrating from OpenAI's Realtime API?

This API deliberately mirrors the shape of OpenAI's Realtime API (same connection path, same two-step auth flow, same client/server event names) so that existing Realtime integrations can switch to Vulavula largely by changing an endpoint. See Differences from OpenAI's Realtime API below for the parts that don't carry over.

Connecting

Connecting has two steps: mint a short-lived client secret from your backend, then open the WebSocket from your client using that secret.

Step 1 — Mint a client secret

POST https://api.lelapa.ai/v1/realtime/client_secrets

This call must be made server-side — it requires your real API key and should never be embedded in browser or mobile client code. Your backend calls this endpoint, then hands the returned short-lived value to the client that will actually open the WebSocket.

Headers

HeaderTypeRequiredDescription
x-api-keystringYesAPI key generated for the project
Content-TypestringYesMust be set to application/json

The Live API authenticates with the x-api-key header, not the X-CLIENT-TOKEN header used by the other Vulavula endpoints. Sending your key as X-CLIENT-TOKEN returns 401 Unauthorized.

Body

FieldTypeRequiredDescription
expires_after.anchorstringNoCurrently only "created_at" (default)
expires_after.secondsintegerNoClient secret lifetime in seconds (default 600, min 10, max 7200)
sessionobjectNoInitial session config — see Session Configuration. Can also be sent later via session.update.
🟢 200 OK
Returns the client secret plus the effective session config.
JSONCode
{ "value": "vv_ek_68af296e8e408191a1120ab6383263c2", "expires_at": 1756310470, "session": { "id": "sess_abc123", "type": "translation", "audio": { "input": { "format": { "type": "audio/pcm", "rate": 24000 } }, "output": { "language": null } } } }
🟠 401 Unauthorized
The API key is missing or invalid.

Step 2 — Open the WebSocket

WSS wss://api.lelapa.ai/v1/realtime

Browsers cannot set arbitrary headers during a WebSocket handshake, so authentication is passed via the Sec-WebSocket-Protocol field instead — the same workaround OpenAI's Realtime API uses. Pass an array of subprotocols to your WebSocket client:

JSONCode
["realtime", "vulavula-insecure-api-key.vv_ek_68af296e8e408191a1120ab6383263c2"]

The vulavula-insecure-api-key. prefix is named that way deliberately (mirroring OpenAI's own openai-insecure-api-key. naming) — it's a reminder that this value is a bearer credential that will be visible to anything that can see the WebSocket handshake (e.g. browser devtools), which is exactly why it should be short-lived and minted server-side rather than a copy of your real API key.

If you're connecting from a trusted backend process (not a browser), you can skip the client-secret step entirely and pass your API key directly the same way — but the two-step flow is required for any client-side code.

Session Configuration

Send a session.update event right after connecting (or include session in the client-secret request) to configure the session:

JSONCode
{ "type": "session.update", "session": { "audio": { "input": { "format": { "type": "audio/pcm", "rate": 24000 }, "transcription": { "model": "vulavula-live", "language": "zul" } }, "output": { "language": "eng" } } } }
FieldTypeRequiredDescription
audio.input.format.typestringNoInput audio encoding: "audio/pcm" (default), "audio/pcmu" (G.711 μ-law), or "audio/pcma" (G.711 A-law) — the same set OpenAI's Realtime API accepts.
audio.input.format.rateintegerNoInput sample rate in Hz for "audio/pcm" (default 24000; 16000 is also supported). Ignored for "audio/pcmu"/"audio/pcma", which are always 8kHz.
audio.input.noise_reductionobject | nullNoAccepted for compatibility but not implemented — any value is logged and ignored.
audio.input.transcription.languagestringNoSource language — see Supported Language Codes below. Defaults to zu (isiZulu) if omitted.
audio.input.transcription.modelstringNoAccepted for compatibility but not implemented — this API runs one fixed ASR model; any value is logged and ignored.
audio.output.languagestring | nullNoTarget language to translate into — see Supported Language Codes below. Omit or set to null for transcription-only — this is the single switch between the two modes.

Supported Language Codes

Language codes are ISO 639-1 (two-letter) or ISO 639-3 (three-letter), matching OpenAI's Speech-to-Text convention — either form works.

LanguageISO 639-1ISO 639-3TranscribeTranslate target
isiZuluzuzul✅✅
South African Englisheneng✅✅

Client Events

EventDescription
session.updateSet the session configuration (see above). Only the first session.update (or the config given at client-secret creation) takes effect — config is fixed once audio streaming starts, and a later session.update gets an error instead.
session.input_audio_buffer.appendAppend audio to the input buffer. audio is base64-encoded mono audio in whatever audio.input.format was configured.
session.closeGracefully close the session after flushing any pending audio.
Code
import base64 import json await ws.send(json.dumps({ "type": "session.input_audio_buffer.append", "audio": base64.b64encode(pcm16_chunk).decode(), }))

Server Events

EventDescription
session.createdSent automatically as the first event after the WebSocket opens.
session.updatedConfirms a session.update was applied. Same shape as session.created. Only sent for the first session.update on a session — config is fixed once audio streaming starts, so later session.updates get an error (session_already_active) instead.
session.input_transcript.deltaThe finalized source-language text for one completed segment of speech. delta is safe to append to a running transcript — segments are sent once each, only after the model has settled on that segment's text (interim/revisable hypotheses are not sent).
session.output_transcript.deltaThe finalized translated text for one completed segment. Only sent when audio.output.language is configured. Same append-safety guarantee as above.
session.closedSent after a session.close (or server-initiated close) once the session has fully ended.
errorA recoverable or non-recoverable error. See error.message/error.code for details.
Example: session.input_transcript.delta
JSONCode
{ "type": "session.input_transcript.delta", "event_id": "event_123", "delta": "Sawubona" }
Example: session.output_transcript.delta
JSONCode
{ "type": "session.output_transcript.delta", "event_id": "event_124", "delta": "Hello" }
Example: error
JSONCode
{ "type": "error", "event_id": "event_125", "error": { "type": "invalid_request_error", "code": "invalid_event", "message": "The 'type' field is missing.", "param": null } }

Differences from OpenAI's Realtime API

This API is intentionally close to OpenAI's Realtime API, but it is not a byte-for-byte clone. Known gaps:

  • No WebRTC transport. WebSocket only — OpenAI recommends WebRTC for browser clients; we don't currently offer that transport.
  • No translated-audio output. Vulavula's translation is text-only. OpenAI's translation mode can also stream synthesized translated speech (session.output_audio.delta); this API never emits that event.
  • One unified session type, not separate transcription-only and translation resources. Toggle translation on/off per session with audio.output.language, rather than connecting to a different endpoint. session.type is always reported as "translation", matching OpenAI's translation session discriminator, regardless of whether translation is enabled for that session.
  • Different subprotocol prefix. vulavula-insecure-api-key. instead of openai-insecure-api-key. — same mechanism, different namespace.

Full Example

See the runnable Python and browser examples in vulavula-examples for a complete end-to-end client.

Last modified on