[{"data":1,"prerenderedAt":916},["ShallowReactive",2],{"navigation":3,"\u002Fdocs\u002Frealtime\u002Fsession-configuration":235,"surround-\u002Fdocs\u002Frealtime\u002Fsession-configuration":913},[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":61,"body":237,"description":905,"extension":906,"links":907,"meta":908,"navigation":909,"new":18,"path":62,"rawbody":910,"seo":911,"stem":63,"technology":907,"__hash__":912},"content\u002Fdocs\u002F2.realtime\u002F7.session-configuration.md",{"type":238,"value":239,"toc":884},"minimark",[240,249,276,281,303,307,421,438,455,460,470,480,488,494,536,539,565,569,653,656,660,689,692,696,703,763,771,775,778,784,788,792,798,802,808,813,817,823,827,833,836,840,846,850,863,867],[241,242,243,244,248],"p",{},"Configure session parameters via ",[245,246,247],"code",{},"session.update"," messages.",[250,251,254],"callout",{"color":252,"icon":253},"primary","i-lucide-info",[241,255,256,259,260,264,265,268,269,275],{},[245,257,258],{},"language"," is optional. Passing a concrete code is ",[261,262,263],"strong",{},"recommended when you know it"," because it improves accuracy. If you omit it or send ",[245,266,267],{},"auto",", the service auto-detects the language. You can also call ",[270,271,272],"a",{"href":206},[245,273,274],{},"POST \u002Fv1\u002Faudio\u002Flanguage-detection"," first and pass the detected code.",[277,278,280],"h2",{"id":279},"when-to-configure","When to configure",[282,283,284,297],"ul",{},[285,286,287,290,291,293,294],"li",{},[261,288,289],{},"Before audio (recommended)",": send ",[245,292,247],{}," right after receiving ",[245,295,296],{},"session.created",[285,298,299,302],{},[261,300,301],{},"During session",": update parameters at any time",[277,304,306],{"id":305},"supported-options","Supported options",[308,309,310,326],"table",{},[311,312,313],"thead",{},[314,315,316,320,323],"tr",{},[317,318,319],"th",{},"Field",[317,321,322],{},"Type",[317,324,325],{},"Description",[327,328,329,357,390,406],"tbody",{},[314,330,331,336,339],{},[332,333,334],"td",{},[245,335,258],{},[332,337,338],{},"string | null",[332,340,341,342,345,346,349,350,345,353,356],{},"Audio source language. A concrete code (e.g. ",[245,343,344],{},"zh",", ",[245,347,348],{},"en",") is recommended for accuracy; ",[245,351,352],{},"\"auto\"",[245,354,355],{},"null",", or omitting it enables detection.",[314,358,359,364,367],{},[332,360,361],{},[245,362,363],{},"refinement",[332,365,366],{},"boolean | string",[332,368,369,370,373,374,377,378,381,382,385,386,389],{},"Opt in to per-utterance AI refinement. ",[245,371,372],{},"true"," selects the default ",[245,375,376],{},"lite"," profile; ",[245,379,380],{},"\"lite\""," \u002F ",[245,383,384],{},"\"pro\""," select a profile explicitly; ",[245,387,388],{},"false"," disables it. Fixed before audio.",[314,391,392,397,403],{},[332,393,394],{},[245,395,396],{},"target_languages",[332,398,399,400],{},"string",[401,402],"span",{},[332,404,405],{},"Translation targets (BCP-47, max 8). Fixed for the session; send before audio.",[314,407,408,413,415],{},[332,409,410],{},[245,411,412],{},"translate_to",[332,414,399],{},[332,416,417,418,420],{},"Single-language shorthand for ",[245,419,396],{},". Fixed for the session.",[241,422,423,425,426,345,428,430,431,433,434,437],{},[245,424,258],{}," can change at any time. ",[245,427,363],{},[245,429,396],{},", and ",[245,432,412],{}," are session-fixed: set them before audio, and later changes return ",[245,435,436],{},"session_features_locked",".",[241,439,440,441,443,444,447,448,345,450,430,452,437],{},"The gateway confirms every applied ",[245,442,247],{}," with a ",[245,445,446],{},"session.updated"," event containing the effective ",[245,449,258],{},[245,451,396],{},[245,453,454],{},"features",[456,457,459],"h3",{"id":458},"enabling-refinement","Enabling refinement",[241,461,462,465,466,469],{},[245,463,464],{},"session.created.features.asr_correction"," tells you whether refinement is available on the gateway. It is ",[261,467,468],{},"off by default","; opt in before sending audio:",[471,472,478],"pre",{"className":473,"code":475,"language":476,"meta":477},[474],"language-json","{ \"type\": \"session.update\", \"refinement\": true }\n","json","",[245,479,475],{"__ignoreMap":477},[241,481,482,373,484,487],{},[245,483,372],{},[261,485,486],{},"Lite"," profile. To pick a profile explicitly:",[471,489,492],{"className":490,"code":491,"language":476,"meta":477},[474],"{ \"type\": \"session.update\", \"refinement\": \"pro\" }\n",[245,493,491],{"__ignoreMap":477},[308,495,496,509],{},[311,497,498],{},[314,499,500,503,506],{},[317,501,502],{},"Profile",[317,504,505],{},"Billing",[317,507,508],{},"Behavior",[327,510,511,523],{},[314,512,513,517,520],{},[332,514,515],{},[245,516,376],{},[332,518,519],{},"Included in the base transcription price",[332,521,522],{},"Short prompt, two segments of context, tight character and completion budgets.",[314,524,525,530,533],{},[332,526,527],{},[245,528,529],{},"pro",[332,531,532],{},"Realtime refinement add-on",[332,534,535],{},"Full prompt, ten segments of context, and a rolling guide.",[241,537,538],{},"Both profiles skip very short slices — fewer than 3 CJK characters or 3 Latin words — and deliver the raw text unchanged. Such slices are rarely misheard on their own and usually lack the context needed to recover them. A skipped slice is still kept as context for the next utterance, so a later correction can still use it.",[241,540,541,542,544,545,548,549,551,552,554,555,558,559,562,563,437],{},"The gateway replies with ",[245,543,446],{}," and ",[245,546,547],{},"features.refinement"," set to the selected profile id (",[245,550,380],{}," or ",[245,553,384],{},"). If correction is not configured, the gateway returns ",[245,556,557],{},"refinement_unavailable","; an unknown profile returns ",[245,560,561],{},"invalid_refinement_profile","; if audio has already started, it returns ",[245,564,436],{},[456,566,568],{"id":567},"language-modes-and-switching","Language modes and switching",[308,570,571,580],{},[311,572,573],{},[314,574,575,578],{},[317,576,577],{},"Client action",[317,579,508],{},[327,581,582,592,607,622,632,640],{},[314,583,584,589],{},[332,585,586,588],{},[245,587,247],{}," with a concrete code",[332,590,591],{},"Use that language immediately. The client value always wins; no detection is run.",[314,593,594,604],{},[332,595,596,598,599,381,601,603],{},[245,597,247],{}," with ",[245,600,352],{},[245,602,355],{}," \u002F no update",[332,605,606],{},"Auto-detect the language. Detection runs on the next speech audio.",[314,608,609,615],{},[332,610,611,612,614],{},"Explicit → ",[245,613,267],{}," mid-session",[332,616,617,618,621],{},"Clear the cached language\u002Fvotes and ",[261,619,620],{},"re-run detection"," on subsequent speech. This is how a session that started in English can switch after another language appears.",[314,623,624,629],{},[332,625,626,628],{},[245,627,267],{}," → explicit",[332,630,631],{},"Use the explicit language immediately and stop detection.",[314,633,634,637],{},[332,635,636],{},"Explicit A → explicit B",[332,638,639],{},"Use B immediately.",[314,641,642,650],{},[332,643,644,646,647,649],{},[245,645,267],{}," → ",[245,648,267],{}," again",[332,651,652],{},"Treat as a detection reset and re-run detection.",[241,654,655],{},"Transcripts already delivered keep their language. The new setting applies to speech transcribed after the update.",[456,657,659],{"id":658},"two-ways-to-use-auto","Two ways to use auto",[661,662,663,677],"ol",{},[285,664,665,668,669,673,674,676],{},[261,666,667],{},"Client-side detection"," — call ",[270,670,671],{"href":206},[245,672,274],{}," with a short clip, then send the returned code via ",[245,675,247],{},". This is the most predictable option and avoids detection inside the stream.",[285,678,679,682,683,685,686,688],{},[261,680,681],{},"Server-side fallback"," — omit ",[245,684,258],{}," or send ",[245,687,352],{},". The session runs its own basic detection strategy (probe\u002Fvote on speech utterances) and caches the result until the client changes the language again.",[241,690,691],{},"Passing a known language is still recommended for accuracy and lower latency. If detection cannot decide, the session reports a detection error and retries on later speech; an empty transcript is not marked safe for downstream use.",[456,693,695],{"id":694},"what-the-client-receives","What the client receives",[241,697,698,699,702],{},"The detected language is delivered on each ",[245,700,701],{},"conversation.item.input_audio_transcription.completed"," event:",[308,704,705,714],{},[311,706,707],{},[314,708,709,711],{},[317,710,319],{},[317,712,713],{},"Meaning for the UI",[327,715,716,725,741,753],{},[314,717,718,722],{},[332,719,720],{},[245,721,258],{},[332,723,724],{},"The language used for this utterance (detected in auto mode)",[314,726,727,732],{},[332,728,729],{},[245,730,731],{},"language_source",[332,733,734,737,738,740],{},[245,735,736],{},"client"," (explicit) or ",[245,739,267],{}," (detected)",[314,742,743,748],{},[332,744,745],{},[245,746,747],{},"language_provisional",[332,749,750,752],{},[245,751,372],{}," while auto-detection is still voting; show “detecting” or a provisional badge",[314,754,755,760],{},[332,756,757],{},[245,758,759],{},"language_detection_error",[332,761,762],{},"Detection failed; show “unknown” and retry on later speech",[241,764,765,766,770],{},"There is no separate client event for “language detected”; update the language indicator when the completed event arrives. Use ",[270,767,768],{"href":206},[245,769,274],{}," if you need the language before audio.",[456,772,774],{"id":773},"audio-configuration","Audio configuration",[241,776,777],{},"Fixed by the gateway, client cannot change:",[471,779,782],{"className":780,"code":781,"language":476,"meta":477},[474],"{ \"format\": \"pcm_s16le\", \"sample_rate\": 16000, \"channels\": 1 }\n",[245,783,781],{"__ignoreMap":477},[277,785,787],{"id":786},"examples","Examples",[456,789,791],{"id":790},"set-language","Set language",[471,793,796],{"className":794,"code":795,"language":476,"meta":477},[474],"{ \"type\": \"session.update\", \"language\": \"zh\" }\n",[245,797,795],{"__ignoreMap":477},[456,799,801],{"id":800},"enable-translation","Enable translation",[471,803,806],{"className":804,"code":805,"language":476,"meta":477},[474],"{\n  \"type\": \"session.update\",\n  \"language\": \"zh\",\n  \"target_languages\": [\"en\", \"ja\"]\n}\n",[245,807,805],{"__ignoreMap":477},[241,809,810,811,437],{},"Send this before the first audio frame. The target set is frozen for the session; see ",[270,812,57],{"href":58},[456,814,816],{"id":815},"switch-language-at-runtime","Switch language at runtime",[471,818,821],{"className":819,"code":820,"language":476,"meta":477},[474],"{ \"type\": \"session.update\", \"language\": \"en\" }\n",[245,822,820],{"__ignoreMap":477},[456,824,826],{"id":825},"switch-to-auto-mid-session","Switch to auto mid-session",[471,828,831],{"className":829,"code":830,"language":476,"meta":477},[474],"{ \"type\": \"session.update\", \"language\": \"auto\" }\n",[245,832,830],{"__ignoreMap":477},[241,834,835],{},"Send this when the language changes or becomes unknown. It resets detection and re-detects on the next speech audio.",[456,837,839],{"id":838},"switch-back-to-an-explicit-language","Switch back to an explicit language",[471,841,844],{"className":842,"code":843,"language":476,"meta":477},[474],"{ \"type\": \"session.update\", \"language\": \"ja\" }\n",[245,845,843],{"__ignoreMap":477},[277,847,849],{"id":848},"tenant-isolation","Tenant isolation",[241,851,852,853,345,856,345,859,862],{},"Identity and credential fields (",[245,854,855],{},"request_id",[245,857,858],{},"session_id",[245,860,861],{},"user_id",") are injected by the gateway and cannot be overridden by the client.",[277,864,866],{"id":865},"related","Related",[282,868,869,874,879],{},[285,870,871,873],{},[270,872,173],{"href":174}," — message format",[285,875,876,878],{},[270,877,177],{"href":178}," — server-pushed events",[285,880,881,883],{},[270,882,119],{"href":120}," — translation concepts",{"title":477,"searchDepth":885,"depth":885,"links":886},2,[887,888,896,903,904],{"id":279,"depth":885,"text":280},{"id":305,"depth":885,"text":306,"children":889},[890,892,893,894,895],{"id":458,"depth":891,"text":459},3,{"id":567,"depth":891,"text":568},{"id":658,"depth":891,"text":659},{"id":694,"depth":891,"text":695},{"id":773,"depth":891,"text":774},{"id":786,"depth":885,"text":787,"children":897},[898,899,900,901,902],{"id":790,"depth":891,"text":791},{"id":800,"depth":891,"text":801},{"id":815,"depth":891,"text":816},{"id":825,"depth":891,"text":826},{"id":838,"depth":891,"text":839},{"id":848,"depth":885,"text":849},{"id":865,"depth":885,"text":866},"language and other session-level options.","md",null,{},true,"---\ntitle: Session Configuration\ndescription: language and other session-level options.\n---\n\nConfigure session parameters via `session.update` messages.\n\n::callout{icon=\"i-lucide-info\" color=\"primary\"}\n`language` is optional. Passing a concrete code is **recommended when you know it** because it improves accuracy. If you omit it or send `auto`, the service auto-detects the language. You can also call [`POST \u002Fv1\u002Faudio\u002Flanguage-detection`](\u002Fdocs\u002Fapi-reference\u002Flanguage-detection) first and pass the detected code.\n::\n\n## When to configure\n\n- **Before audio (recommended)**: send `session.update` right after receiving `session.created`\n- **During session**: update parameters at any time\n\n## Supported options\n\n| Field | Type | Description |\n|---|---|---|\n| `language` | string \\| null | Audio source language. A concrete code (e.g. `zh`, `en`) is recommended for accuracy; `\"auto\"`, `null`, or omitting it enables detection. |\n| `refinement` | boolean \\| string | Opt in to per-utterance AI refinement. `true` selects the default `lite` profile; `\"lite\"` \u002F `\"pro\"` select a profile explicitly; `false` disables it. Fixed before audio. |\n| `target_languages` | string[] | Translation targets (BCP-47, max 8). Fixed for the session; send before audio. |\n| `translate_to` | string | Single-language shorthand for `target_languages`. Fixed for the session. |\n\n`language` can change at any time. `refinement`, `target_languages`, and `translate_to` are session-fixed: set them before audio, and later changes return `session_features_locked`.\n\nThe gateway confirms every applied `session.update` with a `session.updated` event containing the effective `language`, `target_languages`, and `features`.\n\n### Enabling refinement\n\n`session.created.features.asr_correction` tells you whether refinement is available on the gateway. It is **off by default**; opt in before sending audio:\n\n```json\n{ \"type\": \"session.update\", \"refinement\": true }\n```\n\n`true` selects the default **Lite** profile. To pick a profile explicitly:\n\n```json\n{ \"type\": \"session.update\", \"refinement\": \"pro\" }\n```\n\n| Profile | Billing | Behavior |\n|---|---|---|\n| `lite` | Included in the base transcription price | Short prompt, two segments of context, tight character and completion budgets. |\n| `pro` | Realtime refinement add-on | Full prompt, ten segments of context, and a rolling guide. |\n\nBoth profiles skip very short slices — fewer than 3 CJK characters or 3 Latin words — and deliver the raw text unchanged. Such slices are rarely misheard on their own and usually lack the context needed to recover them. A skipped slice is still kept as context for the next utterance, so a later correction can still use it.\n\nThe gateway replies with `session.updated` and `features.refinement` set to the selected profile id (`\"lite\"` or `\"pro\"`). If correction is not configured, the gateway returns `refinement_unavailable`; an unknown profile returns `invalid_refinement_profile`; if audio has already started, it returns `session_features_locked`.\n\n### Language modes and switching\n\n| Client action | Behavior |\n|---|---|\n| `session.update` with a concrete code | Use that language immediately. The client value always wins; no detection is run. |\n| `session.update` with `\"auto\"` \u002F `null` \u002F no update | Auto-detect the language. Detection runs on the next speech audio. |\n| Explicit → `auto` mid-session | Clear the cached language\u002Fvotes and **re-run detection** on subsequent speech. This is how a session that started in English can switch after another language appears. |\n| `auto` → explicit | Use the explicit language immediately and stop detection. |\n| Explicit A → explicit B | Use B immediately. |\n| `auto` → `auto` again | Treat as a detection reset and re-run detection. |\n\nTranscripts already delivered keep their language. The new setting applies to speech transcribed after the update.\n\n### Two ways to use auto\n\n1. **Client-side detection** — call [`POST \u002Fv1\u002Faudio\u002Flanguage-detection`](\u002Fdocs\u002Fapi-reference\u002Flanguage-detection) with a short clip, then send the returned code via `session.update`. This is the most predictable option and avoids detection inside the stream.\n2. **Server-side fallback** — omit `language` or send `\"auto\"`. The session runs its own basic detection strategy (probe\u002Fvote on speech utterances) and caches the result until the client changes the language again.\n\nPassing a known language is still recommended for accuracy and lower latency. If detection cannot decide, the session reports a detection error and retries on later speech; an empty transcript is not marked safe for downstream use.\n\n### What the client receives\n\nThe detected language is delivered on each `conversation.item.input_audio_transcription.completed` event:\n\n| Field | Meaning for the UI |\n|---|---|\n| `language` | The language used for this utterance (detected in auto mode) |\n| `language_source` | `client` (explicit) or `auto` (detected) |\n| `language_provisional` | `true` while auto-detection is still voting; show “detecting” or a provisional badge |\n| `language_detection_error` | Detection failed; show “unknown” and retry on later speech |\n\nThere is no separate client event for “language detected”; update the language indicator when the completed event arrives. Use [`POST \u002Fv1\u002Faudio\u002Flanguage-detection`](\u002Fdocs\u002Fapi-reference\u002Flanguage-detection) if you need the language before audio.\n\n### Audio configuration\n\nFixed by the gateway, client cannot change:\n\n```json\n{ \"format\": \"pcm_s16le\", \"sample_rate\": 16000, \"channels\": 1 }\n```\n\n## Examples\n\n### Set language\n\n```json\n{ \"type\": \"session.update\", \"language\": \"zh\" }\n```\n\n### Enable translation\n\n```json\n{\n  \"type\": \"session.update\",\n  \"language\": \"zh\",\n  \"target_languages\": [\"en\", \"ja\"]\n}\n```\n\nSend this before the first audio frame. The target set is frozen for the session; see [Realtime Translation](\u002Fdocs\u002Frealtime\u002Frealtime-translation).\n\n### Switch language at runtime\n\n```json\n{ \"type\": \"session.update\", \"language\": \"en\" }\n```\n\n### Switch to auto mid-session\n\n```json\n{ \"type\": \"session.update\", \"language\": \"auto\" }\n```\n\nSend this when the language changes or becomes unknown. It resets detection and re-detects on the next speech audio.\n\n### Switch back to an explicit language\n\n```json\n{ \"type\": \"session.update\", \"language\": \"ja\" }\n```\n\n## Tenant isolation\n\nIdentity and credential fields (`request_id`, `session_id`, `user_id`) are injected by the gateway and cannot be overridden by the client.\n\n## Related\n\n- [Client Messages](\u002Fdocs\u002Fapi-reference\u002Fclient-messages) — message format\n- [Server Events](\u002Fdocs\u002Fapi-reference\u002Fserver-events) — server-pushed events\n- [Live Translation](\u002Fdocs\u002Fconcepts\u002Flive-translation) — translation concepts",{"title":61,"description":905},"RZsAc1rv5XnVc7jstD77r250GfiMprJon9UjnwbjEDw",[914,915],{"title":57,"path":58,"stem":59,"children":-1},{"title":65,"path":66,"stem":67,"children":-1},1795064385010]