CreateTtsRequestBody - TypeScript SDK

CreateTtsRequestBody type definition

The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

Text-to-speech request input

Example Usage

1import { CreateTtsRequestBody } from "@openrouter/sdk/models/operations";
2
3let value: CreateTtsRequestBody = {
4 input: "Hello world",
5 model: "elevenlabs/eleven-turbo-v2",
6 voice: "alloy",
7};

Fields

FieldTypeRequiredDescriptionExample
inputstring✔️Text to synthesizeHello world
modelstring✔️TTS model identifierelevenlabs/eleven-turbo-v2
provideroperations.ProviderProvider-specific passthrough configuration
responseFormatoperations.ResponseFormatAudio output formatpcm
speednumberPlayback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers.1
voicestring✔️Voice identifieralloy