Get Your API Key
Add API credit, create a key, and make your first request, on any plan
Every API request is authenticated with an API key and paid from your account's prepaid API credit. This guide gets you both, then makes your first request. The API is open on every plan, the Free plan included: you don't need a subscription or a credit pack to use it.
1. Open the Developer workspace
Sign up
Create an account at voice213.com with your email address or your Google account. You'll need an Algerian mobile number, such as 0661234567 or +213661234567.
Switch to the Developer workspace
Click the workspace switcher under the logo at the top of the sidebar (it reads Creative) and choose Developer. This workspace holds your API key, the API Playground, the Speech to text page, usage and your API credit.
API requests aren't paid from your plan's credits. They're paid from API credit, a separate balance in dinars. Even an Unlimited subscription pays for API requests from API credit, and the Free plan can use the API as soon as it has some.
2. Add API credit
API voice-overs are priced per character, in Algerian dinars, by model: Voice213 Lite, the default, costs 9 DA per 1,000 characters, with a minimum of 100 characters per request. Speech to text is priced per second of audio: KhasbhaSTT costs 3 DA a minute for files (at least 30 seconds per file), and KhasbhaSTT LIVE 5 DA a minute for live streams (at least 15 seconds per session). See API Pricing & Limits for every model.
Open the Developer Dashboard
In the Developer workspace, open the Developer Dashboard. Your balance is on the API credit card, and every model's price is under Endpoints & pricing.
Top up
Click Top up, choose 2,000, 5,000, 10,000 or 20,000 DA (or enter any amount from 1,000 to 200,000 DA), and pay with Edahabia or CIB, by Visa or Mastercard, or by bank transfer. Online payments are added a few moments after they go through.
1,000 DA covers about 111,000 characters with Voice213 Lite, or 50,000 with Voice213 Pro. In speech to text, it covers about 5 hours 30 minutes of audio with KhasbhaSTT, or 3 hours 20 minutes with KhasbhaSTT LIVE. API credit never expires.
3. Create an API key
Open API Keys
In the Developer workspace, open API Keys and click Create key.
Name the key
Enter a Key name you'll recognize later, such as My Store Backend.
Copy it now
Your new key starts with sk_live_. Copy it and keep it somewhere safe, then click I've saved it: the key is shown only once. Afterwards the page shows only its last eight characters.
Treat your API key like a password. Never commit it to source control or ship it in browser or mobile app code. Anyone who has it can spend your API credit.
To transcribe live from a browser, your server hands the browser a short-lived live token instead of the key: see Live tokens for browsers.
An account can have up to 10 API keys, for example one per app or server: they share your API credit and your limits. To replace a key, create the new one, switch your code to it, then delete the old one. You can also switch a key off and on again without deleting it.
4. Set your API key
Keep the key in an environment variable so it never appears in your code:
export VOICE213_API_KEY="sk_live_your_key_here"$env:VOICE213_API_KEY = "sk_live_your_key_here"5. Make your first request
In Python or JavaScript, install the official SDK first. With cURL there's nothing to install.
pip install voice213npm install @voice213/sdkThis request turns a line of Algerian darija into speech with the Voice213 Lite model and the voice Nariman, then saves it as hello.mp3:
curl -s -X POST https://api.voice213.com/api/v1/tts \
-H "Authorization: Bearer $VOICE213_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "مرحبا بيكم في Voice213", "model": "voice213-lite", "voice": "nariman"}' \
| jq -r .audioUrl | xargs curl -s -o hello.mp3from voice213 import Voice213
client = Voice213() # reads VOICE213_API_KEY
speech = client.text_to_speech.create("مرحبا بيكم في Voice213", model="voice213-lite", voice="nariman")
# speech.audio_url is a link to the MP3 file: save() downloads it
speech.save("hello.mp3")
print(speech.billable_chars, speech.cost, speech.remaining_credit)// Node.js 18+, saved as hello.mjs
import Voice213 from "@voice213/sdk";
const voice213 = new Voice213(); // reads VOICE213_API_KEY
const speech = await voice213.textToSpeech.create({ text: "مرحبا بيكم في Voice213", model: "voice213-lite", voice: "nariman" });
// speech.audioUrl is a link to the MP3 file: save() downloads it
await speech.save("hello.mp3");
console.log(speech.billableChars, speech.cost, speech.remainingCredit);Play hello.mp3 and you'll hear Nariman say "Welcome to Voice213" in Algerian darija. The text is 22 characters, so the request was billed the 100-character minimum: 0.90 DA. The voice-over is also in your History in the web app.
To hear the same line with another model or voice, change one word: the model to voice213-pro-2, or the voice to kenza.
Want to try it without writing code? The API Playground runs the same request from your browser with your key, and shows the matching cURL, JavaScript and Python. For speech to text, the Speech to text page does the same with KhasbhaSTT and KhasbhaSTT LIVE.
Next steps
Quick Start
Pick a model, a voice and a dialect, then add tone directions.
Text to Speech
Everything the voice-over endpoint can do.
Voices
Listen to all 30 voices and copy their IDs.
Going to Production
Keep your key safe, retry the right errors, and stay within limits.
KhasbhaSTT
Transcribe audio and video files, darija first.
KhasbhaSTT LIVE
Transcribe a live audio stream as it's spoken.
Was this page helpful?