Get started Authentication

Authentication

One API key. Create a key in the dashboard and you're done — no OAuth dance, no token exchange.

2

Make an authenticated request

Paste the command below into your terminal to run your first API request. Replace $MUNSIT_API_KEY with your secret API key.

bash
curl 'https://api.munsit.com/api/v1/text-to-speech/faseeh-v1-preview' \ -H 'Content-Type: application/json' \ -H "x-api-key: $MUNSIT_API_KEY" \ -d '{ "voice_id": "ar-najdi-male-2", "text": "مرحبا بك في فصيح", "stability": 0.5, "streaming": true, "speed": 1 }'
Response
// audio stream — save and play
3

WebSocket authentication

REST requests always use the x-api-key header. WebSocket endpoints accept it too, plus a query-parameter form for browsers, which cannot set headers on a WebSocket connection.

EndpointHeaderQuery parameter
WS /api/v1/listen — speech to textx-api-keyapi_key (or x-api-key)
WS /websocket/text-to-speechx-api-key or Authorization: Bearerx-api-key — also accepted in the initConnection message
const ws = new WebSocket("wss://api.munsit.com/api/v1/listen?api_key=YOUR_API_KEY");
Query-parameter auth puts the key in the URL. Keep connection URLs out of your logs and analytics. If authentication fails on /api/v1/listen, the connection closes with code 1008 after an Error event.
4

Scope your keys

A key isn't all-or-nothing. Each key can be configured with restrictions and quotas from the dashboard.

ControlWhat it doesUse it when
Endpoint restrictionsControl which API endpoints each key can access — a transcription-only key can't call voice cloning.Per-service keys, or a key you hand to a contractor.
Usage limitsSet custom quotas to manage and monitor your API consumption.Staging keys, per-customer keys, anything you don't want running away.
5

Pick your region

The examples above use the global endpoint (api.munsit.com). If you're in the UAE, use the regional endpoint (ae.api.faseeh.ai) with an API key from the UAE dashboard. See All endpoints for more details.

RegionBase URLDashboard
Global · defaulthttps://api.munsit.com/api/v1app.munsit.com
UAE · data residencyhttps://ae.api.faseeh.ai/api/v1ae.app.munsit.com
API keys are region-specific. Each endpoint requires a key from its corresponding dashboard — a key issued by the global dashboard won't authenticate against the UAE endpoint. Deploying to the UAE? Generate a separate key at ae.app.munsit.com.
6

Keep it secret

Your key is a bearer credential — anyone holding it can spend your credits. Keep it secure and private.

RuleWhy
Never commit keys to version controlPublic repo history is scraped continuously. A leaked key is spent within minutes.
Never share a key publiclyAnyone with the key can call the API as you and consume your quota.
Never include a key in client-side applicationsAnything shipped to the browser or a mobile app is readable. Proxy through your own backend.
Use environment variables, scope, and rotatePair with the endpoint restrictions and usage limits above to bound the blast radius.
7

When it fails

Authentication and access failures come back as standard HTTP status codes with a numeric errorCode. The full list lives on Errors.

StatusError codeMeaningFix
40140101Missing or invalid keyCheck the header name is exactly x-api-key, and that the key hasn't expired or been revoked. In curl, wrap the header in double quotes — '…$MUNSIT_API_KEY' sends the literal text instead of your key.
40340301Access deniedThe key or account can't reach this model or endpoint. Contact support to request access.
42942901Concurrency limit exceededWait for current requests to complete or upgrade your plan — see Rate limits.

Working with an AI assistant? Every page is available as Markdown: add .md to the URL, or send an Accept: text/markdown header. For the whole documentation in one request, point it at llms-full.txt; the page index is llms.txt. Or use Copy Page, top right.