Soniox

Classes

Soniox Node SDK — Class Reference

SonioxNodeClient

Soniox Node Client

Example

import { SonioxNodeClient } from '@soniox/node';

// Default (US) region
const client = new SonioxNodeClient({ api_key: 'your-api-key' });

// EU region
const client = new SonioxNodeClient({ api_key: 'your-api-key', region: 'eu' });

// REST TTS
const audio = await client.tts.generate({
  text: 'Hello',
  voice: 'Adrian',
  language: 'en',
});

// WebSocket TTS
const stream = await client.realtime.tts({
  model: 'tts-rt-v1-preview',
  voice: 'Adrian',
  language: 'en',
  audio_format: 'wav',
});

Constructor

new SonioxNodeClient(options): SonioxNodeClient;

Parameters

ParameterType
optionsSonioxNodeClientOptions

Returns

SonioxNodeClient

Properties


SonioxFilesAPI

delete()

delete(file, signal?): Promise<void>;

Permanently deletes a file. This operation is idempotent - succeeds even if the file doesn't exist.

Parameters

ParameterTypeDescription
fileFileIdentifierThe UUID of the file or a SonioxFile instance
signal?AbortSignalOptional AbortSignal for cancellation

Returns

Promise<void>

Throws

SonioxHttpError On API errors (except 404)

Example

// Delete by ID
await client.files.delete('550e8400-e29b-41d4-a716-446655440000');

// Or delete a file instance
const file = await client.files.get('550e8400-e29b-41d4-a716-446655440000');
if (file) {
    await client.files.delete(file);
}

// Or just use the instance method
await file.delete();

delete_all()

delete_all(options): Promise<void>;

Permanently deletes all uploaded files. Iterates through all pages of files and deletes each one.

Parameters

ParameterTypeDescription
optionsDeleteAllFilesOptionsOptional signal and progress callback.

Returns

Promise<void>

The number of files deleted.

Throws

SonioxHttpError On API errors.

Throws

Error If the operation is aborted via signal.

Example

// Delete all files
await client.files.delete_all();
console.log(`Deleted all files.`);

// With cancellation
const controller = new AbortController();
await client.files.delete_all({ signal: controller.signal });

get()

get(file, signal?): Promise<SonioxFile | null>;

Retrieve metadata for an uploaded file.

Parameters

ParameterTypeDescription
fileFileIdentifierThe UUID of the file or a SonioxFile instance
signal?AbortSignalOptional AbortSignal for cancellation

Returns

Promise<SonioxFile | null>

The file instance, or null if not found

Throws

SonioxHttpError On API errors (except 404)

Example

const file = await client.files.get('550e8400-e29b-41d4-a716-446655440000');
if (file) {
    console.log(file.filename, file.size);
}

list()

list(options): Promise<FileListResult>;

Retrieves list of uploaded files

The returned result is async iterable - use for await...of

Parameters

ParameterTypeDescription
optionsListFilesOptionsOptional pagination and cancellation parameters

Returns

Promise<FileListResult>

FileListResult

Throws

SonioxHttpError

Example

const result = await client.files.list();

// Automatic paging - iterates through ALL files across all pages
for await (const file of result) {
    console.log(file.filename, file.size);
}

// Or access just the first page
for (const file of result.files) {
    console.log(file.filename);
}

// Check if there are more pages
if (result.isPaged()) {
    console.log('More pages available');
}

// Manual paging using cursor
const page1 = await client.files.list({ limit: 10 });
if (page1.next_page_cursor) {
    const page2 = await client.files.list({ cursor: page1.next_page_cursor });
}

// With cancellation
const controller = new AbortController();
const result = await client.files.list({ signal: controller.signal });

upload()

upload(file, options): Promise<SonioxFile>;

Uploads a file to Soniox for transcription

Parameters

ParameterTypeDescription
fileUploadFileInputBuffer, Uint8Array, Blob, or ReadableStream
optionsUploadFileOptionsUpload options

Returns

Promise<SonioxFile>

The uploaded file metadata

Throws

SonioxHttpError On API errors

Throws

Error On validation errors (file too large, invalid input)

Examples

import * as fs from 'node:fs';

const buffer = await fs.promises.readFile('/path/to/audio.mp3');
const file = await client.files.upload(buffer, { filename: 'audio.mp3' });
const file = await client.files.upload(Bun.file('/path/to/audio.mp3'));
const file = await client.files.upload(buffer, {
    filename: 'audio.mp3',
    client_reference_id: 'order-12345',
});
const controller = new AbortController();
setTimeout(() => controller.abort(), 30000);

const file = await client.files.upload(buffer, {
    filename: 'audio.mp3',
    signal: controller.signal,
});

SonioxSttApi

create()

create(options, signal?): Promise<SonioxTranscription>;

Creates a new transcription from audio_url or file_id

Parameters

ParameterTypeDescription
optionsCreateTranscriptionOptionsTranscription options including model and audio source.
signal?AbortSignal-

Returns

Promise<SonioxTranscription>

The created transcription.

Throws

SonioxHttpError On API errors.

Example

// Transcribe from URL
const transcription = await client.stt.create({
    model: 'stt-async-v4',
    audio_url: 'https://soniox.com/media/examples/coffee_shop.mp3',
});

// Transcribe from uploaded file
const file = await client.files.upload(buffer);
const transcription = await client.stt.create({
    model: 'stt-async-v4',
    file_id: file.id,
});

// With speaker diarization
const transcription = await client.stt.create({
    model: 'stt-async-v4',
    audio_url: 'https://soniox.com/media/examples/coffee_shop.mp3',
    enable_speaker_diarization: true,
});

delete()

delete(id, signal?): Promise<void>;

Permanently deletes a transcription. This operation is idempotent - succeeds even if the transcription doesn't exist.

Parameters

ParameterTypeDescription
idTranscriptionIdentifierThe UUID of the transcription or a SonioxTranscription instance
signal?AbortSignal-

Returns

Promise<void>

Throws

SonioxHttpError On API errors (except 404)

Example

// Delete by ID
await client.stt.delete('550e8400-e29b-41d4-a716-446655440000');

// Or delete a transcription instance
const transcription = await client.stt.get('550e8400-e29b-41d4-a716-446655440000');
if (transcription) {
    await client.stt.delete(transcription);
}

delete_all()

delete_all(options): Promise<void>;

Permanently deletes all transcriptions. Iterates through all pages of transcriptions and deletes each one.

Parameters

ParameterTypeDescription
optionsDeleteAllTranscriptionsOptionsOptional signal.

