Documentation menu

Chats and text

Text translation

Translate tickets, emails and saved replies, with the source language detected.

Shell
curl https://api.spiiksi.fi/v1/translate \
  -H "Authorization: Bearer $SPIIKSI_KEY" -H "Content-Type: application/json" \
  -d '{"text": ["Hei, laskuni on väärin", "Kiitos!"], "target": "en",
       "context": "Customer support for a bicycle shop",
       "glossary": {"Acme Cargo": "Acme Cargo"}}'
JSON
{"translations": [
   {"text": "Hi, my invoice is wrong", "detected_source_language": "fi", "translated": true},
   {"text": "Thank you!", "detected_source_language": "fi", "translated": true}],
 "target": "en", "characters_billed": 29, "charged": 0.0003, "currency": "EUR"}
FieldNotes
textOne string, or a list of up to 100 (10,000 characters each, 50,000 in all). The order is kept.
targetThe language to translate into: en, fi, pt-BR…
sourceOptional. Without it the language is detected and returned.
contextOptional, up to 500 characters: where the text comes from, to steer the wording.
glossaryOptional, up to 50 terms and how to render them: product names, your own words.

The text is always translated, never followed as instructions. Names, numbers, order numbers, email addresses, links and code are kept as written.

Text already in the target language comes back unchanged with "translated": false and costs nothing. Characters are billed at €10 per million, excluding VAT; with a test key, a stand-in tags the text instead ([en] Hei…) for free.