CINXE.COM

Finalize — Deepgram | Documentation

<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><script id="_fern-gtm"> (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-M5WQMGR'); </script><link rel="preload" href="/api/fern-docs/search/v1/key" as="fetch" crossorigin="anonymous"/><link rel="preload" href="/api/fern-docs/auth/api-key-injection" as="fetch" crossorigin="anonymous"/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/><title>Finalize — Deepgram | Documentation</title><meta name="robots" content="index,follow"/><meta name="description" content="Learn how to send Deepgram a Finalize message, which flushes the websocket stream&#x27;s audio by forcing the server to process all unprocessed audio data immediately and return the results."/><meta name="theme-color" content="#1a1a1f"/><meta property="og:title" content="Finalize — Deepgram | Documentation"/><meta property="og:description" content="Learn how to send Deepgram a Finalize message, which flushes the websocket stream&#x27;s audio by forcing the server to process all unprocessed audio data immediately and return the results."/><meta property="og:url" content="https://developers.deepgram.com/docs/finalize"/><meta property="og:site_name" content="Deepgram | Documentation"/><link rel="canonical" href="https://developers.deepgram.com/docs/finalize"/><meta name="generator" content="buildwithfern.com"/><link rel="icon" href="https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/assets/favicon.ico" crossorigin="anonymous"/><link rel="preload" href="https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/assets/Inter.woff2" as="font" type="font/woff2" crossorigin="anonymous"/><link rel="preload" href="https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/assets/FiraMono.woff2" as="font" type="font/woff2" crossorigin="anonymous"/><link rel="preload" href="https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/assets/Roobert.woff2" as="font" type="font/woff2" crossorigin="anonymous"/><script type="application/ld+json" id="jsonld-breadcrumb">{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Deepgram | Documentation","item":"https://developers.deepgram.com/"},{"@type":"ListItem","position":2,"name":"Speech to Text","item":"https://developers.deepgram.com/speech-to-text"},{"@type":"ListItem","position":3,"name":"Streaming Audio","item":"https://developers.deepgram.com/speech-to-text/streaming-audio"},{"@type":"ListItem","position":4,"name":"Control Messages","item":"https://developers.deepgram.com/speech-to-text/streaming-audio/control-messages"},{"@type":"ListItem","position":5,"name":"Finalize","item":"https://developers.deepgram.com/docs/finalize"}]}</script><link rel="preload" href="https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/assets/logo.svg" as="image" fetchpriority="high"/><meta name="next-head-count" content="21"/><link href="https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.css" rel="stylesheet"/><script id="theme-script" data-nscript="beforeInteractive">(e=>{let t=document.documentElement;function n(e){t.classList.remove("light","dark"),t.classList.add(e),t.style.colorScheme=e}if(1===e.length)n(e[0]);else try{let t=localStorage.getItem("theme")??"system",r=e.length>0&&"system"===t?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t;n(r)}catch{}})(["dark"])</script><link rel="preload" href="https://app.ferndocs.com/_next/static/css/fdddf7a0ee49c0fe.css?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ" as="style"/><link rel="stylesheet" href="https://app.ferndocs.com/_next/static/css/fdddf7a0ee49c0fe.css?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ" data-n-g=""/><link rel="preload" href="https://app.ferndocs.com/_next/static/css/80bca615e6d01b34.css?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ" as="style"/><link rel="stylesheet" href="https://app.ferndocs.com/_next/static/css/80bca615e6d01b34.css?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="https://app.ferndocs.com/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script src="https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/dist/output.js" type="module" defer="" data-nscript="beforeInteractive"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/8494.89309af69f67ac9d.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/7191.7664a652cf78e25c.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/9862.425ab7b1c7aa2bbe.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/45bb0db8.463a392675fecfb0.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/92e66809.393f81705c519a34.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/118f301d.0a7382916ef4ac18.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/52d2be3c.b954481fe5a6d824.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/f29dc6a8.0d3c3c8683df2eda.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/6003.c51da136c4cdc4e2.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/8950.60863e54159d6916.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/5717.a121432bdbac2575.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/3970.c2fe78b12d70f6c5.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/600.be9fd283f34926c7.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/3551.c5bfca83bde914fb.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/f136264b.fe05aaa57e22d479.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/4217.08fff909190d4e30.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/2729.42c77bdb2d91a65d.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/9042.24fedb3b4f336c12.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/8326.bde182ef6c372b2f.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/6318.58ee0f53c459a73e.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/8508.7a6ed07aa65989af.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/5119.7fbcb17fea114486.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/5438.9dfc11fa11c8ee42.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/6770.7f324a0184155c4e.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/7708.02439b5d10c76bde.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/a20b1002.4488a96695dd3fd2.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/5653.ba43092f7e682928.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/4471.6e794c1da353a5be.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/7679.c0f761d39aecdc07.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/4938.1396ed581cf45ffd.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/1017.8ca9eff971d1c5d5.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/3543.4e2e795cbec0dcd1.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script defer="" src="https://app.ferndocs.com/_next/static/chunks/7575.924e50684a873f53.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ"></script><script src="https://app.ferndocs.com/_next/static/chunks/webpack-c73ef30f2402b86d.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ" defer=""></script><script src="https://app.ferndocs.com/_next/static/chunks/framework-66d89474ad83799b.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ" defer=""></script><script src="https://app.ferndocs.com/_next/static/chunks/main-acca8e44818ccf14.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ" defer=""></script><script src="https://app.ferndocs.com/_next/static/chunks/pages/_app-b5a84ec178cbca0a.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ" defer=""></script><script src="https://app.ferndocs.com/_next/static/chunks/2709-cda5da4a8db8de58.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ" defer=""></script><script src="https://app.ferndocs.com/_next/static/chunks/6053-fa2ca2e38d9b1858.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ" defer=""></script><script src="https://app.ferndocs.com/_next/static/chunks/pages/static/%5Bdomain%5D/%5B%5B...slug%5D%5D-31f428dae64597dc.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ" defer=""></script><script src="https://app.ferndocs.com/_next/static/jEjV2SONtxKUdC_MuPL3x/_buildManifest.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ" defer=""></script><script src="https://app.ferndocs.com/_next/static/jEjV2SONtxKUdC_MuPL3x/_ssgManifest.js?dpl=dpl_2DkHTw3CVJpqyodd7b3zuwXzV4yJ" defer=""></script><style id="__jsx-3596999769"> :root { --typography-body-font-family: 'Inter', -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif; --typography-heading-font-family: 'Roobert', -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif; --typography-code-font-family: 'FiraMono', ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace; --spacing-page-width: 100%; --spacing-content-width: 44rem; --spacing-content-wide-width: 66.5rem; --spacing-sidebar-width: 18rem; --spacing-header-height: 6.75rem; --spacing-header-height-padded: 5rem; --spacing-header-height-real: 4rem; --grayscale-1: var(--mauve-1); --grayscale-2: var(--mauve-2); --grayscale-3: var(--mauve-3); --grayscale-4: var(--mauve-4); --grayscale-5: var(--mauve-5); --grayscale-6: var(--mauve-6); --grayscale-7: var(--mauve-7); --grayscale-8: var(--mauve-8); --grayscale-9: var(--mauve-9); --grayscale-10: var(--mauve-10); --grayscale-11: var(--mauve-11); --grayscale-12: var(--mauve-12); --grayscale-a1: var(--mauve-a1); --grayscale-a2: var(--mauve-a2); --grayscale-a3: var(--mauve-a3); --grayscale-a4: var(--mauve-a4); --grayscale-a5: var(--mauve-a5); --grayscale-a6: var(--mauve-a6); --grayscale-a7: var(--mauve-a7); --grayscale-a8: var(--mauve-a8); --grayscale-a9: var(--mauve-a9); --grayscale-a10: var(--mauve-a10); --grayscale-a11: var(--mauve-a11); --grayscale-a12: var(--mauve-a12); --accent-1: #f7f7f9; --accent-2: #f1f3f9; --accent-3: #e8ebf7; --accent-4: #dde2f9; --accent-5: #d0d7f8; --accent-6: #c0c8f3; --accent-7: #abb5eb; --accent-8: #8f9be2; --accent-9: #7783f7; --accent-10: #6c77e9; --accent-11: #5158c3; --accent-12: #282c5f; --accent-a1: #7a3b7c04; --accent-a2: #1734c309; --accent-a3: #0926c312; --accent-a4: #0327ea1d; --accent-a5: #0126e92a; --accent-a6: #0322d93b; --accent-a7: #011ec950; --accent-a8: #011cc16d; --accent-a9: #0217f486; --accent-a10: #0214dc91; --accent-a11: #020ca8ad; --accent-a12: #010642d7; --accent-surface: #eff1f9cc; --gray-surface: #ffffffcc; --accent: 119, 131, 247; --accent-aa: 81, 96, 245; --accent-aaa: 32, 52, 243; --accent-tinted: 143, 153, 248; --background: 249, 250, 251; --accent-contrast: rgb(255, 255, 255); --bg-color-card: rgba(255, 255, 255, 0.7); --sidebar-background: transparent; --header-background: transparent; --border: var(--grayscale-a4); --border-concealed: var(--grayscale-a2); --body-text: 0, 0, 0; --body-text-inverted: 255, 255, 255; } @media (max-width: 1024px) { :root { --spacing-header-height: 6.75rem; --spacing-header-height-padded: 5rem; } } :is(.dark) { --grayscale-1: var(--gray-1); --grayscale-2: var(--gray-2); --grayscale-3: var(--gray-3); --grayscale-4: var(--gray-4); --grayscale-5: var(--gray-5); --grayscale-6: var(--gray-6); --grayscale-7: var(--gray-7); --grayscale-8: var(--gray-8); --grayscale-9: var(--gray-9); --grayscale-10: var(--gray-10); --grayscale-11: var(--gray-11); --grayscale-12: var(--gray-12); --grayscale-a1: var(--gray-a1); --grayscale-a2: var(--gray-a2); --grayscale-a3: var(--gray-a3); --grayscale-a4: var(--gray-a4); --grayscale-a5: var(--gray-a5); --grayscale-a6: var(--gray-a6); --grayscale-a7: var(--gray-a7); --grayscale-a8: var(--gray-a8); --grayscale-a9: var(--gray-a9); --grayscale-a10: var(--gray-a10); --grayscale-a11: var(--gray-a11); --grayscale-a12: var(--gray-a12); --accent-1: #050d0a; --accent-2: #0f1a15; --accent-3: #092d21; --accent-4: #003d29; --accent-5: #004b34; --accent-6: #005a40; --accent-7: #006b4d; --accent-8: #00805b; --accent-9: #a1f9d4; --accent-10: #97efca; --accent-11: #66cfa6; --accent-12: #9df5d0; --accent-a1: #00b50003; --accent-a2: #4bfb9c10; --accent-a3: #00fca124; --accent-a4: #00fc9735; --accent-a5: #00ffa543; --accent-a6: #00feac53; --accent-a7: #00fdb165; --accent-a8: #00fdb07b; --accent-a9: #a5ffd9f9; --accent-a10: #a0fed6ef; --accent-a11: #7dffcccd; --accent-a12: #a3ffd8f5; --accent-surface: color(display-p3 0.0863 0.1569 0.1255 / 0.5); --gray-surface: color(display-p3 0 0 0 / 5%); --accent: 161, 249, 212; --accent-aa: 161, 249, 212; --accent-aaa: 161, 249, 212; --accent-tinted: 185, 251, 223; --background: 11, 11, 12; --accent-contrast: rgb(11, 40, 29); --bg-color-card: rgb(26, 26, 31); --bg-color-card-solid: rgb(26, 26, 31); --sidebar-background: rgb(11, 11, 12); --header-background: rgb(26, 26, 31); --border: rgb(44, 44, 51); --border-concealed: rgb(44, 44, 51); --body-text: 255, 255, 255; --body-text-inverted: 0, 0, 0; } @font-face { font-family: 'Inter'; src: url('https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/assets/Inter.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; } @font-face { font-family: 'Roobert'; src: url('https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/assets/Roobert.woff2') format('woff2'); font-weight: 600 900; font-style: normal; font-display: swap; } @font-face { font-family: 'FiraMono'; src: url('https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/assets/FiraMono.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; } html { background-color: #f9fafb; } html.dark { background-color: #0b0b0c; } .fern-button.filled { background: linear-gradient(90deg, #201CFF -91.5%, #13EF95 80.05%) !important; } .fern-header-tab-button[data-state=active] { color: white !important; } .fern-header-tab-button[data-state=active]:after { background: linear-gradient(90deg, #201CFF -91.5%, #13EF95 80.05%) !important; height: 2px !important; } .fern-header-tab-button { padding-left: 24px !important; padding-right: 24px !important; } @media (max-width: 1350px) { .fern-header-tab-button { padding-left: 16px !important; padding-right: 16px !important; } } @media (max-width: 1185px) { .fern-header-tab-button { padding-left: 12px !important; padding-right: 12px !important; } } @media (max-width: 1100px) { .fern-header-tab-button { padding-left: 8px !important; padding-right: 8px !important; } } .fern-mdx-link { color: #79affa !important; text-decoration: none; } .fern-mdx-link svg { color: #79affa !important; } .white .fern-card span { background: white !important; } @media (min-width: 1024px) { .fern-header-right-menu { display: none !important; } } .banner { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; } .banner p { margin-top: .25rem; margin-bottom: .25rem; } .banner h1 { margin-top: .5rem; margin-bottom: 16px; } .fern-sidebar-link-container[data-state="active"] { color: white !important; } .fern-sidebar-link-text { font-size: 16px !important; } .fern-sidebar-link-container[data-state=active] .fern-sidebar-link-indent:after { border: 0px !important; } .fern-sidebar-link-container[data-state="active"] .fern-sidebar-link { background-color: #232329 !important; } .fern-sidebar-link-container[data-state="active"] .fern-sidebar-link:after { background: linear-gradient(177.85deg, #201CFF -102.27%, #13EF95 101.45%) !important; width: 1px !important; position: absolute !important; content: "" !important; right: 0 !important; top: 0 !important; bottom: 0 !important; border-radius: 8px !important; } .fern-sidebar-link { border-radius: 0 !important; } .fern-sidebar-link-content { padding-left: 1rem !important; padding-right: 1rem !important; padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; } .fern-sidebar-content { padding-left: 0 !important; padding-right: 0 !important; } @media (min-width: 1024px) { .fern-sidebar-container:not(.fern-sidebar-fixed) { padding-left: 0rem !important; } } .fern-header-tab-button span { font-weight: 700 !important; font-size: 16px !important; line-height: 17.5px !important; letter-spacing: 2% !important; } .fern-search-bar { --tw-ring-color: #4E4E52 !important; background-color: #0B0B0C !important; } .fern-sidebar-heading-content, .fern-sidebar-link-container .font-semibold .fern-sidebar-link-text { font-weight: 700 !important; font-size: 14px !important; line-height: 17.5px !important; letter-spacing: 2% !important; color: #A1F9D4 !important; } .fern-breadcrumb-item { color: var(--grayscale-a11) !important; font-weight: 400 !important; } button[role="tab"][data-state="active"] { background-color: #1A1A1F !important; } button[role="tab"][data-state="active"]:after { background: linear-gradient(90deg, #201CFF -91.5%, #13EF95 80.05%) !important; height: 2px !important; position: absolute !important; content: "" !important; right: 0 !important; left: 0 !important; bottom: 0 !important; } button[role="tab"] { box-shadow: none !important; position: relative !important; } button[role="tab"]:hover span { background-color: #1A1A1F !important; } div[class*="callout"] { border-left-width: 2px !important; border-color: var(--tw-ring-color) !important; } .fern-search-bar, .callout-outlined, .fern-card .fern-button { border-radius: 8px !important; } .bg-tag-default-soft { background-color: #28282B !important; } .code-block-root span[style*="color: rgb(194, 195, 197);"] { --shiki-dark: #949498 !important; } .callout-outlined { background-color: #1D2A34 !important; --tw-ring-color: #149AFB !important; } .callout-outlined-warning { background-color: #342D1E !important; --tw-ring-color: #FEC84B !important; } .callout-outlined p, .callout-outlined h5, .callout-outlined-warning p, .callout-outlined-warning h5, .callout-outlined-success p, .callout-outlined-success h5, .callout-outlined-danger p, .callout-outlined-danger h5, .callout-outlined-info p, .callout-outlined-info h5, .callout-outlined-tip p, .callout-outlined-tip h5, .callout-outlined-primary p, .callout-outlined-primary h5, .callout-outlined-check p, .callout-outlined-check h5, .callout-outlined-secondary p, .callout-outlined-warning li { color: var(--grayscale-a11) !important; } .callout-outlined li { margin-top: 0px !important; } .callout-outlined h2 { margin-top: 0px !important; } .callout-outlined-warning h2 { margin-top: 0px !important; } .logs { background-color: #0b0b0c !important; padding: 0.5rem !important; font-family: var(--typography-code-font-family, var(--code-font-fallback)); } div[class*="callout"] .mt-0\.5.w-4 { align-self: center !important; } span[data-badge-type="http-method"], span[data-badge-type="status-code"] { border-radius: 50px !important; } .dg-badge { margin-right: 6px !important; color: #bbbbbf !important; padding: 1px 1px !important; text-decoration: none !important; border-radius: 4px !important; background-origin: border-box !important; background-image: linear-gradient(90deg, #201cff -91.5%, #13ef95 80.05%); display: flex; align-items: center; justify-content: center; width: fit-content; height: fit-content; } .dg-badge span { background-color: #1A1A1F !important; padding: 4px 12px !important; border-radius: 4px !important; display: flex; align-items: center; justify-content: center; } .dg-badge .fa-icon { background: linear-gradient(90deg, #201cff -91.5%, #13ef95 80.05%); margin-right: 4px !important; } .fern-card { background-color: #0B0B0C !important; border-radius: 8px !important; } ol li { margin-top: 2rem !important; } .small .fern-card { padding-bottom: 1rem !important; padding-top: 1rem !important; } .small .fern-card .items-start { align-items: center !important; } .small .fern-card .text-base { color: #BBBBBF !important; font-weight: 600 !important; } .fern-card h3 { margin-top: 0px !important; } .fern-sidebar-tabs { padding-left: 10px !important; } .fern-sidebar-heading { padding-left: 28px !important; } .api-playground-call { width: fit-content !important; height: fit-content !important; display: flex !important; align-items: center !important; justify-content: center !important; padding: 1px !important; border-radius: 4px !important; background-image: linear-gradient(82.38deg, #ff2eea -99.24%, #4b3cff 99.26%) !important; width: 100% !important; margin-top: 1rem !important; } .api-playground-call span:first-child { display: flex !important; align-items: center !important; gap: 12px !important; background-color: #1A1A1F !important; padding: 4px !important; border-radius: 4px !important; width: 100% !important; flex-direction: row !important; } .api-playground-call p { margin: 0 !important; display: flex !important; align-items: center !important; white-space: nowrap !important; } .api-playground-call p div:first-child { display: inline-flex !important; align-items: center !important; } .api-playground-call img { width: 2.5rem !important; height: 2.5rem !important; display: inline-block !important; margin-top: 4px !important; margin-bottom: 4px !important; transform: scaleX(-1) !important; } .invert-white { filter: invert(1) !important; } .fa-icon, .card-icon { width: 2rem !important; height: 2rem !important; } .dg-badge .fa-icon { width: 1rem !important; height: 1rem !important; } .fern-header, .fern-header-tabs { border-bottom-width: 0px !important; } .fern-header-tabs-list-item span { font-family: 'Roobert' !important; } .fern-header-tabs-list, .fern-header-tabs-list-item { height: 100% !important; } .fern-sidebar-link-indent { margin-left: 20px !important; } .fern-sidebar-link-container[data-state=inactive] .fern-sidebar-link:hover { color: #FBFBFF !important; } .t-muted:is(.dark *) { color: #949498 !important; } .dark\:prose-invert:is(.dark *) { --tw-prose-headings: #FBFBFF !important; color: #E1E1E5 !important; } .fern-page-heading * { color: #FBFBFF !important; } .badge a { text-decoration: none !important; color: unset !important; } .badge svg { display: none !important; } .dep { background: #bbbbbf !important; } .dep .fa-icon { background: #bbbbbf !important; } .dep span { text-decoration: line-through !important; } .pink { background-image: linear-gradient(85deg, #ee028b 5.66%, #ae29ff 99.14%) !important; } .pink .fa-icon { background: linear-gradient(85deg, #ee028b 5.66%, #ae29ff 99.14%) !important; } #fern-header { padding-top: 3rem !important; } .fern-sidebar-container { position: sticky !important; top: 0 !important; margin-top: 10rem !important; overflow-y: auto !important; z-index: 20 !important; height: 100vh !important; } .fern-main { margin-top: calc(var(--header-offset, 0) + 3rem) !important; } .fern-endpoint-content-right .fa-icon, .fern-dropdown-item .fa-icon { width: 1rem !important; height: 1rem !important; } .fern-endpoint-content { padding-top: 3rem !important; } #fern-header { position: absolute !important; } div[id="/reference/speech-to-text-api/listen#request"] .flex.flex-col div:nth-of-type(4) span:nth-of-type(2) { display: none !important; } div[id="/reference/speech-to-text-api/listen#request"] .flex.flex-col div:nth-of-type(4) span:nth-of-type(1):after { content: " binary" !important; color: #949498 !important; font-size: .75rem; line-height: 1rem; font-family: 'Inter' !important; text-shadow: 0 1px 3px rgba(0, 0, 0, .4); margin-left: .5rem; } #fern-header { position: absolute !important; } .fern-sidebar-fixed+.fern-main { padding-left: 0px !important; } .api-playground-call a { padding-left: 4px !important; padding-right: 4px !important; color: #79affa !important; text-decoration: none !important; } *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.tw-absolute{position:absolute}.tw-relative{position:relative}.tw-inset-x-0{left:0;right:0}.tw-top-0{top:0}.tw-z-30{z-index:30}.tw-mx-auto{margin-left:auto;margin-right:auto}.tw-flex{display:flex}.tw-w-full{width:100%}.tw-max-w-\[var\(--spacing-page-width\)\]{max-width:var(--spacing-page-width)}.tw-items-center{align-items:center}.tw-justify-end{justify-content:flex-end}.tw-gap-2{gap:.5rem}.tw-gap-3{gap:.75rem}.tw-rounded-md{border-radius:.375rem}.tw-bg-\[\#232329\]{--tw-bg-opacity: 1;background-color:rgb(35 35 41 / var(--tw-bg-opacity))}.tw-px-3{padding-left:.75rem;padding-right:.75rem}.tw-px-4{padding-left:1rem;padding-right:1rem}.tw-py-2{padding-top:.5rem;padding-bottom:.5rem}.tw-text-\[\#BBBBBF\]{--tw-text-opacity: 1;color:rgb(187 187 191 / var(--tw-text-opacity))}.tw-backdrop-blur-2xl{--tw-backdrop-blur: blur(40px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}#fern-header a{font-size:16px!important;font-family:Inter,sans-serif!important}@media (min-width: 768px){.md\:tw-px-6{padding-left:1.5rem;padding-right:1.5rem}}@media (min-width: 1024px){.lg\:tw-px-8{padding-left:2rem;padding-right:2rem}} </style><style id="__jsx-1533687371">:root{ --header-offset: 108px}@media(max-width:1024px){:root{--header-offset:64px}}</style></head><body class="antialiased"><div id="__next"><noscript id="_fern-gtm-noscript"><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M5WQMGR" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript><div class="fern-background dark:from-transparent"></div><div id="fern-docs" class="fern-container fern-theme-default"><header id="fern-header" role="banner"><div class="fern-header-container width-before-scroll-bar has-background-dark" data-border="hide"><div class="clipped-background"><div class="h-screen opacity-60 dark:opacity-80 fern-background dark:from-transparent"></div></div><div class="fern-header"><nav aria-label="primary" class="fern-header-content max-w-page-width mx-auto"><div class="relative flex h-full min-w-fit flex-1 shrink-0 items-center gap-2 py-1"><div class="flex items-center gap-2"><a href="/"><div class="fern-logo-container"><img alt="Deepgram | Documentation" fetchpriority="high" loading="eager" width="176" height="25" decoding="async" data-nimg="1" class="fern-logo" style="color:transparent;aspect-ratio:7.04;height:24px;width:auto" src="https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/assets/logo.svg"/></div></a></div></div><div class="fern-header-searchbar"><button id="fern-search-button" class="fern-search-bar w-full" disabled=""><span class="search-placeholder"><svg width="1.5em" height="1.5em" viewBox="0 0 24 24" stroke-width="1.5" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class="size-icon-md"><path d="M17 17L21 21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M3 11C3 15.4183 6.58172 19 11 19C13.213 19 15.2161 18.1015 16.6644 16.6493C18.1077 15.2022 19 13.2053 19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Search...</span></span><kbd class="keyboard-shortcut-hint">/</kbd></button></div><div class="fern-header-right-menu flex-1"><div class="lg-menu"><span class="fern-button-group"></span></div><div class="max-lg-menu"><button tabindex="0" disabled="" data-state="off" aria-disabled="true" data-selected="false" id="fern-search-button" class="max-sm:block fern-button minimal large disabled rounded square"><span class="fern-button-content"><svg width="1.5em" height="1.5em" viewBox="0 0 24 24" stroke-width="1.5" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class="!size-icon-md"><path d="M17 17L21 21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M3 11C3 15.4183 6.58172 19 11 19C13.213 19 15.2161 18.1015 16.6644 16.6493C18.1077 15.2022 19 13.2053 19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg></span></button><button tabindex="0" data-state="off" aria-disabled="false" class="fern-button minimal large rounded square"><span class="fern-button-content"><svg width="1.5em" height="1.5em" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class="!size-icon-md"><path d="M3 5H21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M3 12H21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M3 19H21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg></span></button></div></div></nav></div><nav aria-label="tabs" class="fern-header-tabs"><ul class="fern-header-tabs-list"><li class="fern-header-tabs-list-item"><a class="fern-header-tab-button" data-state="inactive" href="/home/introduction"><div class="flex min-w-0 items-center justify-start space-x-2"><span class="truncate font-medium">Home</span></div></a></li><li class="fern-header-tabs-list-item"><a class="fern-header-tab-button" data-state="inactive" href="/docs/voice-agent"><div class="flex min-w-0 items-center justify-start space-x-2"><span class="truncate font-medium">Voice Agent</span></div></a></li><li class="fern-header-tabs-list-item"><a class="fern-header-tab-button" data-state="active" href="/docs/pre-recorded-audio"><div class="flex min-w-0 items-center justify-start space-x-2"><span class="truncate font-medium">Speech to Text</span></div></a></li><li class="fern-header-tabs-list-item"><a class="fern-header-tab-button" data-state="inactive" href="/docs/tts-rest"><div class="flex min-w-0 items-center justify-start space-x-2"><span class="truncate font-medium">Text to Speech</span></div></a></li><li class="fern-header-tabs-list-item"><a class="fern-header-tab-button" data-state="inactive" href="/docs/audio-intelligence"><div class="flex min-w-0 items-center justify-start space-x-2"><span class="truncate font-medium">Intelligence</span></div></a></li><li class="fern-header-tabs-list-item"><a class="fern-header-tab-button" data-state="inactive" href="/reference/deepgram-api-overview"><div class="flex min-w-0 items-center justify-start space-x-2"><span class="truncate font-medium">API Ref</span></div></a></li><li class="fern-header-tabs-list-item"><a class="fern-header-tab-button" data-state="inactive" href="/docs/make-your-first-api-request"><div class="flex min-w-0 items-center justify-start space-x-2"><span class="truncate font-medium">Guides</span></div></a></li><li class="fern-header-tabs-list-item"><a class="fern-header-tab-button" data-state="inactive" href="/docs/deepgram-sdks"><div class="flex min-w-0 items-center justify-start space-x-2"><span class="truncate font-medium">SDKs</span></div></a></li><li class="fern-header-tabs-list-item"><a class="fern-header-tab-button" data-state="inactive" href="/docs/self-hosted-introduction"><div class="flex min-w-0 items-center justify-start space-x-2"><span class="truncate font-medium">Self-Hosted Deployments</span></div></a></li><li class="fern-header-tabs-list-item"><a class="fern-header-tab-button" data-state="inactive" href="/docs/security-policy"><div class="flex min-w-0 items-center justify-start space-x-2"><span class="truncate font-medium">Security</span></div></a></li></ul></nav></div></header><style> .fern-sidebar-container { border-right-width: 0px; border-left-width: 0px; } :is(.dark) .fern-sidebar-container { border-right-width: 1px; border-left-width: 1px; } </style><div class="fern-body"><nav aria-label="secondary" class="fern-sidebar-container desktop fern-sidebar-fixed"><div dir="ltr" class="fern-scroll-area flex-1" style="position:relative;--radix-scroll-area-corner-width:0px;--radix-scroll-area-corner-height:0px"><style>[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}</style><div data-radix-scroll-area-viewport="" class="fern-scroll-area-viewport group/sidebar fern-sidebar-content" data-scrollbars="vertical" style="overflow-x:hidden;overflow-y:hidden"><div style="min-width:100%;display:table"><ul class="fern-sidebar-tabs lg:hidden"><li><a class="min-h-[32px] lg:min-h-[36px] group/tab-button hover:t-accent flex min-w-0 flex-1 select-none items-center justify-start rounded-lg py-2 text-base group-hover/tab-button:transition lg:px-3 lg:text-sm data-[state=inactive]:t-muted data-[state=active]:t-accent" data-state="inactive" href="/home/introduction"><div class="flex min-w-0 items-center justify-start space-x-4"><div class="min-w-fit"><div class="bg-card-surface ring-border-default group-hover/tab-button:bg-tag-primary group-hover/tab-button:ring-accent/70 group-data-[state=active]/tab-button:bg-accent group-hover/tab-button:group-data-[state=active]/tab-button:bg-accent flex size-6 items-center justify-center rounded-md shadow-sm ring-1 group-data-[state=active]/tab-button:ring-0"><span class="bg-faded group-hover/tab-button:bg-accent group-data-[state=active]/tab-button:bg-background group-hover/tab-button:group-data-[state=active]/tab-button:bg-background size-4 fa-icon" style="mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);mask-repeat:no-repeat;mask-position:center center;-webkit-mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);-webkit-mask-repeat:no-repeat;-webkit-mask-position:center center"></span></div></div><span class="truncate font-medium group-data-[state=active]/tab-button:font-semibold">Home</span></div></a></li><li><a class="min-h-[32px] lg:min-h-[36px] group/tab-button hover:t-accent flex min-w-0 flex-1 select-none items-center justify-start rounded-lg py-2 text-base group-hover/tab-button:transition lg:px-3 lg:text-sm data-[state=inactive]:t-muted data-[state=active]:t-accent" data-state="inactive" href="/docs/voice-agent"><div class="flex min-w-0 items-center justify-start space-x-4"><div class="min-w-fit"><div class="bg-card-surface ring-border-default group-hover/tab-button:bg-tag-primary group-hover/tab-button:ring-accent/70 group-data-[state=active]/tab-button:bg-accent group-hover/tab-button:group-data-[state=active]/tab-button:bg-accent flex size-6 items-center justify-center rounded-md shadow-sm ring-1 group-data-[state=active]/tab-button:ring-0"><span class="bg-faded group-hover/tab-button:bg-accent group-data-[state=active]/tab-button:bg-background group-hover/tab-button:group-data-[state=active]/tab-button:bg-background size-4 fa-icon" style="mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);mask-repeat:no-repeat;mask-position:center center;-webkit-mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);-webkit-mask-repeat:no-repeat;-webkit-mask-position:center center"></span></div></div><span class="truncate font-medium group-data-[state=active]/tab-button:font-semibold">Voice Agent</span></div></a></li><li><a class="min-h-[32px] lg:min-h-[36px] group/tab-button hover:t-accent flex min-w-0 flex-1 select-none items-center justify-start rounded-lg py-2 text-base group-hover/tab-button:transition lg:px-3 lg:text-sm data-[state=inactive]:t-muted data-[state=active]:t-accent" data-state="active" href="/docs/pre-recorded-audio"><div class="flex min-w-0 items-center justify-start space-x-4"><div class="min-w-fit"><div class="bg-card-surface ring-border-default group-hover/tab-button:bg-tag-primary group-hover/tab-button:ring-accent/70 group-data-[state=active]/tab-button:bg-accent group-hover/tab-button:group-data-[state=active]/tab-button:bg-accent flex size-6 items-center justify-center rounded-md shadow-sm ring-1 group-data-[state=active]/tab-button:ring-0"><span class="bg-faded group-hover/tab-button:bg-accent group-data-[state=active]/tab-button:bg-background group-hover/tab-button:group-data-[state=active]/tab-button:bg-background size-4 fa-icon" style="mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);mask-repeat:no-repeat;mask-position:center center;-webkit-mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);-webkit-mask-repeat:no-repeat;-webkit-mask-position:center center"></span></div></div><span class="truncate font-medium group-data-[state=active]/tab-button:font-semibold">Speech to Text</span></div></a></li><li><a class="min-h-[32px] lg:min-h-[36px] group/tab-button hover:t-accent flex min-w-0 flex-1 select-none items-center justify-start rounded-lg py-2 text-base group-hover/tab-button:transition lg:px-3 lg:text-sm data-[state=inactive]:t-muted data-[state=active]:t-accent" data-state="inactive" href="/docs/tts-rest"><div class="flex min-w-0 items-center justify-start space-x-4"><div class="min-w-fit"><div class="bg-card-surface ring-border-default group-hover/tab-button:bg-tag-primary group-hover/tab-button:ring-accent/70 group-data-[state=active]/tab-button:bg-accent group-hover/tab-button:group-data-[state=active]/tab-button:bg-accent flex size-6 items-center justify-center rounded-md shadow-sm ring-1 group-data-[state=active]/tab-button:ring-0"><span class="bg-faded group-hover/tab-button:bg-accent group-data-[state=active]/tab-button:bg-background group-hover/tab-button:group-data-[state=active]/tab-button:bg-background size-4 fa-icon" style="mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);mask-repeat:no-repeat;mask-position:center center;-webkit-mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);-webkit-mask-repeat:no-repeat;-webkit-mask-position:center center"></span></div></div><span class="truncate font-medium group-data-[state=active]/tab-button:font-semibold">Text to Speech</span></div></a></li><li><a class="min-h-[32px] lg:min-h-[36px] group/tab-button hover:t-accent flex min-w-0 flex-1 select-none items-center justify-start rounded-lg py-2 text-base group-hover/tab-button:transition lg:px-3 lg:text-sm data-[state=inactive]:t-muted data-[state=active]:t-accent" data-state="inactive" href="/docs/audio-intelligence"><div class="flex min-w-0 items-center justify-start space-x-4"><div class="min-w-fit"><div class="bg-card-surface ring-border-default group-hover/tab-button:bg-tag-primary group-hover/tab-button:ring-accent/70 group-data-[state=active]/tab-button:bg-accent group-hover/tab-button:group-data-[state=active]/tab-button:bg-accent flex size-6 items-center justify-center rounded-md shadow-sm ring-1 group-data-[state=active]/tab-button:ring-0"><span class="bg-faded group-hover/tab-button:bg-accent group-data-[state=active]/tab-button:bg-background group-hover/tab-button:group-data-[state=active]/tab-button:bg-background size-4 fa-icon" style="mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);mask-repeat:no-repeat;mask-position:center center;-webkit-mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);-webkit-mask-repeat:no-repeat;-webkit-mask-position:center center"></span></div></div><span class="truncate font-medium group-data-[state=active]/tab-button:font-semibold">Intelligence</span></div></a></li><li><a class="min-h-[32px] lg:min-h-[36px] group/tab-button hover:t-accent flex min-w-0 flex-1 select-none items-center justify-start rounded-lg py-2 text-base group-hover/tab-button:transition lg:px-3 lg:text-sm data-[state=inactive]:t-muted data-[state=active]:t-accent" data-state="inactive" href="/reference/deepgram-api-overview"><div class="flex min-w-0 items-center justify-start space-x-4"><div class="min-w-fit"><div class="bg-card-surface ring-border-default group-hover/tab-button:bg-tag-primary group-hover/tab-button:ring-accent/70 group-data-[state=active]/tab-button:bg-accent group-hover/tab-button:group-data-[state=active]/tab-button:bg-accent flex size-6 items-center justify-center rounded-md shadow-sm ring-1 group-data-[state=active]/tab-button:ring-0"><span class="bg-faded group-hover/tab-button:bg-accent group-data-[state=active]/tab-button:bg-background group-hover/tab-button:group-data-[state=active]/tab-button:bg-background size-4 fa-icon" style="mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);mask-repeat:no-repeat;mask-position:center center;-webkit-mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);-webkit-mask-repeat:no-repeat;-webkit-mask-position:center center"></span></div></div><span class="truncate font-medium group-data-[state=active]/tab-button:font-semibold">API Ref</span></div></a></li><li><a class="min-h-[32px] lg:min-h-[36px] group/tab-button hover:t-accent flex min-w-0 flex-1 select-none items-center justify-start rounded-lg py-2 text-base group-hover/tab-button:transition lg:px-3 lg:text-sm data-[state=inactive]:t-muted data-[state=active]:t-accent" data-state="inactive" href="/docs/make-your-first-api-request"><div class="flex min-w-0 items-center justify-start space-x-4"><div class="min-w-fit"><div class="bg-card-surface ring-border-default group-hover/tab-button:bg-tag-primary group-hover/tab-button:ring-accent/70 group-data-[state=active]/tab-button:bg-accent group-hover/tab-button:group-data-[state=active]/tab-button:bg-accent flex size-6 items-center justify-center rounded-md shadow-sm ring-1 group-data-[state=active]/tab-button:ring-0"><span class="bg-faded group-hover/tab-button:bg-accent group-data-[state=active]/tab-button:bg-background group-hover/tab-button:group-data-[state=active]/tab-button:bg-background size-4 fa-icon" style="mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);mask-repeat:no-repeat;mask-position:center center;-webkit-mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);-webkit-mask-repeat:no-repeat;-webkit-mask-position:center center"></span></div></div><span class="truncate font-medium group-data-[state=active]/tab-button:font-semibold">Guides</span></div></a></li><li><a class="min-h-[32px] lg:min-h-[36px] group/tab-button hover:t-accent flex min-w-0 flex-1 select-none items-center justify-start rounded-lg py-2 text-base group-hover/tab-button:transition lg:px-3 lg:text-sm data-[state=inactive]:t-muted data-[state=active]:t-accent" data-state="inactive" href="/docs/deepgram-sdks"><div class="flex min-w-0 items-center justify-start space-x-4"><div class="min-w-fit"><div class="bg-card-surface ring-border-default group-hover/tab-button:bg-tag-primary group-hover/tab-button:ring-accent/70 group-data-[state=active]/tab-button:bg-accent group-hover/tab-button:group-data-[state=active]/tab-button:bg-accent flex size-6 items-center justify-center rounded-md shadow-sm ring-1 group-data-[state=active]/tab-button:ring-0"><span class="bg-faded group-hover/tab-button:bg-accent group-data-[state=active]/tab-button:bg-background group-hover/tab-button:group-data-[state=active]/tab-button:bg-background size-4 fa-icon" style="mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);mask-repeat:no-repeat;mask-position:center center;-webkit-mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);-webkit-mask-repeat:no-repeat;-webkit-mask-position:center center"></span></div></div><span class="truncate font-medium group-data-[state=active]/tab-button:font-semibold">SDKs</span></div></a></li><li><a class="min-h-[32px] lg:min-h-[36px] group/tab-button hover:t-accent flex min-w-0 flex-1 select-none items-center justify-start rounded-lg py-2 text-base group-hover/tab-button:transition lg:px-3 lg:text-sm data-[state=inactive]:t-muted data-[state=active]:t-accent" data-state="inactive" href="/docs/self-hosted-introduction"><div class="flex min-w-0 items-center justify-start space-x-4"><div class="min-w-fit"><div class="bg-card-surface ring-border-default group-hover/tab-button:bg-tag-primary group-hover/tab-button:ring-accent/70 group-data-[state=active]/tab-button:bg-accent group-hover/tab-button:group-data-[state=active]/tab-button:bg-accent flex size-6 items-center justify-center rounded-md shadow-sm ring-1 group-data-[state=active]/tab-button:ring-0"><span class="bg-faded group-hover/tab-button:bg-accent group-data-[state=active]/tab-button:bg-background group-hover/tab-button:group-data-[state=active]/tab-button:bg-background size-4 fa-icon" style="mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);mask-repeat:no-repeat;mask-position:center center;-webkit-mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);-webkit-mask-repeat:no-repeat;-webkit-mask-position:center center"></span></div></div><span class="truncate font-medium group-data-[state=active]/tab-button:font-semibold">Self-Hosted Deployments</span></div></a></li><li><a class="min-h-[32px] lg:min-h-[36px] group/tab-button hover:t-accent flex min-w-0 flex-1 select-none items-center justify-start rounded-lg py-2 text-base group-hover/tab-button:transition lg:px-3 lg:text-sm data-[state=inactive]:t-muted data-[state=active]:t-accent" data-state="inactive" href="/docs/security-policy"><div class="flex min-w-0 items-center justify-start space-x-4"><div class="min-w-fit"><div class="bg-card-surface ring-border-default group-hover/tab-button:bg-tag-primary group-hover/tab-button:ring-accent/70 group-data-[state=active]/tab-button:bg-accent group-hover/tab-button:group-data-[state=active]/tab-button:bg-accent flex size-6 items-center justify-center rounded-md shadow-sm ring-1 group-data-[state=active]/tab-button:ring-0"><span class="bg-faded group-hover/tab-button:bg-accent group-data-[state=active]/tab-button:bg-background group-hover/tab-button:group-data-[state=active]/tab-button:bg-background size-4 fa-icon" style="mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);mask-repeat:no-repeat;mask-position:center center;-webkit-mask-image:url(&quot;https://icons.ferndocs.com/solid/book-open.svg&quot;);-webkit-mask-repeat:no-repeat;-webkit-mask-position:center center"></span></div></div><span class="truncate font-medium group-data-[state=active]/tab-button:font-semibold">Security</span></div></a></li></ul><ul class="fern-sidebar-group"><li class="mt-6"><div class="fern-sidebar-heading"><span class="fern-sidebar-heading-content">Pre-Recorded Audio</span></div><ul class="fern-sidebar-group"><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/pre-recorded-audio"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Getting Started</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/stt-pre-recorded-feature-overview"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Feature Overview</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/stt-pre-recorded-starter-apps"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Starter Apps</span></span></a></div></li><li><div data-state="closed"><div class="fern-sidebar-link-container" data-state="inactive"><button class="fern-sidebar-link"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Tips and Tricks</span></span><span class="fern-sidebar-link-expand opacity-50 transition-opacity group-hover:opacity-80" data-state="inactive"><svg width="1.5em" height="1.5em" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class="size-icon-md lg:size-icon -rotate-90"><path d="M6 9L12 15L18 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg></span></button></div></div></li></ul></li><li class="mt-6"><div class="fern-sidebar-heading"><span class="fern-sidebar-heading-content">Streaming Audio</span></div><ul class="fern-sidebar-group"><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/live-streaming-audio"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Getting Started</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/stt-streaming-feature-overview"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Feature Overview</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/getting-started-with-the-streaming-test-suite"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Live Streaming Starter Kit</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/stt-streaming-starter-apps"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Starter Apps</span></span></a></div></li><li><div data-state="open"><div class="fern-sidebar-link-container" data-state="inactive"><button class="fern-sidebar-link"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Control Messages</span></span><span class="fern-sidebar-link-expand opacity-50 transition-opacity group-hover:opacity-80" data-state="inactive"><svg width="1.5em" height="1.5em" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class="size-icon-md lg:size-icon rotate-0"><path d="M6 9L12 15L18 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg></span></button></div><ul class="fern-sidebar-group" data-state="open" id="radix-:Rb2kcoum:"><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/close-stream"><div class="fern-sidebar-link-indent"></div><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Close Stream</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="active"><a class="fern-sidebar-link" href="/docs/finalize"><div class="fern-sidebar-link-indent"></div><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Finalize</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/audio-keep-alive"><div class="fern-sidebar-link-indent"></div><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Audio Keep Alive</span></span></a></div></li></ul></div></li><li><div data-state="closed"><div class="fern-sidebar-link-container" data-state="inactive"><button class="fern-sidebar-link"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Speech Detection</span></span><span class="fern-sidebar-link-expand opacity-50 transition-opacity group-hover:opacity-80" data-state="inactive"><svg width="1.5em" height="1.5em" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class="size-icon-md lg:size-icon -rotate-90"><path d="M6 9L12 15L18 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg></span></button></div></div></li><li><div data-state="closed"><div class="fern-sidebar-link-container" data-state="inactive"><button class="fern-sidebar-link"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Tips and Tricks</span></span><span class="fern-sidebar-link-expand opacity-50 transition-opacity group-hover:opacity-80" data-state="inactive"><svg width="1.5em" height="1.5em" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class="size-icon-md lg:size-icon -rotate-90"><path d="M6 9L12 15L18 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg></span></button></div></div></li></ul></li><li class="mt-6"><div class="fern-sidebar-heading"><span class="fern-sidebar-heading-content">Models and Languages</span></div><ul class="fern-sidebar-group"><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/models-languages-overview"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Models &amp; Languages Overview</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/language"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Languages Support</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/language-detection"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Language Detection</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/multilingual-code-switching"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Multilingual Codeswitching</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/model"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Model Options</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/version"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Version</span></span></a></div></li></ul></li><li class="mt-6"><div class="fern-sidebar-heading"><span class="fern-sidebar-heading-content">Formatting</span></div><ul class="fern-sidebar-group"><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/diarization"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Diarization</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/dictation"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Dictation</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/filler-words"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Filler Words</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/measurements"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Measurements</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/numerals"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Numerals</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/paragraphs"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Paragraphs</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/profanity-filter"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Profanity Filtering</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/punctuation"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Punctuation</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/redaction"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Redaction</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/smart-format"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Smart Formatting</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/supported-entity-types"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Supported Entity Types</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/utterances"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Utterances</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/utterance-split"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Utterance Split</span></span></a></div></li></ul></li><li class="mt-6"><div class="fern-sidebar-heading"><span class="fern-sidebar-heading-content">Custom Vocabulary</span></div><ul class="fern-sidebar-group"><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/find-and-replace"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Find and Replace</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/keyterm"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Keyterm Prompting</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/keywords"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Keywords</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/search"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Search</span></span></a></div></li></ul></li><li class="mt-6"><div class="fern-sidebar-link-container" data-state="inactive"><a class="font-semibold !text-text-default fern-sidebar-link" href="/docs/media-input-settings"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Media Input Settings</span></span></a></div><ul class="fern-sidebar-group"><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/channels"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Channels</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/encoding"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Encoding</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/multichannel"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Multichannel</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/sample-rate"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Sample Rate</span></span></a></div></li></ul></li><li class="mt-6"><div class="fern-sidebar-heading"><span class="fern-sidebar-heading-content">Results Processing</span></div><ul class="fern-sidebar-group"><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/callback"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">STT Callback</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/tagging"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Tagging</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/extra-metadata"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Extra Metadata</span></span></a></div></li></ul></li><li class="mt-6"><div class="fern-sidebar-heading"><span class="fern-sidebar-heading-content">Migrating</span></div><ul class="fern-sidebar-group"><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/migrating-from-amazon-web-services-aws-transcribe-to-deepgram"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Migrating From Amazon Web Services (AWS) Transcribe to Deepgram</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/migrating-from-google-speech-to-text-stt-to-deepgram"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Migrating From Google Speech-to-Text (STT) to Deepgram</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/migrating-from-openai-whisper-to-deepgram"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Migrating From OpenAI Whisper to Deepgram</span></span></a></div></li><li><div class="fern-sidebar-link-container" data-state="inactive"><a class="fern-sidebar-link" href="/docs/migrating-from-assembly-ai-speech-to-text-to-deepgram"><span class="fern-sidebar-link-content"><span class="fern-sidebar-link-text">Migrating from AssemblyAI Speech-to-Text to Deepgram</span></span></a></div></li></ul></li></ul></div></div></div></nav><div class="fern-main"><main class="fern-guide-layout"><aside class="fern-layout-toc"><div dir="ltr" class="fern-scroll-area" style="position:relative;--radix-scroll-area-corner-width:0px;--radix-scroll-area-corner-height:0px"><style>[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}</style><div data-radix-scroll-area-viewport="" class="fern-scroll-area-viewport px-4 pb-12 pt-8 lg:pr-8" data-scrollbars="both" style="overflow-x:hidden;overflow-y:hidden"><div style="min-width:100%;display:table"><div class="text-grayscale-a11 m-0 mb-3 text-sm font-medium">On this page</div><ul class="toc-root not-prose" style="--height:0px;--top:0px"><li class="mb-2 last:mb-0" data-depth="0"><a class="block hyphens-auto break-words text-sm transition-colors hover:transition-none text-grayscale-a11 hover:text-grayscale-a12" style="padding-left:0px" href="/docs/finalize#what-is-the-finalize-message">What is the Finalize Message?</a></li><li class="mb-2 last:mb-0" data-depth="1"><a class="block hyphens-auto break-words text-sm transition-colors hover:transition-none text-grayscale-a11 hover:text-grayscale-a12" style="padding-left:12px" href="/docs/finalize#sending-finalize">Sending Finalize</a></li><li class="mb-2 last:mb-0" data-depth="1"><a class="block hyphens-auto break-words text-sm transition-colors hover:transition-none text-grayscale-a11 hover:text-grayscale-a12" style="padding-left:12px" href="/docs/finalize#finalize-confirmation">Finalize Confirmation</a></li><li class="mb-2 last:mb-0" data-depth="1"><a class="block hyphens-auto break-words text-sm transition-colors hover:transition-none text-grayscale-a11 hover:text-grayscale-a12" style="padding-left:12px" href="/docs/finalize#language-specific-implementations">Language-Specific Implementations</a></li><li class="mb-2 last:mb-0" data-depth="2"><a class="block hyphens-auto break-words text-sm transition-colors hover:transition-none text-grayscale-a11 hover:text-grayscale-a12" style="padding-left:24px" href="/docs/finalize#sending-a-finalize-message-in-json-format">Sending a Finalize message in JSON Format</a></li><li class="mb-2 last:mb-0" data-depth="2"><a class="block hyphens-auto break-words text-sm transition-colors hover:transition-none text-grayscale-a11 hover:text-grayscale-a12" style="padding-left:24px" href="/docs/finalize#streaming-examples">Streaming Examples</a></li><li class="mb-2 last:mb-0" data-depth="1"><a class="block hyphens-auto break-words text-sm transition-colors hover:transition-none text-grayscale-a11 hover:text-grayscale-a12" style="padding-left:12px" href="/docs/finalize#conclusion">Conclusion</a></li></ul></div></div></div></aside><article class="fern-layout-content max-w-content-width"><header class="mb-8"><div class="space-y-1"><div><span class="fern-breadcrumb"><a class="fern-breadcrumb-item" href="/docs/live-streaming-audio">Streaming Audio</a><svg width="1.5em" height="1.5em" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class="fern-breadcrumb-arrow"><path d="M9 6L15 12L9 18" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg><a class="fern-breadcrumb-item" href="/docs/close-stream">Control Messages</a></span></div><h1 class="fern-page-heading"><p>Finalize</p></h1></div><div class="prose-p:t-muted mt-2 leading-7"><p>Learn how to send Deepgram a Finalize message, which flushes the websocket stream’s audio by forcing the server to process all unprocessed audio data immediately and return the results.</p></div></header><div class="prose dark:prose-invert prose-h1:mt-[1.5em] first:prose-h1:mt-0 max-w-full break-words"><a href="/docs/getting-started-with-live-streaming-audio" class="dg-badge"><span><span class="fa-icon" style="mask-image:url(&quot;https://icons.ferndocs.com/solid/waveform-lines.svg&quot;);mask-repeat:no-repeat;mask-position:center center;-webkit-mask-image:url(&quot;https://icons.ferndocs.com/solid/waveform-lines.svg&quot;);-webkit-mask-repeat:no-repeat;-webkit-mask-position:center center"></span> Streaming</span></a> <p>In real-time audio processing, there are scenarios where you may need to force the server to process (<em>or flush</em>) all unprocessed audio data immediately. Deepgram supports a <code>Finalize</code> message to handle such situations, ensuring that interim results are treated as final.</p> <h1 id="what-is-the-finalize-message" data-state="closed">What is the <code>Finalize</code> Message?</h1> <p>The <code>Finalize</code> message is a JSON command that you send to the Deepgram server, instructing it to process and finalize all remaining audio data immediately. This is particularly useful in scenarios where an utterance has ended, or when transitioning to a keep-alive period to ensure that no previous transcripts reappear unexpectedly.</p> <h2 id="sending-finalize" data-state="closed">Sending <code>Finalize</code></h2> <p>To send the <code>Finalize</code> message, you need to send the following JSON message to the server:</p> <div class="bg-card after:ring-card-border relative mb-6 mt-4 flex w-full min-w-0 max-w-full flex-col rounded-lg shadow-sm after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:ring-1 after:ring-inset after:content-[&#x27;&#x27;] first:mt-0"><div class="bg-tag-default-soft rounded-t-[inherit]"><div class="shadow-border-default mx-px flex min-h-10 items-center justify-between shadow-[inset_0_-1px_0_0]"><div class="flex min-h-10 overflow-x-auto"><div class="flex items-center px-3 py-1.5"><span class="t-muted rounded text-sm font-semibold">JSON</span></div></div><button tabindex="0" data-state="closed" aria-disabled="false" class="fern-copy-button group ml-2 mr-1 fern-button minimal normal rounded square"><span class="fern-button-content"><svg width="1.5em" height="1.5em" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor"><path d="M19.4 20H9.6C9.26863 20 9 19.7314 9 19.4V9.6C9 9.26863 9.26863 9 9.6 9H19.4C19.7314 9 20 9.26863 20 9.6V19.4C20 19.7314 19.7314 20 19.4 20Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15 9V4.6C15 4.26863 14.7314 4 14.4 4H4.6C4.26863 4 4 4.26863 4 4.6V14.4C4 14.7314 4.26863 15 4.6 15H9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg></span></button></div></div><pre class="code-block-root not-prose rounded-b-[inherit]" tabindex="0"><div dir="ltr" class="fern-scroll-area" style="position:relative;--radix-scroll-area-corner-width:0px;--radix-scroll-area-corner-height:0px"><style>[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}</style><div data-radix-scroll-area-viewport="" class="fern-scroll-area-viewport" data-scrollbars="both" style="overflow-x:hidden;overflow-y:hidden;max-height:479px"><div style="min-width:100%;display:table"><code class="code-block text-sm"><div class="code-block-inner"><table class="code-block-line-group"><colgroup><col class="w-fit"/><col/></colgroup><tbody><tr class="code-block-line"><td class="code-block-line-gutter"><span>1</span></td><td class="code-block-line-content"><span class="line">{</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>2</span></td><td class="code-block-line-content"><span class="line"> &quot;type&quot;: &quot;Finalize&quot;</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>3</span></td><td class="code-block-line-content"><span class="line">}</span></td></tr></tbody></table></div></code></div></div></div></pre></div> <p>You can optionally specify a <code>channel</code> field to finalize a specific channel. If the <code>channel</code> field is omitted, all channels in the audio will be finalized. Note that channel indexing starts at 0, so to finalize only the <em>first</em> channel you need to send:</p> <div class="bg-card after:ring-card-border relative mb-6 mt-4 flex w-full min-w-0 max-w-full flex-col rounded-lg shadow-sm after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:ring-1 after:ring-inset after:content-[&#x27;&#x27;] first:mt-0"><div class="bg-tag-default-soft rounded-t-[inherit]"><div class="shadow-border-default mx-px flex min-h-10 items-center justify-between shadow-[inset_0_-1px_0_0]"><div class="flex min-h-10 overflow-x-auto"><div class="flex items-center px-3 py-1.5"><span class="t-muted rounded text-sm font-semibold">JSON</span></div></div><button tabindex="0" data-state="closed" aria-disabled="false" class="fern-copy-button group ml-2 mr-1 fern-button minimal normal rounded square"><span class="fern-button-content"><svg width="1.5em" height="1.5em" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor"><path d="M19.4 20H9.6C9.26863 20 9 19.7314 9 19.4V9.6C9 9.26863 9.26863 9 9.6 9H19.4C19.7314 9 20 9.26863 20 9.6V19.4C20 19.7314 19.7314 20 19.4 20Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15 9V4.6C15 4.26863 14.7314 4 14.4 4H4.6C4.26863 4 4 4.26863 4 4.6V14.4C4 14.7314 4.26863 15 4.6 15H9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg></span></button></div></div><pre class="code-block-root not-prose rounded-b-[inherit]" tabindex="0"><div dir="ltr" class="fern-scroll-area" style="position:relative;--radix-scroll-area-corner-width:0px;--radix-scroll-area-corner-height:0px"><style>[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}</style><div data-radix-scroll-area-viewport="" class="fern-scroll-area-viewport" data-scrollbars="both" style="overflow-x:hidden;overflow-y:hidden;max-height:479px"><div style="min-width:100%;display:table"><code class="code-block text-sm"><div class="code-block-inner"><table class="code-block-line-group"><colgroup><col class="w-fit"/><col/></colgroup><tbody><tr class="code-block-line"><td class="code-block-line-gutter"><span>1</span></td><td class="code-block-line-content"><span class="line">{</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>2</span></td><td class="code-block-line-content"><span class="line"> &quot;type&quot;: &quot;Finalize&quot;,</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>3</span></td><td class="code-block-line-content"><span class="line"> &quot;channel&quot;: 0</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>4</span></td><td class="code-block-line-content"><span class="line">}</span></td></tr></tbody></table></div></code></div></div></div></pre></div> <h2 id="finalize-confirmation" data-state="closed"><code>Finalize</code> Confirmation</h2> <p>Upon receiving the Finalize message, the server will process all remaining audio data and return the final results. You may receive a response with the <code>from_finalize</code> attribute set to <code>true</code>, indicating that the finalization process is complete. This response typically occurs when there is a noticeable amount of audio buffered in the server.</p> <p>If you specified a <code>channel</code> to be finalized, use the response’s <code>channel_index</code> field to check which channel was finalized.</p> <div class="bg-card after:ring-card-border relative mb-6 mt-4 flex w-full min-w-0 max-w-full flex-col rounded-lg shadow-sm after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:ring-1 after:ring-inset after:content-[&#x27;&#x27;] first:mt-0"><div class="bg-tag-default-soft rounded-t-[inherit]"><div class="shadow-border-default mx-px flex min-h-10 items-center justify-between shadow-[inset_0_-1px_0_0]"><div class="flex min-h-10 overflow-x-auto"><div class="flex items-center px-3 py-1.5"><span class="t-muted rounded text-sm font-semibold">JSON</span></div></div><button tabindex="0" data-state="closed" aria-disabled="false" class="fern-copy-button group ml-2 mr-1 fern-button minimal normal rounded square"><span class="fern-button-content"><svg width="1.5em" height="1.5em" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor"><path d="M19.4 20H9.6C9.26863 20 9 19.7314 9 19.4V9.6C9 9.26863 9.26863 9 9.6 9H19.4C19.7314 9 20 9.26863 20 9.6V19.4C20 19.7314 19.7314 20 19.4 20Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15 9V4.6C15 4.26863 14.7314 4 14.4 4H4.6C4.26863 4 4 4.26863 4 4.6V14.4C4 14.7314 4.26863 15 4.6 15H9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg></span></button></div></div><pre class="code-block-root not-prose rounded-b-[inherit]" tabindex="0"><div dir="ltr" class="fern-scroll-area" style="position:relative;--radix-scroll-area-corner-width:0px;--radix-scroll-area-corner-height:0px"><style>[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}</style><div data-radix-scroll-area-viewport="" class="fern-scroll-area-viewport" data-scrollbars="both" style="overflow-x:hidden;overflow-y:hidden;max-height:479px"><div style="min-width:100%;display:table"><code class="code-block text-sm"><div class="code-block-inner"><table class="code-block-line-group"><colgroup><col class="w-fit"/><col/></colgroup><tbody><tr class="code-block-line"><td class="code-block-line-gutter"><span>1</span></td><td class="code-block-line-content"><span class="line">{</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>2</span></td><td class="code-block-line-content"><span class="line"> &quot;from_finalize&quot;: true</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>3</span></td><td class="code-block-line-content"><span class="line">}</span></td></tr></tbody></table></div></code></div></div></div></pre></div> <div class="mb-6 mt-4 rounded-lg p-4 first:mt-0 callout-outlined"><div class="flex items-start space-x-3"><div class="mt-0.5 w-4"><svg width="1.5em" height="1.5em" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class="text-intent-default size-icon-md"><path d="M12 11.5V16.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 7.51L12.01 7.49889" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg></div><div class="prose prose-sm dark:prose-invert -my-4 flex-1 overflow-x-auto before:mb-4 before:block after:mt-4 after:block"><div class="text-intent-default"><h5 class="leading-snug"></h5><p>In most cases, you will receive this response, but it is not guaranteed if there is no significant amount of audio data to process.</p></div></div></div></div> <h2 id="language-specific-implementations" data-state="closed">Language-Specific Implementations</h2> <p>Following are code examples to help you get started.</p> <h3 id="sending-a-finalize-message-in-json-format" data-state="closed">Sending a <code>Finalize</code> message in JSON Format</h3> <p>These snippets demonstrate how to construct a JSON message containing the “Finalize” type and send it over the WebSocket connection in each respective language.</p> <div dir="ltr" data-orientation="horizontal" class="bg-card after:ring-card-border relative mb-6 mt-4 flex w-full min-w-0 max-w-full flex-col rounded-lg shadow-sm after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:ring-1 after:ring-inset after:content-[&#x27;&#x27;] first:mt-0"><div class="bg-tag-default-soft rounded-t-[inherit]"><div class="shadow-border-default mx-px flex min-h-10 items-center justify-between shadow-[inset_0_-1px_0_0]"><div class="fern-x-overflow right-mask flex min-h-10"><button type="button" role="tab" aria-selected="true" aria-controls="radix-:R2al8um:-content-0" data-state="active" id="radix-:R2al8um:-trigger-0" class="data-[state=active]:shadow-accent group flex min-h-10 items-center px-2 py-1.5 data-[state=active]:shadow-[inset_0_-2px_0_0_rgba(0,0,0,0.1)]" tabindex="-1" data-orientation="horizontal" data-radix-collection-item=""><span class="t-muted group-data-[state=active]:t-default group-hover:bg-tag-default whitespace-nowrap rounded px-2 py-1 text-sm group-data-[state=active]:font-semibold">JavaScript</span></button><button type="button" role="tab" aria-selected="false" aria-controls="radix-:R2al8um:-content-1" data-state="inactive" id="radix-:R2al8um:-trigger-1" class="data-[state=active]:shadow-accent group flex min-h-10 items-center px-2 py-1.5 data-[state=active]:shadow-[inset_0_-2px_0_0_rgba(0,0,0,0.1)]" tabindex="-1" data-orientation="horizontal" data-radix-collection-item=""><span class="t-muted group-data-[state=active]:t-default group-hover:bg-tag-default whitespace-nowrap rounded px-2 py-1 text-sm group-data-[state=active]:font-semibold">Python</span></button><button type="button" role="tab" aria-selected="false" aria-controls="radix-:R2al8um:-content-2" data-state="inactive" id="radix-:R2al8um:-trigger-2" class="data-[state=active]:shadow-accent group flex min-h-10 items-center px-2 py-1.5 data-[state=active]:shadow-[inset_0_-2px_0_0_rgba(0,0,0,0.1)]" tabindex="-1" data-orientation="horizontal" data-radix-collection-item=""><span class="t-muted group-data-[state=active]:t-default group-hover:bg-tag-default whitespace-nowrap rounded px-2 py-1 text-sm group-data-[state=active]:font-semibold">Go</span></button><button type="button" role="tab" aria-selected="false" aria-controls="radix-:R2al8um:-content-3" data-state="inactive" id="radix-:R2al8um:-trigger-3" class="data-[state=active]:shadow-accent group flex min-h-10 items-center px-2 py-1.5 data-[state=active]:shadow-[inset_0_-2px_0_0_rgba(0,0,0,0.1)]" tabindex="-1" data-orientation="horizontal" data-radix-collection-item=""><span class="t-muted group-data-[state=active]:t-default group-hover:bg-tag-default whitespace-nowrap rounded px-2 py-1 text-sm group-data-[state=active]:font-semibold">C#</span></button></div><button tabindex="0" data-state="closed" aria-disabled="false" class="fern-copy-button group ml-2 mr-1 fern-button minimal normal rounded square"><span class="fern-button-content"><svg width="1.5em" height="1.5em" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor"><path d="M19.4 20H9.6C9.26863 20 9 19.7314 9 19.4V9.6C9 9.26863 9.26863 9 9.6 9H19.4C19.7314 9 20 9.26863 20 9.6V19.4C20 19.7314 19.7314 20 19.4 20Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15 9V4.6C15 4.26863 14.7314 4 14.4 4H4.6C4.26863 4 4 4.26863 4 4.6V14.4C4 14.7314 4.26863 15 4.6 15H9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg></span></button></div></div><pre class="code-block-root not-prose rounded-t-0 rounded-b-[inherit]" style="animation-duration:0s" tabindex="0"><div dir="ltr" class="fern-scroll-area" style="position:relative;--radix-scroll-area-corner-width:0px;--radix-scroll-area-corner-height:0px"><style>[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}</style><div data-radix-scroll-area-viewport="" class="fern-scroll-area-viewport" data-scrollbars="both" style="overflow-x:hidden;overflow-y:hidden;max-height:479px"><div style="min-width:100%;display:table"><code class="code-block text-sm"><div class="code-block-inner"><table class="code-block-line-group"><colgroup><col class="w-fit"/><col/></colgroup><tbody><tr class="code-block-line"><td class="code-block-line-gutter"><span>1</span></td><td class="code-block-line-content"><span class="line">const WebSocket = require(&quot;ws&quot;);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>2</span></td><td class="code-block-line-content"><span class="line"></span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>3</span></td><td class="code-block-line-content"><span class="line">// Assuming &#x27;headers&#x27; is already defined for authorization</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>4</span></td><td class="code-block-line-content"><span class="line">const ws = new WebSocket(&quot;wss://api.deepgram.com/v1/listen&quot;, { headers });</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>5</span></td><td class="code-block-line-content"><span class="line"></span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>6</span></td><td class="code-block-line-content"><span class="line">ws.on(&#x27;open&#x27;, function open() {</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>7</span></td><td class="code-block-line-content"><span class="line"> // Construct Finalize message</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>8</span></td><td class="code-block-line-content"><span class="line"> const finalizeMsg = JSON.stringify({ type: &quot;Finalize&quot; });</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>9</span></td><td class="code-block-line-content"><span class="line"> </span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>10</span></td><td class="code-block-line-content"><span class="line"> // Send Finalize message</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>11</span></td><td class="code-block-line-content"><span class="line"> ws.send(finalizeMsg);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>12</span></td><td class="code-block-line-content"><span class="line">});</span></td></tr></tbody></table></div></code></div></div></div></pre></div> <h3 id="streaming-examples" data-state="closed">Streaming Examples</h3> <p>Here are more complete examples that make a streaming request and use Finalize. Try running these examples to see how Finalize can be sent to Deepgram, forcing the API to process all unprocessed audio data and immediately return the results.</p> <div dir="ltr" data-orientation="horizontal" class="bg-card after:ring-card-border relative mb-6 mt-4 flex w-full min-w-0 max-w-full flex-col rounded-lg shadow-sm after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:ring-1 after:ring-inset after:content-[&#x27;&#x27;] first:mt-0"><div class="bg-tag-default-soft rounded-t-[inherit]"><div class="shadow-border-default mx-px flex min-h-10 items-center justify-between shadow-[inset_0_-1px_0_0]"><div class="fern-x-overflow right-mask flex min-h-10"><button type="button" role="tab" aria-selected="true" aria-controls="radix-:R2ml8um:-content-0" data-state="active" id="radix-:R2ml8um:-trigger-0" class="data-[state=active]:shadow-accent group flex min-h-10 items-center px-2 py-1.5 data-[state=active]:shadow-[inset_0_-2px_0_0_rgba(0,0,0,0.1)]" tabindex="-1" data-orientation="horizontal" data-radix-collection-item=""><span class="t-muted group-data-[state=active]:t-default group-hover:bg-tag-default whitespace-nowrap rounded px-2 py-1 text-sm group-data-[state=active]:font-semibold">JavaScript</span></button><button type="button" role="tab" aria-selected="false" aria-controls="radix-:R2ml8um:-content-1" data-state="inactive" id="radix-:R2ml8um:-trigger-1" class="data-[state=active]:shadow-accent group flex min-h-10 items-center px-2 py-1.5 data-[state=active]:shadow-[inset_0_-2px_0_0_rgba(0,0,0,0.1)]" tabindex="-1" data-orientation="horizontal" data-radix-collection-item=""><span class="t-muted group-data-[state=active]:t-default group-hover:bg-tag-default whitespace-nowrap rounded px-2 py-1 text-sm group-data-[state=active]:font-semibold">Python</span></button></div><button tabindex="0" data-state="closed" aria-disabled="false" class="fern-copy-button group ml-2 mr-1 fern-button minimal normal rounded square"><span class="fern-button-content"><svg width="1.5em" height="1.5em" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor"><path d="M19.4 20H9.6C9.26863 20 9 19.7314 9 19.4V9.6C9 9.26863 9.26863 9 9.6 9H19.4C19.7314 9 20 9.26863 20 9.6V19.4C20 19.7314 19.7314 20 19.4 20Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15 9V4.6C15 4.26863 14.7314 4 14.4 4H4.6C4.26863 4 4 4.26863 4 4.6V14.4C4 14.7314 4.26863 15 4.6 15H9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg></span></button></div></div><pre class="code-block-root not-prose rounded-t-0 rounded-b-[inherit]" style="animation-duration:0s" tabindex="0"><div dir="ltr" class="fern-scroll-area" style="position:relative;--radix-scroll-area-corner-width:0px;--radix-scroll-area-corner-height:0px"><style>[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}</style><div data-radix-scroll-area-viewport="" class="fern-scroll-area-viewport" data-scrollbars="both" style="overflow-x:hidden;overflow-y:hidden;max-height:479px"><div style="min-width:100%;display:table"><code class="code-block text-sm"><div class="code-block-inner"><table class="code-block-line-group"><colgroup><col class="w-fit"/><col/></colgroup><tbody><tr class="code-block-line"><td class="code-block-line-gutter"><span>1</span></td><td class="code-block-line-content"><span class="line">const WebSocket = require(&quot;ws&quot;);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>2</span></td><td class="code-block-line-content"><span class="line">const axios = require(&quot;axios&quot;);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>3</span></td><td class="code-block-line-content"><span class="line">const { PassThrough } = require(&quot;stream&quot;);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>4</span></td><td class="code-block-line-content"><span class="line"></span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>5</span></td><td class="code-block-line-content"><span class="line">const apiKey = &quot;YOUR_DEEPGRAM_API_KEY&quot;;</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>6</span></td><td class="code-block-line-content"><span class="line">const headers = {</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>7</span></td><td class="code-block-line-content"><span class="line"> Authorization: `Token ${apiKey}`,</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>8</span></td><td class="code-block-line-content"><span class="line">};</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>9</span></td><td class="code-block-line-content"><span class="line"></span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>10</span></td><td class="code-block-line-content"><span class="line">// Initialize WebSocket connection</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>11</span></td><td class="code-block-line-content"><span class="line">const ws = new WebSocket(&quot;wss://api.deepgram.com/v1/listen&quot;, { headers });</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>12</span></td><td class="code-block-line-content"><span class="line"></span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>13</span></td><td class="code-block-line-content"><span class="line">ws.on(&quot;open&quot;, async function open() {</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>14</span></td><td class="code-block-line-content"><span class="line"> console.log(&quot;WebSocket connection established.&quot;);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>15</span></td><td class="code-block-line-content"><span class="line"></span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>16</span></td><td class="code-block-line-content"><span class="line"> try {</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>17</span></td><td class="code-block-line-content"><span class="line"> // Fetch the audio stream from the remote URL</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>18</span></td><td class="code-block-line-content"><span class="line"> const response = await axios({</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>19</span></td><td class="code-block-line-content"><span class="line"> method: &quot;get&quot;,</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>20</span></td><td class="code-block-line-content"><span class="line"> url: &quot;http://stream.live.vc.bbcmedia.co.uk/bbc_world_service&quot;,</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>21</span></td><td class="code-block-line-content"><span class="line"> responseType: &quot;stream&quot;,</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>22</span></td><td class="code-block-line-content"><span class="line"> });</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>23</span></td><td class="code-block-line-content"><span class="line"></span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>24</span></td><td class="code-block-line-content"><span class="line"> const passThrough = new PassThrough();</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>25</span></td><td class="code-block-line-content"><span class="line"> response.data.pipe(passThrough);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>26</span></td><td class="code-block-line-content"><span class="line"></span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>27</span></td><td class="code-block-line-content"><span class="line"> passThrough.on(&quot;data&quot;, (chunk) =&gt; {</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>28</span></td><td class="code-block-line-content"><span class="line"> ws.send(chunk);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>29</span></td><td class="code-block-line-content"><span class="line"> });</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>30</span></td><td class="code-block-line-content"><span class="line"></span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>31</span></td><td class="code-block-line-content"><span class="line"> passThrough.on(&quot;end&quot;, () =&gt; {</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>32</span></td><td class="code-block-line-content"><span class="line"> console.log(&quot;Audio stream ended.&quot;);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>33</span></td><td class="code-block-line-content"><span class="line"> finalizeWebSocket();</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>34</span></td><td class="code-block-line-content"><span class="line"> });</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>35</span></td><td class="code-block-line-content"><span class="line"></span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>36</span></td><td class="code-block-line-content"><span class="line"> passThrough.on(&quot;error&quot;, (err) =&gt; {</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>37</span></td><td class="code-block-line-content"><span class="line"> console.error(&quot;Stream error:&quot;, err.message);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>38</span></td><td class="code-block-line-content"><span class="line"> });</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>39</span></td><td class="code-block-line-content"><span class="line"></span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>40</span></td><td class="code-block-line-content"><span class="line"> // Send Finalize message after 10 seconds</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>41</span></td><td class="code-block-line-content"><span class="line"> setTimeout(() =&gt; {</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>42</span></td><td class="code-block-line-content"><span class="line"> finalizeWebSocket();</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>43</span></td><td class="code-block-line-content"><span class="line"> }, 10000);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>44</span></td><td class="code-block-line-content"><span class="line"> } catch (error) {</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>45</span></td><td class="code-block-line-content"><span class="line"> console.error(&quot;Error fetching audio stream:&quot;, error.message);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>46</span></td><td class="code-block-line-content"><span class="line"> }</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>47</span></td><td class="code-block-line-content"><span class="line">});</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>48</span></td><td class="code-block-line-content"><span class="line"></span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>49</span></td><td class="code-block-line-content"><span class="line">// Handle WebSocket message event</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>50</span></td><td class="code-block-line-content"><span class="line">ws.on(&quot;message&quot;, function incoming(data) {</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>51</span></td><td class="code-block-line-content"><span class="line"> let response = JSON.parse(data);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>52</span></td><td class="code-block-line-content"><span class="line"> if (response.type === &quot;Results&quot;) {</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>53</span></td><td class="code-block-line-content"><span class="line"> console.log(&quot;Transcript: &quot;, response.channel.alternatives[0].transcript);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>54</span></td><td class="code-block-line-content"><span class="line"> }</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>55</span></td><td class="code-block-line-content"><span class="line">});</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>56</span></td><td class="code-block-line-content"><span class="line"></span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>57</span></td><td class="code-block-line-content"><span class="line">// Handle WebSocket close event</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>58</span></td><td class="code-block-line-content"><span class="line">ws.on(&quot;close&quot;, function close() {</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>59</span></td><td class="code-block-line-content"><span class="line"> console.log(&quot;WebSocket connection closed.&quot;);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>60</span></td><td class="code-block-line-content"><span class="line">});</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>61</span></td><td class="code-block-line-content"><span class="line"></span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>62</span></td><td class="code-block-line-content"><span class="line">// Handle WebSocket error event</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>63</span></td><td class="code-block-line-content"><span class="line">ws.on(&quot;error&quot;, function error(err) {</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>64</span></td><td class="code-block-line-content"><span class="line"> console.error(&quot;WebSocket error:&quot;, err.message);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>65</span></td><td class="code-block-line-content"><span class="line">});</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>66</span></td><td class="code-block-line-content"><span class="line"></span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>67</span></td><td class="code-block-line-content"><span class="line">// Send Finalize message to WebSocket</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>68</span></td><td class="code-block-line-content"><span class="line">function finalizeWebSocket() {</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>69</span></td><td class="code-block-line-content"><span class="line"> const finalizeMsg = JSON.stringify({ type: &quot;Finalize&quot; });</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>70</span></td><td class="code-block-line-content"><span class="line"> ws.send(finalizeMsg);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>71</span></td><td class="code-block-line-content"><span class="line"> console.log(&quot;Finalize message sent.&quot;);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>72</span></td><td class="code-block-line-content"><span class="line">}</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>73</span></td><td class="code-block-line-content"><span class="line"></span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>74</span></td><td class="code-block-line-content"><span class="line">// Gracefully close the WebSocket connection when done</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>75</span></td><td class="code-block-line-content"><span class="line">function closeWebSocket() {</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>76</span></td><td class="code-block-line-content"><span class="line"> const closeMsg = JSON.stringify({ type: &quot;CloseStream&quot; });</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>77</span></td><td class="code-block-line-content"><span class="line"> ws.send(closeMsg);</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>78</span></td><td class="code-block-line-content"><span class="line"> ws.close();</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>79</span></td><td class="code-block-line-content"><span class="line">}</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>80</span></td><td class="code-block-line-content"><span class="line"></span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>81</span></td><td class="code-block-line-content"><span class="line">// Close WebSocket when process is terminated</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>82</span></td><td class="code-block-line-content"><span class="line">process.on(&quot;SIGINT&quot;, () =&gt; {</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>83</span></td><td class="code-block-line-content"><span class="line"> closeWebSocket();</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>84</span></td><td class="code-block-line-content"><span class="line"> process.exit();</span></td></tr><tr class="code-block-line"><td class="code-block-line-gutter"><span>85</span></td><td class="code-block-line-content"><span class="line">});</span></td></tr></tbody></table></div></code></div></div></div></pre></div> <h2 id="conclusion" data-state="closed">Conclusion</h2> <p>Using the <code>Finalize</code> message with Deepgram’s API allows for precise control over the finalization of audio processing. This feature is essential for scenarios requiring immediate processing of the remaining audio data, ensuring accurate and timely results.</p> <hr/></div><footer class="mt-12"><div class="flex gap-4 max-sm:flex-col sm:justify-between"><div><div><div class="flex w-full flex-wrap items-center justify-between gap-4"><div class="flex items-center justify-start gap-2"><span class="t-muted text-sm font-medium">Was this page helpful?</span><span class="fern-button-group"><button tabindex="0" data-state="closed" aria-disabled="false" data-selected="false" type="button" aria-haspopup="dialog" aria-expanded="false" aria-controls="radix-:Rpat8um:" class="fern-button outlined normal"><span class="fern-button-content"><svg width="1.5em" height="1.5em" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class=""><path d="M16.4724 20H4.1C3.76863 20 3.5 19.7314 3.5 19.4V9.6C3.5 9.26863 3.76863 9 4.1 9H6.86762C7.57015 9 8.22116 8.6314 8.5826 8.02899L11.293 3.51161C11.8779 2.53688 13.2554 2.44422 13.9655 3.33186C14.3002 3.75025 14.4081 4.30635 14.2541 4.81956L13.2317 8.22759C13.1162 8.61256 13.4045 9 13.8064 9H18.3815C19.7002 9 20.658 10.254 20.311 11.5262L18.4019 18.5262C18.1646 19.3964 17.3743 20 16.4724 20Z" stroke="currentColor" stroke-linecap="round"></path><path d="M7 20L7 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="fern-button-text">Yes</span></span></button><button tabindex="0" data-state="closed" aria-disabled="false" data-selected="false" type="button" aria-haspopup="dialog" aria-expanded="false" aria-controls="radix-:R19at8um:" class="fern-button outlined normal"><span class="fern-button-content"><svg width="1.5em" height="1.5em" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class=""><path d="M16.4724 3.5H4.1C3.76863 3.5 3.5 3.76863 3.5 4.1V13.9C3.5 14.2314 3.76863 14.5 4.1 14.5H6.86762C7.57015 14.5 8.22116 14.8686 8.5826 15.471L11.293 19.9884C11.8779 20.9631 13.2554 21.0558 13.9655 20.1681C14.3002 19.7497 14.4081 19.1937 14.2541 18.6804L13.2317 15.2724C13.1162 14.8874 13.4045 14.5 13.8064 14.5H18.3815C19.7002 14.5 20.658 13.246 20.311 11.9738L18.4019 4.97376C18.1646 4.10364 17.3743 3.5 16.4724 3.5Z" stroke="currentColor" stroke-linecap="round"></path><path d="M7 14.5L7 3.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="fern-button-text">No</span></span></button></span></div></div></div></div><a tabindex="0" aria-disabled="false" data-state="off" class="fern-button outlined normal" target="_blank" rel="noreferrer" href="https://github.com/deepgram/deepgram-fern-config/blob/main/fern/docs/finalize.mdx?plain=1"><span class="fern-button-content"><svg width="1.5em" height="1.5em" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor"><path d="M3 21L12 21H21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12.2218 5.82839L15.0503 2.99996L20 7.94971L17.1716 10.7781M12.2218 5.82839L6.61522 11.435C6.42769 11.6225 6.32233 11.8769 6.32233 12.1421L6.32233 16.6776L10.8579 16.6776C11.1231 16.6776 11.3774 16.5723 11.565 16.3847L17.1716 10.7781M12.2218 5.82839L17.1716 10.7781" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="fern-button-text">Edit this page</span></span></a></div><div class="not-prose grid grid-cols-1"><a class="fern-card interactive my-12 flex flex-1 items-center rounded-xl p-6" href="/docs/audio-keep-alive"><div class="flex-1"><div class="text-base font-semibold">Audio Keep Alive</div></div><span class="sm-4 t-muted sm:border-default inline-flex items-center gap-2 py-2.5 text-sm sm:ml-6 sm:border-l sm:pl-6"><span class="hidden leading-none sm:inline">Up Next</span><svg width="1.5em" height="1.5em" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class="size-icon"><path d="M9 6L15 12L9 18" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg></span></a></div></footer><style> #builtwithfern { display: flex !important; opacity: 100% !important; } #builtwithfern * { display: initial !important; width: unset !important; opacity: 100% !important; } #builtwithfern, #builtwithfern * { visibility: initial !important; overflow: visible !important; position: relative !important; left: unset !important; top: unset !important; right: unset !important; bottom: unset !important; inset: unset !important; }</style><a id="builtwithfern" class="mx-auto flex items-baseline gap-1 mx-auto my-8 w-fit" href="https://buildwithfern.com/?utm_campaign=buildWith&amp;utm_medium=docs&amp;utm_source=developers.deepgram.com" data-state="closed"><span class="t-muted whitespace-nowrap text-xs">Built with</span><svg viewBox="0 0 604 164" fill="none" xmlns="http://www.w3.org/2000/svg" class="transition" style="aspect-ratio:604/164;height:14px;margin-top:-2px"><path fill-rule="evenodd" clip-rule="evenodd" d="M295.294 0H255.861H255.836C234.047 0 221.437 11.4661 221.437 33.483V47.2372H193.242V75.2033H221.437V160.5H253.547V75.2033H288.404V47.2372H253.547V37.3728C253.547 30.7118 257.208 27.9661 263.87 27.9661H295.294V0ZM345.26 43.8081C311.777 43.8081 288.844 67.1979 288.844 103.198H288.87C288.87 139.884 311.802 163.96 346.43 163.96C375.311 163.96 392.727 149.291 399.388 126.816H366.591C363.591 133.02 356.955 137.367 346.633 137.367C331.277 137.367 321.87 129.562 320.497 115.35H400.761C401.219 110.545 401.447 106.401 401.447 102.283C401.447 66.2826 378.744 43.8081 345.26 43.8081ZM369.108 90.5877V91.0453H320.269C321.184 77.7487 329.675 69.0284 345.26 69.0284C360.845 69.0284 369.108 77.7487 369.108 90.5877ZM412.668 47.2321H440.863V67.1898C443.609 54.3508 452.787 47.2321 467.227 47.2321H487.414V51.122C487.414 64.4186 476.634 75.1982 463.338 75.1982C450.727 75.1982 444.753 81.6304 444.753 94.4694V160.52H412.642V47.2321H412.668ZM526.939 47.24H498.744H498.719V160.503H530.829V96.0789C530.829 81.6382 539.321 72.6891 552.16 72.6891C564.999 72.6891 571.889 80.0366 571.889 95.1637V160.528H604V91.7315C604 61.7061 586.559 43.8078 558.821 43.8078C545.753 43.8078 533.601 48.8417 526.939 58.7061V47.24Z" class="fill-grayscale-a10"></path><path d="M149.383 80.2222C138.594 71.101 122.341 67.4445 107.936 78.0925C107.273 78.5747 106.449 77.751 106.952 77.1081C110.367 72.7082 114.325 67.9668 117.519 63.2053C120.774 58.3233 125.636 54.8275 131.241 53.1198C161.076 44.079 152.116 0 152.116 0C152.116 0 106.027 2.97342 111.713 42.7329C112.657 49.3829 110.889 56.1535 106.731 61.4374C101.628 67.8865 95.7008 74.0543 91.4014 78.5144C90.4973 79.4386 88.9705 78.5546 89.3321 77.309C93.4909 63.3058 96.5246 41.648 82.1195 27.685L61.848 10.849L57.9504 15.9922C46.3581 31.2812 49.7534 52.8385 65.0625 64.4108C73.8422 71.0407 77.8201 78.2533 77.1973 86.169C76.8156 90.9104 74.6659 95.3505 71.4514 98.8663C65.4041 105.496 59.7586 112.608 55.3989 120.846C54.7962 121.991 53.0483 121.549 53.1086 120.243C53.7314 106.641 52.4255 75.983 29.5221 65.0336L3.88635 55.1289L1.89737 61.0556C-4.55174 80.182 5.99588 100.614 25.1021 107.104C41.7171 112.749 47.6439 123.457 43.6458 139.51C43.465 140.092 40.572 156.627 40.9738 163.96H59.3969C60.0198 152.589 71.9536 145.115 82.3003 149.756C85.2135 151.062 88.207 152.93 91.2809 155.341C107.755 168.32 132.025 165.246 144.983 148.752L148.68 144.05L125.375 127.315C109.383 114.738 88.0463 120.424 72.255 131.192C70.929 132.096 69.2414 130.65 69.9847 129.203C89.0709 91.7542 113.883 91.8346 123.607 100.152C135.4 110.238 153.261 108.429 163.266 96.5961L166.139 93.2007L149.363 80.2222H149.383Z" class="fill-grayscale-a10"></path></svg></a></article></main></div></div><footer id="fern-footer" class=""></footer></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"baseUrl":{"domain":"developers.deepgram.com"},"layout":{"pageWidth":{"type":"full"},"searchbarPlacement":"HEADER","tabsPlacement":"HEADER","contentAlignment":"CENTER","headerPosition":"FIXED","disableHeader":false},"title":"Deepgram | Documentation","favicon":"dc10a8e4-8f8e-4256-9d74-60ebbe1f65d3","colors":{"dark":{"type":"dark","accentPrimary":{"r":161,"g":249,"b":212,"a":1},"logo":"27d7950b-1c65-4988-ae21-49962a69f15e","background":{"type":"solid","r":11,"g":11,"b":12,"a":1},"border":{"r":44,"g":44,"b":51,"a":1},"cardBackground":{"r":26,"g":26,"b":31,"a":1},"sidebarBackground":{"r":11,"g":11,"b":12,"a":1},"headerBackground":{"r":26,"g":26,"b":31,"a":1}}},"js":{"remote":[{"url":"https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/assets/component.js","strategy":"lazyOnload"},{"url":"https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/dist/output.js","strategy":"beforeInteractive"}]},"navbarLinks":[],"logo":{"height":24,"href":"/","dark":{"src":"https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/assets/logo.svg","width":176,"height":25}},"content":{"slug":"docs/finalize","title":{"engine":"mdx-bundler","code":"var Component=(()=\u003e{var f=Object.create;var s=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty;var C=(n,e)=\u003e()=\u003e(e||n((e={exports:{}}).exports,e),e.exports),h=(n,e)=\u003e{for(var t in e)s(n,t,{get:e[t],enumerable:!0})},u=(n,e,t,i)=\u003e{if(e\u0026\u0026typeof e==\"object\"||typeof e==\"function\")for(let o of l(e))!_.call(n,o)\u0026\u0026o!==t\u0026\u0026s(n,o,{get:()=\u003ee[o],enumerable:!(i=x(e,o))||i.enumerable});return n};var D=(n,e,t)=\u003e(t=n!=null?f(M(n)):{},u(e||!n||!n.__esModule?s(t,\"default\",{value:n,enumerable:!0}):t,n)),X=n=\u003eu(s({},\"__esModule\",{value:!0}),n);var a=C((b,d)=\u003e{d.exports=_jsx_runtime});var v={};h(v,{default:()=\u003em,frontmatter:()=\u003ej});var c=D(a());var{useMDXComponents:r}=MdxJsReact;var j=void 0;function p(n){let e={p:\"p\",...r(),...n.components};return(0,c.jsx)(e.p,{children:\"Finalize\"})}function m(n={}){let{wrapper:e}={...r(),...n.components};return e?(0,c.jsx)(e,{...n,children:(0,c.jsx)(p,{...n})}):p(n)}return X(v);})();\n;return Component;","frontmatter":{},"scope":{},"jsxRefs":[]},"subtitle":{"engine":"mdx-bundler","code":"var Component=(()=\u003e{var f=Object.create;var s=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var _=(e,t)=\u003e()=\u003e(t||e((t={exports:{}}).exports,t),t.exports),C=(e,t)=\u003e{for(var n in t)s(e,n,{get:t[n],enumerable:!0})},i=(e,t,n,c)=\u003e{if(t\u0026\u0026typeof t==\"object\"||typeof t==\"function\")for(let o of h(t))!M.call(e,o)\u0026\u0026o!==n\u0026\u0026s(e,o,{get:()=\u003et[o],enumerable:!(c=l(t,o))||c.enumerable});return e};var D=(e,t,n)=\u003e(n=e!=null?f(x(e)):{},i(t||!e||!e.__esModule?s(n,\"default\",{value:e,enumerable:!0}):n,e)),g=e=\u003ei(s({},\"__esModule\",{value:!0}),e);var u=_((j,d)=\u003e{d.exports=_jsx_runtime});var X={};C(X,{default:()=\u003ep,frontmatter:()=\u003ew});var r=D(u());var{useMDXComponents:a}=MdxJsReact;var w=void 0;function m(e){let t={p:\"p\",...a(),...e.components};return(0,r.jsx)(t.p,{children:\"Learn how to send Deepgram a Finalize message, which flushes the websocket stream\\u2019s audio by forcing the server to process all unprocessed audio data immediately and return the results.\"})}function p(e={}){let{wrapper:t}={...a(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(m,{...e})}):m(e)}return g(X);})();\n;return Component;","frontmatter":{},"scope":{},"jsxRefs":[]},"tableOfContents":[{"simpleString":"What is the Finalize Message?","anchorString":"what-is-the-finalize-message","children":[{"simpleString":"Sending Finalize","anchorString":"sending-finalize","children":[]},{"simpleString":"Finalize Confirmation","anchorString":"finalize-confirmation","children":[]},{"simpleString":"Language-Specific Implementations","anchorString":"language-specific-implementations","children":[{"simpleString":"Sending a Finalize message in JSON Format","anchorString":"sending-a-finalize-message-in-json-format","children":[]},{"simpleString":"Streaming Examples","anchorString":"streaming-examples","children":[]}]},{"simpleString":"Conclusion","anchorString":"conclusion","children":[]}]}],"content":{"engine":"mdx-bundler","code":"var Component=(()=\u003e{var m=Object.create;var o=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var S=(i,e)=\u003e()=\u003e(e||i((e={exports:{}}).exports,e),e.exports),y=(i,e)=\u003e{for(var t in e)o(i,t,{get:e[t],enumerable:!0})},l=(i,e,t,a)=\u003e{if(e\u0026\u0026typeof e==\"object\"||typeof e==\"function\")for(let s of f(e))!z.call(i,s)\u0026\u0026s!==t\u0026\u0026o(i,s,{get:()=\u003ee[s],enumerable:!(a=p(e,s))||a.enumerable});return i};var b=(i,e,t)=\u003e(t=i!=null?m(w(i)):{},l(e||!i||!i.__esModule?o(t,\"default\",{value:i,enumerable:!0}):t,i)),_=i=\u003el(o({},\"__esModule\",{value:!0}),i);var d=S((v,h)=\u003e{h.exports=_jsx_runtime});var F={};y(F,{default:()=\u003eu,frontmatter:()=\u003ek});var n=b(d());var{useMDXComponents:r}=MdxJsReact;var k={title:\"Finalize\",subtitle:\"Learn how to send Deepgram a Finalize message, which flushes the websocket stream's audio by forcing the server to process all unprocessed audio data immediately and return the results.\",slug:\"docs/finalize\"};function g(i){let e={code:\"code\",em:\"em\",h1:\"h1\",h2:\"h2\",h3:\"h3\",hr:\"hr\",p:\"p\",...r(),...i.components},{CodeBlocks:t,Icon:a,Info:s}=e;return t||c(\"CodeBlocks\",!0),a||c(\"Icon\",!0),s||c(\"Info\",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(\"a\",{href:\"/docs/getting-started-with-live-streaming-audio\",className:\"dg-badge\",children:(0,n.jsxs)(\"span\",{children:[(0,n.jsx)(a,{icon:\"waveform-lines\"}),\" Streaming\"]})}),`\n`,(0,n.jsxs)(e.p,{children:[\"In real-time audio processing, there are scenarios where you may need to force the server to process (\",(0,n.jsx)(e.em,{children:\"or flush\"}),\") all unprocessed audio data immediately. Deepgram supports a \",(0,n.jsx)(e.code,{children:\"Finalize\"}),\" message to handle such situations, ensuring that interim results are treated as final.\"]}),`\n`,(0,n.jsxs)(e.h1,{id:\"what-is-the-finalize-message\",children:[\"What is the \",(0,n.jsx)(e.code,{children:\"Finalize\"}),\" Message?\"]}),`\n`,(0,n.jsxs)(e.p,{children:[\"The \",(0,n.jsx)(e.code,{children:\"Finalize\"}),\" message is a JSON command that you send to the Deepgram server, instructing it to process and finalize all remaining audio data immediately. This is particularly useful in scenarios where an utterance has ended, or when transitioning to a keep-alive period to ensure that no previous transcripts reappear unexpectedly.\"]}),`\n`,(0,n.jsxs)(e.h2,{id:\"sending-finalize\",children:[\"Sending \",(0,n.jsx)(e.code,{children:\"Finalize\"})]}),`\n`,(0,n.jsxs)(e.p,{children:[\"To send the \",(0,n.jsx)(e.code,{children:\"Finalize\"}),\" message, you need to send the following JSON message to the server:\"]}),`\n`,(0,n.jsx)(t,{items:[{code:`{\n \"type\": \"Finalize\"\n}\n`,language:\"json\",highlightLines:[],highlightStyle:\"highlight\",maxLines:20,title:\"JSON\",wordWrap:!1,matchLanguage:void 0}]}),`\n`,(0,n.jsxs)(e.p,{children:[\"You can optionally specify a \",(0,n.jsx)(e.code,{children:\"channel\"}),\" field to finalize a specific channel. If the \",(0,n.jsx)(e.code,{children:\"channel\"}),\" field is omitted, all channels in the audio will be finalized. Note that channel indexing starts at 0, so to finalize only the \",(0,n.jsx)(e.em,{children:\"first\"}),\" channel you need to send:\"]}),`\n`,(0,n.jsx)(t,{items:[{code:`{\n \"type\": \"Finalize\",\n \"channel\": 0\n}\n`,language:\"json\",highlightLines:[],highlightStyle:\"highlight\",maxLines:20,title:\"JSON\",wordWrap:!1,matchLanguage:void 0}]}),`\n`,(0,n.jsxs)(e.h2,{id:\"finalize-confirmation\",children:[(0,n.jsx)(e.code,{children:\"Finalize\"}),\" Confirmation\"]}),`\n`,(0,n.jsxs)(e.p,{children:[\"Upon receiving the Finalize message, the server will process all remaining audio data and return the final results. You may receive a response with the \",(0,n.jsx)(e.code,{children:\"from_finalize\"}),\" attribute set to \",(0,n.jsx)(e.code,{children:\"true\"}),\", indicating that the finalization process is complete. This response typically occurs when there is a noticeable amount of audio buffered in the server.\"]}),`\n`,(0,n.jsxs)(e.p,{children:[\"If you specified a \",(0,n.jsx)(e.code,{children:\"channel\"}),\" to be finalized, use the response\\u2019s \",(0,n.jsx)(e.code,{children:\"channel_index\"}),\" field to check which channel was finalized.\"]}),`\n`,(0,n.jsx)(t,{items:[{code:`{\n \"from_finalize\": true\n}\n`,language:\"json\",highlightLines:[],highlightStyle:\"highlight\",maxLines:20,title:\"JSON\",wordWrap:!1,matchLanguage:void 0}]}),`\n`,(0,n.jsx)(s,{children:(0,n.jsx)(e.p,{children:\"In most cases, you will receive this response, but it is not guaranteed if there is no significant amount of audio data to process.\"})}),`\n`,(0,n.jsx)(e.h2,{id:\"language-specific-implementations\",children:\"Language-Specific Implementations\"}),`\n`,(0,n.jsx)(e.p,{children:\"Following are code examples to help you get started.\"}),`\n`,(0,n.jsxs)(e.h3,{id:\"sending-a-finalize-message-in-json-format\",children:[\"Sending a \",(0,n.jsx)(e.code,{children:\"Finalize\"}),\" message in JSON Format\"]}),`\n`,(0,n.jsx)(e.p,{children:\"These snippets demonstrate how to construct a JSON message containing the \\u201CFinalize\\u201D type and send it over the WebSocket connection in each respective language.\"}),`\n`,(0,n.jsx)(t,{items:[{code:`const WebSocket = require(\"ws\");\n\n// Assuming 'headers' is already defined for authorization\nconst ws = new WebSocket(\"wss://api.deepgram.com/v1/listen\", { headers });\n\nws.on('open', function open() {\n // Construct Finalize message\n const finalizeMsg = JSON.stringify({ type: \"Finalize\" });\n \n // Send Finalize message\n ws.send(finalizeMsg);\n});\n`,language:\"javascript\",highlightLines:[],highlightStyle:\"highlight\",maxLines:20,title:\"JavaScript\",wordWrap:!1,matchLanguage:void 0},{code:`import json\nimport websocket\n\n# Assuming 'headers' is already defined for authorization\nws = websocket.create_connection(\"wss://api.deepgram.com/v1/listen\", header=headers)\n\n# Construct Finalize message\nfinalize_msg = json.dumps({\"type\": \"Finalize\"})\n\n# Send Finalize message\nws.send(finalize_msg)\n`,language:\"python\",highlightLines:[],highlightStyle:\"highlight\",maxLines:20,title:\"Python\",wordWrap:!1,matchLanguage:void 0},{code:`package main\n\nimport (\n \"encoding/json\"\n \"log\"\n \"net/http\"\n \"github.com/gorilla/websocket\"\n)\n\nfunc main() {\n // Define headers for authorization\n headers := http.Header{}\n \n // Assuming headers are set here for authorization\n conn, _, err := websocket.DefaultDialer.Dial(\"wss://api.deepgram.com/v1/listen\", headers)\n if err != nil {\n log.Fatal(\"Error connecting to WebSocket:\", err)\n }\n defer conn.Close()\n\n // Construct Finalize message\n finalizeMsg := map[string]string{\"type\": \"Finalize\"}\n jsonMsg, err := json.Marshal(finalizeMsg)\n if err != nil {\n log.Fatal(\"Error encoding JSON:\", err)\n }\n\n // Send Finalize message\n err = conn.WriteMessage(websocket.TextMessage, jsonMsg)\n if err != nil {\n log.Fatal(\"Error sending Finalize message:\", err)\n }\n}\n`,language:\"go\",highlightLines:[],highlightStyle:\"highlight\",maxLines:20,title:\"Go\",wordWrap:!1,matchLanguage:void 0},{code:`using System;\nusing System.Net.WebSockets;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nclass Program\n{\n static async Task Main(string[] args)\n {\n // Set up the WebSocket URL and headers\n Uri uri = new Uri(\"wss://api.deepgram.com/v1/listen\");\n \n string apiKey = \"DEEPGRAM_API_KEY\";\n\n // Create a new client WebSocket instance\n using (ClientWebSocket ws = new ClientWebSocket())\n {\n // Set the authorization header\n ws.Options.SetRequestHeader(\"Authorization\", \"Token \" + apiKey);\n\n // Connect to the WebSocket server\n await ws.ConnectAsync(uri, CancellationToken.None);\n\n // Construct the Finalize message\n string finalizeMsg = \"{\\\\\"type\\\\\": \\\\\"Finalize\\\\\"}\";\n\n // Convert the Finalize message to a byte array\n byte[] finalizeBytes = Encoding.UTF8.GetBytes(finalizeMsg);\n\n // Send the Finalize message asynchronously\n await ws.SendAsync(new ArraySegment\u003cbyte\u003e(finalizeBytes), WebSocketMessageType.Text, true, CancellationToken.None);\n }\n }\n}\n`,language:\"csharp\",highlightLines:[],highlightStyle:\"highlight\",maxLines:20,title:\"C#\",wordWrap:!1,matchLanguage:void 0}]}),`\n`,(0,n.jsx)(e.h3,{id:\"streaming-examples\",children:\"Streaming Examples\"}),`\n`,(0,n.jsx)(e.p,{children:\"Here are more complete examples that make a streaming request and use Finalize. Try running these examples to see how Finalize can be sent to Deepgram, forcing the API to process all unprocessed audio data and immediately return the results.\"}),`\n`,(0,n.jsx)(t,{items:[{code:`const WebSocket = require(\"ws\");\nconst axios = require(\"axios\");\nconst { PassThrough } = require(\"stream\");\n\nconst apiKey = \"YOUR_DEEPGRAM_API_KEY\";\nconst headers = {\n Authorization: \\`Token \\${apiKey}\\`,\n};\n\n// Initialize WebSocket connection\nconst ws = new WebSocket(\"wss://api.deepgram.com/v1/listen\", { headers });\n\nws.on(\"open\", async function open() {\n console.log(\"WebSocket connection established.\");\n\n try {\n // Fetch the audio stream from the remote URL\n const response = await axios({\n method: \"get\",\n url: \"http://stream.live.vc.bbcmedia.co.uk/bbc_world_service\",\n responseType: \"stream\",\n });\n\n const passThrough = new PassThrough();\n response.data.pipe(passThrough);\n\n passThrough.on(\"data\", (chunk) =\u003e {\n ws.send(chunk);\n });\n\n passThrough.on(\"end\", () =\u003e {\n console.log(\"Audio stream ended.\");\n finalizeWebSocket();\n });\n\n passThrough.on(\"error\", (err) =\u003e {\n console.error(\"Stream error:\", err.message);\n });\n\n // Send Finalize message after 10 seconds\n setTimeout(() =\u003e {\n finalizeWebSocket();\n }, 10000);\n } catch (error) {\n console.error(\"Error fetching audio stream:\", error.message);\n }\n});\n\n// Handle WebSocket message event\nws.on(\"message\", function incoming(data) {\n let response = JSON.parse(data);\n if (response.type === \"Results\") {\n console.log(\"Transcript: \", response.channel.alternatives[0].transcript);\n }\n});\n\n// Handle WebSocket close event\nws.on(\"close\", function close() {\n console.log(\"WebSocket connection closed.\");\n});\n\n// Handle WebSocket error event\nws.on(\"error\", function error(err) {\n console.error(\"WebSocket error:\", err.message);\n});\n\n// Send Finalize message to WebSocket\nfunction finalizeWebSocket() {\n const finalizeMsg = JSON.stringify({ type: \"Finalize\" });\n ws.send(finalizeMsg);\n console.log(\"Finalize message sent.\");\n}\n\n// Gracefully close the WebSocket connection when done\nfunction closeWebSocket() {\n const closeMsg = JSON.stringify({ type: \"CloseStream\" });\n ws.send(closeMsg);\n ws.close();\n}\n\n// Close WebSocket when process is terminated\nprocess.on(\"SIGINT\", () =\u003e {\n closeWebSocket();\n process.exit();\n});\n`,language:\"javascript\",highlightLines:[],highlightStyle:\"highlight\",maxLines:20,title:\"JavaScript\",wordWrap:!1,matchLanguage:void 0},{code:`from websocket import WebSocketApp\nimport websocket\nimport json\nimport threading\nimport requests\nimport time\n\nauth_token = \"YOUR_DEEPGRAM_API_KEY\" # Replace with your actual authorization token\n\nheaders = {\n \"Authorization\": f\"Token {auth_token}\"\n}\n\n# WebSocket URL\nws_url = \"wss://api.deepgram.com/v1/listen\"\n\n# Audio stream URL\naudio_url = \"http://stream.live.vc.bbcmedia.co.uk/bbc_world_service\"\n\n# Define the WebSocket functions on_open, on_message, on_close, and on_error\n\ndef on_open(ws):\n print(\"WebSocket connection established.\")\n \n # Start audio streaming thread\n audio_thread = threading.Thread(target=stream_audio, args=(ws,))\n audio_thread.daemon = True\n audio_thread.start()\n \n # Finalize test thread\n finalize_thread = threading.Thread(target=finalize_test, args=(ws,))\n finalize_thread.daemon = True\n finalize_thread.start()\n\ndef on_message(ws, message):\n try:\n response = json.loads(message)\n if response.get(\"type\") == \"Results\":\n transcript = response[\"channel\"][\"alternatives\"][0].get(\"transcript\", \"\")\n if transcript:\n print(\"Transcript:\", transcript)\n elif response.get(\"type\") == \"FinalizationComplete\":\n print(\"Finalization complete.\")\n except json.JSONDecodeError as e:\n print(f\"Error decoding JSON message: {e}\")\n except KeyError as e:\n print(f\"Key error: {e}\")\n\ndef on_close(ws, close_status_code, close_msg):\n print(f\"WebSocket connection closed with code: {close_status_code}, message: {close_msg}\")\n\ndef on_error(ws, error):\n print(\"WebSocket error:\", error)\n\n# Define the function to stream audio to the WebSocket\n\ndef stream_audio(ws):\n response = requests.get(audio_url, stream=True)\n if response.status_code == 200:\n print(\"Audio stream opened.\")\n for chunk in response.iter_content(chunk_size=4096):\n ws.send(chunk, opcode=websocket.ABNF.OPCODE_BINARY)\n else:\n print(\"Failed to open audio stream:\", response.status_code)\n\n# Define the function to send the Finalize message\n\ndef finalize_test(ws):\n # Wait for 10 seconds before sending the Finalize message to simulate the end of audio streaming\n time.sleep(10)\n finalize_message = json.dumps({\"type\": \"Finalize\"})\n ws.send(finalize_message)\n print(\"Finalize message sent.\")\n\n# Create WebSocket connection\n\nws = WebSocketApp(ws_url, on_open=on_open, on_message=on_message, on_close=on_close, on_error=on_error, header=headers)\n\n# Run the WebSocket\n\nws.run_forever()\n`,language:\"python\",highlightLines:[],highlightStyle:\"highlight\",maxLines:20,title:\"Python\",wordWrap:!1,matchLanguage:void 0}]}),`\n`,(0,n.jsx)(e.h2,{id:\"conclusion\",children:\"Conclusion\"}),`\n`,(0,n.jsxs)(e.p,{children:[\"Using the \",(0,n.jsx)(e.code,{children:\"Finalize\"}),\" message with Deepgram\\u2019s API allows for precise control over the finalization of audio processing. This feature is essential for scenarios requiring immediate processing of the remaining audio data, ensuring accurate and timely results.\"]}),`\n`,(0,n.jsx)(e.hr,{})]})}function u(i={}){let{wrapper:e}={...r(),...i.components};return e?(0,n.jsx)(e,{...i,children:(0,n.jsx)(g,{...i})}):g(i)}function c(i,e){throw new Error(\"Expected \"+(e?\"component\":\"object\")+\" `\"+i+\"` to be defined: you likely forgot to import, pass, or provide it.\")}return _(F);})();\n;return Component;","frontmatter":{"title":"Finalize","subtitle":"Learn how to send Deepgram a Finalize message, which flushes the websocket stream's audio by forcing the server to process all unprocessed audio data immediately and return the results.","slug":"docs/finalize","edit-this-page-url":"https://github.com/deepgram/deepgram-fern-config/blob/main/fern/docs/finalize.mdx?plain=1"},"scope":{},"jsxRefs":["Icon","CodeGroup","Info"]},"breadcrumb":[{"title":"Streaming Audio","pointsTo":"docs/live-streaming-audio"},{"title":"Control Messages","pointsTo":"docs/close-stream"}],"neighbors":{"prev":{"slug":"docs/close-stream","title":"Close Stream"},"next":{"slug":"docs/audio-keep-alive","title":"Audio Keep Alive"}},"hasAside":false,"type":"markdown-page","apis":{},"endpointIdsToSlugs":{}},"navigation":{"currentTabIndex":2,"tabs":[{"type":"tabGroup","title":"Home","index":0,"slug":"home","pointsTo":"home/introduction"},{"type":"tabGroup","title":"Voice Agent","index":1,"slug":"voice-agent","pointsTo":"docs/voice-agent"},{"type":"tabGroup","title":"Speech to Text","index":2,"slug":"speech-to-text","pointsTo":"docs/pre-recorded-audio"},{"type":"tabGroup","title":"Text to Speech","index":3,"slug":"text-to-speech","pointsTo":"docs/tts-rest"},{"type":"tabGroup","title":"Intelligence","index":4,"slug":"intelligence","pointsTo":"docs/audio-intelligence"},{"type":"tabGroup","title":"API Ref","index":5,"slug":"reference","pointsTo":"reference/deepgram-api-overview"},{"type":"tabGroup","title":"Guides","index":6,"slug":"docs","pointsTo":"docs/make-your-first-api-request"},{"type":"tabGroup","title":"SDKs","index":7,"slug":"sdks","pointsTo":"docs/deepgram-sdks"},{"type":"tabGroup","title":"Self-Hosted Deployments","index":8,"slug":"self-hosted","pointsTo":"docs/self-hosted-introduction"},{"type":"tabGroup","title":"Security","index":9,"slug":"security","pointsTo":"docs/security-policy"}],"versions":[],"sidebar":{"type":"sidebarRoot","id":"2512984ea602967579eb7ec2419818a8a6f4f196dc7040a958b54f6e8c035dc4","children":[{"type":"section","id":"dd83c328250695b6b788f427f429ed29268ad3863429901b22bf611ef01370d9","children":[{"type":"page","id":"4f2c02eec74b762d8353dd69ae828d142daf08c615bdf1d6e630c0c3f4e91d01","title":"Getting Started","slug":"docs/pre-recorded-audio","pageId":"docs/pre-recorded-audio.mdx"},{"type":"page","id":"a8b2f5933b07b452f21561a216e85372854e397a675edbe47213f2adc1a18bf6","title":"Feature Overview","slug":"docs/stt-pre-recorded-feature-overview","pageId":"docs/stt-pre-recorded-feature-overview.mdx"},{"type":"page","id":"41666796ba57ee54209292599c30c88bc4eabe8c3d636d1dfcb9ce35edf7e70a","title":"Starter Apps","slug":"docs/stt-pre-recorded-starter-apps","pageId":"docs/stt-pre-recorded-starter-apps.mdx"},{"type":"section","id":"40f9bf4fd346b266f2ad344dcadae4ba965c7a6d798016e47056023850d4c11b","children":[{"type":"page","id":"ef1eddd8f9f07c35cf919f460eb2aaa9720e9b75ad1a052cedb142b2ad08eb7b","title":"Automatically Generating WebVTT \u0026 SRT Captions","slug":"docs/automatically-generating-webvtt-and-srt-captions","pageId":"docs/automatically-generating-webvtt-and-srt-captions.mdx"},{"type":"page","id":"304fd421cca1f3475018723a52c920f2790fab368e463f6e4a78c8d29e886008","title":"Automatically Transcribe and Summarize Phone Calls","slug":"docs/automatically-transcribing-and-summarizing-phone-calls","pageId":"docs/automatically-transcribing-and-summarizing-phone-calls.mdx"},{"type":"page","id":"04b8691dc6c1d9db3d3fc04f5e973818959aec2df24cb058f56ac76fa900f9d3","title":"Getting Started with Deepgram Whisper Cloud","slug":"docs/deepgram-whisper-cloud","pageId":"docs/deepgram-whisper-cloud.mdx"},{"type":"page","id":"91c5b306ca641e037bdbe7e0e3ba7035324eb6e9a038ad4a5d37e5696823b92a","title":"Generating and Saving Transcripts From the Terminal","slug":"docs/generating-and-saving-transcripts-from-the-terminal","pageId":"docs/generating-and-saving-transcripts-from-the-terminal.mdx"},{"type":"page","id":"96f36a9acc01156c31554a818e5e4911e008114f10304f533cc5ddfb45746ca6","title":"Using Callbacks to Return Transcripts to Your Server","slug":"docs/using-callbacks-to-return-transcripts-to-your-server","pageId":"docs/using-callbacks-to-return-transcripts-to-your-server.mdx"},{"type":"page","id":"e5354f4dc6bbc7f43ad8e102a1c162bfe854ec001068db3e1db010c6c50971dc","title":"When Callback Is Not Received","slug":"docs/payload-too-large","pageId":"docs/payload-too-large.mdx"},{"type":"page","id":"c871f3f989a093c699e378fd71e11e08b96493a8f6be74910186b8aacced54cf","title":"When To Use Multichannel and Diarization","slug":"docs/multichannel-vs-diarization","pageId":"docs/multichannel-vs-diarization.mdx"},{"type":"page","id":"fd1942cd0a0ee71b9ee98cb82f1a00c300d5c5c54c845a6f5ab6d53402d7187e","title":"When To Use Keywords and Search","slug":"docs/keywords-vs-search","pageId":"docs/keywords-vs-search.mdx"}],"title":"Tips and Tricks","slug":"speech-to-text/pre-recorded-audio/tips-and-tricks","pointsTo":"docs/automatically-generating-webvtt-and-srt-captions"}],"title":"Pre-Recorded Audio","slug":"speech-to-text/pre-recorded-audio","pointsTo":"docs/pre-recorded-audio"},{"type":"section","id":"387397de98c076a9e0c321b8c1da6d4ccaf95db7399b89e02b4a3b70c49a7a6f","children":[{"type":"page","id":"3006eb1301772b8b34c597f828b6ebd3d927a663d5ae53b3237204c62656a604","title":"Getting Started","slug":"docs/live-streaming-audio","pageId":"docs/live-streaming-audio.mdx"},{"type":"page","id":"e083b7264ec47f11bf418031a386e7116bc3a9e2868014dee29d13f42491e840","title":"Feature Overview","slug":"docs/stt-streaming-feature-overview","pageId":"docs/stt-streaming-feature-overview.mdx"},{"type":"page","id":"501127f2d80cc329f2dab775b43dfa77b6610c54c9658007ae6d4a641753e5b1","title":"Live Streaming Starter Kit","slug":"docs/getting-started-with-the-streaming-test-suite","pageId":"docs/getting-started-with-the-streaming-test-suite.mdx"},{"type":"page","id":"dccd19d1e54527bafecfeb00363465526f557c4eddca9670114611b54f77ace9","title":"Starter Apps","slug":"docs/stt-streaming-starter-apps","pageId":"docs/stt-streaming-starter-apps.mdx"},{"type":"section","id":"ad7910b3108d44b42ea6e12a215bb550fe571d131bf8f8ebebdd29ce470edb34","children":[{"type":"page","id":"4a62215374567a9db7fbdabad29a88e4b8a4e526fb0a7f17241ee4df04f63c1c","title":"Close Stream","slug":"docs/close-stream","pageId":"docs/close-stream.mdx"},{"type":"page","id":"15b8e09924ec4a4a735002711b3d9b281ae454646f20232e6d386dabd71b91c3","title":"Finalize","slug":"docs/finalize","pageId":"docs/finalize.mdx"},{"type":"page","id":"5e4d7c1b076a79238c4d41e99b2af8bef119a2e7a57d5ececaed3cac2c9baaa1","title":"Audio Keep Alive","slug":"docs/audio-keep-alive","pageId":"docs/audio-keep-alive.mdx"}],"title":"Control Messages","slug":"speech-to-text/streaming-audio/control-messages","pointsTo":"docs/close-stream"},{"type":"section","id":"77c3aa9c9ba851fff17350b89bddff26c5e537aeb7efa9e2b777d8146b0f48de","children":[{"type":"page","id":"b44dfd8b2bb7d30ed44cfb32b77bffda6e7da47412b509831607b1a42ad56368","title":"Speech Started","slug":"docs/speech-started","pageId":"docs/speech-started.mdx"},{"type":"page","id":"a4c4a3c3fba63621206387709addd2ab7dd48d69ed20abec5d8711d18a3ba353","title":"Utterance End","slug":"docs/utterance-end","pageId":"docs/utterance-end.mdx"},{"type":"page","id":"36e0aff3f85c41d85dad65f522c0d33d1b0e0f0053c2ddf894b69fc8160edbe0","title":"Endpointing","slug":"docs/endpointing","pageId":"docs/endpointing.mdx"},{"type":"page","id":"a8b9821070f9a768f3b2ce4d27be94538b70117e0ea7d7d0ccc3ee45668ab41e","title":"Interim Results","slug":"docs/interim-results","pageId":"docs/interim-results.mdx"}],"title":"Speech Detection","slug":"speech-to-text/streaming-audio/speech-detection","pointsTo":"docs/speech-started"},{"type":"section","id":"c1c488e7a0c7bf50008448944aa0acf813194756eff7e1f609837257186ada69","children":[{"type":"page","id":"b68c43edcdb00cd4acab1506b84a52b3a1bc47025402e163439012901ced2b77","title":"End of Speech Detection While Live Streaming","slug":"docs/understanding-end-of-speech-detection","pageId":"docs/understanding-end-of-speech-detection.mdx"},{"type":"page","id":"8db1f4e9cde1fcd9a674054aaec5c108d6b21dcb1e1d040e7517d8444413b99e","title":"Using Interim Results","slug":"docs/using-interim-results","pageId":"docs/using-interim-results.mdx"},{"type":"page","id":"346b22813c5481dc25e513d13c81f490c367b3e48a0cb70b9c80c4ee1e3723d0","title":"Endpointing \u0026 Interim Results With Live Streaming","slug":"docs/understand-endpointing-interim-results","pageId":"docs/understand-endpointing-interim-results.mdx"},{"type":"page","id":"e87c05a536109c53204838e35212dad72bdc9c09ca688216cbebcf2da05c772a","title":"Determining Your Audio Format for Live Streaming Audio","slug":"docs/determining-your-audio-format-for-live-streaming-audio","pageId":"docs/determining-your-audio-format-for-live-streaming-audio.mdx"},{"type":"page","id":"97eaf5c6533db23692feb53901d074e9e0c6a6f88317887ee6c28189eebe957d","title":"Measuring Streaming Latency","slug":"docs/measuring-streaming-latency","pageId":"docs/measuring-streaming-latency.mdx"},{"type":"page","id":"d07312bd70848cf02ad5a5ded255bcc939afb33b431ea9d3cf376faeb690c391","title":"WebSocket DATA \u0026 NET Errors When Live Streaming","slug":"docs/troubleshooting-websocket-data-and-net-errors-when-live-streaming-audio","pageId":"docs/troubleshooting-websocket-data-and-net-errors-when-live-streaming-audio.mdx"},{"type":"page","id":"8e0b6f1ec09106775d178129269ac37e654486f9cfc773d8f3844be7e2818113","title":"Recovering From Connection Errors \u0026 Timeouts When Live Streaming","slug":"docs/recovering-from-connection-errors-and-timeouts-when-live-streaming-audio","pageId":"docs/recovering-from-connection-errors-and-timeouts-when-live-streaming-audio.mdx"},{"type":"page","id":"f3c6a11ff06841a521ee382ddcac7d2e8056ab562cd5470d4899e9f0e8769b53","title":"Using Lower-Level Websockets with the Streaming API","slug":"docs/lower-level-websockets","pageId":"docs/lower-level-websockets.mdx"}],"title":"Tips and Tricks","slug":"speech-to-text/streaming-audio/tips-and-tricks","pointsTo":"docs/understanding-end-of-speech-detection"}],"title":"Streaming Audio","slug":"speech-to-text/streaming-audio","pointsTo":"docs/live-streaming-audio"},{"type":"section","id":"2761e2eef7ee89974f031edadb5f848658b2bcca205c5ae5334675cce6f3ff79","children":[{"type":"page","id":"46faf360e82089b73b936e5431a42d2da12a758189e4417c7bd4ca4fad398060","title":"Models \u0026 Languages Overview","slug":"docs/models-languages-overview","pageId":"docs/models-languages-overview.mdx"},{"type":"page","id":"7322016ed5560a819f39de4c1394ada3349352da523aebfd36b661d1d309925b","title":"Languages Support","slug":"docs/language","pageId":"docs/language.mdx"},{"type":"page","id":"f95b5ee4557715c4a8c9b2c37549b89f3804a3a91c0d42ac78091e4382c7233b","title":"Language Detection","slug":"docs/language-detection","pageId":"docs/language-detection.mdx"},{"type":"page","id":"d4697f3bd249888714261296e3c9d9b75a39da9ae83cbccb56292abc96fc9d6e","title":"Multilingual Codeswitching","slug":"docs/multilingual-code-switching","pageId":"docs/multilingual-code-switching.mdx"},{"type":"page","id":"b036b6af1514f0f0e498fe419f8a1b4745a4f1d9e31f4cf226e80b5a966b0426","title":"Model Options","slug":"docs/model","pageId":"docs/model.mdx"},{"type":"page","id":"5e5b0c8ef2893930d504e28eed21c100b6b6b605b8b4b3ccb59a4c62b70fca8c","title":"Version","slug":"docs/version","pageId":"docs/version.mdx"}],"title":"Models and Languages","slug":"speech-to-text/models-and-languages","pointsTo":"docs/models-languages-overview"},{"type":"section","id":"2a4b86418485c3f5404ea09a1115ac7339dcca45178cc129b6d5cb1d017365b3","children":[{"type":"page","id":"1158de108f006a9f7c6e5d572aed70907c72ae7405aee6738b3801e11c00d025","title":"Diarization","slug":"docs/diarization","pageId":"docs/diarization.mdx"},{"type":"page","id":"d18711ca4d78f986ceace3d539a1bb3c0fc8cc8d1fa4071cf6125c62e5b618c2","title":"Dictation","slug":"docs/dictation","pageId":"docs/dictation.mdx"},{"type":"page","id":"9c3da4d8f8b4052cbe42cf751ecb8b2f8dbad25e54a70565e6e74f3574fadd97","title":"Filler Words","slug":"docs/filler-words","pageId":"docs/filler-words.mdx"},{"type":"page","id":"6b2bc62b24533493fe3d879b36acee963df1444762d60b37c802659c2a1e3096","title":"Measurements","slug":"docs/measurements","pageId":"docs/measurements.mdx"},{"type":"page","id":"b0c6b521c29f8097cbe68b3a286cea90bbc21dc7aaf8d018bdfd4c7d5ee617e7","title":"Numerals","slug":"docs/numerals","pageId":"docs/numerals.mdx"},{"type":"page","id":"e4d31a5352d3d564f9329f70d530644523c5188044674ee6a7f3fc73f9168894","title":"Paragraphs","slug":"docs/paragraphs","pageId":"docs/paragraphs.mdx"},{"type":"page","id":"ed6e5caccc1adf5566a6fb810b5e791f45b011e5945fa28add70a5bb97887d0e","title":"Profanity Filtering","slug":"docs/profanity-filter","pageId":"docs/profanity-filter.mdx"},{"type":"page","id":"436984aeb93b081563a3ab62f7a201083cfc6a73b4eab0bd68cf0ebf03741cb3","title":"Punctuation","slug":"docs/punctuation","pageId":"docs/punctuation.mdx"},{"type":"page","id":"e087f649ef34c738db03b43d706942e666c9edb6c8df9564992d5a9ff530593d","title":"Redaction","slug":"docs/redaction","pageId":"docs/redaction.mdx"},{"type":"page","id":"46194943b3fcae2d1cfeee1afaeac7edd6bb1884ed4e51e365621c90a1cbe864","title":"Smart Formatting","slug":"docs/smart-format","pageId":"docs/smart-format.mdx"},{"type":"page","id":"4ea2daf621167db886ab5cb5ece4bfe8f5aa17e8693e6179bbedb52f18aa1c10","title":"Supported Entity Types","slug":"docs/supported-entity-types","pageId":"docs/supported-entity-types.mdx"},{"type":"page","id":"323204771be8c70f54dd33fba73c447801519a61f2dbf06c851ab4f25671901b","title":"Utterances","slug":"docs/utterances","pageId":"docs/utterances.mdx"},{"type":"page","id":"ffe415ce5657c88b886c180c6484d6178d4fea1ee4e9a077659e3a6729983524","title":"Utterance Split","slug":"docs/utterance-split","pageId":"docs/utterance-split.mdx"}],"title":"Formatting","slug":"speech-to-text/formatting","pointsTo":"docs/diarization"},{"type":"section","id":"512662b8bc38cbd2cde3fedd4511e8a7b579d364dacbbe32a26bcbccdd7a1c51","children":[{"type":"page","id":"59af1130802fb4673857577232dec2d603af95632a4dd1f5666759744b2a8e91","title":"Find and Replace","slug":"docs/find-and-replace","pageId":"docs/find-and-replace.mdx"},{"type":"page","id":"0c4264769ebcc1d280503fc380894acb7f6db76332da2d8547e8ca090cb03b28","title":"Keyterm Prompting","slug":"docs/keyterm","pageId":"docs/keyterm.mdx"},{"type":"page","id":"8e8edb91fa3d3425fb9821fe1a8413033a6ad7775bc6315167b9c08fcccd203b","title":"Keywords","slug":"docs/keywords","pageId":"docs/keywords.mdx"},{"type":"page","id":"be428ac735eec238146674c50c6a2cc85d59e53a6e4b81ec70c01fdd144c6e74","title":"Search","slug":"docs/search","pageId":"docs/search.mdx"}],"title":"Custom Vocabulary","slug":"speech-to-text/custom-vocabulary","pointsTo":"docs/find-and-replace"},{"type":"section","id":"a5b931a7dd41708cb774e956da2f57ad712329af1af0a97cf44663bb55cdc23c","children":[{"type":"page","id":"c977e86e25a434bec44172780d54df7464f657b00d716964dc6f39dab859c256","title":"Channels","slug":"docs/channels","pageId":"docs/channels.mdx"},{"type":"page","id":"0f65f39a6ab980df6470536901edc6ebcf96b92930367fbf1ea69540d6ef5d53","title":"Encoding","slug":"docs/encoding","pageId":"docs/encoding.mdx"},{"type":"page","id":"ba64637ffc434636ee08c05e2d690069ba7a433bb236f42661379f6e43f04055","title":"Multichannel","slug":"docs/multichannel","pageId":"docs/multichannel.mdx"},{"type":"page","id":"4780bdee1151434e1731b52b90bec66d386f2e65f2daf85bacde0fe7f2c167d0","title":"Sample Rate","slug":"docs/sample-rate","pageId":"docs/sample-rate.mdx"}],"title":"Media Input Settings","slug":"docs/media-input-settings","overviewPageId":"docs/media-input-settings.mdx"},{"type":"section","id":"88e879abb881af43b6ae9694e76adb7e393bec4b2fe21e63732272bf577c5113","children":[{"type":"page","id":"b979143d6db3a2b411e104ba9d62fa52471c936da83549a4d5a32eb1578ac9ea","title":"STT Callback","slug":"docs/callback","pageId":"docs/callback.mdx"},{"type":"page","id":"07974d7307b512259f2a3c11977881a73dcf0587316abb576638079da3b73fa1","title":"Tagging","slug":"docs/tagging","pageId":"docs/tagging.mdx"},{"type":"page","id":"d59e2cd8d66fe7e074882303bd6c51308094368f5ff2bcc6f4c927598e8ab7dc","title":"Extra Metadata","slug":"docs/extra-metadata","pageId":"docs/extra-metadata.mdx"}],"title":"Results Processing","slug":"speech-to-text/results-processing","pointsTo":"docs/callback"},{"type":"section","id":"bdef75158e06b9f25e90fc753480b426d18f824b915c1b38a4415950ed1f746b","children":[{"type":"page","id":"23ab615b70144eb359cf43a2b006e77970b33bbd8b03bb6fc0afc3861e8762dc","title":"Migrating From Amazon Web Services (AWS) Transcribe to Deepgram","slug":"docs/migrating-from-amazon-web-services-aws-transcribe-to-deepgram","pageId":"docs/migrating-from-amazon-web-services-aws-transcribe-to-deepgram.mdx"},{"type":"page","id":"683dde83f7e8722908f33a1a86f7e11e4e475f2ccbb70e78c829e886e6745d7e","title":"Migrating From Google Speech-to-Text (STT) to Deepgram","slug":"docs/migrating-from-google-speech-to-text-stt-to-deepgram","pageId":"docs/migrating-from-google-speech-to-text-stt-to-deepgram.mdx"},{"type":"page","id":"2f83f8f363b048ee8810566374186d3910a40f741ea608087c9456e60da7f5da","title":"Migrating From OpenAI Whisper to Deepgram","slug":"docs/migrating-from-openai-whisper-to-deepgram","pageId":"docs/migrating-from-openai-whisper-to-deepgram.mdx"},{"type":"page","id":"03a6135d0a7089bbb4e250ceb98c8d186dded1390100f4baabd7c1c43fc6c8da","title":"Migrating from AssemblyAI Speech-to-Text to Deepgram","slug":"docs/migrating-from-assembly-ai-speech-to-text-to-deepgram","pageId":"docs/migrating-from-assembly-ai-speech-to-text-to-deepgram.mdx"}],"title":"Migrating","slug":"speech-to-text/migrating","pointsTo":"docs/migrating-from-amazon-web-services-aws-transcribe-to-deepgram"}]},"trailingSlash":false},"edgeFlags":{"isApiPlaygroundEnabled":true,"isApiScrollingDisabled":false,"isWhitelabeled":false,"isSeoDisabled":false,"isTocDefaultEnabled":false,"isSnippetTemplatesEnabled":false,"isSearchDisabled":true,"isHttpSnippetsEnabled":true,"isInlineFeedbackEnabled":false,"isDarkCodeEnabled":false,"isProxyDisabled":false,"isImageZoomDisabled":false,"useJavaScriptAsTypeScript":false,"alwaysEnableJavaScriptFetch":false,"scrollInContainerEnabled":false,"useMdxBundler":true,"isBatchStreamToggleDisabled":false,"isAuthEnabledInDocs":false,"isAskAiEnabled":false,"isAudioFileDownloadSpanSummary":false,"isDocsLogoTextEnabled":false,"isAudioExampleInternal":false,"usesApplicationJsonInFormDataValue":false,"isBinaryOctetStreamAudioPlayer":false,"hasVoiceIdPlaygroundForm":false,"isCohereTheme":false,"isFileForgeHackEnabled":false,"is404PageHidden":false,"isNewSearchExperienceEnabled":false,"isAuthenticatedPagesDiscoverable":false,"isSearchV2Enabled":false},"apis":["13f46c0a-d9a8-4a70-a074-ba483cf7fbb2"],"seo":{"openGraph":{"siteName":"Deepgram | Documentation"},"twitter":{},"additionalMetaTags":[],"additionalLinkTags":[{"rel":"icon","href":"https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/assets/favicon.ico","crossOrigin":"anonymous"},{"rel":"preload","href":"https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/assets/Inter.woff2","as":"font","type":"font/woff2","crossOrigin":"anonymous"},{"rel":"preload","href":"https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/assets/FiraMono.woff2","as":"font","type":"font/woff2","crossOrigin":"anonymous"},{"rel":"preload","href":"https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/assets/Roobert.woff2","as":"font","type":"font/woff2","crossOrigin":"anonymous"}],"breadcrumbList":{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Deepgram | Documentation","item":"https://developers.deepgram.com/"},{"@type":"ListItem","position":2,"name":"Speech to Text","item":"https://developers.deepgram.com/speech-to-text"},{"@type":"ListItem","position":3,"name":"Streaming Audio","item":"https://developers.deepgram.com/speech-to-text/streaming-audio"},{"@type":"ListItem","position":4,"name":"Control Messages","item":"https://developers.deepgram.com/speech-to-text/streaming-audio/control-messages"},{"@type":"ListItem","position":5,"name":"Finalize","item":"https://developers.deepgram.com/docs/finalize"}]},"canonical":"https://developers.deepgram.com/docs/finalize","title":"Finalize","description":"Learn how to send Deepgram a Finalize message, which flushes the websocket stream's audio by forcing the server to process all unprocessed audio data immediately and return the results.","titleTemplate":"%s — Deepgram | Documentation","noindex":false,"nofollow":false},"fallback":{},"theme":"default","analyticsConfig":{"gtm":{"containerId":"GTM-M5WQMGR"}},"defaultLang":"curl","stylesheet":"\n:root {\n --typography-body-font-family: 'Inter', -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;\n --typography-heading-font-family: 'Roobert', -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;\n --typography-code-font-family: 'FiraMono', ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;\n --spacing-page-width: 100%;\n --spacing-content-width: 44rem;\n --spacing-content-wide-width: 66.5rem;\n --spacing-sidebar-width: 18rem;\n --spacing-header-height: 6.75rem;\n --spacing-header-height-padded: 5rem;\n --spacing-header-height-real: 4rem;\n \n --grayscale-1: var(--mauve-1);\n --grayscale-2: var(--mauve-2);\n --grayscale-3: var(--mauve-3);\n --grayscale-4: var(--mauve-4);\n --grayscale-5: var(--mauve-5);\n --grayscale-6: var(--mauve-6);\n --grayscale-7: var(--mauve-7);\n --grayscale-8: var(--mauve-8);\n --grayscale-9: var(--mauve-9);\n --grayscale-10: var(--mauve-10);\n --grayscale-11: var(--mauve-11);\n --grayscale-12: var(--mauve-12);\n --grayscale-a1: var(--mauve-a1);\n --grayscale-a2: var(--mauve-a2);\n --grayscale-a3: var(--mauve-a3);\n --grayscale-a4: var(--mauve-a4);\n --grayscale-a5: var(--mauve-a5);\n --grayscale-a6: var(--mauve-a6);\n --grayscale-a7: var(--mauve-a7);\n --grayscale-a8: var(--mauve-a8);\n --grayscale-a9: var(--mauve-a9);\n --grayscale-a10: var(--mauve-a10);\n --grayscale-a11: var(--mauve-a11);\n --grayscale-a12: var(--mauve-a12);\n --accent-1: #f7f7f9;\n --accent-2: #f1f3f9;\n --accent-3: #e8ebf7;\n --accent-4: #dde2f9;\n --accent-5: #d0d7f8;\n --accent-6: #c0c8f3;\n --accent-7: #abb5eb;\n --accent-8: #8f9be2;\n --accent-9: #7783f7;\n --accent-10: #6c77e9;\n --accent-11: #5158c3;\n --accent-12: #282c5f;\n --accent-a1: #7a3b7c04;\n --accent-a2: #1734c309;\n --accent-a3: #0926c312;\n --accent-a4: #0327ea1d;\n --accent-a5: #0126e92a;\n --accent-a6: #0322d93b;\n --accent-a7: #011ec950;\n --accent-a8: #011cc16d;\n --accent-a9: #0217f486;\n --accent-a10: #0214dc91;\n --accent-a11: #020ca8ad;\n --accent-a12: #010642d7;\n --accent-surface: #eff1f9cc;\n --gray-surface: #ffffffcc;\n --accent: 119, 131, 247;\n --accent-aa: 81, 96, 245;\n --accent-aaa: 32, 52, 243;\n --accent-tinted: 143, 153, 248;\n --background: 249, 250, 251;\n --accent-contrast: rgb(255, 255, 255);\n --bg-color-card: rgba(255, 255, 255, 0.7);\n --sidebar-background: transparent;\n --header-background: transparent;\n --border: var(--grayscale-a4);\n --border-concealed: var(--grayscale-a2);\n --body-text: 0, 0, 0;\n --body-text-inverted: 255, 255, 255;\n}\n\n@media (max-width: 1024px) {\n :root {\n --spacing-header-height: 6.75rem;\n --spacing-header-height-padded: 5rem;\n }\n}\n\n\n:is(.dark) {\n --grayscale-1: var(--gray-1);\n --grayscale-2: var(--gray-2);\n --grayscale-3: var(--gray-3);\n --grayscale-4: var(--gray-4);\n --grayscale-5: var(--gray-5);\n --grayscale-6: var(--gray-6);\n --grayscale-7: var(--gray-7);\n --grayscale-8: var(--gray-8);\n --grayscale-9: var(--gray-9);\n --grayscale-10: var(--gray-10);\n --grayscale-11: var(--gray-11);\n --grayscale-12: var(--gray-12);\n --grayscale-a1: var(--gray-a1);\n --grayscale-a2: var(--gray-a2);\n --grayscale-a3: var(--gray-a3);\n --grayscale-a4: var(--gray-a4);\n --grayscale-a5: var(--gray-a5);\n --grayscale-a6: var(--gray-a6);\n --grayscale-a7: var(--gray-a7);\n --grayscale-a8: var(--gray-a8);\n --grayscale-a9: var(--gray-a9);\n --grayscale-a10: var(--gray-a10);\n --grayscale-a11: var(--gray-a11);\n --grayscale-a12: var(--gray-a12);\n --accent-1: #050d0a;\n --accent-2: #0f1a15;\n --accent-3: #092d21;\n --accent-4: #003d29;\n --accent-5: #004b34;\n --accent-6: #005a40;\n --accent-7: #006b4d;\n --accent-8: #00805b;\n --accent-9: #a1f9d4;\n --accent-10: #97efca;\n --accent-11: #66cfa6;\n --accent-12: #9df5d0;\n --accent-a1: #00b50003;\n --accent-a2: #4bfb9c10;\n --accent-a3: #00fca124;\n --accent-a4: #00fc9735;\n --accent-a5: #00ffa543;\n --accent-a6: #00feac53;\n --accent-a7: #00fdb165;\n --accent-a8: #00fdb07b;\n --accent-a9: #a5ffd9f9;\n --accent-a10: #a0fed6ef;\n --accent-a11: #7dffcccd;\n --accent-a12: #a3ffd8f5;\n --accent-surface: color(display-p3 0.0863 0.1569 0.1255 / 0.5);\n --gray-surface: color(display-p3 0 0 0 / 5%);\n --accent: 161, 249, 212;\n --accent-aa: 161, 249, 212;\n --accent-aaa: 161, 249, 212;\n --accent-tinted: 185, 251, 223;\n --background: 11, 11, 12;\n --accent-contrast: rgb(11, 40, 29);\n --bg-color-card: rgb(26, 26, 31);\n --bg-color-card-solid: rgb(26, 26, 31);\n --sidebar-background: rgb(11, 11, 12);\n --header-background: rgb(26, 26, 31);\n --border: rgb(44, 44, 51);\n --border-concealed: rgb(44, 44, 51);\n --body-text: 255, 255, 255;\n --body-text-inverted: 0, 0, 0;\n}\n\n@font-face {\n font-family: 'Inter';\n src: url('https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/assets/Inter.woff2') format('woff2');\n font-weight: 400;\n font-style: normal;\n font-display: swap;\n}\n\n@font-face {\n font-family: 'Roobert';\n src: url('https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/assets/Roobert.woff2') format('woff2');\n font-weight: 600 900;\n font-style: normal;\n font-display: swap;\n}\n\n@font-face {\n font-family: 'FiraMono';\n src: url('https://files.buildwithfern.com/https://deepgram.docs.buildwithfern.com/2025-02-26T00:10:30.605Z/assets/FiraMono.woff2') format('woff2');\n font-weight: 100 900;\n font-style: normal;\n font-display: swap;\n}\n\nhtml {\n background-color: #f9fafb;\n}\n\nhtml.dark {\n background-color: #0b0b0c;\n}\n\n\n\n.fern-button.filled {\n\tbackground: linear-gradient(90deg, #201CFF -91.5%, #13EF95 80.05%) !important;\n}\n\n.fern-header-tab-button[data-state=active] {\n\tcolor: white !important;\n}\n\n.fern-header-tab-button[data-state=active]:after {\n\tbackground: linear-gradient(90deg, #201CFF -91.5%, #13EF95 80.05%) !important;\n\theight: 2px !important;\n}\n\n.fern-header-tab-button {\n\tpadding-left: 24px !important;\n\tpadding-right: 24px !important;\n}\n\n@media (max-width: 1350px) {\n\t.fern-header-tab-button {\n\t\tpadding-left: 16px !important;\n\t\tpadding-right: 16px !important;\n\t}\n}\n\n@media (max-width: 1185px) {\n\t.fern-header-tab-button {\n\t\tpadding-left: 12px !important;\n\t\tpadding-right: 12px !important;\n\t}\n}\n\n@media (max-width: 1100px) {\n\t.fern-header-tab-button {\n\t\tpadding-left: 8px !important;\n\t\tpadding-right: 8px !important;\n\t}\n}\n\n.fern-mdx-link {\n\tcolor: #79affa !important;\n\ttext-decoration: none;\n}\n\n.fern-mdx-link svg {\n\tcolor: #79affa !important;\n}\n\n.white .fern-card span {\n\tbackground: white !important;\n}\n\n@media (min-width: 1024px) {\n\t.fern-header-right-menu {\n\t\tdisplay: none !important;\n\t}\n}\n\n.banner {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\ttext-align: center;\n}\n\n.banner p {\n\tmargin-top: .25rem;\n\tmargin-bottom: .25rem;\n}\n\n.banner h1 {\n\tmargin-top: .5rem;\n\tmargin-bottom: 16px;\n}\n\n.fern-sidebar-link-container[data-state=\"active\"] {\n\tcolor: white !important;\n}\n\n.fern-sidebar-link-text {\n\tfont-size: 16px !important;\n}\n\n.fern-sidebar-link-container[data-state=active] .fern-sidebar-link-indent:after {\n border: 0px !important;\n}\n\n.fern-sidebar-link-container[data-state=\"active\"] .fern-sidebar-link {\n\tbackground-color: #232329 !important;\n}\n\n.fern-sidebar-link-container[data-state=\"active\"] .fern-sidebar-link:after {\n\tbackground: linear-gradient(177.85deg, #201CFF -102.27%, #13EF95 101.45%) !important;\n\twidth: 1px !important;\n\tposition: absolute !important;\n\tcontent: \"\" !important;\n\tright: 0 !important;\n\ttop: 0 !important;\n\tbottom: 0 !important;\n\tborder-radius: 8px !important;\n}\n\n.fern-sidebar-link {\n\tborder-radius: 0 !important;\n}\n\n.fern-sidebar-link-content {\n\tpadding-left: 1rem !important;\n\tpadding-right: 1rem !important;\n\tpadding-top: 0.5rem !important;\n\tpadding-bottom: 0.5rem !important;\n}\n\n.fern-sidebar-content {\n\tpadding-left: 0 !important;\n\tpadding-right: 0 !important;\n}\n\n@media (min-width: 1024px) {\n .fern-sidebar-container:not(.fern-sidebar-fixed) {\n padding-left: 0rem !important;\n }\n}\n\n.fern-header-tab-button span {\n\tfont-weight: 700 !important;\n\tfont-size: 16px !important;\n\tline-height: 17.5px !important;\n\tletter-spacing: 2% !important;\n}\n\n.fern-search-bar {\n\t--tw-ring-color: #4E4E52 !important;\n\tbackground-color: #0B0B0C !important;\n}\n\n.fern-sidebar-heading-content,\n.fern-sidebar-link-container .font-semibold .fern-sidebar-link-text {\n\tfont-weight: 700 !important;\n\tfont-size: 14px !important;\n\tline-height: 17.5px !important;\n\tletter-spacing: 2% !important;\n\tcolor: #A1F9D4 !important;\n}\n\n.fern-breadcrumb-item {\n\tcolor: var(--grayscale-a11) !important;\n\tfont-weight: 400 !important;\n}\n\nbutton[role=\"tab\"][data-state=\"active\"] {\n\tbackground-color: #1A1A1F !important;\n}\n\nbutton[role=\"tab\"][data-state=\"active\"]:after {\n\tbackground: linear-gradient(90deg, #201CFF -91.5%, #13EF95 80.05%) !important;\n\theight: 2px !important;\n\tposition: absolute !important;\n\tcontent: \"\" !important;\n\tright: 0 !important;\n\tleft: 0 !important;\n\tbottom: 0 !important;\n}\n\nbutton[role=\"tab\"] {\n\tbox-shadow: none !important;\n\tposition: relative !important;\n}\n\nbutton[role=\"tab\"]:hover span {\n\tbackground-color: #1A1A1F !important;\n}\n\ndiv[class*=\"callout\"] {\n\tborder-left-width: 2px !important;\n\tborder-color: var(--tw-ring-color) !important;\n}\n\n.fern-search-bar,\n.callout-outlined,\n.fern-card\n.fern-button {\n\tborder-radius: 8px !important;\n}\n\n.bg-tag-default-soft {\n background-color: #28282B !important;\n}\n\n.code-block-root span[style*=\"color: rgb(194, 195, 197);\"] {\n\t--shiki-dark: #949498 !important;\n}\n\n.callout-outlined {\n\tbackground-color: #1D2A34 !important;\n\t--tw-ring-color: #149AFB !important;\n}\n\n.callout-outlined-warning {\n\tbackground-color: #342D1E !important;\n\t--tw-ring-color: #FEC84B !important;\n}\n\n.callout-outlined p,\n.callout-outlined h5,\n.callout-outlined-warning p,\n.callout-outlined-warning h5,\n.callout-outlined-success p,\n.callout-outlined-success h5,\n.callout-outlined-danger p,\n.callout-outlined-danger h5,\n.callout-outlined-info p,\n.callout-outlined-info h5,\n.callout-outlined-tip p,\n.callout-outlined-tip h5,\n.callout-outlined-primary p,\n.callout-outlined-primary h5,\n.callout-outlined-check p,\n.callout-outlined-check h5,\n.callout-outlined-secondary p,\n.callout-outlined-warning li {\n\tcolor: var(--grayscale-a11) !important;\n}\n\n.callout-outlined li {\n\tmargin-top: 0px !important;\n}\n\n.callout-outlined h2 {\n\tmargin-top: 0px !important;\n}\n\n.callout-outlined-warning h2 {\n\tmargin-top: 0px !important;\n}\n\n.logs {\n\tbackground-color: #0b0b0c !important;\n\tpadding: 0.5rem !important;\n\tfont-family: var(--typography-code-font-family, var(--code-font-fallback));\n\n}\n\ndiv[class*=\"callout\"] .mt-0\\.5.w-4 {\n\talign-self: center !important;\n}\n\nspan[data-badge-type=\"http-method\"],\nspan[data-badge-type=\"status-code\"] {\n\tborder-radius: 50px !important;\n}\n\n.dg-badge {\n\tmargin-right: 6px !important;\n\tcolor: #bbbbbf !important;\n\tpadding: 1px 1px !important;\n\ttext-decoration: none !important;\n\tborder-radius: 4px !important;\n\tbackground-origin: border-box !important;\n background-image: linear-gradient(90deg, #201cff -91.5%, #13ef95 80.05%);\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: fit-content;\n\theight: fit-content;\n}\n\n.dg-badge span {\n\tbackground-color: #1A1A1F !important;\n\tpadding: 4px 12px !important;\n\tborder-radius: 4px !important;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.dg-badge .fa-icon {\n\tbackground: linear-gradient(90deg, #201cff -91.5%, #13ef95 80.05%);\n\tmargin-right: 4px !important;\n}\n\n.fern-card {\n\tbackground-color: #0B0B0C !important;\n\tborder-radius: 8px !important;\n}\n\nol li {\n\tmargin-top: 2rem !important;\n}\n\n.small .fern-card {\n\tpadding-bottom: 1rem !important;\n\tpadding-top: 1rem !important;\n}\n\n.small .fern-card .items-start {\n\talign-items: center !important;\n}\n\n.small .fern-card .text-base {\n\tcolor: #BBBBBF !important;\n\tfont-weight: 600 !important;\n}\n\n.fern-card h3 {\n\tmargin-top: 0px !important;\n}\n\n.fern-sidebar-tabs {\n\tpadding-left: 10px !important;\n}\n\n.fern-sidebar-heading {\n\tpadding-left: 28px !important;\n}\n\n.api-playground-call {\n\twidth: fit-content !important;\n\theight: fit-content !important;\n\tdisplay: flex !important;\n\talign-items: center !important;\n\tjustify-content: center !important;\n\tpadding: 1px !important;\n\tborder-radius: 4px !important;\n\tbackground-image: linear-gradient(82.38deg, #ff2eea -99.24%, #4b3cff 99.26%) !important;\n\twidth: 100% !important;\n\tmargin-top: 1rem !important;\n}\n\n.api-playground-call span:first-child {\n\tdisplay: flex !important;\n\talign-items: center !important;\n\tgap: 12px !important;\n\tbackground-color: #1A1A1F !important;\n\tpadding: 4px !important;\n\tborder-radius: 4px !important;\n\twidth: 100% !important;\n\tflex-direction: row !important;\n}\n\n.api-playground-call p {\n\tmargin: 0 !important;\n\tdisplay: flex !important;\n\talign-items: center !important;\n\twhite-space: nowrap !important;\n}\n\n.api-playground-call p div:first-child {\n\tdisplay: inline-flex !important;\n\talign-items: center !important;\n}\n\n.api-playground-call img {\n\twidth: 2.5rem !important;\n\theight: 2.5rem !important;\n\tdisplay: inline-block !important;\n\tmargin-top: 4px !important;\n\tmargin-bottom: 4px !important;\n\ttransform: scaleX(-1) !important;\n}\n\n.invert-white {\n\tfilter: invert(1) !important;\n}\n\n.fa-icon,\n.card-icon {\n\twidth: 2rem !important;\n\theight: 2rem !important;\n}\n\n.dg-badge .fa-icon {\n\twidth: 1rem !important;\n\theight: 1rem !important;\n}\n\n.fern-header,\n.fern-header-tabs {\n\tborder-bottom-width: 0px !important;\n}\n\n.fern-header-tabs-list-item span {\n\tfont-family: 'Roobert' !important;\n}\n\n.fern-header-tabs-list,\n.fern-header-tabs-list-item {\n\theight: 100% !important;\n}\n\n.fern-sidebar-link-indent {\n\tmargin-left: 20px !important;\n}\n\n.fern-sidebar-link-container[data-state=inactive] .fern-sidebar-link:hover {\n\tcolor: #FBFBFF !important;\n}\n\n.t-muted:is(.dark *) {\n\tcolor: #949498 !important;\n}\n\n.dark\\:prose-invert:is(.dark *) {\n\t--tw-prose-headings: #FBFBFF !important;\n\tcolor: #E1E1E5 !important;\n}\n\n.fern-page-heading * {\n\tcolor: #FBFBFF !important;\n}\n\n.badge a {\n\ttext-decoration: none !important;\n\tcolor: unset !important;\n}\n\n.badge svg {\n\tdisplay: none !important;\n}\n\n.dep {\n\tbackground: #bbbbbf !important;\n}\n\n.dep .fa-icon {\n\tbackground: #bbbbbf !important;\n}\n\n.dep span {\n\ttext-decoration: line-through !important;\n}\n\n.pink {\n\tbackground-image: linear-gradient(85deg, #ee028b 5.66%, #ae29ff 99.14%) !important;\n}\n\n.pink .fa-icon {\n\tbackground: linear-gradient(85deg, #ee028b 5.66%, #ae29ff 99.14%) !important;\n}\n\n#fern-header {\n\tpadding-top: 3rem !important;\n}\n\n.fern-sidebar-container {\n\tposition: sticky !important;\n\ttop: 0 !important;\n margin-top: 10rem !important;\n\toverflow-y: auto !important;\n\tz-index: 20 !important;\n\theight: 100vh !important;\n}\n\n.fern-main {\n\tmargin-top: calc(var(--header-offset, 0) + 3rem) !important;\n}\n\n.fern-endpoint-content-right .fa-icon,\n.fern-dropdown-item .fa-icon {\n\twidth: 1rem !important;\n\theight: 1rem !important;\n}\n\n.fern-endpoint-content {\n\tpadding-top: 3rem !important;\n}\n\n#fern-header {\n\tposition: absolute !important;\n}\n\ndiv[id=\"/reference/speech-to-text-api/listen#request\"] .flex.flex-col div:nth-of-type(4) span:nth-of-type(2) {\n\tdisplay: none !important;\n}\n\ndiv[id=\"/reference/speech-to-text-api/listen#request\"] .flex.flex-col div:nth-of-type(4) span:nth-of-type(1):after {\n\tcontent: \" binary\" !important;\n\tcolor: #949498 !important;\n\tfont-size: .75rem;\n line-height: 1rem;\n\tfont-family: 'Inter' !important;\n\ttext-shadow: 0 1px 3px rgba(0, 0, 0, .4);\n\tmargin-left: .5rem;\n}\n\n#fern-header {\n\tposition: absolute !important;\n}\n\n.fern-sidebar-fixed+.fern-main {\n\tpadding-left: 0px !important;\n}\n\n.api-playground-call a {\n padding-left: 4px !important;\n padding-right: 4px !important;\n color: #79affa !important;\n text-decoration: none !important;\n}\n\n\n*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.tw-absolute{position:absolute}.tw-relative{position:relative}.tw-inset-x-0{left:0;right:0}.tw-top-0{top:0}.tw-z-30{z-index:30}.tw-mx-auto{margin-left:auto;margin-right:auto}.tw-flex{display:flex}.tw-w-full{width:100%}.tw-max-w-\\[var\\(--spacing-page-width\\)\\]{max-width:var(--spacing-page-width)}.tw-items-center{align-items:center}.tw-justify-end{justify-content:flex-end}.tw-gap-2{gap:.5rem}.tw-gap-3{gap:.75rem}.tw-rounded-md{border-radius:.375rem}.tw-bg-\\[\\#232329\\]{--tw-bg-opacity: 1;background-color:rgb(35 35 41 / var(--tw-bg-opacity))}.tw-px-3{padding-left:.75rem;padding-right:.75rem}.tw-px-4{padding-left:1rem;padding-right:1rem}.tw-py-2{padding-top:.5rem;padding-bottom:.5rem}.tw-text-\\[\\#BBBBBF\\]{--tw-text-opacity: 1;color:rgb(187 187 191 / var(--tw-text-opacity))}.tw-backdrop-blur-2xl{--tw-backdrop-blur: blur(40px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}#fern-header a{font-size:16px!important;font-family:Inter,sans-serif!important}@media (min-width: 768px){.md\\:tw-px-6{padding-left:1.5rem;padding-right:1.5rem}}@media (min-width: 1024px){.lg\\:tw-px-8{padding-left:2rem;padding-right:2rem}}\n\n","featureFlagsConfig":{}},"__N_SSG":true},"page":"/static/[domain]/[[...slug]]","query":{"domain":"developers.deepgram.com","slug":["docs","finalize"]},"buildId":"jEjV2SONtxKUdC_MuPL3x","assetPrefix":"https://app.ferndocs.com","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[58494,47191,39862,22055,98508,37110,7575],"gsp":true,"scriptLoader":[]}</script></body></html>

Pages: 1 2 3 4 5 6 7 8 9 10