Returns

Promise<void>

Throws

SonioxHttpError On API errors.

Throws

Error If the operation is aborted via signal.

Example

// Delete all transcriptions
await client.stt.delete_all();
console.log(`Deleted all transcriptions.`);

// With cancellation
const controller = new AbortController();
await client.stt.delete_all({ signal: controller.signal });

destroy()

destroy(id): Promise<void>;

Permanently deletes a transcription and its associated file (if any). This operation is idempotent - succeeds even if resources don't exist.

Parameters

ParameterTypeDescription
idTranscriptionIdentifierThe UUID of the transcription or a SonioxTranscription instance

Returns

Promise<void>

Throws

SonioxHttpError On API errors (except 404)

Example

// Clean up both transcription and uploaded file
const transcription = await client.stt.transcribe({
    model: 'stt-async-v4',
    file: buffer,
    wait: true,
});
// ... use transcription ...
await client.stt.destroy(transcription); // Deletes both

// Or by ID
await client.stt.destroy('550e8400-e29b-41d4-a716-446655440000');

destroy_all()

destroy_all(options): Promise<void>;

Permanently deletes all transcriptions and their associated files. Iterates through all pages of transcriptions and calls destroy on each one, removing both the transcription and its uploaded file.

Parameters

ParameterTypeDescription
optionsDeleteAllTranscriptionsOptionsOptional signal and progress callback.

Returns

Promise<void>

The number of transcriptions destroyed.

Throws

SonioxHttpError On API errors.

Throws

Error If the operation is aborted via signal.

Example

// Destroy all transcriptions and their files
await client.stt.destroy_all();
console.log(`Destroyed all transcriptions and their files.`);

// With cancellation
const controller = new AbortController();
await client.stt.destroy_all({ signal: controller.signal });

get()

get(id, signal?): Promise<SonioxTranscription | null>;

Retrieves a transcription by ID

Parameters

ParameterTypeDescription
idTranscriptionIdentifierThe UUID of the transcription or a SonioxTranscription instance.
signal?AbortSignal-

Returns

Promise<SonioxTranscription | null>

The transcription, or null if not found.

Throws

SonioxHttpError On API errors (except 404).

Example

const transcription = await client.stt.get('550e8400-e29b-41d4-a716-446655440000');
if (transcription) {
    console.log(transcription.status, transcription.model);
}

getTranscript()

getTranscript(id, signal?): Promise<SonioxTranscript | null>;

Retrieves the full transcript text and tokens for a completed transcription. Only available for successfully completed transcriptions.

Parameters

ParameterTypeDescription
idTranscriptionIdentifierThe UUID of the transcription or a SonioxTranscription instance
signal?AbortSignal-

Returns

Promise<SonioxTranscript | null>

The transcript with text and detailed tokens, or null if not found

Throws

SonioxHttpError On API errors (except 404)

Example

const transcript = await client.stt.getTranscript('550e8400-e29b-41d4-a716-446655440000');
if (transcript) {
    console.log(transcript.text);
    for (const token of transcript.tokens) {
        console.log(token.text, token.start_ms, token.end_ms, token.confidence);
    }
}

list()

list(options, signal?): Promise<TranscriptionListResult>;

Retrieves list of transcriptions

The returned result is async iterable - use for await...of to iterate through all pages

Parameters

ParameterTypeDescription
optionsListTranscriptionsOptionsOptional pagination and filter parameters.
signal?AbortSignal-

Returns

Promise<TranscriptionListResult>

TranscriptionListResult with async iteration support.

Throws

SonioxHttpError On API errors.

Example

const result = await client.stt.list();

// Automatic paging - iterates through ALL transcriptions across all pages
for await (const transcription of result) {
    console.log(transcription.id, transcription.status);
}

// Or access just the first page
for (const transcription of result.transcriptions) {
    console.log(transcription.id);
}

// Check if there are more pages
if (result.isPaged()) {
    console.log('More pages available');
}

transcribe()

transcribe(options): Promise<SonioxTranscription>;

Unified transcribe method - supports direct file upload

When file is provided, uploads it first then creates a transcription When wait: true, waits for completion before returning When cleanup is specified (requires wait: true), cleans up resources after completion or on error/timeout

Parameters

ParameterTypeDescription
optionsTranscribeOptionsTranscribe options including model, audio source, and wait settings.

Returns

Promise<SonioxTranscription>

The transcription (completed if wait=true, otherwise in queued/processing state).

Throws

SonioxHttpError On API errors.

Throws

Error On validation errors or wait timeout.

Example

// Transcribe from URL and wait for completion
const result = await client.stt.transcribe({
    model: 'stt-async-v4',
    audio_url: 'https://soniox.com/media/examples/coffee_shop.mp3',
    wait: true,
});

// Upload file and transcribe in one call
const result = await client.stt.transcribe({
    model: 'stt-async-v4',
    file: buffer,  // or Blob, ReadableStream
    filename: 'meeting.mp3',
    enable_speaker_diarization: true,
    wait: true,
});

// With wait progress callback
const result = await client.stt.transcribe({
    model: 'stt-async-v4',
    file: buffer,
    wait: true,
    wait_options: {
        interval_ms: 2000,
        on_status_change: (status) => console.log(`Status: ${status}`),
    },
});

// Auto-cleanup uploaded file after transcription
const result = await client.stt.transcribe({
    model: 'stt-async-v4',
    file: buffer,
    wait: true,
    cleanup: ['file'], // Deletes uploaded file, keeps transcription record
});

// Auto-cleanup everything after transcription
const result = await client.stt.transcribe({
    model: 'stt-async-v4',
    file: buffer,
    wait: true,
    cleanup: ['file', 'transcription'], // Deletes both file and transcription record
});

transcribeFromFile()

transcribeFromFile(file, options): Promise<SonioxTranscription>;

Wrapper to transcribe from raw file data.

Parameters

ParameterTypeDescription
fileUploadFileInputBuffer, Uint8Array, Blob, or ReadableStream
optionsTranscribeFromFileOptionsTranscription options (excluding file)

Returns

Promise<SonioxTranscription>

The transcription (completed if wait=true, otherwise in queued/processing state).


transcribeFromFileId()

transcribeFromFileId(file_id, options): Promise<SonioxTranscription>;

Wrapper to transcribe from an uploaded file ID.

Parameters

ParameterTypeDescription
file_idstringID of a previously uploaded file
optionsTranscribeFromFileIdOptionsTranscription options (excluding file_id)

Returns

Promise<SonioxTranscription>

