[{"data":1,"prerenderedAt":640},["ShallowReactive",2],{"navigation":3,"\u002Fdocs\u002Fapi-reference\u002Frealtime-api":235,"surround-\u002Fdocs\u002Fapi-reference\u002Frealtime-api":637},[4],{"title":5,"path":6,"stem":7,"children":8,"page":18},"Docs","\u002Fdocs","docs",[9,33,68,95,130,161,208],{"title":10,"path":11,"stem":12,"children":13,"page":18,"type":32},"Start","\u002Fdocs\u002Fstart","docs\u002F1.start",[14,20,24,28],{"title":15,"path":16,"stem":17,"new":18,"type":19,"children":-1},"Get started with Lanson Live API","\u002Fdocs\u002Fstart\u002Fquickstart","docs\u002F1.start\u002F2.quickstart",false,"page",{"title":21,"path":22,"stem":23,"new":18,"type":19,"children":-1},"Authentication","\u002Fdocs\u002Fstart\u002Fauthentication","docs\u002F1.start\u002F3.authentication",{"title":25,"path":26,"stem":27,"new":18,"type":19,"children":-1},"Choose an API","\u002Fdocs\u002Fstart\u002Fchoose-an-api","docs\u002F1.start\u002F5.choose-an-api",{"title":29,"path":30,"stem":31,"new":18,"type":19,"children":-1},"Pricing","\u002Fdocs\u002Fstart\u002Fpricing","docs\u002F1.start\u002F6.pricing","group",{"title":34,"path":35,"stem":36,"children":37,"new":18,"type":32},"Realtime","\u002Fdocs\u002Frealtime","docs\u002F2.realtime\u002F1.index",[38,40,44,48,52,56,60,64],{"title":39,"path":35,"stem":36,"new":18,"type":19,"children":-1},"Realtime Overview",{"title":41,"path":42,"stem":43,"new":18,"type":19,"children":-1},"Realtime Quickstart","\u002Fdocs\u002Frealtime\u002Fquickstart","docs\u002F2.realtime\u002F2.quickstart",{"title":45,"path":46,"stem":47,"new":18,"type":19,"children":-1},"Connection Lifecycle","\u002Fdocs\u002Frealtime\u002Fconnection-lifecycle","docs\u002F2.realtime\u002F3.connection-lifecycle",{"title":49,"path":50,"stem":51,"new":18,"type":19,"children":-1},"Audio Input","\u002Fdocs\u002Frealtime\u002Faudio-input","docs\u002F2.realtime\u002F4.audio-input",{"title":53,"path":54,"stem":55,"new":18,"type":19,"children":-1},"Transcript Lifecycle","\u002Fdocs\u002Frealtime\u002Ftranscript-lifecycle","docs\u002F2.realtime\u002F5.transcript-lifecycle",{"title":57,"path":58,"stem":59,"new":18,"type":19,"children":-1},"Realtime Translation","\u002Fdocs\u002Frealtime\u002Frealtime-translation","docs\u002F2.realtime\u002F6.realtime-translation",{"title":61,"path":62,"stem":63,"new":18,"type":19,"children":-1},"Session Configuration","\u002Fdocs\u002Frealtime\u002Fsession-configuration","docs\u002F2.realtime\u002F7.session-configuration",{"title":65,"path":66,"stem":67,"new":18,"type":19,"children":-1},"Handling Interruptions & Silence","\u002Fdocs\u002Frealtime\u002Finterruptions-silence","docs\u002F2.realtime\u002F8.interruptions-silence",{"title":69,"path":70,"stem":71,"children":72,"new":18,"type":32},"Recorded","\u002Fdocs\u002Frecorded","docs\u002F3.recorded\u002F1.index",[73,75,79,83,87,91],{"title":74,"path":70,"stem":71,"new":18,"type":19,"children":-1},"Recorded Overview",{"title":76,"path":77,"stem":78,"new":18,"type":19,"children":-1},"Transcribe Audio","\u002Fdocs\u002Frecorded\u002Ftranscribe-audio","docs\u002F3.recorded\u002F2.transcribe-audio",{"title":80,"path":81,"stem":82,"new":18,"type":19,"children":-1},"Timestamps & Speakers","\u002Fdocs\u002Frecorded\u002Ftimestamps-speakers","docs\u002F3.recorded\u002F3.timestamps-speakers",{"title":84,"path":85,"stem":86,"new":18,"type":19,"children":-1},"Subtitles","\u002Fdocs\u002Frecorded\u002Fsubtitles","docs\u002F3.recorded\u002F4.subtitles",{"title":88,"path":89,"stem":90,"new":18,"type":19,"children":-1},"Recorded Translation","\u002Fdocs\u002Frecorded\u002Ftranslation","docs\u002F3.recorded\u002F5.translation",{"title":92,"path":93,"stem":94,"new":18,"type":19,"children":-1},"Structured Results","\u002Fdocs\u002Frecorded\u002Fstructured-results","docs\u002F3.recorded\u002F6.structured-results",{"title":96,"path":97,"stem":98,"children":99,"new":18,"type":32},"Concepts","\u002Fdocs\u002Fconcepts","docs\u002F4.concepts\u002F1.index",[100,102,106,110,114,118,122,126],{"title":101,"path":97,"stem":98,"new":18,"type":19,"children":-1},"Voice Context Layer",{"title":103,"path":104,"stem":105,"new":18,"type":19,"children":-1},"Stable vs. Partial Text","\u002Fdocs\u002Fconcepts\u002Fstable-vs-partial-text","docs\u002F4.concepts\u002F2.stable-vs-partial-text",{"title":107,"path":108,"stem":109,"new":18,"type":19,"children":-1},"StableStream™","\u002Fdocs\u002Fconcepts\u002Fstablestream","docs\u002F4.concepts\u002F3.stablestream",{"title":111,"path":112,"stem":113,"new":18,"type":19,"children":-1},"Context-Aware Processing","\u002Fdocs\u002Fconcepts\u002Fcontext-aware-processing","docs\u002F4.concepts\u002F4.context-aware-processing",{"title":115,"path":116,"stem":117,"new":18,"type":19,"children":-1},"Understanding Latency","\u002Fdocs\u002Fconcepts\u002Flatency","docs\u002F4.concepts\u002F5.latency",{"title":119,"path":120,"stem":121,"new":18,"type":19,"children":-1},"Live Translation","\u002Fdocs\u002Fconcepts\u002Flive-translation","docs\u002F4.concepts\u002F6.live-translation",{"title":123,"path":124,"stem":125,"new":18,"type":19,"children":-1},"Trinity Engine","\u002Fdocs\u002Fconcepts\u002Ftrinity-engine","docs\u002F4.concepts\u002F7.trinity-engine",{"title":127,"path":128,"stem":129,"new":18,"type":19,"children":-1},"LiveFinal™","\u002Fdocs\u002Fconcepts\u002Flivefinal","docs\u002F4.concepts\u002F8.livefinal",{"title":131,"path":132,"stem":133,"children":134,"new":18,"type":32},"Guides","\u002Fdocs\u002Fguides","docs\u002F5.guides\u002F1.index",[135,137,141,145,149,153,157],{"title":136,"path":132,"stem":133,"new":18,"type":19,"children":-1},"Browser Live Captions",{"title":138,"path":139,"stem":140,"new":18,"type":19,"children":-1},"Server-side Streaming","\u002Fdocs\u002Fguides\u002Fserver-side-streaming","docs\u002F5.guides\u002F2.server-side-streaming",{"title":142,"path":143,"stem":144,"new":18,"type":19,"children":-1},"Build a Stable Caption UI","\u002Fdocs\u002Fguides\u002Fstable-caption-ui","docs\u002F5.guides\u002F3.stable-caption-ui",{"title":146,"path":147,"stem":148,"new":18,"type":19,"children":-1},"Build Live Translation","\u002Fdocs\u002Fguides\u002Flive-translation","docs\u002F5.guides\u002F4.live-translation",{"title":150,"path":151,"stem":152,"new":18,"type":19,"children":-1},"Save a Transcript","\u002Fdocs\u002Fguides\u002Fsave-transcript","docs\u002F5.guides\u002F5.save-transcript",{"title":154,"path":155,"stem":156,"new":18,"type":19,"children":-1},"Reconnect a Live Session","\u002Fdocs\u002Fguides\u002Freconnection","docs\u002F5.guides\u002F6.reconnection",{"title":158,"path":159,"stem":160,"new":18,"type":19,"children":-1},"Client-VAD speech segments","\u002Fdocs\u002Fguides\u002Fclient-vad-segments","docs\u002F5.guides\u002F7.client-vad-segments",{"title":162,"path":163,"stem":164,"children":165,"new":18,"type":32},"API Reference","\u002Fdocs\u002Fapi-reference","docs\u002F6.api-reference\u002F1.index",[166,168,172,176,180,184,188,192,196,200,204],{"title":167,"path":163,"stem":164,"new":18,"type":19,"children":-1},"API Reference Overview",{"title":169,"path":170,"stem":171,"new":18,"type":19,"children":-1},"Realtime API","\u002Fdocs\u002Fapi-reference\u002Frealtime-api","docs\u002F6.api-reference\u002F2.realtime-api",{"title":173,"path":174,"stem":175,"new":18,"type":19,"children":-1},"Client Messages","\u002Fdocs\u002Fapi-reference\u002Fclient-messages","docs\u002F6.api-reference\u002F3.client-messages",{"title":177,"path":178,"stem":179,"new":18,"type":19,"children":-1},"Server Events","\u002Fdocs\u002Fapi-reference\u002Fserver-events","docs\u002F6.api-reference\u002F4.server-events",{"title":181,"path":182,"stem":183,"new":18,"type":19,"children":-1},"Segment Transcription API","\u002Fdocs\u002Fapi-reference\u002Fsegment-transcription","docs\u002F6.api-reference\u002F5.segment-transcription",{"title":185,"path":186,"stem":187,"new":18,"type":19,"children":-1},"Batch Transcription Jobs","\u002Fdocs\u002Fapi-reference\u002Fbatch-jobs","docs\u002F6.api-reference\u002F6.batch-jobs",{"title":189,"path":190,"stem":191,"new":18,"type":19,"children":-1},"Languages & Models","\u002Fdocs\u002Fapi-reference\u002Flanguages","docs\u002F6.api-reference\u002F7.languages",{"title":193,"path":194,"stem":195,"new":18,"type":19,"children":-1},"Errors","\u002Fdocs\u002Fapi-reference\u002Ferrors","docs\u002F6.api-reference\u002F8.errors",{"title":197,"path":198,"stem":199,"new":18,"type":19,"children":-1},"Rate Limits","\u002Fdocs\u002Fapi-reference\u002Frate-limits","docs\u002F6.api-reference\u002F9.rate-limits",{"title":201,"path":202,"stem":203,"new":18,"type":19,"children":-1},"Admin API","\u002Fdocs\u002Fapi-reference\u002Fadmin","docs\u002F6.api-reference\u002F10.admin",{"title":205,"path":206,"stem":207,"new":18,"type":19,"children":-1},"Language Detection","\u002Fdocs\u002Fapi-reference\u002Flanguage-detection","docs\u002F6.api-reference\u002F11.language-detection",{"title":209,"path":210,"stem":211,"children":212,"new":18,"type":32},"Production","\u002Fdocs\u002Fproduction","docs\u002F7.production\u002F1.index",[213,215,219,223,227,231],{"title":214,"path":210,"stem":211,"new":18,"type":19,"children":-1},"Production Checklist",{"title":216,"path":217,"stem":218,"new":18,"type":19,"children":-1},"Reconnection & Retries","\u002Fdocs\u002Fproduction\u002Freconnection-retries","docs\u002F7.production\u002F2.reconnection-retries",{"title":220,"path":221,"stem":222,"new":18,"type":19,"children":-1},"Latency Best Practices","\u002Fdocs\u002Fproduction\u002Flatency-best-practices","docs\u002F7.production\u002F3.latency-best-practices",{"title":224,"path":225,"stem":226,"new":18,"type":19,"children":-1},"Security & Privacy","\u002Fdocs\u002Fproduction\u002Fsecurity-privacy","docs\u002F7.production\u002F4.security-privacy",{"title":228,"path":229,"stem":230,"new":18,"type":19,"children":-1},"Data Retention","\u002Fdocs\u002Fproduction\u002Fdata-retention","docs\u002F7.production\u002F5.data-retention",{"title":232,"path":233,"stem":234,"new":18,"type":19,"children":-1},"Changelog","\u002Fdocs\u002Fproduction\u002Fchangelog","docs\u002F7.production\u002F6.changelog",{"id":236,"title":169,"body":237,"description":628,"extension":629,"links":630,"meta":631,"navigation":633,"new":18,"path":170,"rawbody":634,"seo":635,"stem":171,"technology":630,"__hash__":636},"content\u002Fdocs\u002F6.api-reference\u002F2.realtime-api.md",{"type":238,"value":239,"toc":614},"minimark",[240,245,259,278,282,292,295,298,359,368,398,402,407,426,430,437,445,450,454,457,479,483,588,592],[241,242,244],"h2",{"id":243},"what-it-does","What it does",[246,247,248,249,253,254,258],"p",{},"Stream live speech with ",[250,251,252],"strong",{},"Lanson Live API",". Open a WebSocket, send PCM16LE audio frames, and receive completed transcript events. No model parameter is required; language and optional features are configured through ",[255,256,257],"code",{},"session.update",".",[260,261,264],"callout",{"color":262,"icon":263},"primary","i-lucide-info",[246,265,266,269,270,273,274,258],{},[250,267,268],{},"Billing:"," WebSocket usage is metered by processed audio and billed at the ",[250,271,272],{},"realtime transcription"," rate. See ",[275,276,277],"a",{"href":30},"API pricing",[241,279,281],{"id":280},"endpoint","Endpoint",[283,284,289],"pre",{"className":285,"code":287,"language":288},[286],"language-text","WSS \u002Fv1\u002Faudio\u002Ftranscriptions\u002Fstream\n","text",[255,290,287],{"__ignoreMap":291},"",[241,293,21],{"id":294},"authentication",[246,296,297],{},"Three authentication methods:",[299,300,301,317],"table",{},[302,303,304],"thead",{},[305,306,307,311,314],"tr",{},[308,309,310],"th",{},"Method",[308,312,313],{},"Usage",[308,315,316],{},"Use case",[318,319,320,334,347],"tbody",{},[305,321,322,326,331],{},[323,324,325],"td",{},"Bearer header",[323,327,328],{},[255,329,330],{},"Authorization: Bearer sk-...",[323,332,333],{},"Server-side clients",[305,335,336,339,344],{},[323,337,338],{},"Query token",[323,340,341],{},[255,342,343],{},"?access_token=rt_...",[323,345,346],{},"Browser (session token)",[305,348,349,352,357],{},[323,350,351],{},"Query token (alias)",[323,353,354],{},[255,355,356],{},"?token=rt_...",[323,358,346],{},[246,360,361,362,365,366,258],{},"Session tokens are obtained via ",[255,363,364],{},"POST \u002Fv1\u002Faudio\u002Ftranscriptions\u002Fsession-token"," and are valid for 60 seconds. See ",[275,367,21],{"href":22},[260,369,370],{"color":262,"icon":263},[246,371,372,375,376,379,380,383,384,387,388,393,394,397],{},[255,373,374],{},"language"," is optional. Send a concrete code (e.g. ",[255,377,378],{},"en",", ",[255,381,382],{},"zh",") when you know it for better accuracy; otherwise omit it or send ",[255,385,386],{},"language: \"auto\""," to auto-detect. You can also call ",[275,389,390],{"href":206},[255,391,392],{},"POST \u002Fv1\u002Faudio\u002Flanguage-detection"," first and pass the result. An explicit code always wins; sending ",[255,395,396],{},"\"auto\""," mid-session resets detection and re-detects on later speech.",[241,399,401],{"id":400},"connection","Connection",[403,404,406],"h3",{"id":405},"upgrade-conditions","Upgrade conditions",[408,409,410,417,423],"ul",{},[411,412,413,414],"li",{},"Request must be a WebSocket upgrade, otherwise ",[255,415,416],{},"426 websocket_required",[411,418,419,420],{},"Gateway must be enabled, otherwise ",[255,421,422],{},"503 gateway_disabled",[411,424,425],{},"Connection quota must pass (concurrent connections + handshake rate)",[403,427,429],{"id":428},"on-success","On success",[246,431,432,433,436],{},"Receives a ",[255,434,435],{},"session.created"," event:",[283,438,443],{"className":439,"code":441,"language":442,"meta":291},[440],"language-json","{\n  \"type\": \"session.created\",\n  \"request_id\": \"...\",\n  \"session_id\": \"sess_...\",\n  \"audio\": { \"format\": \"pcm_s16le\", \"sample_rate\": 16000, \"channels\": 1 },\n  \"turn_detection\": { \"type\": \"server_vad\" },\n  \"plan\": \"pro\",\n  \"features\": { \"asr_correction\": false },\n  \"limits\": {\n    \"max_concurrent_utterances\": 8,\n    \"max_session_seconds\": 28800,\n    \"idle_timeout_seconds\": 180,\n    \"remaining_audio_seconds\": 720000\n  }\n}\n","json",[255,444,441],{"__ignoreMap":291},[246,446,447,448,258],{},"Limits depend on the plan; see ",[275,449,197],{"href":198},[241,451,453],{"id":452},"message-format","Message format",[246,455,456],{},"All client audio is sent as JSON text frames. Binary PCM frames are not transcribed by the public gateway today.",[408,458,459,469],{},[411,460,461,464,465,468],{},[250,462,463],{},"Text frames",": JSON objects, must contain a ",[255,466,467],{},"type"," field",[411,470,471,474,475,478],{},[250,472,473],{},"Audio",": base64 PCM16LE in ",[255,476,477],{},"input_audio_buffer.append"," (binary frames are not transcribed today)",[241,480,482],{"id":481},"websocket-close-codes","WebSocket close codes",[299,484,485,499],{},[302,486,487],{},[305,488,489,493,496],{},[308,490,492],{"align":491},"right","Code",[308,494,495],{},"Close reason",[308,497,498],{},"Meaning",[318,500,501,512,525,537,549,562,575],{},[305,502,503,506,509],{},[323,504,505],{"align":491},"1000",[323,507,508],{},"—",[323,510,511],{},"Normal close",[305,513,514,517,522],{},[323,515,516],{"align":491},"1008",[323,518,519],{},[255,520,521],{},"session_audio_limit",[323,523,524],{},"Realtime session audio budget exceeded",[305,526,527,529,534],{},[323,528,516],{"align":491},[323,530,531],{},[255,532,533],{},"audio_quota_exhausted",[323,535,536],{},"Billing-window audio budget exhausted",[305,538,539,541,546],{},[323,540,516],{"align":491},[323,542,543],{},[255,544,545],{},"session_duration_limit",[323,547,548],{},"Session wall-clock duration exceeded",[305,550,551,554,559],{},[323,552,553],{"align":491},"1009",[323,555,556],{},[255,557,558],{},"frame_too_large",[323,560,561],{},"Audio frame exceeds 1 MiB",[305,563,564,567,572],{},[323,565,566],{"align":491},"1011",[323,568,569],{},[255,570,571],{},"client_error",[323,573,574],{},"Client socket error or unexpected gateway error",[305,576,577,580,585],{},[323,578,579],{"align":491},"4408",[323,581,582],{},[255,583,584],{},"idle_timeout",[323,586,587],{},"No audio received within idle timeout window",[241,589,591],{"id":590},"related","Related",[408,593,594,599,604,609],{},[411,595,596,598],{},[275,597,173],{"href":174}," — all client-sent messages",[411,600,601,603],{},[275,602,177],{"href":178}," — all server-pushed events",[411,605,606,608],{},[275,607,41],{"href":42}," — complete example",[411,610,611,613],{},[275,612,21],{"href":22}," — auth details",{"title":291,"searchDepth":615,"depth":615,"links":616},2,[617,618,619,620,625,626,627],{"id":243,"depth":615,"text":244},{"id":280,"depth":615,"text":281},{"id":294,"depth":615,"text":21},{"id":400,"depth":615,"text":401,"children":621},[622,624],{"id":405,"depth":623,"text":406},3,{"id":428,"depth":623,"text":429},{"id":452,"depth":615,"text":453},{"id":481,"depth":615,"text":482},{"id":590,"depth":615,"text":591},"The Realtime WebSocket path of Lanson Live API.","md",null,{"updated":632},"2026-11-08",true,"---\ntitle: Realtime API\ndescription: The Realtime WebSocket path of Lanson Live API.\nupdated: 2026-11-08\n---\n## What it does\n\nStream live speech with **Lanson Live API**. Open a WebSocket, send PCM16LE audio frames, and receive completed transcript events. No model parameter is required; language and optional features are configured through `session.update`.\n\n::callout{icon=\"i-lucide-info\" color=\"primary\"}\n**Billing:** WebSocket usage is metered by processed audio and billed at the **realtime transcription** rate. See [API pricing](\u002Fdocs\u002Fstart\u002Fpricing).\n::\n\n## Endpoint\n\n```\nWSS \u002Fv1\u002Faudio\u002Ftranscriptions\u002Fstream\n```\n\n## Authentication\n\nThree authentication methods:\n\n| Method | Usage | Use case |\n|---|---|---|\n| Bearer header | `Authorization: Bearer sk-...` | Server-side clients |\n| Query token | `?access_token=rt_...` | Browser (session token) |\n| Query token (alias) | `?token=rt_...` | Browser (session token) |\n\nSession tokens are obtained via `POST \u002Fv1\u002Faudio\u002Ftranscriptions\u002Fsession-token` and are valid for 60 seconds. See [Authentication](\u002Fdocs\u002Fstart\u002Fauthentication).\n\n::callout{icon=\"i-lucide-info\" color=\"primary\"}\n`language` is optional. Send a concrete code (e.g. `en`, `zh`) when you know it for better accuracy; otherwise omit it or send `language: \"auto\"` to auto-detect. You can also call [`POST \u002Fv1\u002Faudio\u002Flanguage-detection`](\u002Fdocs\u002Fapi-reference\u002Flanguage-detection) first and pass the result. An explicit code always wins; sending `\"auto\"` mid-session resets detection and re-detects on later speech.\n::\n\n## Connection\n\n### Upgrade conditions\n\n- Request must be a WebSocket upgrade, otherwise `426 websocket_required`\n- Gateway must be enabled, otherwise `503 gateway_disabled`\n- Connection quota must pass (concurrent connections + handshake rate)\n\n### On success\n\nReceives a `session.created` event:\n\n```json\n{\n  \"type\": \"session.created\",\n  \"request_id\": \"...\",\n  \"session_id\": \"sess_...\",\n  \"audio\": { \"format\": \"pcm_s16le\", \"sample_rate\": 16000, \"channels\": 1 },\n  \"turn_detection\": { \"type\": \"server_vad\" },\n  \"plan\": \"pro\",\n  \"features\": { \"asr_correction\": false },\n  \"limits\": {\n    \"max_concurrent_utterances\": 8,\n    \"max_session_seconds\": 28800,\n    \"idle_timeout_seconds\": 180,\n    \"remaining_audio_seconds\": 720000\n  }\n}\n```\n\nLimits depend on the plan; see [Rate Limits](\u002Fdocs\u002Fapi-reference\u002Frate-limits).\n\n## Message format\n\nAll client audio is sent as JSON text frames. Binary PCM frames are not transcribed by the public gateway today.\n\n- **Text frames**: JSON objects, must contain a `type` field\n- **Audio**: base64 PCM16LE in `input_audio_buffer.append` (binary frames are not transcribed today)\n\n## WebSocket close codes\n\n| Code | Close reason | Meaning |\n|---:|---|---|\n| 1000 | — | Normal close |\n| 1008 | `session_audio_limit` | Realtime session audio budget exceeded |\n| 1008 | `audio_quota_exhausted` | Billing-window audio budget exhausted |\n| 1008 | `session_duration_limit` | Session wall-clock duration exceeded |\n| 1009 | `frame_too_large` | Audio frame exceeds 1 MiB |\n| 1011 | `client_error` | Client socket error or unexpected gateway error |\n| 4408 | `idle_timeout` | No audio received within idle timeout window |\n\n## Related\n\n- [Client Messages](\u002Fdocs\u002Fapi-reference\u002Fclient-messages) — all client-sent messages\n- [Server Events](\u002Fdocs\u002Fapi-reference\u002Fserver-events) — all server-pushed events\n- [Realtime Quickstart](\u002Fdocs\u002Frealtime\u002Fquickstart) — complete example\n- [Authentication](\u002Fdocs\u002Fstart\u002Fauthentication) — auth details\n",{"title":169,"description":628},"8BazpL2LW0EABo0KnYCx0ej1cENnJ2h4HN-NdOlOHZA",[638,639],{"title":205,"path":206,"stem":207,"children":-1},{"title":173,"path":174,"stem":175,"children":-1},1795064386114]