Two AI helpers for text and language: translate a text into another language, and guess the most likely language of a place from its country, state and city. Both answer with plain text, store nothing and run on the customer’s own OpenAI API key.
/api/Translations/translatesourceText into the language targetLang. Returns the translation as plain text./api/Translations/detect-language-aicountry, state and city. Returns an ISO 639-3 language code such as nld as plain text.The texts of the chat window per language are managed per channel, see the Channels page.
sourceText (string, required)targetLang (string, required)nl, fr, deu or Eng; a regional code such as nl-BE also works. The code is not validated: an unknown code is passed to the model as it is.Accept header it comes as text/plain; with Accept: application/json as a JSON string.POST /api/Translations/translate
Authorization: Bearer <token>
Content-Type: application/json
{
"sourceText": "Thank you for your message. Your order 2026-001234 ships on Monday.",
"targetLang": "nl"
} 200 OK
Content-Type: text/plain; charset=utf-8
Bedankt voor je bericht. Je bestelling 2026-001234 wordt maandag verzonden. POST /api/Translations/translate
Accept: application/json
200 OK
Content-Type: application/json; charset=utf-8
"Bedankt voor je bericht. Je bestelling 2026-001234 wordt maandag verzonden." country (string, required)Belgium or BE.state (string, required)city (string, required)All three must be present and not empty; a missing one gives 400.
nld, fra or deu). When it is not sure, it answers eng.GET /api/Translations/detect-language-ai?country=Belgium&state=Wallonia&city=Namur
Authorization: Bearer <token> 200 OK
Content-Type: text/plain; charset=utf-8
fra Every signed-in user of the customer can call these endpoints. The calls use the OpenAI API key of the customer in the token, so they count towards that customer’s OpenAI usage.
200 OK400 Bad RequestsourceText, targetLang, country, state or city, or no OpenAI API key configured for the customer (the text No valid OpenAI API key configured for this customer.).404 Not Found500 Internal Server ErrorAn error occurred during translation.503 Service UnavailableISO 639 codes of 2 or 3 letters, such as nl, nld, fr or fra; case does not matter. The model gets the English name of the language. An unknown code is not refused, so check your codes.
No. Both endpoints only return text; no message, draft or other data is changed.
The default text translation model set for the customer, or AnswerPal's default translation model when none is set. The language detection always uses AnswerPal's general model.
Both calls run on the customer's own OpenAI API key. Configure the key for the customer first.
AnswerPal: AI-powered customer service solutions to elevate your support and communication effortlessly.
For all support, sales, and partnership inquiries, email us at info@answerpal.eu
AnswerPal
Bisschoppenhoflaan 380
2100 Antwerp
Belgium
+32.36416685
BE 0862.692.858