Getting Started with Voice213
Welcome to Voice213! This guide will help you get up and running with our AI generation platform.
Prerequisites
Before you begin, make sure you have:
- A Voice213 account. Sign up here .
- An API Key. You can generate one in your dashboard .
Quick Start
Get your API Key
Log in to your dashboard and navigate to the API section. Create a new key and copy it.
Make your first request
Use the following curl command to generate speech from text:
curl -X POST https://api.voice213.com/v1/tts/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Hello, world! This is Voice213.",
"voice_id": "voice_123"
}'Check the response
You will receive a JSON response containing the audio data as a Base64 Data URL.
{
"audio_data": "data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMA...",
"duration": 2.5
}Handling the Audio
You can extract the raw base64 string from the data URL like this:
const response = await fetch('https://api.voice213.com/v1/tts/generate', { ... });
const data = await response.json();
// Extract the base64 string
const base64Data = data.audio_data.split(";base64,").pop();
// Example: Play the audio in the browser
const audio = new Audio(data.audio_data);
audio.play();Next Steps
- Explore the API Reference for detailed endpoint documentation.
- Check out our SDKs for easier integration.
Last updated on