Translation

Ask for a translation the same way you'd ask any other question — through /v1/chat/completions. No separate endpoint, no target-language parameter: say what you want in the message.

There is no /v1/translations endpoint. A translation is a normal chat completion — send the text and say which language you want back. Call larsa-auto and the router notices the instruction and routes it consistently; call larsa-general (or larsa-general-fast) directly and you get exactly the same model, one hop sooner.

What the router listens for

When you call larsa-auto, it reads your message for a translation instruction before anything else — this decides which backend answers, not what the answer says. A phrase it recognises settles the route in microseconds, with no extra model call:

LanguageRecognised as a translation instruction
Englishtranslate — anywhere in the message
Persianترجمه کن · ترجمه بکن · به اسپانیایی ترجمه کن · برگردان به
Spanishtraduce · traducir · traduzca
This table only affects larsa-auto. Phrase it differently, or call larsa-general directly, and translation still works — the sentence is still an instruction the model follows, the router just isn't the one deciding that for you.

Forcing the target language

There is no target_language field. Name the language in the instruction and the model does the rest — put it early in the sentence rather than trusting it to notice a language named only at the end of a long passage.

POST/v1/chat/completions
Translate, target language forced
curl -s https://api.console.larsa.larsima.com/v1/chat/completions \
  -H "Authorization: Bearer $LARSA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "larsa-auto",
    "messages": [{
      "role": "user",
      "content": "Translate the following into Spanish: مهلت تجدیدنظرخواهی بیست روز از تاریخ ابلاغ است."
    }]
  }'

# {"choices":[{"message":{"content":
#   "El plazo para apelar es de veinte días a partir de la fecha de notificación."
# }}], "model":"larsa-general", ...}

The three languages this system is built around

English, Persian and Spanish are what the rest of the product is built from — the Iranian and Spanish/EU legal corpora, the interface, the support that reads your traffic. Translation among these three is what actually gets exercised. Anything else routes to the same general-purpose model and its broader multilingual ability, which has not been measured here — treat it as best effort, not a guarantee, and check a sample before you rely on it.

Checking the route without spending tokens

POST /v1/route runs the same classification larsa-auto runs, without answering — useful while you're deciding how to phrase something.

cURL
curl -s https://api.console.larsa.larsima.com/v1/route \
  -H "Authorization: Bearer $LARSA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"traduce esto al persa"}]}'

# {"route":"translate","decided_by":"signal",
#  "backend":"http://127.0.0.1:8085/v1","elapsed":0.001}
ParameterTypeDescription
route
Optional
stringlaw-ir · law-es · translate · code · general — which backend would answer.
decided_by
Optional
stringsignal (settled from the text), model (a cheap classification call was needed), or image (a picture was attached).
Navigate Open esc Close