The transcription (completed if wait=true, otherwise in queued/processing state).


transcribeFromUrl()

transcribeFromUrl(audio_url, options): Promise<SonioxTranscription>;

Wrapper to transcribe from a URL.

Parameters

ParameterTypeDescription
audio_urlstringPublicly accessible audio URL
optionsTranscribeFromUrlOptionsTranscription options (excluding audio_url)

Returns

Promise<SonioxTranscription>

The transcription (completed if wait=true, otherwise in queued/processing state).


wait()

wait(id, options?): Promise<SonioxTranscription>;

Waits for a transcription to complete

Parameters

ParameterTypeDescription
idTranscriptionIdentifierThe UUID of the transcription or a SonioxTranscription instance.
options?WaitOptionsWait options including polling interval, timeout, and callbacks.

Returns

Promise<SonioxTranscription>

The completed or errored transcription.

Throws

Error If the wait times out or is aborted.

Throws

SonioxHttpError On API errors.

Example

const completed = await client.stt.wait('550e8400-e29b-41d4-a716-446655440000');

// With progress callback
const completed = await client.stt.wait('id', {
    interval_ms: 2000,
    on_status_change: (status) => console.log(`Status: ${status}`),
});

SonioxModelsAPI

list()

list(signal?): Promise<SonioxModel[]>;

List of available models and their attributes.

Parameters

ParameterTypeDescription
signal?AbortSignalOptional AbortSignal for cancellation

Returns

Promise<SonioxModel[]>

List of available models and their attributes.

See

https://soniox.com/docs/stt/api-reference/models/get_models


SonioxWebhooksAPI

Webhook utilities API accessible via client.webhooks

Provides methods for handling incoming Soniox webhook requests. When used via the client, results include lazy fetch helpers for transcripts.

getAuthFromEnv()

getAuthFromEnv(): WebhookAuthConfig | undefined;

Get webhook authentication configuration from environment variables.

Reads SONIOX_API_WEBHOOK_HEADER and SONIOX_API_WEBHOOK_SECRET environment variables. Returns undefined if either variable is not set (both are required for authentication).

Returns

WebhookAuthConfig | undefined


handle()

handle(options): WebhookHandlerResultWithFetch;

Framework-agnostic webhook handler

Parameters

ParameterType
optionsHandleWebhookOptions

Returns

WebhookHandlerResultWithFetch


handleExpress()

handleExpress(req, auth?): WebhookHandlerResultWithFetch;

Handle a webhook from an Express-like request

Parameters

Returns

WebhookHandlerResultWithFetch

Example

app.post('/webhook', async (req, res) => {
    const result = soniox.webhooks.handleExpress(req);

    if (result.ok && result.event.status === 'completed') {
        const transcript = await result.fetchTranscript();
        console.log(transcript?.text);
    }

    res.status(result.status).json({ received: true });
});

handleFastify()

handleFastify(req, auth?): WebhookHandlerResultWithFetch;

Handle a webhook from a Fastify request

Parameters

Returns

WebhookHandlerResultWithFetch


handleHono()

handleHono(c, auth?): Promise<WebhookHandlerResultWithFetch>;

Handle a webhook from a Hono context

Parameters

Returns

Promise<WebhookHandlerResultWithFetch>


handleNestJS()

handleNestJS(req, auth?): WebhookHandlerResultWithFetch;

Handle a webhook from a NestJS request

Parameters

Returns

WebhookHandlerResultWithFetch


handleRequest()

handleRequest(request, auth?): Promise<WebhookHandlerResultWithFetch>;

Handle a webhook from a Fetch API Request

Parameters

ParameterType
requestRequest
auth?WebhookAuthConfig

Returns

Promise<WebhookHandlerResultWithFetch>


isEvent()

isEvent(payload): payload is WebhookEvent;

Type guard to check if a value is a valid WebhookEvent

Parameters

ParameterType
payloadunknown

Returns

payload is WebhookEvent


parseEvent()

parseEvent(payload): WebhookEvent;

Parse and validate a webhook event payload

Parameters

ParameterType
payloadunknown

Returns

WebhookEvent


verifyAuth()

verifyAuth(headers, auth): boolean;

Verify webhook authentication header

Parameters

ParameterType
headersWebhookHeaders
authWebhookAuthConfig

Returns

boolean


SonioxAuthAPI

createTemporaryKey()

createTemporaryKey(request, signal?): Promise<TemporaryApiKeyResponse>;

Creates a temporary API key for client-side use.

Parameters

ParameterTypeDescription
requestTemporaryApiKeyRequestRequest parameters for the temporary key
signal?AbortSignalOptional AbortSignal for cancellation

Returns

Promise<TemporaryApiKeyResponse>

The temporary API key response

Example

const sttKey = await client.auth.createTemporaryKey({
  usage_type: 'transcribe_websocket',
  expires_in_seconds: 300,
});

const ttsKey = await client.auth.createTemporaryKey({
  usage_type: 'tts_rt',
  expires_in_seconds: 300,
});

SonioxRealtimeApi

Real-time API factory for creating STT sessions and TTS connections.

Examples

const session = client.realtime.stt({ model: 'stt-rt-v4' });
await session.connect();
const stream = await client.realtime.tts({
  model: 'tts-rt-v1-preview',
  voice: 'Adrian',
  language: 'en',
  audio_format: 'wav',
});
stream.sendText("Hello");
stream.finish();
for await (const chunk of stream) { ... }
const conn = await client.realtime.tts.multiStream();
const stream = await conn.stream({
  model: 'tts-rt-v1-preview',
  voice: 'Adrian',
  language: 'en',
  audio_format: 'wav',
});

stt()

stt(config, options?): RealtimeSttSession;

Create a new Speech-to-Text session.

config is shallow-merged on top of stt_defaults from the client options; caller-provided fields override the defaults.

Parameters

ParameterType
configSttSessionConfig
options?SttSessionOptions

Returns

RealtimeSttSession

Properties

PropertyType
ttsTtsFactory

SonioxFile

Uploaded file

Constructor

new SonioxFile(data, _http): SonioxFile;

Parameters

ParameterType
dataSonioxFileData
_httpHttpClient

Returns

SonioxFile

delete()

delete(signal?): Promise<void>;

Permanently deletes this file. This operation is idempotent - succeeds even if the file doesn't exist.

Parameters

ParameterTypeDescription
signal?AbortSignalOptional AbortSignal for cancellation

Returns

Promise<void>

Throws

SonioxHttpError On API errors (except 404)

Example

