> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bland.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate to Bland Speech

> Move an existing TTS integration to Bland's realtime WebSocket, HTTP, or OpenAI-compatible endpoint.

Choose the Bland endpoint that matches your application:

| Input shape | Use |
| - | - |
| LLM tokens or partial text, multi-turn conversation, interruptions | [`WSS /v2/tts/ws`](https://docs.bland.ai/api-v2/post/tts-ws) |
| Existing OpenAI `/audio/speech` client or SDK | [`POST /v2/audio/speech`](https://docs.bland.ai/api-v2/post/audio-speech) |
| Complete text available up front, downloadable or batch audio | [`POST /v2/tts`](https://docs.bland.ai/api-v2/post/tts) |

For new conversational applications, start with the [Realtime TTS Quickstart](https://docs.bland.ai/tts/realtime-quickstart.md). It keeps one warm WebSocket open, sends LLM tokens immediately, and lets Bland handle text buffering.

## Provider guides

> [card] [ElevenLabs](https://docs.bland.ai/tts/migrations/elevenlabs.md)
>
> Replace stream-input messages, base64 audio, and manual flush behavior.

> [card] [Cartesia](https://docs.bland.ai/tts/migrations/cartesia.md)
>
> Map contexts and continuations to turns, preemption, and cancellation.

> [card] [Deepgram](https://docs.bland.ai/tts/migrations/deepgram.md)
>
> Map Speak, Flush, Clear, and Close to Bland turn messages.

> [card] [PlayHT](https://docs.bland.ai/tts/migrations/playht.md)
>
> Replace the generated socket URL and request-level speech commands.

> [card] [Resemble AI](https://docs.bland.ai/tts/migrations/resemble.md)
>
> Move from request IDs and audio\_end to Bland turn boundaries.

> [card] [Google Cloud TTS](https://docs.bland.ai/tts/migrations/google-cloud.md)
>
> Replace bidirectional gRPC configuration and audio responses.

> [card] [Amazon Polly](https://docs.bland.ai/tts/migrations/amazon-polly.md)
>
> Move synchronous synthesis or add token-level realtime streaming.

## Shared migration rules

All realtime migrations have the same core changes:

1. Select a Bland voice UUID from [List Voices](https://docs.bland.ai/api-v1/get/voices.md). Voice IDs are provider-specific and cannot be reused.
2. Open one socket per conversation and send `init` once.
3. Wait for `ready` before sending text.
4. Send only new text deltas under one `context_id` per turn.
5. Send `end_of_turn` after the LLM completes.
6. Read binary frames as raw PCM or mu-law audio.
7. On interruption, send a new context to preempt or send `cancel` without replacement text.
8. Drop unplayed local audio for preempted or cancelled turns.
9. Send `close` only after the final turn's `utterance_end`, then wait for `done`.

See [Realtime TTS Concepts](https://docs.bland.ai/tts/realtime-concepts.md) for the state model and playback responsibilities.

***

Docs for agents: [llms.txt](https://docs.bland.ai/llms.txt)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.