An API you already know how to call

Call the engine with a Bearer key on /v1 routes. The examples below are illustrative. The public API hostname will be fixed at launch; today you can try the engine through the preview page.

api.muwakilai.com in the samples is the intended production shape, not a declared production endpoint yet.

Core REST /v1 endpoints

Endpoint Purpose
POST /v1/chat/completions Standard text & tool-calling completions
POST /v1/audio/speech Text-to-Speech with preset or cloned voices
POST /v1/audio/transcriptions Arabic dialect Speech-to-Text (WAV, WebM, M4A, MP3)
POST /v1/embeddings Multilingual embeddings for RAG knowledge bases
POST /v1/agents/{id}/chat Streaming SSE agent turn with tools & memory
POST /v1/voices Upload a consented 3–6 s voice clone reference
GET /v1/conversations/{id}/analysis Post-call summary, sentiment state & extracted JSON

Chat completions

curl https://api.muwakilai.com/v1/chat/completions \
  -H "Authorization: Bearer $MUWAKIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "muwakil-chat",
    "messages": [
      {"role": "system", "content": "جاوب باللهجة الأردنية ومن معلومات المتجر فقط."},
      {"role": "user", "content": "شو ساعات العمل يوم الخميس؟"}
    ]
  }'

Text to speech

curl https://api.muwakilai.com/v1/audio/speech \
  -H "Authorization: Bearer $MUWAKIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "muwakil-voice",
    "voice": "omar",
    "dialect": "jo",
    "input": "طلب رقم سبعة تسعة خمسة اثنين بخمسطعش دينار"
  }' --output reply.wav

Speech-to-Text (/v1/audio/transcriptions)

curl https://api.muwakilai.com/v1/audio/transcriptions \
  -H "Authorization: Bearer $MUWAKIL_API_KEY" \
  -F "file=@call.wav" \
  -F "language=ar"

Agent Chat Streaming (SSE)

curl -N https://api.muwakilai.com/v1/agents/agent_store_jo/chat \
  -H "Authorization: Bearer $MUWAKIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "بدي أتأكد من طلبي رقم 4821",
    "stream": true
  }'

Post-call sentiment & data extraction

curl https://api.muwakilai.com/v1/conversations/conv_91f2a8/analysis \
  -H "Authorization: Bearer $MUWAKIL_API_KEY"

Auth and isolation

Each product or customer gets its own key. The preview page never sends the key to the browser; it is injected on the server. Do not commit keys to public repositories.

Security & self-hosting details