const file = await client.files.get('550e8400-e29b-41d4-a716-446655440000');
if (file) {
    await file.delete();
}

toJSON()

toJSON(): SonioxFileData;

Returns the raw data for this file.

Returns

SonioxFileData

Properties

PropertyType
client_reference_idstring | undefined
created_atstring
filenamestring
idstring
sizenumber

SonioxTranscription

A Transcription instance

Constructor

new SonioxTranscription(
   data, 
   _http, 
   transcript?): SonioxTranscription;

Parameters

ParameterType
dataSonioxTranscriptionData
_httpHttpClient
transcript?SonioxTranscript | null

Returns

SonioxTranscription

delete()

delete(): Promise<void>;

Permanently deletes this transcription. This operation is idempotent - succeeds even if the transcription doesn't exist.

Returns

Promise<void>

Throws

SonioxHttpError On API errors (except 404)

Example

const transcription = await client.stt.get('550e8400-e29b-41d4-a716-446655440000');
await transcription.delete();

destroy()

destroy(): Promise<void>;

Permanently deletes this transcription and its associated file (if any). This operation is idempotent - succeeds even if resources don't exist.

Returns

Promise<void>

Throws

SonioxHttpError On API errors (except 404)

Example

// Clean up both transcription and uploaded file
const transcription = await client.stt.transcribe({
    model: 'stt-async-v4',
    file: buffer,
    wait: true,
});
// ... use transcription ...
await transcription.destroy(); // Deletes both transcription and file

getTranscript()

getTranscript(options?): Promise<SonioxTranscript | null>;

Retrieves the full transcript text and tokens for this transcription. Only available for successfully completed transcriptions.

Returns cached transcript if available (when using transcribe() with wait: true). Use force: true to bypass the cache and fetch fresh data from the API.

Parameters

ParameterTypeDescription
options?{ force?: boolean; signal?: AbortSignal; }Optional settings
options.force?booleanIf true, bypasses cached transcript and fetches from API
options.signal?AbortSignalOptional AbortSignal for request cancellation

Returns

Promise<SonioxTranscript | null>

The transcript with text and detailed tokens, or null if not found.

Throws

SonioxHttpError On API errors (except 404).

Example

const transcription = await client.stt.get('550e8400-e29b-41d4-a716-446655440000');
if (transcription) {
    const transcript = await transcription.getTranscript();
    if (transcript) {
        console.log(transcript.text);
    }
}

// Force re-fetch from API
const freshTranscript = await transcription.getTranscript({ force: true });

refresh()

refresh(signal?): Promise<SonioxTranscription>;

Re-fetches this transcription to get the latest status.

Parameters

ParameterTypeDescription
signal?AbortSignalOptional AbortSignal for request cancellation.

Returns

Promise<SonioxTranscription>

A new SonioxTranscription instance with updated data.

Throws

SonioxHttpError

Example

let transcription = await client.stt.get('550e8400-e29b-41d4-a716-446655440000');
transcription = await transcription.refresh();
console.log(transcription.status);

toJSON()

toJSON(): SonioxTranscriptionData;

Returns the raw data for this transcription.

Returns

SonioxTranscriptionData


wait()

wait(options): Promise<SonioxTranscription>;

Waits for the transcription to complete or fail. Polls the API at the specified interval until the status is 'completed' or 'error'.

Parameters

ParameterTypeDescription
optionsWaitOptionsWait options including polling interval, timeout, and callbacks.

Returns

Promise<SonioxTranscription>

The completed or errored transcription.

Throws

Error If the wait times out or is aborted.

Throws

SonioxHttpError On API errors.

Example

const transcription = await client.stt.create({
    model: 'stt-async-v4',
    audio_url: 'https://soniox.com/media/examples/coffee_shop.mp3',
});

// Simple wait
const completed = await transcription.wait();

// Wait with progress callback
const completed = await transcription.wait({
    interval_ms: 2000,
    on_status_change: (status) => console.log(`Status: ${status}`),
});

Properties

PropertyTypeDescription
audio_duration_msnumber | null | undefinedDuration of the audio in milliseconds. Only available after processing begins.
audio_urlstring | null | undefinedURL of the audio file being transcribed.
client_reference_idstring | null | undefinedOptional tracking identifier.
context| TranscriptionContext | null | undefinedAdditional context provided for the transcription.
created_atstringUTC timestamp when the transcription was created.
enable_language_identificationbooleanWhen true, language is detected for each part of the transcription.
enable_speaker_diarizationbooleanWhen true, speakers are identified and separated in the transcription output.
error_messagestring | null | undefinedError message if transcription failed.
error_typestring | null | undefinedError type if transcription failed.
file_idstring | null | undefinedID of the uploaded file being transcribed.
filenamestringName of the file being transcribed.
idstringUnique identifier of the transcription.
language_hintsstring[] | undefinedExpected languages in the audio.
modelstringSpeech-to-text model used.
statusTranscriptionStatusCurrent status of the transcription.
transcriptSonioxTranscript | null | undefinedPre-fetched transcript. Only available when using transcribe() with wait: true, fetch_transcript !== false, and the transcription completed successfully
webhook_auth_header_namestring | null | undefinedName of the authentication header sent with webhook notifications.
webhook_auth_header_valuestring | null | undefinedAuthentication header value (masked).
webhook_status_codenumber | null | undefinedHTTP status code received when webhook was delivered.
webhook_urlstring | null | undefinedURL to receive webhook notifications.

SonioxTranscript

A Transcript result containing the transcribed text and tokens.

Constructor

new SonioxTranscript(data): SonioxTranscript;

Parameters

ParameterType
dataTranscriptResponse

Returns

SonioxTranscript

segments()

segments(options?): TranscriptSegment[];

Groups tokens into segments based on specified grouping keys.

A new segment starts when any of the group_by fields changes.

Parameters

ParameterTypeDescription
options?SegmentTranscriptOptionsSegmentation options

Returns

TranscriptSegment[]

Array of segments with combined text and timing

Example

const transcript = await transcription.getTranscript();

// Group by both speaker and language (default)
const segments = transcript.segments();

// Group by speaker only
const bySpeaker = transcript.segments({ group_by: ['speaker'] });

for (const s of segments) {
    console.log(`[Speaker ${s.speaker}] ${s.text}`);
}

Properties

PropertyTypeDescription
idstringUnique identifier of the transcription this transcript belongs to.
textstringComplete transcribed text content.
tokensTranscriptToken[]List of detailed token information with timestamps and metadata.

FileListResult

Result set for file listing

