Skip to content
speechinfraConsole

Deepgram · Realtime ASR

Nova-3 Realtime

Realtime speech recognition with fast partials and production-ready final transcripts.

nova-3-realtime
$0.005 / audio minuteTry in Console

Current model-specific price from our catalog. Requests require your project API key and sufficient balance. Availability is checked at execution time.

Input and capabilities

Connect over WebSocket. After session.updated, send mono PCM16 little-endian audio at 16 kHz. The direct streaming session supports up to 30 seconds of audio.

  • transcription
  • realtime input
  • streaming output
  • diarization
  • realtime diarization
  • word timestamps
  • segment timestamps
  • hotwords
  • partial transcripts
  • endpointing

Automatic language detection: not supported.

Supported language codes: af, ar, hy, as, be, bn, bs, bg, ca, zh, hr, cs, da, nl, en, et, fi, fr, ka, de, el, gu, he, hi, hu, id, it, ja, kn, kk, ko, lv, lt, mk, ms, mr, mn, ne, no, ps, fa, pl, pt, pa, ro, ru, sr, sk, sl, es, sv, tl, ta, te, th, tr, uk, ur, vi.

API endpoint

WEBSOCKET wss://api.speechinfra.com/v1/inference/nova-3-realtime/realtime

Authenticate with your Speechinfra project key. Read the quickstart and billing guide.

Python
# pip install websockets
# audio.pcm: mono, 16 kHz, signed PCM16 little-endian; <= 30 seconds.
import asyncio, json, os
from pathlib import Path
from websockets.asyncio.client import connect

async def main():
    headers = {"Authorization": "Bearer " + os.environ["SPEECH_API_KEY"]}
    async with connect("wss://api.speechinfra.com/v1/inference/nova-3-realtime/realtime", additional_headers=headers) as socket:
        await socket.send("{\"language\":\"en\",\"smart_format\":false,\"diarize_model\":\"off\",\"interim_results\":false,\"endpointing\":10,\"vad_events\":false,\"type\":\"session.configure\"}")
        while True:
            event = json.loads(await socket.recv())
            if event["type"] == "error":
                raise RuntimeError(event)
            if event["type"] == "session.updated":
                break
        async def send():
            audio = Path("audio.pcm").read_bytes()
            assert 0 < len(audio) <= 960000 and len(audio) % 2 == 0
            for i in range(0, len(audio), 3200):
                await socket.send(audio[i:i+3200])
                await asyncio.sleep(0.1)
            await socket.send('{"type":"session.close"}')
        sender = asyncio.create_task(send())
        try:
            async with asyncio.timeout(90):
                async for message in socket:
                    print(message)
        finally:
            sender.cancel()

asyncio.run(main())
JavaScript / browser
// Use from the console origin with a Speech Cloud project key.
// apiKey is a Speech Cloud project key, never a provider key.
const socket = new WebSocket("wss://api.speechinfra.com/v1/inference/nova-3-realtime/realtime", ['speech', apiKey]);
socket.onopen = () => socket.send("{\"language\":\"en\",\"smart_format\":false,\"diarize_model\":\"off\",\"interim_results\":false,\"endpointing\":10,\"vad_events\":false,\"type\":\"session.configure\"}");
socket.onmessage = ({data}) => {
  const event = JSON.parse(data);
  console.log(event);
  if (event.type === 'session.updated') {
    // Send mono PCM16 / 16 kHz binary frames, <= 30 s in total.
    // After the final frame: socket.send(JSON.stringify({type:'session.close'}));
  }
};
// For a complete file-streaming example: scripts/test_models.py

Request parameters

Generated from the API schema for this deployment. Conditional parameters apply only when their controlling setting is enabled.

ParameterTypeDetails
languagestring

Single-language recognition, or multi for code-switching between: en, es, fr, de, hi, ru, pt, ja, it, nl.

enum: af, ar, hy, as, be, bn, bs, bg, ca, zh, hr, cs … · default: "en"

