Speech
Create speech (OpenAI-compatible)
Generate audio from text in OpenAI's text-to-speech format
/v1/audio/speechGenerates audio from text in the format of OpenAI's /v1/audio/speech endpoint, so the OpenAI SDKs work against Inworld once the base URL, API key, model, and voice point at it. See OpenAI Compatibility for SDK examples, audio formats, and streaming.
Authorizationstringrequired
Your authentication credentials. Pass your API key as a Bearer token: Bearer $INWORLD_API_KEY. The OpenAI SDKs send the key this way.
modelstringrequired
An Inworld model ID. See Models. OpenAI model names such as tts-1 are rejected.
inputstringrequired
The text to synthesize, up to 4,000 characters. Inline markup such as steering tags and pause controls is supported.
voicestringrequired
An Inworld voice ID, or the ID of one of your custom voices. Voice IDs are case-sensitive. OpenAI voice names such as alloy are not available.
response_formatenum<string>default: "mp3"
The audio format. mp3, opus, flac, and wav are 48 kHz mono. pcm is raw 16-bit signed little-endian mono samples at 24 kHz, with no header. aac is not supported.
Available options:mp3opusflacwavpcm
speednumberdefault: 1
The speaking rate. Values outside 0.5 to 1.5 are rejected.
instructionsstring
A natural-language steering instruction for the whole request. Supported on inworld-tts-2 only; other models ignore it.
stream_formatenum<string>default: "audio"
audio streams raw audio bytes. sse streams server-sent events.
Available options:audiosse