Constructor

new FileListResult(
   initialResponse, 
   _http, 
   _limit, 
   _signal): FileListResult;

Parameters

ParameterTypeDefault value
initialResponseListFilesResponse<SonioxFileData>undefined
_httpHttpClientundefined
_limitnumber | undefinedundefined
_signalAbortSignal | undefinedundefined

Returns

FileListResult

[asyncIterator]()

asyncIterator: AsyncIterator<SonioxFile>;

Async iterator that automatically fetches all pages Use with for await...of to iterate through all files

Returns

AsyncIterator<SonioxFile>


isPaged()

isPaged(): boolean;

Returns true if there are more pages of results beyond the first page

Returns

boolean


toJSON()

toJSON(): ListFilesResponse<SonioxFileData>;

Returns the raw data for this list result. Also used by JSON.stringify() to prevent serialization of internal HTTP client.

Returns

ListFilesResponse<SonioxFileData>

Properties

PropertyTypeDescription
filesSonioxFile[]Files from the first page of results
next_page_cursorstring | nullPagination cursor for the next page. Null if no more pages

TranscriptionListResult

Result set for transcription listing.

Constructor

new TranscriptionListResult(
   initialResponse, 
   _http, 
   _options, 
   _signal?): TranscriptionListResult;

Parameters

ParameterType
initialResponseListTranscriptionsResponse<SonioxTranscriptionData>
_httpHttpClient
_optionsListTranscriptionsOptions
_signal?AbortSignal

Returns

TranscriptionListResult

[asyncIterator]()

asyncIterator: AsyncIterator<SonioxTranscription>;

Async iterator that automatically fetches all pages. Use with for await...of to iterate through all transcriptions.

Returns

AsyncIterator<SonioxTranscription>


isPaged()

isPaged(): boolean;

Returns true if there are more pages of results beyond the first page.

Returns

boolean


toJSON()

toJSON(): ListTranscriptionsResponse<SonioxTranscriptionData>;

Returns the raw data for this list result

Returns

ListTranscriptionsResponse<SonioxTranscriptionData>

Properties

PropertyTypeDescription
next_page_cursorstring | nullPagination cursor for the next page. Null if no more pages.
transcriptionsSonioxTranscription[]Transcriptions from the first page of results.

RealtimeSttSession

Real-time Speech-to-Text session

Provides WebSocket-based streaming transcription with support for:

  • Event-based and async iterator consumption
  • Pause/resume with automatic keepalive while paused
  • AbortSignal cancellation

Example

const session = new RealtimeSttSession(apiKey, wsUrl, { model: 'stt-rt-v4' });

session.on('result', (result) => {
  console.log(result.tokens.map(t => t.text).join(''));
});

await session.connect();
session.sendAudio(audioChunk);
await session.finish();

paused

get paused(): boolean;

Whether the session is currently paused.

Returns

boolean


state

get state(): SttSessionState;

Current session state.

Returns

SttSessionState

Constructor

new RealtimeSttSession(
   apiKey, 
   wsBaseUrl, 
   config, 
   options?): RealtimeSttSession;

Parameters

ParameterType
apiKeystring
wsBaseUrlstring
configSttSessionConfig
options?SttSessionOptions

Returns

RealtimeSttSession

[asyncIterator]()

asyncIterator: AsyncIterator<RealtimeEvent>;

Async iterator for consuming events.

Returns

AsyncIterator<RealtimeEvent>


close()

close(): void;

Close (cancel) the session immediately without waiting

Returns

void


connect()

connect(): Promise<void>;

Connect to the Soniox WebSocket API.

Returns

Promise<void>

Throws

AbortError If aborted

Throws

ConnectionError If connection fails

Throws

StateError If already connected


finalize()

finalize(options?): void;

Requests the server to finalize current transcription

Parameters

ParameterType
options?{ trailing_silence_ms?: number; }
options.trailing_silence_ms?number

Returns

void


finish()

finish(): Promise<void>;

Gracefully finish the session

Returns

Promise<void>


keepAlive()

keepAlive(): void;

Send a keepalive message

Returns

void


off()

off<E>(event, handler): this;

Remove an event handler

Type Parameters

Type Parameter
E extends keyof SttSessionEvents

Parameters

ParameterType
eventE
handlerSttSessionEvents[E]

Returns

this


on()

on<E>(event, handler): this;

Register an event handler

Type Parameters

Type Parameter
E extends keyof SttSessionEvents

Parameters

ParameterType
eventE
handlerSttSessionEvents[E]

Returns

this


once()

once<E>(event, handler): this;

Register a one-time event handler

Type Parameters

Type Parameter
E extends keyof SttSessionEvents

Parameters

ParameterType
eventE
handlerSttSessionEvents[E]

Returns

this


pause()

pause(): void;

Pause audio transmission and starts automatic keepalive messages

Returns

void


resume()

resume(): void;

Resume audio transmission

Returns

void


sendAudio()

sendAudio(data): void;

Send audio data to the server

Parameters

ParameterTypeDescription
dataAudioDataAudio data as Uint8Array or ArrayBuffer

Returns

void

Throws

AbortError If aborted

Throws

StateError If not connected


sendStream()

sendStream(stream, options?): Promise<void>;

Stream audio data from an async iterable source.

Parameters

ParameterTypeDescription
streamAsyncIterable<AudioData>Async iterable yielding audio chunks
options?SendStreamOptionsOptional pacing and auto-finish settings

Returns

Promise<void>

Throws

AbortError If aborted during streaming

Throws

StateError If not connected


RealtimeSegmentBuffer

Rolling buffer for turning real-time results into stable segments.

size

get size(): number;

Number of tokens currently buffered.

Returns

number

Constructor

new RealtimeSegmentBuffer(options?): RealtimeSegmentBuffer;

Parameters

ParameterType
options?RealtimeSegmentBufferOptions

Returns

RealtimeSegmentBuffer

add()

add(result): RealtimeSegment[];

Add a real-time result and return stable segments.

Parameters

ParameterType
resultRealtimeResult

Returns

RealtimeSegment[]


flushAll()

flushAll(): RealtimeSegment[];

Flush all buffered tokens into segments and clear the buffer.

Includes tokens that are not yet stable by final_audio_proc_ms.

Returns

RealtimeSegment[]


reset()

reset(): void;

Clear all buffered tokens.

Returns

void


RealtimeUtteranceBuffer

Collects real-time results into utterances for endpoint-driven workflows.

Constructor

new RealtimeUtteranceBuffer(options?): RealtimeUtteranceBuffer;

