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/api/v1/tts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "سلام عليكم معاكم VOICE213",
"voice_id": "nariman"
}'Check the response
You will receive a JSON response containing the audio data as a Base64 Data URL.
{
"audio_data": "data:audio/wav;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMA...",
"format": "audio/wav",
"textLength": 9,
"wordCount": 2,
"pointsDeducted": 2
}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', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
});
const data = await response.json();
const audio = new Audio(data.audio_data);
await audio.play();
Next Steps
- Explore the API Reference for detailed endpoint documentation.
Last updated on