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

# Media · Generate · Generate speech from text

POST https://api.simplified.com/api/v1/voices/{voice_id}/translate
Content-Type: application/json

Convert text to spoken audio using the voice referenced by `voice_id`
(get voices from `listVoices`). `storage` controls whether the audio is saved.

Set `use_ssml: true` ONLY when `text` contains SSML markup like `<speak>` /
`<break>` / `<emphasis>`. For plain prose leave it false — providers handle
punctuation pacing well and SSML support varies.

Storage modes:

* `default` — returns the audio URL only (can expire)
* `asset`   — also saves it to your asset library for reuse

Reference: https://docs.simplified.com/api-reference/platform/ai-generation/generate-audio

## Authentication

- `Authorization` header (required) (prefixed with ` Api-Key   `) — Header authentication of the form `Api-Key  <token>`
- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `voice_id` (string, required) — Voice UUID from listVoices `voices[].id`

### Body (application/json)

This endpoint expects an object.

- `text` (string, required) — Text to synthesize. HTML entities will be unescaped server-side.
- `use_ssml` (boolean, optional, default: false) — Set true ONLY when `text` contains SSML markup like `<speak>`, `<break>`, `<emphasis>`.
- `storage` (enum, optional, default: default) — `default` returns the audio URL only; `asset` also saves a persistent TldrAsset (library entry) for reuse.
  - Allowed values: `default`, `asset`
- `instructions` (string, optional) — Natural-language style hint controlling tone and delivery (e.g. "say cheerfully" or audio tags like "[whispers]"). Honored ONLY when the voice's `supports_instructions` is `true` (check via `listVoices` / `getVoice`); silently ignored by voices that don't support it. It nudges delivery — it is NOT a rate/duration control.

## Response

### 200

The generated speech audio.

- `any`

## Errors

### 400 Bad Request Error

Invalid voice_id, text, or storage value

- `any`

### 401 Unauthorized Error

Unauthorized

- `any`

### 403 Forbidden Error

Voice not accessible in this workspace

- `any`

### 429 Too Many Requests Error

Quota exceeded — no remaining AI credits

- `any`

## Examples

**Request**

```json
{
  "text": "Welcome to Simplified. Let's build your next ad.",
  "use_ssml": false,
  "storage": "asset",
  "instructions": "say warmly and with excitement"
}
```

**SDK Code**

```python AI Generation_generateAudio_example
import requests

url = "https://api.simplified.com/api/v1/voices/voice_id/translate"

payload = {
    "text": "Welcome to Simplified. Let's build your next ad.",
    "use_ssml": False,
    "storage": "asset",
    "instructions": "say warmly and with excitement"
}
headers = {
    "Authorization": "Api-Key  <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript AI Generation_generateAudio_example
const url = 'https://api.simplified.com/api/v1/voices/voice_id/translate';
const options = {
  method: 'POST',
  headers: {Authorization: 'Api-Key  <apiKey>', 'Content-Type': 'application/json'},
  body: '{"text":"Welcome to Simplified. Let\'s build your next ad.","use_ssml":false,"storage":"asset","instructions":"say warmly and with excitement"}'
};

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

```go AI Generation_generateAudio_example
package main

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

func main() {

	url := "https://api.simplified.com/api/v1/voices/voice_id/translate"

	payload := strings.NewReader("{\n  \"text\": \"Welcome to Simplified. Let's build your next ad.\",\n  \"use_ssml\": false,\n  \"storage\": \"asset\",\n  \"instructions\": \"say warmly and with excitement\"\n}")

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

	req.Header.Add("Authorization", "Api-Key  <apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby AI Generation_generateAudio_example
require 'uri'
require 'net/http'

url = URI("https://api.simplified.com/api/v1/voices/voice_id/translate")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Api-Key  <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"text\": \"Welcome to Simplified. Let's build your next ad.\",\n  \"use_ssml\": false,\n  \"storage\": \"asset\",\n  \"instructions\": \"say warmly and with excitement\"\n}"

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

```java AI Generation_generateAudio_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.simplified.com/api/v1/voices/voice_id/translate")
  .header("Authorization", "Api-Key  <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"text\": \"Welcome to Simplified. Let's build your next ad.\",\n  \"use_ssml\": false,\n  \"storage\": \"asset\",\n  \"instructions\": \"say warmly and with excitement\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.simplified.com/api/v1/voices/voice_id/translate', [
  'body' => '{
  "text": "Welcome to Simplified. Let\'s build your next ad.",
  "use_ssml": false,
  "storage": "asset",
  "instructions": "say warmly and with excitement"
}',
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp AI Generation_generateAudio_example
using RestSharp;

var client = new RestClient("https://api.simplified.com/api/v1/voices/voice_id/translate");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Api-Key  <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"text\": \"Welcome to Simplified. Let's build your next ad.\",\n  \"use_ssml\": false,\n  \"storage\": \"asset\",\n  \"instructions\": \"say warmly and with excitement\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift AI Generation_generateAudio_example
import Foundation

let headers = [
  "Authorization": "Api-Key  <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "text": "Welcome to Simplified. Let's build your next ad.",
  "use_ssml": false,
  "storage": "asset",
  "instructions": "say warmly and with excitement"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.simplified.com/api/v1/voices/voice_id/translate")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
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()
```