Parameters

ParameterType
options?RealtimeUtteranceBufferOptions

Returns

RealtimeUtteranceBuffer

addResult()

addResult(result): RealtimeSegment[];

Add a real-time result and collect stable segments.

Parameters

ParameterType
resultRealtimeResult

Returns

RealtimeSegment[]


markEndpoint()

markEndpoint(): RealtimeUtterance | undefined;

Mark an endpoint and flush the current utterance.

Returns

RealtimeUtterance | undefined


reset()

reset(): void;

Clear buffered segments and tokens.

Returns

void


SonioxError

Extends

  • Error

Extended by

toJSON()

toJSON(): Record<string, unknown>;

Converts to a plain object for logging/serialization

Returns

Record<string, unknown>


toString()

toString(): string;

Creates a human-readable string representation

Returns

string

Properties

PropertyTypeDescription
causeunknownThe underlying error that caused this error, if any.
code| string & { } | SonioxErrorCodeError code describing the type of error. Typed as string at the base level to allow subclasses (e.g. HTTP errors) to use their own error code unions.
statusCodenumber | undefinedHTTP status code when applicable (e.g., 401 for auth errors, 500 for server errors).

SonioxHttpError

HTTP error class for all HTTP-related failures (REST API).

Thrown when HTTP requests fail due to network issues, timeouts, server errors, or response parsing failures.

Extends

toJSON()

toJSON(): Record<string, unknown>;

Converts to a plain object for logging/serialization

Returns

Record<string, unknown>

Overrides

SonioxError.toJSON


toString()

toString(): string;

Creates a human-readable string representation

Returns

string

Overrides

SonioxError.toString

Properties

PropertyTypeDescription
bodyTextstring | undefinedResponse body text, capped at 4KB (only for http_error/parse_error)
causeunknownThe underlying error that caused this error, if any.
codeHttpErrorCodeCategorized HTTP error code
headersRecord<string, string> | undefinedResponse headers (only for http_error)
methodHttpMethodHTTP method
statusCodenumber | undefinedHTTP status code when applicable (e.g., 401 for auth errors, 500 for server errors).
urlstringRequest URL

RealtimeError

Base error class for all real-time (WebSocket) SDK errors

Extends

Extended by

toJSON()

toJSON(): Record<string, unknown>;

Converts to a plain object for logging/serialization

Returns

Record<string, unknown>

Overrides

SonioxError.toJSON


toString()

toString(): string;

Creates a human-readable string representation

Returns

string

Overrides

SonioxError.toString

Properties

PropertyTypeDescription
causeunknownThe underlying error that caused this error, if any.
codeRealtimeErrorCodeReal-time error code
rawunknownOriginal response payload for debugging. Contains the raw WebSocket message that caused the error.
statusCodenumber | undefinedHTTP status code when applicable (e.g., 401 for auth errors, 500 for server errors).

AuthError

Authentication error (401). Thrown when the API key is invalid or expired.

Extends

toJSON()

toJSON(): Record<string, unknown>;

Converts to a plain object for logging/serialization

Returns

Record<string, unknown>

Inherited from

RealtimeError.toJSON


toString()

toString(): string;

Creates a human-readable string representation

Returns

string

Inherited from

RealtimeError.toString

Properties

PropertyTypeDescription
causeunknownThe underlying error that caused this error, if any.
codeRealtimeErrorCodeReal-time error code
rawunknownOriginal response payload for debugging. Contains the raw WebSocket message that caused the error.
statusCodenumber | undefinedHTTP status code when applicable (e.g., 401 for auth errors, 500 for server errors).

BadRequestError

Bad request error (400). Thrown for invalid configuration or parameters.

Extends

toJSON()

toJSON(): Record<string, unknown>;

Converts to a plain object for logging/serialization

Returns

Record<string, unknown>

Inherited from

RealtimeError.toJSON


toString()

toString(): string;

Creates a human-readable string representation

Returns

string

Inherited from

RealtimeError.toString

Properties

PropertyTypeDescription
causeunknownThe underlying error that caused this error, if any.
codeRealtimeErrorCodeReal-time error code
rawunknownOriginal response payload for debugging. Contains the raw WebSocket message that caused the error.
statusCodenumber | undefinedHTTP status code when applicable (e.g., 401 for auth errors, 500 for server errors).

QuotaError

Quota error (402, 429). Thrown when rate limits are exceeded or quota is exhausted.

Extends

toJSON()

toJSON(): Record<string, unknown>;

Converts to a plain object for logging/serialization

Returns

Record<string, unknown>

Inherited from

RealtimeError.toJSON


toString()

toString(): string;

Creates a human-readable string representation

Returns

string

Inherited from

RealtimeError.toString

Properties

PropertyTypeDescription
causeunknownThe underlying error that caused this error, if any.
codeRealtimeErrorCodeReal-time error code
rawunknownOriginal response payload for debugging. Contains the raw WebSocket message that caused the error.
statusCodenumber | undefinedHTTP status code when applicable (e.g., 401 for auth errors, 500 for server errors).

ConnectionError

Connection error. Thrown for WebSocket connection failures and transport errors.

Extends

toJSON()

toJSON(): Record<string, unknown>;

Converts to a plain object for logging/serialization

Returns

Record<string, unknown>

Inherited from

RealtimeError.toJSON


toString()

toString(): string;

Creates a human-readable string representation

Returns

string

Inherited from

RealtimeError.toString

Properties

PropertyTypeDescription
causeunknownThe underlying error that caused this error, if any.
codeRealtimeErrorCodeReal-time error code
rawunknownOriginal response payload for debugging. Contains the raw WebSocket message that caused the error.
statusCodenumber | undefinedHTTP status code when applicable (e.g., 401 for auth errors, 500 for server errors).

NetworkError

Network error. Thrown for server-side network issues (408, 500, 503).

Extends

toJSON()

toJSON(): Record<string, unknown>;

Converts to a plain object for logging/serialization

Returns

Record<string, unknown>

Inherited from

RealtimeError.toJSON


toString()

toString(): string;

Creates a human-readable string representation

Returns

string

Inherited from

RealtimeError.toString

Properties

PropertyTypeDescription
causeunknownThe underlying error that caused this error, if any.
codeRealtimeErrorCodeReal-time error code
rawunknownOriginal response payload for debugging. Contains the raw WebSocket message that caused the error.
statusCodenumber | undefinedHTTP status code when applicable (e.g., 401 for auth errors, 500 for server errors).

AbortError

Abort error. Thrown when an operation is cancelled via AbortSignal.

