> 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.

# Voice Changer

POST https://api.murf.ai/v1/voice-changer/convert
Content-Type: multipart/form-data

Returns a url to the generated audio file along with other associated properties.

Reference: https://murf.ai/api/docs/api-reference/voice-changer/convert

## Request

### Headers

- `token` (string, optional)
- `api-key` (string, optional)

### Body (multipart/form-data)

This endpoint expects a multipart form containing an optional file.

- `audio_duration` (double, optional) — This parameter allows specifying the duration (in seconds) for the generated audio. If the value is 0, this parameter will be ignored. Only available for Gen2 model.
- `channel_type` (string, optional) — Valid values: STEREO, MONO
- `encode_output_as_base64` (boolean, optional) — Set to true to receive audio in response as a Base64 encoded string along with a url.
- `file` (file, optional) — The file to upload
- `file_url` (string, optional)
- `format` (string, optional) — Format of the generated audio file. Valid values: MP3, WAV, FLAC, ALAW, ULAW
- `multi_native_locale` (string, optional) — Specifies the language for the generated audio, enabling a voice to speak in multiple languages natively. Only available in the Gen2 model. Valid values: "en-US", "en-UK", "es-ES", etc. Use the GET /v1/speech/voices endpoint to retrieve the list of available voices and languages.
- `pitch` (integer, optional) — Pitch of the voiceover
- `rate` (integer, optional) — Speed of the voiceover
- `retain_accent` (boolean, optional) — Set to true to retain the original accent of the speaker during voice generation.
- `retain_prosody` (boolean, optional) — Indicates whether to retain the original prosody (intonation, rhythm, and stress) of the input voice in the generated output.
- `return_transcription` (boolean, optional) — Set to true to include a textual transcription of the generated audio in the response.
- `sample_rate` (double, optional) — Valid values are 8000, 24000, 44100, 48000
- `style` (string, optional) — The voice style to be used for voiceover generation.
- `transcription` (string, optional) — This parameter allows specifying a transcription of the audio clip, which will then be used as input for the voice changer
- `variation` (integer, optional) — Higher values will add more variation in terms of Pause, Pitch, and Speed to the voice. Only available for Gen2 model.
- `voice_id` (string, required) — Use the GET /v1/speech/voices API to find supported voiceIds. You can use either the voiceId (e.g. en-US-natalie) or just the voice actor's name (e.g. natalie).

## Response

### 200

Ok

- `audio_file` (string, required) — The URL or path of the generated audio file.
- `audio_length_in_seconds` (double, required) — Length of the generated audio in seconds.
- `remaining_character_count` (long, required) — Remaining number of characters available for synthesis in the current billing cycle.
- `encoded_audio` (string, optional) — Base64 encoded string of the generated audio. Used when audio is returned directly in the response.
- `warning` (string, optional) — Any warning or informational message related to the audio generation process.
- `transcription` (string, optional, deprecated) — Transcript of the generated audio, if transcription was requested.

## Errors

### 400 Bad Request Error

Bad Request

- `any`

### 402 Payment Required Error

Expired subscription or character limit exhausted

- `any`

### 403 Forbidden Error

Invalid or expired token/api-key provided

- `any`

### 500 Internal Server Error

Internal Server Error

- `any`

### 503 Service Unavailable Error

Service Unavailable

- `any`

## Examples

**Request**

```json
{
  "file": "<file: <file1>>",
  "voice_id": "Natalie"
}
```

**Response**

```json
{
  "audio_file": "https://murf.ai/link/to/audio/file",
  "audio_length_in_seconds": 8.75,
  "remaining_character_count": 992150,
  "encoded_audio": "UklGRlpHSEFWA..."
}
```

**SDK Code**

```python BasicExample
import requests

url = "https://api.murf.ai/v1/voice-changer/convert"

files = { "file": "open('<file1>', 'rb')" }
payload = {
    "audio_duration": ,
    "channel_type": ,
    "encode_output_as_base64": ,
    "file_url": ,
    "format": ,
    "multi_native_locale": ,
    "pitch": ,
    "rate": ,
    "retain_accent": ,
    "retain_prosody": ,
    "return_transcription": ,
    "sample_rate": ,
    "style": ,
    "transcription": ,
    "variation": ,
    "voice_id": "Natalie"
}

response = requests.post(url, data=payload, files=files)

print(response.json())
```

