Make your first streaming TTS API request
This quickstart walks through making your first streaming API request, which we recommend for realtime, low-latency applications. For batch audio generation, pre-rendered content, and anywhere latency isn’t critical, see Make a non-streaming request below.Create an API key
Create an Inworld account.In Inworld Portal, generate an API key by going to Settings > API Keys. Copy the Base64 credentials.
Set your API key as an environment variable.

Prepare your first streaming request
First, create a new file called For Python, you may also have to install
inworld_stream_quickstart.py for Python or inworld_stream_quickstart.js for JavaScript. Next, set your INWORLD_API_KEY as an environment variable. Finally, copy the following code into the file.For this streaming example, we’ll use Linear PCM format (instead of MP3), which we specify in the audio_config. We also include a Connection: keep-alive header to reuse the TCP+TLS connection across requests.The first request to the API may be slower due to the initial TCP and TLS handshake. Subsequent requests on the same connection will be faster. Use
Connection: keep-alive (and a persistent session in Python) to take advantage of connection reuse. See the low-latency examples in our API examples repo for more advanced techniques.requests if not already installed. For the JavaScript SDK, install @inworld/tts.Make a non-streaming request
The synchronous endpoint is the simplest way to try Inworld TTS and works well for batch audio generation, pre-rendered content, and anywhere latency isn’t critical. Assuming you’ve already set up your API key:Prepare your first request
For Python or JavaScript, create a new file called
inworld_quickstart.py or inworld_quickstart.js. Copy the corresponding code into the file. For a cURL request, copy the request.Next Steps
Now that you’ve tried out Inworld’s TTS API, you can explore more of Inworld’s TTS capabilities.TTS
Understand the capabilities of Inworld’s TTS models.
Voice Cloning
Create a personalized voice clone with just 5 seconds of audio.
Best Practices
Learn tips and tricks for synthesizing high-quality speech.