DeepInfra raises $107M Series B to scale the inference cloud — read the announcement
nvidia/
$0.00100
/ minute
Nemotron Speech Streaming EN 0.6B is NVIDIA's 600M-parameter cache-aware FastConformer-RNNT model for low-latency English speech recognition. It transcribes audio as it arrives, with native punctuation and capitalization, by reusing cached encoder context instead of recomputing overlapping windows. DeepInfra serves it at 560 ms lookahead over a realtime WebSocket API compatible with OpenAI Realtime transcription, batching many concurrent streams on each GPU, for live captioning, voice agents and real-time speech-to-text.

nvidia/Nemo3-ASR-Streaming is served over realtime WebSocket sessions, compatible with OpenAI's Realtime transcription API: you stream audio in and receive the transcript as the words are recognized. It is not available over HTTP inference.
wss://api.deepinfra.com/v1/realtime?model=nvidia/Nemo3-ASR-Streaming
Authenticate with Authorization: Bearer $DEEPINFRA_API_KEY. Browsers, which cannot set headers on a WebSocket, can pass the key as the subprotocol openai-insecure-api-key.<key> instead.
Optional query parameters, for session rotation (below): going_away=1, going_away_test_s=<10 to 600>, rotate_from=<session id> and preroll_s=<0 to 600>.
session.id is the session's id. A session that opted in to rotation also gets preroll_s (the pre-roll granted, often 0) and align_samples (in your sample rate, so read it from session.updated).delta is the new text; transcript is the whole open utterance so far, which may revise earlier words.transcript of an utterance, and its words, each with word, start and end in seconds from the session's first audio sample. A long utterance can arrive as several completed items, and the last item of a session can come without words.stats.audio_seconds and stats.utterances.error.code says what went wrong. An error that ends the session is followed by a close.session.close.session.going_away deadline passed (going_away). Open a new session.server_restart), or the session lost its reservation (session_expired). Reconnect.server_is_overloaded, websocket_connection_limit_reached, rate_limit_exceeded, idle_timeout or audio_backlog.inference_error). Reconnect.credit_balance_exhausted, model_not_found, invalid_api_key, forbidden).We sometimes have to end a live session, for example to move it off a model server or to restart our gateway. A session that opts in is told first, so it can move to a new session without losing audio.
going_away=1 on the connect URL.reason (model_pod_drain, gateway_shutdown or test) and deadline_s, the seconds until it is ended. A second event can follow if the deadline moves sooner.rotate_from=<old session id>&preroll_s=<seconds>. preroll_s is how much recent audio you will send again, up to 600; the grant, capped by the model, is preroll_s in its session.updated, and is 0 if the old session is not yours, is on another model, was already taken over, or ended more than 60 s ago (an ended session can be taken over only if it had opted in).preroll_s seconds at once, starting at a sample that is a multiple of align_samples counted from the old session's first sample; then send live audio to both sessions.words count from its first sample, so add the replay's offset). Use the old session's words through that run and the new session's after it, and close the old session. If no such run comes within about 20 s, or the old session closes first, switch anyway at the last word the old session gave; a word there can then be lost or repeated.going_away and closes with 1001. If there was too little time to tell it, it closes as a session that did not opt in would: 1012 for a gateway restart, 1014 for a model server.going_away_test_s=N (10 to 600): a test event comes N seconds into the session, and the session is closed with 1001 60 s later, like a real one.Usage is billed per second the session is connected. A session that rotates in also bills the pre-roll it sent ahead of real time. The session it took over is not billed for 60 s from the takeover if it was told by a real event (not a test one), so the overlap is billed once.
import asyncio
import base64
import json
import os
import wave
from websockets.asyncio.client import connect
URL = "wss://api.deepinfra.com/v1/realtime?model=nvidia/Nemo3-ASR-Streaming"
PACKET_SEC = 0.1
async def main() -> None:
with wave.open("speech.wav") as w: # 16-bit mono PCM
rate, pcm = w.getframerate(), w.readframes(w.getnframes())
packet = int(rate * PACKET_SEC) * 2
headers = {"Authorization": "Bearer " + os.environ["DEEPINFRA_API_KEY"]}
async with connect(URL, additional_headers=headers) as ws:
await ws.send(json.dumps({"type": "session.update", "session": {
"type": "transcription",
"audio": {"input": {"format": {"type": "audio/pcm", "rate": rate}}}}}))
async def send_audio() -> None:
for off in range(0, len(pcm), packet):
await ws.send(json.dumps({"type": "input_audio_buffer.append",
"audio": base64.b64encode(pcm[off:off + packet]).decode()}))
await asyncio.sleep(PACKET_SEC)
await ws.send(json.dumps({"type": "session.close"}))
sender = asyncio.create_task(send_audio())
async for raw in ws:
event = json.loads(raw)
if event["type"] == "conversation.item.input_audio_transcription.delta":
print("partial:", event.get("transcript") or event["delta"])
elif event["type"] == "conversation.item.input_audio_transcription.completed":
print("final:", event["transcript"])
elif event["type"] == "error":
print("error:", event["error"]["code"], event["error"]["message"])
await sender
asyncio.run(main())
partial: Welcome to our AI
partial: Welcome to our AI testing session.
final: Welcome to our AI testing session.
This session asks for a test session.going_away 10 seconds in. On the event, it opens a new session with a 10 s pre-roll, replays that audio, streams live audio to both sessions, joins on words and closes the old session. On a 150 s recording its transcript matched a session without rotation: 343 words each, none lost or repeated.
import asyncio
import base64
import json
import math
import os
import re
import wave
from websockets.asyncio.client import connect
from websockets.exceptions import ConnectionClosed
URL = "wss://api.deepinfra.com/v1/realtime?model=nvidia/Nemo3-ASR-Streaming&going_away=1"
PACKET_SEC = 0.1
PREROLL_S = 10
JOIN_WITHIN_S = 20 # no 3-word join by then: switch anyway
HEADERS = {"Authorization": "Bearer " + os.environ["DEEPINFRA_API_KEY"]}
def norm(word: str) -> str:
return re.sub(r"[^a-z0-9]", "", word.lower())
class Session:
async def open(self, query: str, rate: int) -> "Session":
self.ws = await connect(URL + query, additional_headers=HEADERS)
await self.ws.send(json.dumps({"type": "session.update", "session": {
"type": "transcription", "audio": {"input": {"format": {"type": "audio/pcm", "rate": rate}}}}}))
while (event := json.loads(await self.ws.recv()))["type"] != "session.updated":
pass
self.id = event["session"]["id"]
self.preroll_s = event["session"]["preroll_s"] # granted; may be 0
self.align = event["session"]["align_samples"] or 1
self.first = 0 # the sample of our audio that is this session's first sample
self.words = [] # (start, word), start in seconds on our audio's clock
self.shown = 0 # how many of self.words are printed
return self
async def send(self, pcm: bytes) -> None:
try:
await self.ws.send(json.dumps({"type": "input_audio_buffer.append",
"audio": base64.b64encode(pcm).decode()}))
except ConnectionClosed:
pass
def show(self, upto: int) -> None:
if upto > self.shown:
print("final:", " ".join(w for _, w in self.words[self.shown:upto]))
self.shown = upto
def join(old: Session, new: Session) -> tuple[int, int] | None:
"""The first 3 words both sessions agree on (same text, start within 1 s):
the end of that run in old.words and in new.words."""
for i in range(old.shown, len(old.words) - 2):
for j in range(len(new.words) - 2):
if all(norm(old.words[i + k][1]) == norm(new.words[j + k][1])
and abs(old.words[i + k][0] - new.words[j + k][0]) <= 1.0 for k in range(3)):
return i + 3, j + 3
return None
async def main() -> None:
with wave.open("speech.wav") as w: # 16-bit mono PCM
rate, pcm = w.getframerate(), w.readframes(w.getnframes())
step = int(rate * PACKET_SEC) * 2
# going_away_test_s=10: a test session.going_away 10 s in, to try the rotation.
state = {"cur": await Session().open("&going_away_test_s=10", rate), "new": None, "pos": 0}
async def switch(run: tuple[int, int] | None) -> None:
"""Print the old session's words through the join (all of them without one), make
the new session current, and close the old one."""
old, new = state["cur"], state["new"]
state["cur"], state["new"] = new, None
if run is None: # no join: a word at the switch can be lost or repeated
old.show(len(old.words))
last = old.words[-1][0] if old.words else 0.0
run = (old.shown, next((j for j, w in enumerate(new.words) if w[0] > last), len(new.words)))
print("switched without a join")
else:
print("joined")
old.show(run[0])
new.shown = run[1]
new.show(len(new.words))
await old.ws.close()
async def fallback(new: Session) -> None:
await asyncio.sleep(JOIN_WITHIN_S)
if state["new"] is new:
await switch(None)
async def read(s: Session) -> None:
async for raw in s.ws:
event = json.loads(raw)
if event["type"] == "session.going_away" and s is state["cur"] and not state["new"]:
print(f"going_away: {event['reason']}, {event['deadline_s']} s left")
new = await Session().open(f"&rotate_from={s.id}&preroll_s={PREROLL_S}", rate)
# Replay at most the granted pre-roll, starting on a multiple of
# align_samples counted from the old session's first sample.
back = max(state["pos"] // 2 - int(new.preroll_s * rate), s.first)
new.first = min(s.first + math.ceil((back - s.first) / s.align) * s.align, state["pos"] // 2)
off = new.first * 2
while off < state["pos"]: # catch up to the live position, then go live
await new.send(pcm[off:min(off + step, state["pos"])])
off = min(off + step, state["pos"])
state["new"] = new
asyncio.create_task(read(new))
asyncio.create_task(fallback(new))
elif event["type"] == "conversation.item.input_audio_transcription.completed":
words = [(w["start"] + s.first / rate, w["word"]) for w in event["words"]]
if not words and event["transcript"]: # the last item can come without words
words = [(s.words[-1][0] if s.words else s.first / rate, event["transcript"])]
s.words += words
if state["new"] is None:
state["cur"].show(len(state["cur"].words))
elif (run := join(state["cur"], state["new"])) is not None:
await switch(run) # old session's words through the run, new one's after it
if s is state["cur"] and state["new"] is not None: # the old session ended first
await switch(None)
asyncio.create_task(read(state["cur"]))
for off in range(0, len(pcm), step):
state["pos"] = min(off + step, len(pcm))
for s in filter(None, (state["cur"], state["new"])):
await s.send(pcm[off:state["pos"]])
await asyncio.sleep(PACKET_SEC)
for s in filter(None, (state["new"], state["cur"])): # a rotation still open: end it too
await s.ws.send(json.dumps({"type": "session.close"}))
await s.ws.wait_closed()
state["cur"].show(len(state["cur"].words))
asyncio.run(main())
...
final: Nor is Mr.
final: Quilter's
final: manner less interesting
going_away: test, 60 s left
joined
final: than his matter.
final: He
final: tells us that
...
© 2026 DeepInfra. All rights reserved.