Skip to main content

Inworld TTS

InworldTTS targets the Inworld TTS HTTP endpoint (POST https://api.inworld.ai/tts/v1/voice:stream). The response is NDJSON — one JSON object per line of the form {"result": {"audioContent": "<base64>", "timestampInfo": ...}} — and the provider yields the base64-decoded audio chunks as they arrive. The default model is inworld-tts-2 (sub-200 ms time-to-first-audio, 100+ languages with mid-utterance switching, natural-language voice steering). Pass model="inworld-tts-1.5-max" to fall back to the prior generation when you need temperature control. The default audio output is PCM_S16LE @ 16 kHz so chunks drop straight into the Patter pipeline without transcoding.

Install

The getpatter[inworld] extra adds aiohttp>=3.10 for streaming the NDJSON body. (TypeScript uses native fetch and needs no extra dependency.)

Authentication

The Inworld dashboard issues a Base64 token that is already in the form expected by the Authorization: Basic <token> header — paste it into INWORLD_API_KEY as-is. Do not re-encode it.If you only have the raw API key string, base64-encode "<api_key>:" (note the trailing colon) yourself before passing it in.

Usage

Plug it into an agent:

Customising delivery mode (TTS-2)

deliveryMode controls how expressive the TTS-2 voice is. Use EXPRESSIVE for warm conversational agents, STABLE when you want consistent, predictable prosody (e.g. for IVR-style read-backs), and BALANCED for the middle ground.
deliveryMode is TTS-2 only — it is silently ignored by the TTS-1.5 family. Conversely temperature is TTS-1.5 only and ignored by TTS-2.

Switching to TTS-1.5 for temperature control

When you need sampling-temperature control (e.g. for more variation across multi-turn conversations), drop down to inworld-tts-1.5-max:

Models

Options

Low-level usage

If you want the streaming generator without going through the pipeline-mode wrapper:

Pricing

The default rate in pricing.py is $0.020 / 1k characters for inworld-tts-2, with $0.025 / 1k for the TTS-1.5 family. These are placeholder defaults — verify against your current Inworld platform tier and override per-project via Patter(pricing={...}) if needed.