> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://murf.ai/api/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://murf.ai/api/docs/_mcp/server.

# Migration Guide for Play AI's TTS API

> Switch Play AI's TTS API to Murf's TTS Streaming API in minutes. Reach out to us for Voice Matching and Pricing support.

With Play.ai's acquisition by Meta and subsequent service disruption, many developers are looking for a reliable alternative for their text-to-speech streaming needs. Murf offers a powerful, feature-rich streaming TTS API that provides an excellent migration path for Play.ai users.

This guide will help you seamlessly transition from Play.ai's streaming API to Murf's streaming solution.

## Why Choose Murf?

#### Unparalleled Pronunciation Accuracy

Over 99% pronunciation accuracy for natural, precise speech

#### Superior Quality

Advanced GEN2 model for natural, human-like speech

#### Global Scale

Over 150 voices across 35+ languages and accents

#### Developer-First

Comprehensive SDKs, detailed documentation, and responsive support

## Quick Migration Overview

| Feature               | Play.ai                         | Murf                                       | Migration Notes                |
| --------------------- | ------------------------------- | ------------------------------------------ | ------------------------------ |
| **Endpoint**          | `POST /api/v1/tts/stream`       | `POST /v1/speech/stream`                   | Simple URL change              |
| **Authentication**    | `X-USER-ID` + `Authorization`   | `api-key` header                           | Simplified auth                |
| **Voice Selection**   | S3 paths or voice names         | Voice IDs or names                         | More intuitive naming          |
| **Audio Formats**     | mp3, mulaw, raw, wav, ogg, flac | MP3, WAV, PCM                              | Supports all essential formats |
| **Advanced Features** | Limited customization           | pronunciation, styles, Multilingual Locale | More control options           |

## Step-by-Step Migration

#### Get Your Murf API Key

