Speech to text realtime

nemotron-3.5-asr-streaming-0.6b

Live speech-to-text. WebSocket only. $0.00333 / min plus the $0.05 request fee.

Native stream: PCM16 mono at 8000 or 16000 Hz on wss://api.pascalai.co/v1/speech-to-text/realtime. Default 16000 Hz.. Live price and availability are on GET /v1/models/nemotron-3.5-asr-streaming-0.6b.

  • A session is charged $0.05 plus connected time at $0.00333 per minute.
  • A session runs for up to 5 hours.
  • The transcript is returned on the socket.

Parameters

FieldTypeDescription
session.language
Default auto
stringauto detects the language. An ISO 639-1 or BCP-47 code selects it, such as en or en-US.
session.sample_rate
Default 16000
integer8000 or 16000. Omit it and the rate is 16000 Hz. The bytes have to already be that rate. A live frame has no header, so a mismatch is still accepted and the transcript can come out degraded.
session.chunk_ms
Default 160
integerThe session runs at 160 ms. The first caption arrives after about 1.2 seconds of speech.
session.endpointing
Default silence
stringsilence or manual. silence commits after stop_history_eou_ms of quiet audio. manual commits the turn when the client sends session.commit.
session.stop_history_eou_ms
Default 3200
integer200 to 10000. Silence, in milliseconds, that ends a turn when endpointing is silence.
session.speech_contextstringUp to 500 characters. A phrase to boost, such as a name or a product term.
session.speech_context_boost
Default 10
number0 to 20. When speech_context is set and this field is omitted, the boost is 10.
session.profanity_filter
Default false
booleanMask profanity in the transcript.

Example

const socket = new WebSocket(
  'wss://api.pascalai.co/v1/speech-to-text/realtime?model=nemotron-3.5-asr-streaming-0.6b&api_key=' + key
);
socket.binaryType = 'arraybuffer';
socket.onopen = () => {
  socket.send(JSON.stringify({
    type: 'session.update',
    session: {
      language: 'auto',
    },
  }));
};
// binary Int16 PCM16 mono frames at 8000 or 16000 Hz
socket.send(JSON.stringify({ type: 'session.close' }));