---
title: "What is text-to-speech (TTS)? How speech APIs work | BroadRouter"
description: "Text-to-speech turns written text into spoken audio. How TTS APIs work, what SSML controls, output formats, and why BroadNet offers speech-to-text but not TTS."
url: https://broadrouter.com/glossary/text-to-speech/
lang: en
updated: 2026-11-15
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# Text-to-speech (TTS)

Updated 2026-11-15

Text-to-speech (TTS), or speech synthesis, converts written text into spoken audio. A TTS API takes text, a voice and an output format such as MP3 or WAV, and returns generated speech. It is the reverse of speech-to-text, which turns audio into text.

Also called: TTS, text to speech, speech synthesis

Speech-to-text listens. Text-to-speech talks back. Voice assistants need both.

## How it works

A TTS API takes three things: the text, a voice, and an audio format. This is the shape of the Python example in OpenAI’s guide:

```python
from openai import OpenAI
client = OpenAI()
with client.audio.speech.with_streaming_response.create(
    model="gpt-4o-mini-tts",
    voice="coral",
    input="Today is a wonderful day to build something people love!",
    instructions="Speak in a cheerful and positive tone.",
) as response:
    response.stream_to_file("speech.mp3")
```

Its guide documents the `/v1/audio/speech` endpoint, 13 built-in voices, and output formats MP3 (default), Opus, AAC, FLAC, WAV and PCM, where PCM is raw 24 kHz 16-bit samples with no header. It supports streaming with chunked transfer encoding, so playback can start before the file is finished, and recommends WAV or PCM for the fastest responses. The guide also marks `tts-1`, `tts-1-hd` and `gpt-4o-mini-tts` as deprecated, with shutdown on 6 January 2027. Check the current model list before you build on one.

Many engines also accept SSML, the W3C’s XML markup for synthesis. The root `<speak>` element declares `version="1.1"` and `xml:lang`. Other elements include `<break>` for pauses, `<say-as>` to mark dates or numbers, `<phoneme>` for an exact pronunciation (for example in IPA) and `<lang>` for a phrase in another language:

```xml
<speak version="1.1" xml:lang="en-US">
  Pasta should be cooked <lang xml:lang="it">al dente</lang>.
  <break/> Enjoy your meal.
</speak>
```

## Why it matters

-   **Voice products are pipelines.** A voice bot is [speech-to-text](https://broadrouter.com/glossary/speech-to-text/), then a chat model, then TTS. Each step adds [latency](https://broadrouter.com/glossary/latency/) and cost, and each can be a different provider.
-   **Format choice.** The output format decides size and playback support. WhatsApp, for example, plays [Ogg Opus](https://broadrouter.com/glossary/ogg-opus/) voice notes.
-   **Disclosure.** OpenAI requires telling end users that a TTS voice is AI-generated.

## On BroadNet Inference

BroadNet does not offer text-to-speech. Its API reference documents only `POST /v1/chat/completions` and `POST /v1/audio/transcriptions`. It offers the other direction: [BroadNet Transcribe Arabic](https://broadrouter.com/models/cohere-transcribe-arabic/) and [BroadNet Transcribe](https://broadrouter.com/models/cohere-transcribe/) turn WAV or MP3 audio into text, at $0.0042 and $0.002 per minute. BroadNet also offers no live or real-time voice.

If your product must speak, pair BroadNet transcription and chat with a separate TTS provider. [Text, speech and vision](https://broadrouter.com/blog/text-speech-vision/) maps which jobs BroadNet covers and where you need another service, and the [WhatsApp chatbot architecture](https://broadrouter.com/blog/arabic-whatsapp-chatbot-architecture/) post shows the voice-note side of the pipeline.

## Common mistakes

-   **Confusing TTS with STT.** Speech-to-text APIs do not generate audio. Check the endpoint list, not just the word “speech”.
-   **Assuming SSML works everywhere.** Many APIs accept only plain text or a subset of SSML.

## Questions

### Does BroadNet Inference offer text-to-speech?

No. BroadNet documents two endpoints, chat completions and audio transcription. There is no /v1/audio/speech. Use a separate TTS provider if your app must speak.

### What is SSML?

Speech Synthesis Markup Language, a W3C Recommendation (version 1.1, 2010). It is XML that controls pronunciation, pauses, pitch, rate and language switches in synthesized speech. Support varies by TTS provider.

### Do I have to tell users a voice is AI-generated?

OpenAI's usage policies, as quoted in its TTS guide, require a clear disclosure that the voice is AI-generated. Check your own provider's terms and local law.

## See also

-   [Speech-to-text](https://broadrouter.com/glossary/speech-to-text/) (term)
-   [Multimodal AI](https://broadrouter.com/glossary/multimodal/) (term)
-   [Ogg Opus](https://broadrouter.com/glossary/ogg-opus/) (term)
-   [WAV](https://broadrouter.com/glossary/wav/) (term)
-   [Streaming](https://broadrouter.com/glossary/streaming/) (term)
-   [Text, speech or vision? Start with the task](https://broadrouter.com/blog/text-speech-vision/) (article)
-   [Arabic WhatsApp chatbot architecture: voice notes to replies](https://broadrouter.com/blog/arabic-whatsapp-chatbot-architecture/) (article)

Try it on your real workload. New accounts start with $5 of credit for Gemma and transcription. DeepSeek, GLM and Qwen3.8 need a top-up.

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=glossary-text-to-speech&utm_content=page-cta) ·

**Sources**

-   [OpenAI API docs, text to speech guide: /v1/audio/speech, voices, output formats, disclosure rule (checked 2026-11-15)](https://developers.openai.com/api/docs/guides/text-to-speech)
-   [W3C, Speech Synthesis Markup Language (SSML) Version 1.1, Recommendation (checked 2026-11-15)](https://www.w3.org/TR/speech-synthesis11/)
-   [BroadNet Inference API reference: chat completions and audio transcription endpoints (checked 2026-11-15)](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=glossary-text-to-speech&utm_content=sources)
