Audio speech
curl --request POST \
--url https://app.frogbot.ai/api/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": "<string>",
"voice": "<string>",
"response_format": "<string>",
"speed": 123
}
'import requests
url = "https://app.frogbot.ai/api/v1/audio/speech"
payload = {
"model": "<string>",
"input": "<string>",
"voice": "<string>",
"response_format": "<string>",
"speed": 123
}
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: '<string>',
speed: 123
})
};
fetch('https://app.frogbot.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://app.frogbot.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([
'model' => '<string>',
'input' => '<string>',
'voice' => '<string>',
'response_format' => '<string>',
'speed' => 123
]),
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://app.frogbot.ai/api/v1/audio/speech"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"voice\": \"<string>\",\n \"response_format\": \"<string>\",\n \"speed\": 123\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://app.frogbot.ai/api/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\": \"<string>\",\n \"speed\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.frogbot.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 \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"voice\": \"<string>\",\n \"response_format\": \"<string>\",\n \"speed\": 123\n}"
response = http.request(request)
puts response.read_bodyInference API
Audio speech
Generate spoken audio from text
POST
/
api
/
v1
/
audio
/
speech
Audio speech
curl --request POST \
--url https://app.frogbot.ai/api/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": "<string>",
"voice": "<string>",
"response_format": "<string>",
"speed": 123
}
'import requests
url = "https://app.frogbot.ai/api/v1/audio/speech"
payload = {
"model": "<string>",
"input": "<string>",
"voice": "<string>",
"response_format": "<string>",
"speed": 123
}
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: '<string>',
speed: 123
})
};
fetch('https://app.frogbot.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://app.frogbot.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([
'model' => '<string>',
'input' => '<string>',
'voice' => '<string>',
'response_format' => '<string>',
'speed' => 123
]),
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://app.frogbot.ai/api/v1/audio/speech"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"voice\": \"<string>\",\n \"response_format\": \"<string>\",\n \"speed\": 123\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://app.frogbot.ai/api/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\": \"<string>\",\n \"speed\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.frogbot.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 \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"voice\": \"<string>\",\n \"response_format\": \"<string>\",\n \"speed\": 123\n}"
response = http.request(request)
puts response.read_bodyGenerate audio from a text input. Returns an audio file stream.
Authenticate
Use an API key in theAuthorization header.
curl https://app.frogbot.ai/api/v1/audio/speech \
-H "Authorization: Bearer $FROGBOT_API_KEY"
Request body
string
required
TTS model ID to use. See available speech models for the full list.Examples:
gpt-4o-mini-tts, elevenlabs-tts-multilingual-v2string
required
The text to synthesize. Maximum length is 4096 characters.
string
Voice to use for synthesis. Leave it out to use the provider’s default voice. OpenAI voices:
alloy, echo, fable, onyx, nova, shimmer. ElevenLabs voices map automatically from these names or accept raw voice IDs.string
default:"mp3"
Audio format for the output. Options:
mp3, opus, aac, flac, pcm, wav.number
default:"1.0"
Playback speed of the generated audio. Range:
0.25 to 4.0.Response
Returns the audio file as a binary stream withContent-Type: audio/mpeg (or the appropriate MIME type for the requested format).
Examples
curl https://app.frogbot.ai/api/v1/audio/speech \
-H "Authorization: Bearer $FROGBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tts-1",
"input": "Hello, welcome to FrogBot.",
"voice": "alloy"
}' \
--output speech.mp3
curl https://app.frogbot.ai/api/v1/audio/speech \
-H "Authorization: Bearer $FROGBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "elevenlabs/eleven_multilingual_v2",
"input": "Hello, welcome to FrogBot.",
"voice": "alloy"
}' \
--output speech.mp3
from openai import OpenAI
client = OpenAI(
base_url="https://app.frogbot.ai/api/v1",
api_key="YOUR_API_KEY"
)
response = client.audio.speech.create(
model="tts-1",
input="Hello, welcome to FrogBot.",
voice="alloy"
)
with open("speech.mp3", "wb") as f:
f.write(response.content)
import OpenAI from "openai";
import fs from "fs";
const client = new OpenAI({
baseURL: "https://app.frogbot.ai/api/v1",
apiKey: "YOUR_API_KEY",
});
const response = await client.audio.speech.create({
model: "tts-1",
input: "Hello, welcome to FrogBot.",
voice: "alloy",
});
const buffer = Buffer.from(await response.arrayBuffer());
fs.writeFileSync("speech.mp3", buffer);