AUDIO
🔊 Gemini TTS Model
Making Request:
Endpoint:
https://api.hyprlab.io/v1beta/models/[MODEL]:generateContent?key=[API-KEY]
Single-Speaker Example:
#!/bin/bash
set -e -E
HYPRLAB_API_KEY="$HYPRLAB_API_KEY"
MODEL_ID="gemini-2.5-flash-preview-tts"
curl -X POST \
-H "Content-Type: application/json" \
"https://api.hyprlab.io/v1beta/models/${MODEL_ID}:generateContent?key=${HYPRLAB_API_KEY}" \
-d '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Greet the user in a warm and welcoming voice: Good morning! Ready to start your day?"
}
]
}
],
"generationConfig": {
"responseModalities": ["audio"],
"temperature": 1,
"speech_config": {
"voice_config": {
"prebuilt_voice_config": {
"voice_name": "Zephyr"
}
}
}
}
}' > output.json
echo "Response saved as output.json"
const axios = require("axios");
const fs = require("fs");
// API endpoint and headers
const modelId = "gemini-2.5-flash-preview-tts";
const url = `https://api.hyprlab.io/v1beta/models/${modelId}:generateContent?key=${process.env.HYPRLAB_API_KEY}`;
const headers = {
"Content-Type": "application/json",
};
// Request payload
const data = {
contents: [
{
role: "user",
parts: [
{
text: "Greet the user in a warm and welcoming voice: Good morning! Ready to start your day?",
},
],
},
],
generationConfig: {
responseModalities: ["audio"],
temperature: 1,
speech_config: {
voice_config: {
prebuilt_voice_config: {
voice_name: "Zephyr",
},
},
},
},
};
// Make the request
axios
.post(url, data, { headers })
.then((response) => {
// Save the full JSON response to output.json
fs.writeFileSync("output.json", JSON.stringify(response.data, null, 2));
console.log("Response saved as output.json");
})
.catch((error) => {
console.error("Error:", error.response ? error.response.data : error.message);
});
import requests
import json
import os
# API endpoint and headers
model_id = "gemini-2.5-flash-preview-tts"
url = f"https://api.hyprlab.io/v1beta/models/{model_id}:generateContent?key={os.getenv('HYPRLAB_API_KEY')}"
headers = {
"Content-Type": "application/json",
}
# Request payload
data = {
"contents": [
{
"role": "user",
"parts": [
{
"text": "Greet the user in a warm and welcoming voice: Good morning! Ready to start your day?"
}
]
}
],
"generationConfig": {
"responseModalities": ["audio"],
"temperature": 1,
"speech_config": {
"voice_config": {
"prebuilt_voice_config": {
"voice_name": "Zephyr"
}
}
}
}
}
# Make the request
response = requests.post(url, json=data, headers=headers)
# Save the full JSON response to output.json
with open("output.json", "w") as f:
json.dump(response.json(), f, indent=2)
print("Response saved as output.json")
Multiple-Speaker Example:
#!/bin/bash
set -e -E
HYPRLAB_API_KEY="$HYPRLAB_API_KEY"
MODEL_ID="gemini-2.5-flash-preview-tts"
curl -X POST \
-H "Content-Type: application/json" \
"https://api.hyprlab.io/v1beta/models/${MODEL_ID}:generateContent?key=${HYPRLAB_API_KEY}" \
-d '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Read aloud in a warm, welcoming tone\nSpeaker 1: Hello! We are excited to show you our native speech capabilities.\nSpeaker 2: Where you can direct a voice, create realistic dialog, and so much more. Edit these placeholders to get started."
}
]
}
],
"generationConfig": {
"responseModalities": ["audio"],
"temperature": 1,
"speech_config": {
"multi_speaker_voice_config": {
"speaker_voice_configs": [
{
"speaker": "Speaker 1",
"voice_config": {
"prebuilt_voice_config": {
"voice_name": "Zephyr"
}
}
},
{
"speaker": "Speaker 2",
"voice_config": {
"prebuilt_voice_config": {
"voice_name": "Puck"
}
}
}
]
}
}
}
}' > output.json
echo "Response saved as output.json"
const axios = require("axios");
const fs = require("fs");
// API endpoint and headers
const modelId = "gemini-2.5-flash-preview-tts";
const url = `https://api.hyprlab.io/v1beta/models/${modelId}:generateContent?key=${process.env.HYPRLAB_API_KEY}`;
const headers = {
"Content-Type": "application/json",
};
// Request payload
const data = {
contents: [
{
role: "user",
parts: [
{
text: "Read aloud in a warm, welcoming tone\nSpeaker 1: Hello! We are excited to show you our native speech capabilities.\nSpeaker 2: Where you can direct a voice, create realistic dialog, and so much more. Edit these placeholders to get started.",
},
],
},
],
generationConfig: {
responseModalities: ["audio"],
temperature: 1,
speech_config: {
multi_speaker_voice_config: {
speaker_voice_configs: [
{
speaker: "Speaker 1",
voice_config: {
prebuilt_voice_config: {
voice_name: "Zephyr",
},
},
},
{
speaker: "Speaker 2",
voice_config: {
prebuilt_voice_config: {
voice_name: "Puck",
},
},
},
],
},
},
},
};
// Make the request
axios
.post(url, data, { headers })
.then((response) => {
// Save the full JSON response to output.json
fs.writeFileSync("output.json", JSON.stringify(response.data, null, 2));
console.log("Response saved as output.json");
})
.catch((error) => {
console.error("Error:", error.response ? error.response.data : error.message);
});
import requests
import json
import os
# API endpoint and headers
model_id = "gemini-2.5-flash-preview-tts"
url = f"https://api.hyprlab.io/v1beta/models/{model_id}:generateContent?key={os.getenv('HYPRLAB_API_KEY')}"
headers = {
"Content-Type": "application/json",
}
# Request payload
data = {
"contents": [
{
"role": "user",
"parts": [
{
"text": "Read aloud in a warm, welcoming tone\nSpeaker 1: Hello! We are excited to show you our native speech capabilities.\nSpeaker 2: Where you can direct a voice, create realistic dialog, and so much more. Edit these placeholders to get started."
}
]
}
],
"generationConfig": {
"responseModalities": ["audio"],
"temperature": 1,
"speech_config": {
"multi_speaker_voice_config": {
"speaker_voice_configs": [
{
"speaker": "Speaker 1",
"voice_config": {
"prebuilt_voice_config": {
"voice_name": "Zephyr"
}
}
},
{
"speaker": "Speaker 2",
"voice_config": {
"prebuilt_voice_config": {
"voice_name": "Puck"
}
}
}
]
}
}
}
}
# Make the request
response = requests.post(url, json=data, headers=headers)
# Save the full JSON response to output.json
with open("output.json", "w") as f:
json.dump(response.json(), f, indent=2)
print("Response saved as output.json")
Pricing:
🔊 Chirp TTS Model
Making Request:
Endpoint:
https://api.hyprlab.io/v1/text:synthesize
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Bearer $HYPRLAB_API_KEY" \
--data '{
"input": {
"markup": "Let me take a look, [pause long] yes, I see it."
},
"voice": {
"languageCode": "en-US",
"name": "en-US-Chirp3-HD-Aoede"
},
"audioConfig": {
"audioEncoding": "MP3"
}
}' "https://api.hyprlab.io/v1/text:synthesize" | \
jq -r '.audioContent' | base64 -d > output.mp3
const axios = require("axios");
const fs = require("fs");
// API endpoint and headers
const url = "https://api.hyprlab.io/v1/text:synthesize";
const headers = {
"Content-Type": "application/json",
Authorization: "Bearer $HYPRLAB_API_KEY",
};
// Request payload
const data = {
input: {
markup: "Let me take a look, [pause long] yes, I see it.",
},
voice: {
languageCode: "en-US",
name: "en-US-Chirp3-HD-Aoede",
},
audioConfig: {
audioEncoding: "MP3",
},
};
// Make the request
axios
.post(url, data, { headers })
.then((response) => {
// Extract base64 audio content and decode it
const audioContent = response.data.audioContent;
const audioBuffer = Buffer.from(audioContent, "base64");
// Save as MP3
fs.writeFileSync("output.mp3", audioBuffer);
console.log("Audio saved as output.mp3");
})
.catch((error) => {
console.error("Error:", error);
});
import requests
import base64
# API endpoint and headers
url = "https://api.hyprlab.io/v1/text:synthesize"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer $HYPRLAB_API_KEY"
}
# Request payload
data = {
"input": {
"markup": "Let me take a look, [pause long] yes, I see it."
},
"voice": {
"languageCode": "en-US",
"name": "en-US-Chirp3-HD-Aoede"
},
"audioConfig": {
"audioEncoding": "MP3"
}
}
# Make the request
response = requests.post(url, json=data, headers=headers)
# Extract base64 audio content and decode it
audio_content = response.json()["audioContent"]
audio_data = base64.b64decode(audio_content)
# Save as MP3
with open("output.mp3", "wb") as f:
f.write(audio_data)
Pricing:
Model Name:
Discount:
Pricing:
chirp-3
33% off
$20 / 1M Characters
Last updated