```javascript BasicExample
const url = 'https://api.murf.ai/v1/voice-changer/convert';
const form = new FormData();
form.append('audio_duration', '');
form.append('channel_type', '');
form.append('encode_output_as_base64', '');
form.append('file', '<file1>');
form.append('file_url', '');
form.append('format', '');
form.append('multi_native_locale', '');
form.append('pitch', '');
form.append('rate', '');
form.append('retain_accent', '');
form.append('retain_prosody', '');
form.append('return_transcription', '');
form.append('sample_rate', '');
form.append('style', '');
form.append('transcription', '');
form.append('variation', '');
form.append('voice_id', 'Natalie');

const options = {method: 'POST'};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go BasicExample
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.murf.ai/v1/voice-changer/convert"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_duration\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"channel_type\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"encode_output_as_base64\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"format\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"multi_native_locale\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pitch\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"rate\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"retain_accent\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"retain_prosody\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"return_transcription\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"sample_rate\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"style\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"transcription\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"variation\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_id\"\r\n\r\nNatalie\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby BasicExample
require 'uri'
require 'net/http'

url = URI("https://api.murf.ai/v1/voice-changer/convert")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_duration\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"channel_type\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"encode_output_as_base64\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"format\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"multi_native_locale\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pitch\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"rate\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"retain_accent\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"retain_prosody\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"return_transcription\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"sample_rate\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"style\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"transcription\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"variation\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_id\"\r\n\r\nNatalie\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java BasicExample
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.murf.ai/v1/voice-changer/convert")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_duration\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"channel_type\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"encode_output_as_base64\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"format\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"multi_native_locale\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pitch\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"rate\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"retain_accent\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"retain_prosody\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"return_transcription\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"sample_rate\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"style\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"transcription\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"variation\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_id\"\r\n\r\nNatalie\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php BasicExample
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.murf.ai/v1/voice-changer/convert', [
  'multipart' => [
    [
        'name' => 'file',
        'filename' => '<file1>',
        'contents' => null
    ],
    [
        'name' => 'voice_id',
        'contents' => 'Natalie'
    ]
  ]
]);

echo $response->getBody();
```

```csharp BasicExample
using RestSharp;

var client = new RestClient("https://api.murf.ai/v1/voice-changer/convert");
var request = new RestRequest(Method.POST);
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_duration\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"channel_type\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"encode_output_as_base64\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"format\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"multi_native_locale\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pitch\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"rate\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"retain_accent\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"retain_prosody\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"return_transcription\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"sample_rate\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"style\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"transcription\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"variation\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_id\"\r\n\r\nNatalie\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift BasicExample
import Foundation
let parameters = [
  [
    "name": "audio_duration",
    "value": 
  ],
  [
    "name": "channel_type",
    "value": 
  ],
  [
    "name": "encode_output_as_base64",
    "value": 
  ],
  [
    "name": "file",
    "fileName": "<file1>"
  ],
  [
    "name": "file_url",
    "value": 
  ],
  [
    "name": "format",
    "value": 
  ],
  [
    "name": "multi_native_locale",
    "value": 
  ],
  [
    "name": "pitch",
    "value": 
  ],
  [
    "name": "rate",
    "value": 
  ],
  [
    "name": "retain_accent",
    "value": 
  ],
  [
    "name": "retain_prosody",
    "value": 
  ],
  [
    "name": "return_transcription",
    "value": 
  ],
  [
    "name": "sample_rate",
    "value": 
  ],
  [
    "name": "style",
    "value": 
  ],
  [
    "name": "transcription",
    "value": 
  ],
  [
    "name": "variation",
    "value": 
  ],
  [
    "name": "voice_id",
    "value": "Natalie"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.murf.ai/v1/voice-changer/convert")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```