Try streaming speech to text with your microphone and API key, without writing code.
Get an API key from the dashboard, paste it below, and select Start recording. Allow microphone access and speak. Select Stop and transcribe to receive the final transcript.Auto-finalize after pauses confirms each utterance after 500 milliseconds of silence and keeps listening. Turn it off to receive one final transcript when you stop. Choose Balanced for faster feedback or High accuracy for more context. Language detection is automatic.The demo uses the same ASR WebSocket API as your application and charges your workspace’s normal speech-to-text credits. The two-minute recording cap applies to this demo, not the API.
Closing or reloading the page stops the recording and clears the transcript and API key from the demo. Copy any text you want to keep before leaving. For application integration, keep your API key on your server.
The WebSocket reference also has a developer playground. Enter your API key under Security Schemes, select Connect, and wait for session.started.
Keep alive resets the idle timer. It has no response.
Commit a segment finalizes audio sent so far and keeps the session open.
End input returns the remaining transcript and closes the connection.
These control messages are prefilled. To send microphone audio, use the demo above. See the streaming guide for the full protocol and quickstart for runnable client code.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Chariot API","colors":{"primary":"#16A34A","light":"#07C983","dark":"#15803D"},"logo":{"light":"https://mintcdn.com/chariot-in/DPMArB4SWaSi9h2J/logo/light.svg?fit=max\u0026auto=format\u0026n=DPMArB4SWaSi9h2J\u0026q=85\u0026s=ee82fe07f2481e5750fab291abc5582c","dark":"https://mintcdn.com/chariot-in/DPMArB4SWaSi9h2J/logo/dark.svg?fit=max\u0026auto=format\u0026n=DPMArB4SWaSi9h2J\u0026q=85\u0026s=8c6ef4bee6c712b8e976ff68d9608bb6"},"favicon":"https://mintcdn.com/chariot-in/vjAYjVWb31On6V4s/favicon.png?fit=max\u0026auto=format\u0026n=vjAYjVWb31On6V4s\u0026q=85\u0026s=62a09f39cf248786f54b886a88fe8322","api":{"playground":{"proxy":true}},"navbar":{"links":[],"primary":{"type":"button","label":"Dashboard","href":"https://platform.chariot.in"}},"footer":{},"search":{"prompt":"Search the Chariot docs..."},"seo":{"metatags":{"google-site-verification":"27t6YRcff1tiU2-grH0EqYekzCAEyXO1HbIlsLi1Mv8"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"thumbnails":{"appearance":"light"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"chariot-in","hasAudioNarration":false,"actualSubdomain":"chariot-in","customDomains":["docs.chariot.in"],"gitSource":{"type":"github","owner":"chariot-ai","repo":"chariot-api-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"collectionId":"a5f0646d-af86-476a-8d2c-7380e5b1f174","liveDeploymentHistoryId":"6ae0ba6a48a2baadae912373","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae0ba6a48a2baadae912373"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae0ba6a48a2baadae912373","clientVersion":"0.0.4006","searchFilterCounts":[{"language":"default","tag":"Guides","count":24},{"language":"default","tag":"Speech to text","count":19},{"language":"default","tag":"API reference","count":17},{"language":"default","tag":"Text to speech","count":12},{"language":"default","tag":"Batch transcription","count":5},{"language":"default","tag":"Get started","count":4},{"language":"default","tag":"Resources","count":3},{"language":"default","tag":"Voices","count":1},{"language":"default","tag":"Account","count":1},{"language":"default","tag":"Getting started","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"nav-logo,nav-logo img,nav-logo svg{height:2.25rem!important;max-height:none!important;width:auto!important}@media (max-width:640px){nav-logo,nav-logo img,nav-logo svg{height:1.75rem!important}}@media (prefers-reduced-motion:reduce){nav-logo img,nav-logo svg{animation:none!important}}"}],"page":{"pagePath":"guides/speech-to-text/playground","slug":"/guides/speech-to-text/playground","pageMetadata":{"title":"Microphone demo","description":"Try streaming speech to text with your microphone and API key, without writing code.","href":"/guides/speech-to-text/playground"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Try streaming speech to text with your microphone and API key, without writing code.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const AsrMicrophoneDemo=({apiBase=`https://api.chariot.in`})=>{const[apiKey,setApiKey]=useState(``);const[mode,setMode]=useState(`balanced`);const[vad,setVad]=useState(true);const[phase,setPhase]=useState(`idle`);const[error,setError]=useState(``);const[transcript,setTranscript]=useState(``);const[activity,setActivity]=useState(``);const[events,setEvents]=useState([]);const[copied,setCopied]=useState(false);const session=useRef(null);const busy=[`microphone`,`connecting`,`recording`,`finishing`].includes(phase);const stopCapture=run=>{if(run.node){run.node.onaudioprocess=null;run.node.disconnect()}if(run.source)run.source.disconnect();if(run.stream)run.stream.getTracks().forEach(track=>track.stop());if(run.ctx)run.ctx.close().catch(()=>{});clearTimeout(run.demoTimer)};const dispose=run=>{if(!run)return;clearTimeout(run.timer);stopCapture(run);if(run.ws){run.ws.onopen=run.ws.onmessage=run.ws.onerror=run.ws.onclose=null;run.ws.close()}};useEffect(()=>()=>{const run=session.current;session.current=null;dispose(run)},[]);const fail=(run,message)=>{if(session.current!==run)return;session.current=null;dispose(run);setError(message);setActivity(``);setPhase(`error`)};const finish=()=>{const run=session.current;if(!run||!run.recording||run.finishing)return;run.finishing=true;setPhase(`finishing`);setActivity(``);run.recording=false;stopCapture(run);if(run.ws?.readyState!==WebSocket.OPEN){fail(run,`The connection closed before the recording could finish.`);return}run.flushAudio();if(session.current!==run)return;run.ws.send(JSON.stringify({type:`input.done`}));clearTimeout(run.demoTimer);run.timer=setTimeout(()=>fail(run,`The final transcript took too long. Your received text is kept below. Try a new session.`),65e3)};const start=async()=>{if(session.current||!apiKey.trim())return;const run={committed:[],partial:``,recording:false,finishing:false};session.current=run;setPhase(`microphone`);setError(``);setTranscript(``);setCopied(false);setEvents([]);setActivity(``);try{if(!navigator.mediaDevices?.getUserMedia||!window.AudioContext){throw new Error(`Use a browser with microphone support over HTTPS.`)}run.ctx=new AudioContext({sampleRate:16e3});await run.ctx.resume();if(session.current!==run){dispose(run);return}run.stream=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:true,noiseSuppression:true},video:false});if(session.current!==run){dispose(run);return}run.stream.getAudioTracks().forEach(track=>{track.onended=()=>{if(session.current===run\u0026\u0026!run.finishing)fail(run,`Microphone access ended. Start again to continue.`)}});if(run.ctx.sampleRate!==16e3){throw new Error(`This browser cannot capture the demo's audio format. Try Chrome, Edge, or Firefox.`)}run.samples=[];run.flushAudio=()=>{if(!run.samples.length||session.current!==run||run.ws?.readyState!==WebSocket.OPEN)return;if(run.ws.bufferedAmount>1024*1024){fail(run,`The connection cannot keep up with the microphone. Try again on a faster connection.`);return}const buffer=new ArrayBuffer(run.samples.length*2);const view=new DataView(buffer);run.samples.forEach((value,i)=>{const sample=Math.max(-1,Math.min(1,value));view.setInt16(i*2,Math.round(sample*(sample\u003c0?32768:32767)),true)});run.samples=[];run.ws.send(buffer)};run.node=run.ctx.createScriptProcessor(2048,1,1);run.node.onaudioprocess=({inputBuffer})=>{if(!run.recording||session.current!==run)return;for(const sample of inputBuffer.getChannelData(0)){run.samples.push(sample);if(run.samples.length===1600)run.flushAudio()}};setPhase(`connecting`);const url=new URL(`/v1/asr/ws`,apiBase);url.protocol=`wss:`;url.search=new URLSearchParams({api_key:apiKey.trim(),audio_format:`pcm_16000`,mode,commit_strategy:vad?`vad`:`manual`,silence_duration_ms:`500`}).toString();run.ws=new WebSocket(url);run.timer=setTimeout(()=>fail(run,`Could not start a session. Check your key and connection, then try again.`),2e4);run.ws.onmessage=({data})=>{if(session.current!==run)return;let event;try{event=JSON.parse(data)}catch{fail(run,`The server returned an unexpected message.`);return}setEvents(previous=>[...previous.slice(-19),event.type]);if(event.type===`session.started`){if(run.recording)return;if(event.commit_strategy!==(vad?`vad`:`manual`)){fail(run,`The server did not accept the requested turn settings.`);return}clearTimeout(run.timer);run.source=run.ctx.createMediaStreamSource(run.stream);run.source.connect(run.node);run.node.connect(run.ctx.destination);run.recording=true;setPhase(`recording`);run.demoTimer=setTimeout(finish,12e4)}else if(event.type===`transcript.delta`){run.partial+=typeof event.text===`string`?event.text:``;setTranscript([...run.committed,run.partial].filter(Boolean).join(` `))}else if(event.type===`transcript.committed`||event.type===`transcript.done`){if(event.text?.trim())run.committed.push(event.text.trim());run.partial=``;setTranscript(run.committed.join(` `));if(event.type===`transcript.done`){session.current=null;dispose(run);setActivity(``);setPhase(`done`)}}else if(event.type===`input_audio_buffer.speech_started`){setActivity(`Speech detected`)}else if(event.type===`input_audio_buffer.speech_stopped`){setActivity(`Pause detected`)}else if(event.type===`error`){const messages={1008:`The API key is missing, invalid, or expired, or the session settings were rejected. Check the key and try again.`,4402:`This workspace does not have enough credits. Add credits in the dashboard, then try again.`,4429:`This workspace has reached its ASR concurrency limit. Wait for another session to finish.`};fail(run,messages[event.code]||`The transcription service could not finish this session. Your received text is kept below.`)}};run.ws.onerror=()=>fail(run,`Could not connect. Check your connection and API key, then try again.`);run.ws.onclose=()=>fail(run,`The connection closed before the final transcript arrived. Your received text is kept below.`)}catch(cause){const message=cause?.name===`NotAllowedError`?`Microphone access was denied. Allow microphone access for this site and try again.`:cause?.name===`NotFoundError`?`No microphone was found. Connect a microphone and try again.`:`Could not start microphone capture. Check browser permissions and try again.`;fail(run,message)}};const cancel=()=>{const run=session.current;session.current=null;dispose(run);setPhase(`idle`);setActivity(``)};const labels={idle:`Ready`,microphone:`Allow microphone access`,connecting:`Connecting`,recording:`Listening`,finishing:`Finishing transcript`,done:`Complete`,error:`Could not complete`};const field=`mt-1 w-full rounded-lg border border-gray-300 bg-transparent px-3 py-2 text-sm dark:border-gray-700`;return _jsxs(`section`,{\"aria-label\":`Try ASR with your microphone`,className:`not-prose mint-my-6 mint-space-y-4 mint-rounded-xl mint-border mint-border-gray-200 mint-p-5 dark:mint-border-gray-800`,children:[_jsxs(`div`,{children:[_jsx(`h3`,{className:`mint-text-lg mint-font-semibold`,children:`Try it with your microphone`}),_jsx(`p`,{className:`mint-mt-1 mint-text-sm mint-opacity-75`,children:`Paste your API key, start recording, and speak. Your transcript appears here.`})]}),_jsxs(`label`,{className:`mint-block mint-text-sm mint-font-medium`,children:[`API key`,_jsx(`input`,{\"aria-label\":`Demo API key`,type:`password`,autoComplete:`off`,spellCheck:false,value:apiKey,disabled:busy,onChange:e=>setApiKey(e.target.value),placeholder:`Paste your Chariot API key`,className:`mint-mt-1 mint-w-full mint-rounded-lg mint-border mint-border-gray-300 mint-bg-transparent mint-px-3 mint-py-2 mint-text-sm dark:mint-border-gray-700`})]}),_jsxs(`div`,{className:`mint-flex mint-flex-wrap mint-items-end mint-gap-4`,children:[_jsxs(`label`,{className:`mint-text-sm mint-font-medium`,children:[`Mode`,_jsxs(`select`,{\"aria-label\":`Demo mode`,value:mode,disabled:busy,onChange:e=>setMode(e.target.value),className:`mint-mt-1 mint-w-full mint-rounded-lg mint-border mint-border-gray-300 mint-bg-transparent mint-px-3 mint-py-2 mint-text-sm dark:mint-border-gray-700`,children:[_jsx(`option`,{value:`balanced`,children:`Balanced`}),_jsx(`option`,{value:`high_accuracy`,children:`High accuracy`})]})]}),_jsxs(`label`,{className:`mint-flex mint-items-center mint-gap-2 mint-pb-2 mint-text-sm`,children:[_jsx(`input`,{type:`checkbox`,checked:vad,disabled:busy,onChange:e=>setVad(e.target.checked)}),`Auto-finalize after pauses`]})]}),_jsxs(`div`,{className:`mint-flex mint-flex-wrap mint-items-center mint-gap-3`,children:[!busy\u0026\u0026_jsx(`button`,{type:`button`,onClick:start,disabled:!apiKey.trim(),className:`mint-rounded-lg mint-bg-green-700 mint-px-4 mint-py-2 mint-text-sm mint-font-semibold mint-text-white disabled:mint-opacity-50`,children:`Start recording`}),phase===`recording`\u0026\u0026_jsx(`button`,{type:`button`,onClick:finish,className:`mint-rounded-lg mint-bg-green-700 mint-px-4 mint-py-2 mint-text-sm mint-font-semibold mint-text-white`,children:`Stop and transcribe`}),(phase===`microphone`||phase===`connecting`)\u0026\u0026_jsx(`button`,{type:`button`,onClick:cancel,className:`mint-rounded-lg mint-border mint-px-4 mint-py-2 mint-text-sm`,children:`Cancel`}),_jsxs(`span`,{role:`status`,className:`mint-text-sm`,children:[labels[phase],activity?` · ${activity}`:``]})]}),error\u0026\u0026_jsx(`p`,{role:`alert`,className:`mint-text-sm mint-text-red-700 dark:mint-text-red-400`,children:error}),_jsx(`div`,{\"aria-label\":`Live transcript`,\"aria-live\":`polite`,\"aria-atomic\":`true`,className:`mint-min-h-24 mint-whitespace-pre-wrap mint-rounded-lg mint-bg-gray-100 mint-p-4 mint-text-sm dark:mint-bg-gray-900`,children:transcript||(phase===`done`?`No speech was detected.`:`Your transcript will appear here.`)}),transcript\u0026\u0026!busy\u0026\u0026_jsx(`button`,{type:`button`,className:`mint-rounded-lg mint-border mint-px-3 mint-py-2 mint-text-sm`,onClick:async()=>{try{await navigator.clipboard.writeText(transcript);setCopied(true)}catch{setError(`Could not copy automatically. Select and copy the transcript above.`)}},children:copied?`Copied`:`Copy transcript`}),_jsx(`p`,{className:`mint-text-xs mint-opacity-75`,children:`Uses your workspace credits. The demo stops after two minutes. Your key stays in this page's memory and is sent only to the Chariot API. Closing this page stops recording.`}),events.length>0\u0026\u0026_jsxs(`details`,{className:`mint-text-sm`,children:[_jsx(`summary`,{className:`mint-cursor-pointer`,children:`Recent API events`}),_jsx(`ol`,{className:`mint-mt-2 mint-space-y-1 mint-font-mono mint-text-xs`,children:events.map((name,i)=>_jsx(`li`,{children:name},i))})]})]})};function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Heading,Note,_MdxComponentBoundary}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Get an API key from the `,_jsx(_components.a,{href:`https://platform.chariot.in`,children:`dashboard`}),`, paste it below, and select `,_jsx(_components.strong,{children:`Start recording`}),`. Allow microphone access and speak. Select `,_jsx(_components.strong,{children:`Stop and transcribe`}),` to receive the final transcript.`]}),`\n`,_jsx(_MdxComponentBoundary,{name:`AsrMicrophoneDemo`,children:_jsx(AsrMicrophoneDemo,{})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Auto-finalize after pauses`}),` confirms each utterance after 500 milliseconds of silence and keeps listening. Turn it off to receive one final transcript when you stop. Choose `,_jsx(_components.strong,{children:`Balanced`}),` for faster feedback or `,_jsx(_components.strong,{children:`High accuracy`}),` for more context. Language detection is automatic.`]}),`\n`,_jsxs(_components.p,{children:[`The demo uses the same `,_jsx(_components.a,{href:`/api-reference/endpoint/asr-websocket`,children:`ASR WebSocket API`}),` as your application and charges your workspace’s normal speech-to-text credits. The two-minute recording cap applies to this demo, not the API.`]}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Closing or reloading the page stops the recording and clears the transcript and API key from the demo. Copy any text you want to keep before leaving. For application integration, keep your API key on your server.`})}),`\n`,_jsx(Heading,{level:`2`,id:`inspect-the-api-messages`,children:`Inspect the API messages`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/api-reference/endpoint/asr-websocket`,children:`WebSocket reference`}),` also has a developer playground. Enter your API key under `,_jsx(_components.strong,{children:`Security Schemes`}),`, select `,_jsx(_components.strong,{children:`Connect`}),`, and wait for `,_jsx(_components.code,{children:`session.started`}),`.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Keep alive`}),` resets the idle timer. It has no response.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Commit a segment`}),` finalizes audio sent so far and keeps the session open.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`End input`}),` returns the remaining transcript and closes the connection.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`These control messages are prefilled. To send microphone audio, use the demo above. See the `,_jsx(_components.a,{href:`/guides/speech-to-text/websocket`,children:`streaming guide`}),` for the full protocol and `,_jsx(_components.a,{href:`/guides/speech-to-text/quickstart`,children:`quickstart`}),` for runnable client code.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{AsrMicrophoneDemo,default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Microphone demo","description":"Try streaming speech to text with your microphone and API key, without writing code.","href":"/guides/speech-to-text/playground"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[153,10629,")=>null;function _cr"]]},"mdxExtracts":{"tableOfContents":[{"title":"Inspect the API messages","slug":"inspect-the-api-messages","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"dynamicCss":".mint-my-6 {\n margin-top: 1.5rem;\n margin-bottom: 1.5rem\n}\n.mint-mt-1 {\n margin-top: 0.25rem\n}\n.mint-mt-2 {\n margin-top: 0.5rem\n}\n.mint-block {\n display: block\n}\n.mint-flex {\n display: flex\n}\n.mint-min-h-24 {\n min-height: 6rem\n}\n.mint-w-full {\n width: 100%\n}\n.mint-cursor-pointer {\n cursor: pointer\n}\n.mint-flex-wrap {\n flex-wrap: wrap\n}\n.mint-items-end {\n align-items: flex-end\n}\n.mint-items-center {\n align-items: center\n}\n.mint-gap-2 {\n gap: 0.5rem\n}\n.mint-gap-3 {\n gap: 0.75rem\n}\n.mint-gap-4 {\n gap: 1rem\n}\n.mint-space-y-1 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.25rem * var(--tw-space-y-reverse))\n}\n.mint-space-y-4 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1rem * var(--tw-space-y-reverse))\n}\n.mint-whitespace-pre-wrap {\n white-space: pre-wrap\n}\n.mint-rounded-lg {\n border-radius: 0.5rem\n}\n.mint-rounded-xl {\n border-radius: 0.75rem\n}\n.mint-border {\n border-width: 1px\n}\n.mint-border-gray-200 {\n --tw-border-opacity: 1;\n border-color: rgb(229 231 235 / var(--tw-border-opacity, 1))\n}\n.mint-border-gray-300 {\n --tw-border-opacity: 1;\n border-color: rgb(209 213 219 / var(--tw-border-opacity, 1))\n}\n.mint-bg-gray-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1))\n}\n.mint-bg-green-700 {\n --tw-bg-opacity: 1;\n background-color: rgb(21 128 61 / var(--tw-bg-opacity, 1))\n}\n.mint-bg-transparent {\n background-color: transparent\n}\n.mint-p-4 {\n padding: 1rem\n}\n.mint-p-5 {\n padding: 1.25rem\n}\n.mint-px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem\n}\n.mint-px-4 {\n padding-left: 1rem;\n padding-right: 1rem\n}\n.mint-py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem\n}\n.mint-pb-2 {\n padding-bottom: 0.5rem\n}\n.mint-font-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace\n}\n.mint-text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem\n}\n.mint-text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem\n}\n.mint-text-xs {\n font-size: 0.75rem;\n line-height: 1rem\n}\n.mint-font-medium {\n font-weight: 500\n}\n.mint-font-semibold {\n font-weight: 600\n}\n.mint-text-red-700 {\n --tw-text-opacity: 1;\n color: rgb(185 28 28 / var(--tw-text-opacity, 1))\n}\n.mint-text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1))\n}\n.mint-opacity-75 {\n opacity: 0.75\n}\n.disabled\\:mint-opacity-50:disabled {\n opacity: 0.5\n}\n.dark\\:mint-border-gray-700:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(55 65 81 / var(--tw-border-opacity, 1))\n}\n.dark\\:mint-border-gray-800:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(31 41 55 / var(--tw-border-opacity, 1))\n}\n.dark\\:mint-bg-gray-900:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(17 24 39 / var(--tw-bg-opacity, 1))\n}\n.dark\\:mint-text-red-400:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(248 113 113 / var(--tw-text-opacity, 1))\n}","subdomain":"chariot-in","siteName":"Chariot API","title":"Microphone demo - Chariot API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-27T14:51:52.400Z","originalFileLocation":"guides/speech-to-text/playground.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Try streaming speech to text with your microphone and API key, without writing code.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Chariot API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/chariot-in/F_NtRhkvBqnc9y9O/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/chariot-in/F_NtRhkvBqnc9y9O/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/chariot-in/F_NtRhkvBqnc9y9O/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/chariot-in/F_NtRhkvBqnc9y9O/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/chariot-in/F_NtRhkvBqnc9y9O/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/chariot-in/F_NtRhkvBqnc9y9O/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/chariot-in/F_NtRhkvBqnc9y9O/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/chariot-in/F_NtRhkvBqnc9y9O/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/chariot-in/F_NtRhkvBqnc9y9O/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Microphone demo - Chariot API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Try streaming speech to text with your microphone and API key, without writing code.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Chariot API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.chariot.in/guides/speech-to-text/playground\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://chariot-in.mintlify.app/_mintlify/api/og/v2?division=Speech+to+text\u0026amp;title=Microphone+demo\u0026amp;description=Try+streaming+speech+to+text+with+your+microphone+and+API+key%2C+without+writing+code.\u0026amp;theme=cc01bbb7ab41affcae10c526\u0026amp;signature=906c8036483f0c4dff2792587888e0a8a901be3217040d82d3ebc5accf130718\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Microphone demo - Chariot API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Try streaming speech to text with your microphone and API key, without writing code.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://chariot-in.mintlify.app/_mintlify/api/og/v2?division=Speech+to+text\u0026amp;title=Microphone+demo\u0026amp;description=Try+streaming+speech+to+text+with+your+microphone+and+API+key%2C+without+writing+code.\u0026amp;theme=cc01bbb7ab41affcae10c526\u0026amp;signature=906c8036483f0c4dff2792587888e0a8a901be3217040d82d3ebc5accf130718\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/chariot-in/F_NtRhkvBqnc9y9O/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Chariot API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#16A34A\">\u003cmeta data-mint-head name=\"google-site-verification\" content=\"27t6YRcff1tiU2-grH0EqYekzCAEyXO1HbIlsLi1Mv8\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.chariot.in/guides/speech-to-text/playground\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/speech-to-text/playground.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.chariot.in/#organization\",\"name\":\"Chariot API\",\"url\":\"https://docs.chariot.in\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/chariot-in/DPMArB4SWaSi9h2J/logo/light.svg?fit=max\u0026auto=format\u0026n=DPMArB4SWaSi9h2J\u0026q=85\u0026s=ee82fe07f2481e5750fab291abc5582c\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.chariot.in#website\",\"name\":\"Chariot API\",\"url\":\"https://docs.chariot.in\",\"publisher\":{\"@id\":\"https://docs.chariot.in/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.chariot.in/guides/speech-to-text/playground#webpage\",\"url\":\"https://docs.chariot.in/guides/speech-to-text/playground\",\"name\":\"Microphone demo\",\"description\":\"Try streaming speech to text with your microphone and API key, without writing code.\",\"dateModified\":\"2026-10-27T14:51:52.400Z\",\"isPartOf\":{\"@id\":\"https://docs.chariot.in#website\"},\"breadcrumb\":{\"@id\":\"https://docs.chariot.in/guides/speech-to-text/playground#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.chariot.in/guides/speech-to-text/playground#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Speech to text\",\"item\":\"https://docs.chariot.in/guides/speech-to-text/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Microphone demo\",\"item\":\"https://docs.chariot.in/guides/speech-to-text/playground\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.chariot.in/guides/speech-to-text/playground#article\",\"headline\":\"Microphone demo\",\"name\":\"Microphone demo\",\"description\":\"Try streaming speech to text with your microphone and API key, without writing code.\",\"url\":\"https://docs.chariot.in/guides/speech-to-text/playground\",\"mainEntityOfPage\":{\"@id\":\"https://docs.chariot.in/guides/speech-to-text/playground#webpage\"},\"dateModified\":\"2026-10-27T14:51:52.400Z\",\"publisher\":{\"@id\":\"https://docs.chariot.in/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.chariot.in#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Chariot API\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Chariot API","nav":{"global":null,"tabs":[{"tab":"Guides","groups":[{"group":"Get started","icon":"rocket","pages":[{"title":"Welcome to Chariot","href":"/guides/introduction"},{"title":"Quickstart","href":"/guides/quickstart"},{"title":"Authentication","href":"/guides/authentication"},{"title":"Models","href":"/guides/models"}]},{"group":"Text to speech","icon":"waveform-lines","pages":[{"title":"Text to speech overview","href":"/guides/text-to-speech/overview"},{"title":"Choosing an API","href":"/guides/text-to-speech/which-api"},{"title":"HTTP streaming","href":"/guides/text-to-speech/streaming"},{"title":"WebSocket streaming","href":"/guides/text-to-speech/websocket"},{"title":"Multi-context WebSocket","sidebarTitle":"Multi-context WebSocket","tag":"BETA","href":"/guides/text-to-speech/websocket-multi"},{"title":"Latency testing","href":"/guides/text-to-speech/latency-testing"},{"title":"Voices","href":"/guides/text-to-speech/voices"}]},{"group":"Speech to text","icon":"microphone","pages":[{"title":"Speech to text overview","href":"/guides/speech-to-text/overview"},{"title":"Speech to text quickstart","sidebarTitle":"Quickstart","description":"Stream audio to Chariot over a WebSocket and get a live transcript in a few minutes.","href":"/guides/speech-to-text/quickstart"},{"title":"Microphone demo","href":"/guides/speech-to-text/playground"},{"title":"File transcription","sidebarTitle":"File transcription","description":"Upload a recording or provide an audio URL and receive its complete transcript in one request.","tag":"BETA","href":"/guides/speech-to-text/file-transcription"},{"title":"Async transcription","tag":"BETA","href":"/guides/speech-to-text/async-transcription"},{"title":"Transcription webhooks","tag":"BETA","href":"/guides/speech-to-text/webhooks"},{"title":"Streaming WebSocket","href":"/guides/speech-to-text/websocket"},{"title":"Languages, modes, and styles","href":"/guides/speech-to-text/modes-and-languages"},{"title":"Audio formats","href":"/guides/speech-to-text/audio-formats"},{"title":"Transcription history","href":"/guides/speech-to-text/history"}]},{"group":"Resources","icon":"book","pages":[{"title":"Errors \u0026 status codes","href":"/guides/resources/errors"},{"title":"Rate limits \u0026 concurrency","href":"/guides/resources/rate-limits"},{"title":"Credits \u0026 pricing","href":"/guides/resources/credits"}]}]},{"tab":"API reference","pages":[{"title":"API reference","href":"/api-reference/introduction"}]}]},"title":"Microphone demo - Chariot API","buildId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","deploymentId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","dynamics":[],"chunks":[]}