All accepted values
[
  "af",
  "ar",
  "hy",
  "as",
  "be",
  "bn",
  "bs",
  "bg",
  "ca",
  "zh",
  "hr",
  "cs",
  "da",
  "nl",
  "en",
  "et",
  "fi",
  "fr",
  "ka",
  "de",
  "el",
  "gu",
  "he",
  "hi",
  "hu",
  "id",
  "it",
  "ja",
  "kn",
  "kk",
  "ko",
  "lv",
  "lt",
  "mk",
  "ms",
  "mr",
  "mn",
  "ne",
  "no",
  "ps",
  "fa",
  "pl",
  "pt",
  "pa",
  "ro",
  "ru",
  "sr",
  "sk",
  "sl",
  "es",
  "sv",
  "tl",
  "ta",
  "te",
  "th",
  "tr",
  "uk",
  "ur",
  "vi",
  "af-ZA",
  "ar-AE",
  "ar-SA",
  "ar-QA",
  "ar-KW",
  "ar-SY",
  "ar-LB",
  "ar-PS",
  "ar-JO",
  "ar-EG",
  "ar-SD",
  "ar-TD",
  "ar-MA",
  "ar-DZ",
  "ar-TN",
  "ar-IQ",
  "ar-IR",
  "as-IN",
  "zh-HK",
  "zh-CN",
  "zh-TW",
  "cs-CZ",
  "da-DK",
  "en-US",
  "en-AU",
  "en-GB",
  "en-IN",
  "en-NZ",
  "nl-BE",
  "fr-CA",
  "ka-GE",
  "de-CH",
  "gu-IN",
  "kk-KZ",
  "ko-KR",
  "ps-AF",
  "pt-BR",
  "pt-PT",
  "pa-IN",
  "es-419",
  "sv-SE",
  "th-TH",
  "tr-TR",
  "multi"
]
keytermsarray

max 100 items

smart_formatboolean

default: false

diarize_modelstring

enum: off, latest, v1 · default: "off"

All accepted values
[
  "off",
  "latest",
  "v1"
]
interim_resultsboolean

default: false

endpointinginteger

default: 10 · min: 0 · max: 10000

utterance_end_msinteger

min: 0 · max: 10000

Applies when: {"interim_results":true}

vad_eventsboolean

default: false

typestring

enum: session.configure · default: "session.configure"

All accepted values
[
  "session.configure"
]
Complete request schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [],
  "properties": {
    "language": {
      "type": "string",
      "default": "en",
      "description": "Single-language recognition, or multi for code-switching between: en, es, fr, de, hi, ru, pt, ja, it, nl.",
      "enum": [
        "af",
        "ar",
        "hy",
        "as",
        "be",
        "bn",
        "bs",
        "bg",
        "ca",
        "zh",
        "hr",
        "cs",
        "da",
        "nl",
        "en",
        "et",
        "fi",
        "fr",
        "ka",
        "de",
        "el",
        "gu",
        "he",
        "hi",
        "hu",
        "id",
        "it",
        "ja",
        "kn",
        "kk",
        "ko",
        "lv",
        "lt",
        "mk",
        "ms",
        "mr",
        "mn",
        "ne",
        "no",
        "ps",
        "fa",
        "pl",
        "pt",
        "pa",
        "ro",
        "ru",
        "sr",
        "sk",
        "sl",
        "es",
        "sv",
        "tl",
        "ta",
        "te",
        "th",
        "tr",
        "uk",
        "ur",
        "vi",
        "af-ZA",
        "ar-AE",
        "ar-SA",
        "ar-QA",
        "ar-KW",
        "ar-SY",
        "ar-LB",
        "ar-PS",
        "ar-JO",
        "ar-EG",
        "ar-SD",
        "ar-TD",
        "ar-MA",
        "ar-DZ",
        "ar-TN",
        "ar-IQ",
        "ar-IR",
        "as-IN",
        "zh-HK",
        "zh-CN",
        "zh-TW",
        "cs-CZ",
        "da-DK",
        "en-US",
        "en-AU",
        "en-GB",
        "en-IN",
        "en-NZ",
        "nl-BE",
        "fr-CA",
        "ka-GE",
        "de-CH",
        "gu-IN",
        "kk-KZ",
        "ko-KR",
        "ps-AF",
        "pt-BR",
        "pt-PT",
        "pa-IN",
        "es-419",
        "sv-SE",
        "th-TH",
        "tr-TR",
        "multi"
      ]
    },
    "keyterms": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
      },
      "maxItems": 100
    },
    "smart_format": {
      "type": "boolean",
      "default": false
    },
    "diarize_model": {
      "type": "string",
      "enum": [
        "off",
        "latest",
        "v1"
      ],
      "default": "off"
    },
    "interim_results": {
      "type": "boolean",
      "default": false
    },
    "endpointing": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10000,
      "default": 10
    },
    "utterance_end_ms": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10000,
      "visibleWhen": {
        "interim_results": true
      }
    },
    "vad_events": {
      "type": "boolean",
      "default": false
    },
    "type": {
      "type": "string",
      "enum": [
        "session.configure"
      ],
      "default": "session.configure"
    }
  }
}

Response schema

Returns JSON events over the WebSocket connection.

View complete response schema
{
  "type": "object",
  "description": "JSON server events. Send binary mono PCM16 at 16 kHz after session.updated; session.close drains and returns session.closed.",
  "properties": {
    "type": {
      "enum": [
        "session.created",
        "session.updated",
        "session.routed",
        "transcript.partial",
        "transcript.final",
        "error",
        "session.closed"
      ]
    }
  }
}