Extends

toJSON()

toJSON(): Record<string, unknown>;

Converts to a plain object for logging/serialization

Returns

Record<string, unknown>

Inherited from

RealtimeError.toJSON


toString()

toString(): string;

Creates a human-readable string representation

Returns

string

Inherited from

RealtimeError.toString

Properties

PropertyTypeDescription
causeunknownThe underlying error that caused this error, if any.
codeRealtimeErrorCodeReal-time error code
rawunknownOriginal response payload for debugging. Contains the raw WebSocket message that caused the error.
statusCodenumber | undefinedHTTP status code when applicable (e.g., 401 for auth errors, 500 for server errors).

StateError

State error. Thrown when an operation is attempted in an invalid state.

Extends

toJSON()

toJSON(): Record<string, unknown>;

Converts to a plain object for logging/serialization

Returns

Record<string, unknown>

Inherited from

RealtimeError.toJSON


toString()

toString(): string;

Creates a human-readable string representation

Returns

string

Inherited from

RealtimeError.toString

Properties

PropertyTypeDescription
causeunknownThe underlying error that caused this error, if any.
codeRealtimeErrorCodeReal-time error code
rawunknownOriginal response payload for debugging. Contains the raw WebSocket message that caused the error.
statusCodenumber | undefinedHTTP status code when applicable (e.g., 401 for auth errors, 500 for server errors).

RealtimeTtsConnection

WebSocket connection for real-time Text-to-Speech.

Supports up to 5 concurrent streams multiplexed by stream_id. The connection automatically sends keepalive messages while open.

Example

const conn = new RealtimeTtsConnection(apiKey, wsUrl, ttsDefaults);
await conn.connect();

const s1 = conn.stream({ model, voice, language, audio_format });
s1.sendText("Hello");
s1.finish();
for await (const chunk of s1) { ... }

conn.close();

Extends

isConnected

get isConnected(): boolean;

Whether the WebSocket is connected.

Returns

boolean

Constructor

new RealtimeTtsConnection(
   apiKey, 
   wsUrl, 
   ttsDefaults?, 
   options?): RealtimeTtsConnection;

Parameters

ParameterType
apiKeystring
wsUrlstring
ttsDefaults?Partial<TtsStreamConfig>
options?TtsConnectionOptions

Returns

RealtimeTtsConnection

Overrides

TypedEmitter<TtsConnectionEvents>.constructor

close()

close(): void;

Close the WebSocket connection and terminate all active streams.

Returns

void


connect()

connect(): Promise<void>;

Open the WebSocket connection and start keepalive. Called automatically by stream if not yet connected.

Returns

Promise<void>


emit()

emit<E>(event, ...args): void;

Emit an event to all registered handlers. Handler errors do not prevent other handlers from running. Errors are reported to an error event if present, otherwise rethrown async.

Type Parameters

Type Parameter
E extends keyof TtsConnectionEvents

Parameters

ParameterType
eventE
...argsParameters<TtsConnectionEvents[E]>

Returns

void

Inherited from

TypedEmitter.emit

off()

off<E>(event, handler): this;

Remove an event handler.

Type Parameters

Type Parameter
E extends keyof TtsConnectionEvents

Parameters

ParameterType
eventE
handlerTtsConnectionEvents[E]

Returns

this

Inherited from

TypedEmitter.off

on()

on<E>(event, handler): this;

Register an event handler.

Type Parameters

Type Parameter
E extends keyof TtsConnectionEvents

Parameters

ParameterType
eventE
handlerTtsConnectionEvents[E]

Returns

this

Inherited from

TypedEmitter.on

once()

once<E>(event, handler): this;

Register a one-time event handler.

Type Parameters

Type Parameter
E extends keyof TtsConnectionEvents

Parameters

ParameterType
eventE
handlerTtsConnectionEvents[E]

Returns

this

Inherited from

TypedEmitter.once

removeAllListeners()

removeAllListeners(event?): void;

Remove all event handlers.

Parameters

ParameterType
event?keyof TtsConnectionEvents

Returns

void

Inherited from

TypedEmitter.removeAllListeners

stream()

stream(input?): Promise<RealtimeTtsStream>;

Open a new TTS stream on this connection. Auto-connects if the WebSocket is not yet open.

Parameters

ParameterTypeDescription
input?TtsStreamInputStream configuration (merged with tts_defaults)

Returns

Promise<RealtimeTtsStream>

A ready-to-use stream handle


RealtimeTtsStream

Handle for one TTS stream on a WebSocket connection.

Emits typed events and supports async iteration over decoded audio chunks.

Examples

stream.on('audio', (chunk) => process(chunk));
stream.on('terminated', () => console.log('done'));
stream.sendText("Hello world");
stream.finish();
stream.sendText("Hello world");
stream.finish();
for await (const chunk of stream) {
  process(chunk);
}

Extends

state

get state(): TtsStreamState;

Current stream lifecycle state.

Returns

TtsStreamState

[asyncIterator]()

asyncIterator: AsyncIterator<Uint8Array<ArrayBufferLike>>;

Async iterator that yields decoded audio chunks.

Returns

AsyncIterator<Uint8Array<ArrayBufferLike>>


cancel()

cancel(): void;

Cancel this stream. The server will stop generating and send terminated.

Returns

void


close()

close(): void;

Close this stream. For single-stream usage (created via tts(input)), also closes the underlying WebSocket connection.

Returns

void


emit()

emit<E>(event, ...args): void;

Emit an event to all registered handlers. Handler errors do not prevent other handlers from running. Errors are reported to an error event if present, otherwise rethrown async.

Type Parameters

Type Parameter
E extends keyof TtsStreamEvents

Parameters

ParameterType
eventE
...argsParameters<TtsStreamEvents[E]>

Returns

void

Inherited from

TypedEmitter.emit

finish()

finish(): void;

Signal that no more text will be sent for this stream. The server will finish generating audio and send terminated.

Returns

void


off()

off<E>(event, handler): this;

Remove an event handler.

Type Parameters

Type Parameter
E extends keyof TtsStreamEvents

Parameters

ParameterType
eventE
handlerTtsStreamEvents[E]

Returns

this

Inherited from

TypedEmitter.off

on()

on<E>(event, handler): this;

Register an event handler.

Type Parameters

Type Parameter
E extends keyof TtsStreamEvents

Parameters

ParameterType
eventE
handlerTtsStreamEvents[E]

Returns

this

Inherited from

TypedEmitter.on

once()

once<E>(event, handler): this;

