Soniox

Full Node SDK reference

Full SDK reference for the Node SDK

Environment variables

Environment variables are used to configure the client. You can set them in your environment or pass them explicitly to the client.

VariableDescriptionDefault
SONIOX_API_KEYAPI key for REST requests-
SONIOX_API_BASE_URLREST base URLhttps://api.soniox.com
SONIOX_WS_URLReal-time WebSocket base URLwss://stt-rt.soniox.com/transcribe-websocket
SONIOX_API_WEBHOOK_HEADERWebhook auth header name-
SONIOX_API_WEBHOOK_SECRETWebhook auth header value-

Client

Available client methods

MethodDescription
client.files.upload(file, options)Upload file
client.files.list(options)List files
client.files.get(id)Get file
client.files.delete(id)Delete file
client.files.delete_all()Delete all files
------
client.stt.create(options)Create transcription
client.stt.list(options)List transcriptions
client.stt.get(id)Get transcription
client.stt.getTranscript(id)Get transcription transcript
client.stt.delete(id)Delete transcription
client.stt.destroy(id)Delete transcription and its file
client.stt.wait(id)Wait for transcription to complete
client.stt.transcribe(options)Transcribe audio
client.stt.transcribeFromUrl(url, options)Transcribe audio from URL
client.stt.transcribeFromFile(file, options)Transcribe audio from file
client.stt.transcribeFromFileId(id, options)Transcribe audio from file ID
client.stt.delete_all()Delete all transcriptions
client.stt.destroy_all()Delete all transcriptions and their files
------
client.models.list()List available models
------
client.webhooks.handle(options)Handle webhook
client.webhooks.handleRequest(request, options)Handle webhook with Fetch API
client.webhooks.handleExpress(req, options)Handle webhook with Express
client.webhooks.handleFastify(req, options)Handle webhook with Fastify
client.webhooks.handleNestJS(req, options)Handle webhook with NestJS
client.webhooks.handleHono(c, options)Handle webhook with Hono
client.webhooks.getAuthFromEnv()Get webhook auth from environment variables
client.webhooks.verifyAuth(headers, auth)Verify webhook auth
client.webhooks.parseEvent(body)Parse webhook event
client.webhooks.isEvent(body)Check if body is a webhook event
------
client.auth.createTemporaryKey(options)Create temporary API key
------
client.realtime.stt(options)Create real-time session

File

Available file instance methods

MethodDescription
file.delete()Delete file

Transcription

Available transcription instance methods

MethodDescription
transcription.getTranscript()Get transcription transcript
transcription.delete()Delete transcription
transcription.destroy()Delete transcription and its file
transcription.wait()Wait for transcription to complete
transcription.refresh()Refresh transcription

Transcript

MethodDescription
transcript.segments()Get transcript segments
transcript.textTranscript text
transcript.tokensTranscript tokens

Real-time STT Session

MethodDescription
realtime.stt.connect()Establish websocket connection
realtime.stt.close()Close websocket connection
realtime.stt.finalize()Request server to finalize current transcription
realtime.stt.finish()Gracefully finish the session
realtime.stt.keepAlive()Send keepalive message
realtime.stt.off()Remove event handler
realtime.stt.on()Register event handler
realtime.stt.once()Register one-time event handler
realtime.stt.sendAudio(audio)Send audio chunk
realtime.stt.sendStream(stream, options)Send audio stream
realtime.stt.pause()Pause audio transmission
realtime.stt.resume()Resume audio transmission
realtime.stt.pausedWhether the session is currently paused
realtime.stt.stateCurrent session state