Sign up at [Murf API Dashboard](https://murf.ai/api/dashboard) and generate
your API key. Store it securely as an environment variable if needed.

#### Test Connectivity

Verify your API key works with a simple request: `bash curl -X GET
    https://api.murf.ai/v1/speech/voices \ -H "api-key: YOUR_API_KEY" `

#### API Endpoint Migration

Change the API endpoint to Murf's.

**Play.ai Endpoint:**

```
POST https://api.play.ai/api/v1/tts/stream
```

**Murf Endpoint:**

```
POST https://api.murf.ai/v1/speech/stream
```

#### Authentication Changes

Play.ai uses `X-USER-ID` and `Authorization` headers for authentication.
Murf uses `api-key` header. Make sure to update your code to use the new
header.

**`Play.ai Authentication`**

```js title="Play.ai Authentication"
const headers = {
'X-USER-ID': 'your-user-id',
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
};
```

**`Murf Authentication`**

```js title="Murf Authentication"
const headers = {
"api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
};
```

#### Request Body Parameter Mapping

Change the request body parameters to match Murf's parameters. Only `text`, and `voiceId` are the required parameters and all other parameters are optional.

| Play.ai Parameter | Murf Parameter | Notes                                                                                  |
| ----------------- | -------------- | -------------------------------------------------------------------------------------- |
| `text`            | `text`         | Direct mapping, no need to change                                                      |
| `voice`           | `voiceId`      | Use a murf voice ID, you can choose from [here](/api/docs/voices-styles/voice-library) |
| `output_format`   | `format`       | "MP3", "WAV", or "PCM"                                                                 |
| `sample_rate`     | `sampleRate`   | 8000, 24000, 44100, or 48000                                                           |
| `speed`           | `rate`         | Range: -50 to +50 (vs Play.ai's decimal values)                                        |

Any other Play.ai parameter that was not listed above should be removed. To see the full list of parameters that you can use, please refer to the [Murf Streaming API Reference](/api/docs/api-reference/text-to-speech/stream).

#### Process the Response

Both Play.ai and Murf return the audio stream in the response body. You can
use the same code to process the response.

### Code Migration Examples

#### Python

**`Before: Play.ai Code`**

```py title="Before: Play.ai Code"
import requests

url = "https://api.play.ai/api/v1/tts/stream"
headers = {
    "X-USER-ID": "your-user-id",
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "text": "Hello, this is a test message.",
    "voice": "s3://voice-cloning-zero-shot/path/to/voice",
    "voice_engine": "Play3.0",
    "output_format": "mp3",
    "sample_rate": 44100,
    "speed": 1.0
}

response = requests.post(url, headers=headers, json=data, stream=True)
with open("audio.mp3", "wb") as f:
    for chunk in response.iter_content(chunk_size=1024):
        f.write(chunk)

```

**`After: Murf Code (direct HTTP)`**

```py title="After: Murf Code (direct HTTP)"
import requests

url = "https://api.murf.ai/v1/speech/stream"
headers = {
    "api-key": "YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "text": "Hello, this is a test message.",
    "voiceId": "Gordon",
    "locale":"en-US",
    "format": "MP3",
    "sampleRate": 44100,
    "rate": 0,
    "channelType": "MONO",
    "model":"falcon-2"
}

response = requests.post(url, headers=headers, json=data, stream=True)
with open("audio.mp3", "wb") as f:
    for chunk in response.iter_content(chunk_size=1024):
        f.write(chunk)
```

#### Node.js/JavaScript

**`Before: Play.ai Code`**

```js title="Before: Play.ai Code"
import fs from "fs";
import fetch from "node-fetch";

const url = "https://api.play.ai/api/v1/tts/stream";
const options = {
  method: "POST",
  headers: {
    "X-USER-ID": "your-user-id",
    Authorization: "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
    accept: "audio/mpeg",
  },
  body: JSON.stringify({
    text: "Hello, this is a test message.",
    voice:
      "s3://voice-cloning-zero-shot/d9ff78ba-d016-47f6-b0ef-dd630f59414e/female-cs/manifest.json",
    voice_engine: "Play3.0",
    output_format: "mp3",
    sample_rate: 44100,
    speed: 1.0,
  }),
};

const response = await fetch(url, options);
response.body.pipe(fs.createWriteStream("./audio.mp3"));
```

**`After: Murf Code`**

```js title="After: Murf Code"
import fs from "fs";
import fetch from "node-fetch";

const url = "https://api.murf.ai/v1/speech/stream";
const options = {
  method: "POST",
  headers: {
    "api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    text: "Hello, this is a test message.",
    voiceId: "Natalie", // Much simpler voice selection
    format: "MP3",
    sampleRate: 44100,
    rate: 0, // 0 = normal speed, -50 to +50 range
    channelType: "MONO",
  }),
};

const response = await fetch(url, options);
response.body.pipe(fs.createWriteStream("./audio.mp3"));
```

#### curl

**`Before: Play.ai cURL`**

```curl title="Before: Play.ai cURL"

curl --request POST \
 --url https://api.play.ai/api/v1/tts/stream \
 --header 'X-USER-ID: your-user-id' \
 --header 'Authorization: Bearer YOUR_API_KEY' \
 --header 'Content-Type: application/json' \
 --header 'accept: audio/mpeg' \
 --output audio.mp3 \
 --data '{
"text": "Hello, this is a test message.",
"voice": "s3://voice-cloning-zero-shot/path/to/voice",
"voice_engine": "Play3.0",
"output_format": "mp3",
"sample_rate": 44100,
"speed": 1.0
}'

```

**`After: Murf cURL`**

```curl title="After: Murf cURL"

curl -X POST https://api.murf.ai/v1/speech/stream \
     -H "Content-Type: application/json" \
     -d '{
  "text": "Hi, How are you doing today?",
  "voiceId": "Gordon",
  "locale":"en-US",
  "model":"falcon-2",
  "format": "MP3",
  "sampleRate": 44100
}'

```

## Voice Migration Guide

### Finding Equivalent Voices

Play.ai used complex S3 paths for voice selection. Murf uses intuitive voice names and IDs.

**Play.ai Voice Examples:**

```
s3://voice-cloning-zero-shot/d9ff78ba-d016-47f6-b0ef-dd630f59414e/female-cs/manifest.json
```

**Murf Voice Examples:**

```
"en-US-natalie"     // Female, US English
"en-UK-oliver"      // Male, UK English
"es-ES-sofia"       // Female, Spanish
"fr-FR-marcel"      // Male, French
```

#### [Voice Library](/api/docs/voices-styles/voice-library)

Use our Voice Library to find the perfect voice for your needs.

To programmatically fetch the list of voices, use the [List voices endpoint](/api/docs/api-reference/voices/get-voices).

```py
from murf import Murf

client = Murf(api_key="YOUR_API_KEY")
voices = client.voices.list()

for voice in voices:
    print(f"{voice.voice_id} - {voice.display_name} ({voice.gender})")
```

```js
const response = await fetch("https://api.murf.ai/v1/speech/voices", {
  headers: { "api-key": "YOUR_API_KEY" },
});

const voices = await response.json();
console.log(voices);
```

## Rate Limits & Concurrency

You can find more information about the rate limits and concurrency in our [Rate Limits](/api/docs/resources/rate-limits) page.

## Getting Help

#### [Documentation](/api/docs)

Comprehensive API documentation and guides

#### [Support](mailto:support@murf.ai)

Direct support for migration assistance

#### [Community](https://discord.gg/FbKAy96Sz7)

Join our developer community

#### [Enterprise](https://murf.ai/enterprise)

Custom solutions and dedicated support

## Migration Support

Need help with your migration? Our team is here to assist:

* **Migration consultation**: Free 30-minute consultation to review your use case
* **Custom voice matching**: Help finding the perfect voice equivalents
* **Code review**: Technical review of your migration implementation
* **Priority support**: Expedited support during your migration period

[Contact our migration team](mailto:support@murf.ai?subject=Play.ai%20Migration%20Support) to get started.

---

**Ready to migrate?** Start with our [Streaming Quickstart Guide](/api/docs/text-to-speech/streaming) or [generate your API key](https://murf.ai/api/dashboard) to begin testing immediately.