Lightweight language and dialect detection. Returns in under 100ms — no AI model call required.
X-NAWA-Cache: HIT).| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer nawa_live_sk_xxx or Bearer nawa_test_sk_xxx |
Content-Type | Yes | application/json |
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The text to detect. Max 5,000 characters. |
| Field | Type | Description |
|---|---|---|
text | string | The original input text |
language | string | Detected language: ar, en, or mixed |
dialect | string or null | Detected Arabic dialect: gulf, egyptian, levantine, msa. Null if not Arabic. |
dialect_confidence | number or null | Confidence score 0—1 for dialect detection. Null if not Arabic. |
script | string | Script type: arabic, latin, or mixed |
text_direction | string | Text direction: rtl or ltr |
word_count | number | Number of words in the input text |
fallback_used | boolean | Always false for this endpoint (local detection only) |
cached | boolean | Whether served from semantic cache |
cost_usd | number | Cost in USD |
credits_used | number | Credits deducted |
Gulf Arabic
ar, dialect: gulf, confidence: 0.95, script: arabic, direction: rtlEgyptian Arabic
ar, dialect: egyptian, script: arabic, direction: rtlEnglish
en, dialect: null, script: latin, direction: ltrMixed script
mixed, dialect detected, script: mixed, direction: rtl| Status | Type | When |
|---|---|---|
| 400 | invalid_request_error | Missing text. Text too long. |
| 401 | authentication_error | Invalid or missing API key |
| 402 | insufficient_credits | No credits remaining |
| 429 | rate_limit_error | Rate limit exceeded |
| 500 | api_error | Internal error |