Sawalni API
APIsDocumentationOpen portal ↗
Omneity Labs API collection ↗Integration quickstart →API keys and playgrounds →
API Reference

Tarjamli v3 Translation API

Translate Moroccan Arabic written in Arabic or Latin script into English, French, or Modern Standard Arabic. Tarjamli is a focused translation model. It does not provide explanations, chat, or analysis.

Endpoint

text
POST https://api.sawalni.com/v1/chat/completions

Model contract

FieldValue
Modeltarjamli-v3
SourceMoroccan Arabic in Arabic or Latin script
TargetsEnglish, French, Modern Standard Arabic
Context window8,192 tokens, including input and output
OutputThe raw translation only

Use exactly this user-message format:

text
Translate this Moroccan Arabic text to TARGET. Return only the translation. SOURCE_TEXT

Replace TARGET with one of the three target names in the table. Do not add a system message, chat history, labels, Markdown, or extra instructions. Use temperature: 0 for deterministic translation.

cURL

bash
curl https://api.sawalni.com/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "tarjamli-v3", "messages": [{ "role": "user", "content": "Translate this Moroccan Arabic text to English. Return only the translation.\n\nواش نتا جاي غدا ولا باقي ما عارف؟" }], "temperature": 0, "max_tokens": 512, "stream": false }'

Python

python
from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.sawalni.com/v1", ) response = client.chat.completions.create( model="tarjamli-v3", messages=[{ "role": "user", "content": ( "Translate this Moroccan Arabic text to French. " "Return only the translation.\n\n" "safi ana ghadi nmchi daba, n3ayet lik mn b3d" ), }], temperature=0, max_tokens=512, ) print(response.choices[0].message.content)

Response

Read only choices[0].message.content. That field contains the translation without a label or explanation.

json
{ "model": "tarjamli-v3", "choices": [{ "message": { "role": "assistant", "content": "Are you coming tomorrow or are you still unsure?" }, "finish_reason": "stop" }] }

Use the Tarjamli playground to verify a request before integration.