Create a speech turn
Send one base64 audio turn to an audio-in/audio-out model and receive its spoken reply as base64 audio. The model understands and answers the audio directly — this is NOT transcription followed by synthesis. Use s2s/auto with an optional feature for managed routing, or an exact realtime slug.
curl --request POST \
--url https://api.usenaive.ai/v1/audio/speech-to-speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input_audio": {
"data": "<string>",
"format": "<string>",
"sample_rate": 123,
"channels": 123
},
"output_audio": {
"format": "wav",
"sample_rate": 123
},
"voice": "auto",
"instructions": "<string>",
"temperature": 123,
"max_output_tokens": 123,
"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-to-speech"
payload = {
"model": "<string>",
"input_audio": {
"data": "<string>",
"format": "<string>",
"sample_rate": 123,
"channels": 123
},
"output_audio": {
"format": "wav",
"sample_rate": 123
},
"voice": "auto",
"instructions": "<string>",
"temperature": 123,
"max_output_tokens": 123,
"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_audio: {data: '<string>', format: '<string>', sample_rate: 123, channels: 123},
output_audio: {format: 'wav', sample_rate: 123},
voice: 'auto',
instructions: '<string>',
temperature: 123,
max_output_tokens: 123,
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-to-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-to-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_audio' => [
'data' => '<string>',
'format' => '<string>',
'sample_rate' => 123,
'channels' => 123
],
'output_audio' => [
'format' => 'wav',
'sample_rate' => 123
],
'voice' => 'auto',
'instructions' => '<string>',
'temperature' => 123,
'max_output_tokens' => 123,
'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-to-speech"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input_audio\": {\n \"data\": \"<string>\",\n \"format\": \"<string>\",\n \"sample_rate\": 123,\n \"channels\": 123\n },\n \"output_audio\": {\n \"format\": \"wav\",\n \"sample_rate\": 123\n },\n \"voice\": \"auto\",\n \"instructions\": \"<string>\",\n \"temperature\": 123,\n \"max_output_tokens\": 123,\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-to-speech")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input_audio\": {\n \"data\": \"<string>\",\n \"format\": \"<string>\",\n \"sample_rate\": 123,\n \"channels\": 123\n },\n \"output_audio\": {\n \"format\": \"wav\",\n \"sample_rate\": 123\n },\n \"voice\": \"auto\",\n \"instructions\": \"<string>\",\n \"temperature\": 123,\n \"max_output_tokens\": 123,\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-to-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_audio\": {\n \"data\": \"<string>\",\n \"format\": \"<string>\",\n \"sample_rate\": 123,\n \"channels\": 123\n },\n \"output_audio\": {\n \"format\": \"wav\",\n \"sample_rate\": 123\n },\n \"voice\": \"auto\",\n \"instructions\": \"<string>\",\n \"temperature\": 123,\n \"max_output_tokens\": 123,\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{
"id": "<string>",
"object": "audio.speech_to_speech",
"created": 123,
"model": "<string>",
"resolved_model": "<string>",
"provider": "<string>",
"audio": {
"data": "<string>",
"format": "<string>",
"content_type": "<string>",
"sample_rate": 123,
"channels": 123
},
"transcript": "<string>",
"input_transcript": "<string>",
"usage": {
"seconds": 123,
"billable_seconds": 123,
"input_seconds": 123,
"output_seconds": 123,
"input_chars": 123,
"cost": 123,
"currency": "<string>"
},
"credits_used": 123,
"credits_remaining": 123
}{
"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 realtime slug, or s2s/auto for managed feature routing.
Base64 audio (JSON requests only). Mutually exclusive with the multipart file field.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Managed routes require auto — native voice ids are not portable.
Case-sensitive capability to prioritize. Valid ONLY with model s2s/auto; rejected for pinned models.
Emotion Understanding, Emotion Alignment, Expressive Robustness, Voice naturalness, Problem redirecting System guidance for how the model should answer the turn.
Per-request routing constraints, applied before ranking.
Show child attributes
Show child attributes
Response
OK.
"audio.speech_to_speech"
Show child attributes
Show child attributes
Transcript of the model's spoken answer.
Transcript of your audio; null when the model does not return one.
Normalized usage. cost is in USD; Naive credits are reported separately as credits_used.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.usenaive.ai/v1/audio/speech-to-speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input_audio": {
"data": "<string>",
"format": "<string>",
"sample_rate": 123,
"channels": 123
},
"output_audio": {
"format": "wav",
"sample_rate": 123
},
"voice": "auto",
"instructions": "<string>",
"temperature": 123,
"max_output_tokens": 123,
"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-to-speech"
payload = {
"model": "<string>",
"input_audio": {
"data": "<string>",
"format": "<string>",
"sample_rate": 123,
"channels": 123
},
"output_audio": {
"format": "wav",
"sample_rate": 123
},
"voice": "auto",
"instructions": "<string>",
"temperature": 123,
"max_output_tokens": 123,
"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_audio: {data: '<string>', format: '<string>', sample_rate: 123, channels: 123},
output_audio: {format: 'wav', sample_rate: 123},
voice: 'auto',
instructions: '<string>',
temperature: 123,
max_output_tokens: 123,
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-to-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-to-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_audio' => [
'data' => '<string>',
'format' => '<string>',
'sample_rate' => 123,
'channels' => 123
],
'output_audio' => [
'format' => 'wav',
'sample_rate' => 123
],
'voice' => 'auto',
'instructions' => '<string>',
'temperature' => 123,
'max_output_tokens' => 123,
'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-to-speech"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input_audio\": {\n \"data\": \"<string>\",\n \"format\": \"<string>\",\n \"sample_rate\": 123,\n \"channels\": 123\n },\n \"output_audio\": {\n \"format\": \"wav\",\n \"sample_rate\": 123\n },\n \"voice\": \"auto\",\n \"instructions\": \"<string>\",\n \"temperature\": 123,\n \"max_output_tokens\": 123,\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-to-speech")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input_audio\": {\n \"data\": \"<string>\",\n \"format\": \"<string>\",\n \"sample_rate\": 123,\n \"channels\": 123\n },\n \"output_audio\": {\n \"format\": \"wav\",\n \"sample_rate\": 123\n },\n \"voice\": \"auto\",\n \"instructions\": \"<string>\",\n \"temperature\": 123,\n \"max_output_tokens\": 123,\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-to-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_audio\": {\n \"data\": \"<string>\",\n \"format\": \"<string>\",\n \"sample_rate\": 123,\n \"channels\": 123\n },\n \"output_audio\": {\n \"format\": \"wav\",\n \"sample_rate\": 123\n },\n \"voice\": \"auto\",\n \"instructions\": \"<string>\",\n \"temperature\": 123,\n \"max_output_tokens\": 123,\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{
"id": "<string>",
"object": "audio.speech_to_speech",
"created": 123,
"model": "<string>",
"resolved_model": "<string>",
"provider": "<string>",
"audio": {
"data": "<string>",
"format": "<string>",
"content_type": "<string>",
"sample_rate": 123,
"channels": 123
},
"transcript": "<string>",
"input_transcript": "<string>",
"usage": {
"seconds": 123,
"billable_seconds": 123,
"input_seconds": 123,
"output_seconds": 123,
"input_chars": 123,
"cost": 123,
"currency": "<string>"
},
"credits_used": 123,
"credits_remaining": 123
}{
"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": {}
}
}