HyprLab Docs
  • GETTING STARTED
    • Introduction
    • Authentication
    • Making requests
  • BROWSE MODELS
    • Model List
      • OpenAI
        • AUDIO
        • CHAT
        • EMBEDDINGS
        • IMAGE
        • TEXT
        • MODERATION
      • Anthropic
      • Google AI
        • 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
      • 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
  1. BROWSE MODELS
  2. Model List
  3. Google AI

AUDIO

PreviousGoogle AINextCHAT

Last updated 5 days ago

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)

SEE MORE:


🔊 TTS Model


Model Name:
Pricing:

chirp-3

$20 / 1M Characters


https://cloud.google.com/text-to-speech/docs/chirp3-hd
Page cover image