curl --request POST \
--url https://openrouter.ai/api/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "Hello world",
"model": "mistralai/voxtral-mini-tts-2603",
"response_format": "pcm",
"speed": 1,
"voice": "en_paul_neutral"
}
'import requests
url = "https://openrouter.ai/api/v1/audio/speech"
payload = {
"input": "Hello world",
"model": "mistralai/voxtral-mini-tts-2603",
"response_format": "pcm",
"speed": 1,
"voice": "en_paul_neutral"
}
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({
input: 'Hello world',
model: 'mistralai/voxtral-mini-tts-2603',
response_format: 'pcm',
speed: 1,
voice: 'en_paul_neutral'
})
};
fetch('https://openrouter.ai/api/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://openrouter.ai/api/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([
'input' => 'Hello world',
'model' => 'mistralai/voxtral-mini-tts-2603',
'response_format' => 'pcm',
'speed' => 1,
'voice' => 'en_paul_neutral'
]),
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://openrouter.ai/api/v1/audio/speech"
payload := strings.NewReader("{\n \"input\": \"Hello world\",\n \"model\": \"mistralai/voxtral-mini-tts-2603\",\n \"response_format\": \"pcm\",\n \"speed\": 1,\n \"voice\": \"en_paul_neutral\"\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://openrouter.ai/api/v1/audio/speech")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"Hello world\",\n \"model\": \"mistralai/voxtral-mini-tts-2603\",\n \"response_format\": \"pcm\",\n \"speed\": 1,\n \"voice\": \"en_paul_neutral\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openrouter.ai/api/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 \"input\": \"Hello world\",\n \"model\": \"mistralai/voxtral-mini-tts-2603\",\n \"response_format\": \"pcm\",\n \"speed\": 1,\n \"voice\": \"en_paul_neutral\"\n}"
response = http.request(request)
puts response.read_body"<binary audio data>"{
"error": {
"code": 400,
"message": "Invalid request parameters"
}
}{
"error": {
"code": 401,
"message": "Missing Authentication header"
}
}{
"error": {
"code": 402,
"message": "Insufficient credits. Add more using https://openrouter.ai/credits"
}
}{
"error": {
"code": 404,
"message": "Resource not found"
}
}{
"error": {
"code": 429,
"message": "Rate limit exceeded"
}
}{
"error": {
"code": 500,
"message": "Internal Server Error"
}
}{
"error": {
"code": 502,
"message": "Provider returned error"
}
}{
"error": {
"code": 503,
"message": "Service temporarily unavailable"
}
}{
"error": {
"code": 524,
"message": "Request timed out. Please try again later."
}
}{
"error": {
"code": 529,
"message": "Provider returned error"
}
}Create speech
Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav).
curl --request POST \
--url https://openrouter.ai/api/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "Hello world",
"model": "mistralai/voxtral-mini-tts-2603",
"response_format": "pcm",
"speed": 1,
"voice": "en_paul_neutral"
}
'import requests
url = "https://openrouter.ai/api/v1/audio/speech"
payload = {
"input": "Hello world",
"model": "mistralai/voxtral-mini-tts-2603",
"response_format": "pcm",
"speed": 1,
"voice": "en_paul_neutral"
}
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({
input: 'Hello world',
model: 'mistralai/voxtral-mini-tts-2603',
response_format: 'pcm',
speed: 1,
voice: 'en_paul_neutral'
})
};
fetch('https://openrouter.ai/api/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://openrouter.ai/api/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([
'input' => 'Hello world',
'model' => 'mistralai/voxtral-mini-tts-2603',
'response_format' => 'pcm',
'speed' => 1,
'voice' => 'en_paul_neutral'
]),
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://openrouter.ai/api/v1/audio/speech"
payload := strings.NewReader("{\n \"input\": \"Hello world\",\n \"model\": \"mistralai/voxtral-mini-tts-2603\",\n \"response_format\": \"pcm\",\n \"speed\": 1,\n \"voice\": \"en_paul_neutral\"\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://openrouter.ai/api/v1/audio/speech")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"Hello world\",\n \"model\": \"mistralai/voxtral-mini-tts-2603\",\n \"response_format\": \"pcm\",\n \"speed\": 1,\n \"voice\": \"en_paul_neutral\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openrouter.ai/api/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 \"input\": \"Hello world\",\n \"model\": \"mistralai/voxtral-mini-tts-2603\",\n \"response_format\": \"pcm\",\n \"speed\": 1,\n \"voice\": \"en_paul_neutral\"\n}"
response = http.request(request)
puts response.read_body"<binary audio data>"{
"error": {
"code": 400,
"message": "Invalid request parameters"
}
}{
"error": {
"code": 401,
"message": "Missing Authentication header"
}
}{
"error": {
"code": 402,
"message": "Insufficient credits. Add more using https://openrouter.ai/credits"
}
}{
"error": {
"code": 404,
"message": "Resource not found"
}
}{
"error": {
"code": 429,
"message": "Rate limit exceeded"
}
}{
"error": {
"code": 500,
"message": "Internal Server Error"
}
}{
"error": {
"code": 502,
"message": "Provider returned error"
}
}{
"error": {
"code": 503,
"message": "Service temporarily unavailable"
}
}{
"error": {
"code": 524,
"message": "Request timed out. Please try again later."
}
}{
"error": {
"code": 529,
"message": "Provider returned error"
}
}Authorizations
API key as bearer token in Authorization header
Body
Text-to-speech request input
Text to synthesize
"Hello world"
TTS model identifier
"mistralai/voxtral-mini-tts-2603"
Reference content for stateless voice cloning: one input_audio part carrying the voice sample, optionally accompanied by one text part with its transcript. Only routed to endpoints that support voice cloning.
Reference content part for stateless voice cloning
- Option 1
- Option 2
Show child attributes
Show child attributes
{
"input_audio": {
"data": "data:audio/wav;base64,UklGRuQXDABXQVZF..."
},
"type": "input_audio"
}
[
{
"input_audio": {
"data": "data:audio/wav;base64,UklGRuQXDABXQVZF..."
},
"type": "input_audio"
},
{
"text": "I used to rule the world.",
"type": "text"
}
]
Provider-specific passthrough configuration
Show child attributes
Show child attributes
Audio output format
mp3, pcm "pcm"
Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers.
1
Voice identifier (provider-specific).
1"en_paul_neutral"
Response
Audio bytes stream
Raw audio bytestream. Content-Type varies by requested format (audio/mpeg for mp3, audio/pcm for pcm — 16-bit little-endian).