Docs
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
Class References
Function References
Interface References
Type Alias References
Variable References

TTSOptions

Interface: TTSOptions<TProviderOptions>

Defined in: packages/typescript/ai/src/types.ts:1598

Options for text-to-speech generation. These are the common options supported across providers.

Type Parameters

TProviderOptions

TProviderOptions extends object = object

Properties

format?

ts
optional format: "mp3" | "opus" | "aac" | "flac" | "wav" | "pcm";
optional format: "mp3" | "opus" | "aac" | "flac" | "wav" | "pcm";

Defined in: packages/typescript/ai/src/types.ts:1606

The output audio format


logger

ts
logger: InternalLogger;
logger: InternalLogger;

Defined in: packages/typescript/ai/src/types.ts:1616

Internal logger threaded from the generateSpeech() entry point. Adapters must call logger.request() before the SDK call and logger.errors() in catch blocks.


model

ts
model: string;
model: string;

Defined in: packages/typescript/ai/src/types.ts:1600

The model to use for TTS generation


modelOptions?

ts
optional modelOptions: TProviderOptions;
optional modelOptions: TProviderOptions;

Defined in: packages/typescript/ai/src/types.ts:1610

Model-specific options for TTS generation


speed?

ts
optional speed: number;
optional speed: number;

Defined in: packages/typescript/ai/src/types.ts:1608

The speed of the generated audio (0.25 to 4.0)


text

ts
text: string;
text: string;

Defined in: packages/typescript/ai/src/types.ts:1602

The text to convert to speech


voice?

ts
optional voice: string;
optional voice: string;

Defined in: packages/typescript/ai/src/types.ts:1604

The voice to use for generation