Create speech
Synthesize speech from text. The response is binary audio streamed in the requested response_format. Use model: "tts/auto" with voice: "auto" for managed routing, optionally steered by feature; or pin an exact owner/model slug and use that model’s native voice id. Because a binary body carries no usage object, the upstream request id is returned on the X-Audio-Request-Id response header — use it with GET /v1/audio/usage/ for the cost, or GET /v1/audio/requests/ for the route trace.
curl --request POST \
--url https://api.usenaive.ai/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": "<string>",
"voice": "<string>",
"response_format": "mp3",
"speed": 1,
"instructions": "<string>",
"language": "<string>",
"metadata": {},
"provider": {
"only": [
"<string>"
],
"ignore": [
"<string>"
],
"order": [
"<string>"
],
"allow_fallbacks": true,
"require_features": true,
"max_price": {
"per_min": 123,
"per_1k_chars": 123
},
"region": [
"<string>"
]
},
"options": {}
}
'import requests
url = "https://api.usenaive.ai/v1/audio/speech"
payload = {
"model": "<string>",
"input": "<string>",
"voice": "<string>",
"response_format": "mp3",
"speed": 1,
"instructions": "<string>",
"language": "<string>",
"metadata": {},
"provider": {
"only": ["<string>"],
"ignore": ["<string>"],
"order": ["<string>"],
"allow_fallbacks": True,
"require_features": True,
"max_price": {
"per_min": 123,
"per_1k_chars": 123
},
"region": ["<string>"]
},
"options": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
input: '<string>',
voice: '<string>',
response_format: 'mp3',
speed: 1,
instructions: '<string>',
language: '<string>',
metadata: {},
provider: {
only: ['<string>'],
ignore: ['<string>'],
order: ['<string>'],
allow_fallbacks: true,
require_features: true,
max_price: {per_min: 123, per_1k_chars: 123},
region: ['<string>']
},
options: {}
})
};
fetch('https://api.usenaive.ai/v1/audio/speech', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usenaive.ai/v1/audio/speech",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'input' => '<string>',
'voice' => '<string>',
'response_format' => 'mp3',
'speed' => 1,
'instructions' => '<string>',
'language' => '<string>',
'metadata' => [
],
'provider' => [
'only' => [
'<string>'
],
'ignore' => [
'<string>'
],
'order' => [
'<string>'
],
'allow_fallbacks' => true,
'require_features' => true,
'max_price' => [
'per_min' => 123,
'per_1k_chars' => 123
],
'region' => [
'<string>'
]
],
'options' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.usenaive.ai/v1/audio/speech"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"voice\": \"<string>\",\n \"response_format\": \"mp3\",\n \"speed\": 1,\n \"instructions\": \"<string>\",\n \"language\": \"<string>\",\n \"metadata\": {},\n \"provider\": {\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"order\": [\n \"<string>\"\n ],\n \"allow_fallbacks\": true,\n \"require_features\": true,\n \"max_price\": {\n \"per_min\": 123,\n \"per_1k_chars\": 123\n },\n \"region\": [\n \"<string>\"\n ]\n },\n \"options\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.usenaive.ai/v1/audio/speech")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"voice\": \"<string>\",\n \"response_format\": \"mp3\",\n \"speed\": 1,\n \"instructions\": \"<string>\",\n \"language\": \"<string>\",\n \"metadata\": {},\n \"provider\": {\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"order\": [\n \"<string>\"\n ],\n \"allow_fallbacks\": true,\n \"require_features\": true,\n \"max_price\": {\n \"per_min\": 123,\n \"per_1k_chars\": 123\n },\n \"region\": [\n \"<string>\"\n ]\n },\n \"options\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usenaive.ai/v1/audio/speech")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"voice\": \"<string>\",\n \"response_format\": \"mp3\",\n \"speed\": 1,\n \"instructions\": \"<string>\",\n \"language\": \"<string>\",\n \"metadata\": {},\n \"provider\": {\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"order\": [\n \"<string>\"\n ],\n \"allow_fallbacks\": true,\n \"require_features\": true,\n \"max_price\": {\n \"per_min\": 123,\n \"per_1k_chars\": 123\n },\n \"region\": [\n \"<string>\"\n ]\n },\n \"options\": {}\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": {
"code": "unauthorized",
"message": "<string>",
"hint": "<string>",
"reason": "<string>",
"block_reason": "no_subscription",
"credit_kind": "trial",
"balance": 123,
"balance_note": "<string>",
"actions": {}
}
}{
"error": {
"code": "unauthorized",
"message": "<string>",
"hint": "<string>",
"reason": "<string>",
"block_reason": "no_subscription",
"credit_kind": "trial",
"balance": 123,
"balance_note": "<string>",
"actions": {}
}
}Authorizations
Workspace API key. Create one via the dashboard or POST /v1/auth/keys.
Body
Exact owner/model slug, or tts/auto for managed feature routing.
The text to synthesize.
Managed routes require auto; pinned models take a native voice id.
Case-sensitive capability to prioritize. Valid ONLY with model tts/auto and voice auto; rejected for pinned models. Omit it to classify the request automatically.
Acting, Expressiveness, Voice identity, Language stability, Reliability, Extended long-form, Long-form, Acoustic quality Supported values are model-specific — check GET /v1/audio/endpoints.
mp3, ogg, opus, aac, flac, wav, pcm, ulaw, alaw, json Style guidance for instruction-following voices.
Per-request routing constraints, applied before ranking.
Show child attributes
Show child attributes
Response
The synthesized audio, with the matching Content-Type (e.g. audio/mpeg).
The response is of type file.
curl --request POST \
--url https://api.usenaive.ai/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": "<string>",
"voice": "<string>",
"response_format": "mp3",
"speed": 1,
"instructions": "<string>",
"language": "<string>",
"metadata": {},
"provider": {
"only": [
"<string>"
],
"ignore": [
"<string>"
],
"order": [
"<string>"
],
"allow_fallbacks": true,
"require_features": true,
"max_price": {
"per_min": 123,
"per_1k_chars": 123
},
"region": [
"<string>"
]
},
"options": {}
}
'import requests
url = "https://api.usenaive.ai/v1/audio/speech"
payload = {
"model": "<string>",
"input": "<string>",
"voice": "<string>",
"response_format": "mp3",
"speed": 1,
"instructions": "<string>",
"language": "<string>",
"metadata": {},
"provider": {
"only": ["<string>"],
"ignore": ["<string>"],
"order": ["<string>"],
"allow_fallbacks": True,
"require_features": True,
"max_price": {
"per_min": 123,
"per_1k_chars": 123
},
"region": ["<string>"]
},
"options": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
input: '<string>',
voice: '<string>',
response_format: 'mp3',
speed: 1,
instructions: '<string>',
language: '<string>',
metadata: {},
provider: {
only: ['<string>'],
ignore: ['<string>'],
order: ['<string>'],
allow_fallbacks: true,
require_features: true,
max_price: {per_min: 123, per_1k_chars: 123},
region: ['<string>']
},
options: {}
})
};
fetch('https://api.usenaive.ai/v1/audio/speech', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usenaive.ai/v1/audio/speech",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'input' => '<string>',
'voice' => '<string>',
'response_format' => 'mp3',
'speed' => 1,
'instructions' => '<string>',
'language' => '<string>',
'metadata' => [
],
'provider' => [
'only' => [
'<string>'
],
'ignore' => [
'<string>'
],
'order' => [
'<string>'
],
'allow_fallbacks' => true,
'require_features' => true,
'max_price' => [
'per_min' => 123,
'per_1k_chars' => 123
],
'region' => [
'<string>'
]
],
'options' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.usenaive.ai/v1/audio/speech"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"voice\": \"<string>\",\n \"response_format\": \"mp3\",\n \"speed\": 1,\n \"instructions\": \"<string>\",\n \"language\": \"<string>\",\n \"metadata\": {},\n \"provider\": {\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"order\": [\n \"<string>\"\n ],\n \"allow_fallbacks\": true,\n \"require_features\": true,\n \"max_price\": {\n \"per_min\": 123,\n \"per_1k_chars\": 123\n },\n \"region\": [\n \"<string>\"\n ]\n },\n \"options\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.usenaive.ai/v1/audio/speech")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"voice\": \"<string>\",\n \"response_format\": \"mp3\",\n \"speed\": 1,\n \"instructions\": \"<string>\",\n \"language\": \"<string>\",\n \"metadata\": {},\n \"provider\": {\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"order\": [\n \"<string>\"\n ],\n \"allow_fallbacks\": true,\n \"require_features\": true,\n \"max_price\": {\n \"per_min\": 123,\n \"per_1k_chars\": 123\n },\n \"region\": [\n \"<string>\"\n ]\n },\n \"options\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usenaive.ai/v1/audio/speech")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"voice\": \"<string>\",\n \"response_format\": \"mp3\",\n \"speed\": 1,\n \"instructions\": \"<string>\",\n \"language\": \"<string>\",\n \"metadata\": {},\n \"provider\": {\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"order\": [\n \"<string>\"\n ],\n \"allow_fallbacks\": true,\n \"require_features\": true,\n \"max_price\": {\n \"per_min\": 123,\n \"per_1k_chars\": 123\n },\n \"region\": [\n \"<string>\"\n ]\n },\n \"options\": {}\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": {
"code": "unauthorized",
"message": "<string>",
"hint": "<string>",
"reason": "<string>",
"block_reason": "no_subscription",
"credit_kind": "trial",
"balance": 123,
"balance_note": "<string>",
"actions": {}
}
}{
"error": {
"code": "unauthorized",
"message": "<string>",
"hint": "<string>",
"reason": "<string>",
"block_reason": "no_subscription",
"credit_kind": "trial",
"balance": 123,
"balance_note": "<string>",
"actions": {}
}
}