Get up and running with Hyperbolic’s Serverless Inference API in minutes. This guide walks you through making your first API calls for text, image, and audio generation.
Convert text to natural-sounding speech using the audio generation endpoint.
Python
cURL
import requestsimport base64url = "https://api.hyperbolic.xyz/v1/audio/generation"headers = { "Content-Type": "application/json", "Authorization": "Bearer YOUR_API_KEY"}data = { "text": "Welcome to Hyperbolic! This is an example of text-to-speech generation.", "speed": 1}response = requests.post(url, headers=headers, json=data)result = response.json()# Save the generated audioaudio_data = base64.b64decode(result["audio"])with open("generated_audio.mp3", "wb") as f: f.write(audio_data)
curl -X POST "https://api.hyperbolic.xyz/v1/audio/generation" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "text": "Welcome to Hyperbolic! This is an example of text-to-speech generation.", "speed": 1 }'
The speed parameter controls playback speed (1.0 is normal). The response contains base64-encoded audio data.