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, 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. 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. 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.
An account has one API key. To replace it, delete it on the API Keys page and create a new one. You can also switch it 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
This 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.mp3import os
import requests
response = requests.post(
"https://api.voice213.com/api/v1/tts",
headers={"Authorization": f"Bearer {os.environ['VOICE213_API_KEY']}"},
json={"text": "مرحبا بيكم في Voice213", "model": "voice213-lite", "voice": "nariman"},
timeout=300,
)
response.raise_for_status()
result = response.json()
# audioUrl is a link to the MP3 file
with open("hello.mp3", "wb") as f:
f.write(requests.get(result["audioUrl"], timeout=60).content)
print(result["billableChars"], result["cost"], result["remainingCredit"])// Node.js 18+, saved as hello.mjs
import { writeFile } from "node:fs/promises";
const response = await fetch("https://api.voice213.com/api/v1/tts", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.VOICE213_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ text: "مرحبا بيكم في Voice213", model: "voice213-lite", voice: "nariman" }),
});
const result = await response.json();
if (!response.ok) throw new Error(result.message ?? result.error);
// audioUrl is a link to the MP3 file
const audio = await fetch(result.audioUrl);
await writeFile("hello.mp3", Buffer.from(await audio.arrayBuffer()));
console.log(result.billableChars, result.cost, result.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: "model": "voice213-pro-2", or "voice": "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.
Next steps
Was this page helpful?