HyprLab Docs
  • GETTING STARTED
    • Introduction
    • Authentication
    • Making requests
  • BROWSE MODELS
    • Model List
      • OpenAI
        • AUDIO
        • CHAT
        • EMBEDDINGS
        • IMAGE
        • TEXT
        • MODERATION
      • Anthropic
      • Google
        • AUDIO
        • CHAT
          • OpenAI-Format
          • Google-Format
        • IMAGE
        • VIDEO
      • DeepSeek
      • x.AI
        • CHAT
        • IMAGE
      • Cohere
      • Meta AI
      • Qwen
      • Microsoft
      • Mistral AI
      • Perplexity AI
      • Cognitive Computations
      • Nvidia
      • Nous Research
      • MiniMax
      • Amazon
      • AI21-Labs
      • Reka AI
      • Black Forest Labs
      • Stability AI
        • Stable Diffusion 3.5
        • Stable Diffusion 3 - Ultra
        • Stable Diffusion 3 - Core
        • Stable Diffusion 3
        • Stable Diffusion XL 1.0
      • Recraft AI
      • Ideogram AI
      • Kling AI
      • Luma AI
      • Free-GPT
  • Playground
    • HyprLab Studio
    • HyprLab Chat
    • HyprLab - SillyTavern
  • INTEGRATION
    • Basic Setup
      • SillyTavern
      • Janitor AI
      • Risu AI
      • Agnai Chat
      • TypingMind
      • ChatWaifu - Steam
Powered by GitBook
On this page
  • 🔊 Gemini TTS Model
  • Making Request:
  • Pricing:
  • 🔊 Chirp TTS Model
  • Making Request:
  • Pricing:
  1. BROWSE MODELS
  2. Model List
  3. Google

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


PreviousGoogleNextCHAT

Last updated 6 days ago

LEARN MORE: |

Model Name:
Discount:
Input:
Output:
Context Length:
Moderation:
Capabilities:
Model Name:
Discount:
Input:
Output:
Context Length:
Moderation:
Capabilities:

SEE MORE:

  • gemini-2.5-pro-preview-tts

  • 60% off

  • $0.4 / 1M Tokens

  • $8 / 1M Tokens

  • 32,000

  • Unfiltered

  • Single-Speaker Audio

  • Multi-Speaker Audio

  • gemini-2.5-flash-preview-tts

  • 60% off

  • $0.2 / 1M Tokens

  • $4 / 1M Tokens

  • 32,000

  • Unfiltered

  • Single-Speaker Audio

  • Multi-Speaker Audio

https://aistudio.google.com/generate-speech
https://ai.google.dev/gemini-api/docs/speech-generation
https://cloud.google.com/text-to-speech/docs/chirp3-hd
Page cover image