AsyncAPI channel · Layercode
· Layercode Realtime Voice WebSocket API
/v1/agents/web/websocket
Realtime voice channel. Opened by the browser with
`?client_session_key=...`. Both directions exchange JSON text frames; all
audio payloads are carried as base64 strings inside JSON messages.
Signals the client is connected and ready to stream.
Content-Type:
client.audio
A chunk of microphone audio from the browser.
Content-Type:
trigger.turn.start
Turn start trigger (push-to-talk)
Content-Type:
trigger.turn.end
Turn end trigger (push-to-talk)
Content-Type:
trigger.response.audio.replay_finished
Client finished playing back a response audio turn.
Content-Type:
client.response.text
A typed text message from the user.
Content-Type:
client.response.data
Arbitrary structured JSON emitted by the client UI.
Content-Type:
turn.start
Turn start
Content-Type:
response.audio
Synthesized speech audio from Layercode.
Content-Type:
response.text.delta
Response text delta
Content-Type:
response.text
Response text (complete)
Content-Type:
user.transcript.interim_delta
Interim transcript delta
Content-Type:
user.transcript.delta
Final transcript delta
Content-Type:
user.transcript
Complete turn transcript
Content-Type:
response.data
Structured JSON pushed to the client without audio.
Content-Type:
About AsyncAPI
The AsyncAPI specification describes event-driven APIs the way OpenAPI describes request/response APIs. A channel is the named pipe — a webhook URL, a Kafka topic, a WebSocket route, an MQTT subject — that producers and consumers publish or subscribe to. Each channel carries one or more messages with structured payloads, and an operation declares whether a given party sends or receives on that channel.
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.