Skip to content

The MenaVoice API authenticates requests with API keys. Send your key in the x-api-key header of every request:

curl -X POST https://api.menavoice.ai/api/tts \
  -H "x-api-key: $MENAVOICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "مرحباً", "voiceId": "layla"}'

​API keys

  • Create keys on the API Keys page of the Developer workspace. Every account can create keys, on any plan.
  • A key starts with mv_live_. It's shown once, when you create it. MenaVoice stores only a hash, so a lost key can't be recovered: create a new one instead.
  • An account can have up to 10 keys.
  • All keys of an account share its API credit, rate limits and concurrency.
  • The API Keys page shows when each key was last used. The Developer Dashboard shows usage and cost for each key.

​Revoking a key

Revoke a key on the API Keys page when it's no longer needed or may have leaked. It stops working immediately. Requests that use it get 401 Invalid or revoked API key.

​Authentication errors

StatusErrorCause
401Missing or invalid Authorization headerThe request has no x-api-key header, or it's empty.
401Invalid or revoked API keyThe key is wrong, incomplete or revoked.

​Public endpoints

GET /tts/voices and GET /health don't need a key.

​Keeping keys safe

An API key gives full access to your API credit. Keep it secret.

  • Store keys in environment variables or a secret manager, never in source code.
  • Use keys only in server-side code. Never put them in websites, mobile apps or anything else you ship to users.
  • Use a separate key for each app and environment, and revoke keys you no longer use.
  • If a key may have leaked, revoke it right away and create a new one.

Was this page helpful?