Register a one-time event handler.

Type Parameters

Type Parameter
E extends keyof TtsStreamEvents

Parameters

ParameterType
eventE
handlerTtsStreamEvents[E]

Returns

this

Inherited from

TypedEmitter.once

removeAllListeners()

removeAllListeners(event?): void;

Remove all event handlers.

Parameters

ParameterType
event?keyof TtsStreamEvents

Returns

void

Inherited from

TypedEmitter.removeAllListeners

sendStream()

sendStream(source): Promise<void>;

Pipe an async iterable of text chunks into the stream. Automatically calls finish when the iterable completes.

Designed for concurrent use: call sendStream() and consume audio via for await or events simultaneously.

Parameters

ParameterType
sourceAsyncIterable<string>

Returns

Promise<void>

Example

stream.sendStream(llmTokenStream);
for await (const audio of stream) { forward(audio); }

sendText()

sendText(text, options?): void;

Send one text chunk to the TTS stream.

Parameters

ParameterTypeDescription
textstringText to synthesize
options?{ end?: boolean; }-
options.end?booleanIf true, signals this is the final text chunk

Returns

void

Properties

PropertyType
streamIdstring

SonioxTtsApi

REST API for Text-to-Speech generation and TTS model listing.

Accessed via client.tts on SonioxNodeClient.

Inherits browser-safe generate() and generateStream() from TtsRestClient in @soniox/core, and adds Node-specific methods generateToFile() and listModels().

Extends

  • TtsRestClient

Constructor

new SonioxTtsApi(
   apiKey, 
   ttsApiUrl, 
   http): SonioxTtsApi;

Parameters

ParameterType
apiKeystring
ttsApiUrlstring
httpHttpClient

Returns

SonioxTtsApi

Overrides

TtsRestClient.constructor

generate()

generate(options): Promise<Uint8Array<ArrayBufferLike>>;

Generate speech audio from text. Returns the full audio as a Uint8Array.

Parameters

ParameterType
optionsGenerateSpeechOptions

Returns

Promise<Uint8Array<ArrayBufferLike>>

Throws

SonioxHttpError on non-2xx responses, network failures, or aborted requests.

Inherited from

TtsRestClient.generate

generateStream()

generateStream(options): AsyncIterable<Uint8Array<ArrayBufferLike>>;

Generate speech audio from text as a streaming async iterable.

Yields Uint8Array chunks as they arrive from the server response body. Lower time-to-first-audio than generate.

Known limitation: Mid-stream server errors (reported via HTTP trailers) cannot be detected through the fetch API. The iterator may end early without an explicit error. Use WebSocket TTS for reliable error detection.

Parameters

ParameterType
optionsGenerateSpeechOptions

Returns

AsyncIterable<Uint8Array<ArrayBufferLike>>

Throws

SonioxHttpError on non-2xx responses, network failures, or aborted requests (before the stream starts).

Inherited from

TtsRestClient.generateStream

generateToFile()

generateToFile(output, options): Promise<number>;

Generate speech audio and write to a file or writable stream.

Parameters

ParameterTypeDescription
outputstring | WritableStream<Uint8Array<ArrayBufferLike>>File path (string) or a WritableStream<Uint8Array>
optionsGenerateSpeechOptionsGeneration options

Returns

Promise<number>

Number of bytes written

Examples

const bytes = await client.tts.generateToFile('output.wav', {
  text: 'Hello world',
  voice: 'Adrian',
  language: 'en',
});
const bytes = await client.tts.generateToFile(writableStream, {
  text: 'Hello world',
  voice: 'Adrian',
  language: 'en',
});

listModels()

listModels(signal?): Promise<TtsModel[]>;

List available TTS models and their voices.

Parameters

ParameterType
signal?AbortSignal

Returns

Promise<TtsModel[]>

Example

const models = await client.tts.listModels();
for (const model of models) {
  console.log(model.id, model.voices.map(v => v.id));
}

On this page

SonioxNodeClient
Example
Constructor
Properties
SonioxFilesAPI
delete()
delete_all()
get()
list()
upload()
SonioxSttApi
create()
delete()
delete_all()
destroy()
destroy_all()
get()
getTranscript()
list()
transcribe()
transcribeFromFile()
transcribeFromFileId()
transcribeFromUrl()
wait()
SonioxModelsAPI
list()
SonioxWebhooksAPI
getAuthFromEnv()
handle()
handleExpress()
handleFastify()
handleHono()
handleNestJS()
handleRequest()
isEvent()
parseEvent()
verifyAuth()
SonioxAuthAPI
createTemporaryKey()
SonioxRealtimeApi
Examples
stt()
Properties
SonioxFile
Constructor
delete()
toJSON()
Properties
SonioxTranscription
Constructor
delete()
destroy()
getTranscript()
refresh()
toJSON()
wait()
Properties
SonioxTranscript
Constructor
segments()
Properties
FileListResult
Constructor
[asyncIterator]()
isPaged()
toJSON()
Properties
TranscriptionListResult
Constructor
[asyncIterator]()
isPaged()
toJSON()
Properties
RealtimeSttSession
Example
paused
state
Constructor
[asyncIterator]()
close()
connect()
finalize()
finish()
keepAlive()
off()
on()
once()
pause()
resume()
sendAudio()
sendStream()
RealtimeSegmentBuffer
size
Constructor
add()
flushAll()
reset()
RealtimeUtteranceBuffer
Constructor
addResult()
markEndpoint()
reset()
SonioxError
Extends
Extended by
toJSON()
toString()
Properties
SonioxHttpError
Extends
toJSON()
toString()
Properties
RealtimeError
Extends
Extended by
toJSON()
toString()
Properties
AuthError
Extends
toJSON()
toString()
Properties
BadRequestError
Extends
toJSON()
toString()
Properties
QuotaError
Extends
toJSON()
toString()
Properties
ConnectionError
Extends
toJSON()
toString()
Properties
NetworkError
Extends
toJSON()
toString()
Properties
AbortError
Extends
toJSON()
toString()
Properties
StateError
Extends
toJSON()
toString()
Properties
RealtimeTtsConnection
Example
Extends
isConnected
Constructor
close()
connect()
emit()
off()
on()
once()
removeAllListeners()
stream()
RealtimeTtsStream
Examples
Extends
state
[asyncIterator]()
cancel()
close()
emit()
finish()
off()
on()
once()
removeAllListeners()
sendStream()
sendText()
Properties
SonioxTtsApi
Extends
Constructor
generate()
generateStream()
generateToFile()
listModels()