Skip to main content

Translate

POST /ai/translation
devhttps://api.sandbox.ovok.com

AI Translation uses LLMs for translation.

Warning

The translation may fail or return hallucinated results due to the nature of LLMs.

Body Parameters

ParameterTypeDescriptionExample
sourceLanguagestringISO 639-1 language code, or full language name.en-US
targetLanguagestringISO 639-1 language code, or full language name.de-DE
textstring[]The text to translate.["Hello, world!", "How is ?"]

String values in the text array can be in any format, including HTML, Markdown, or plain text and may contain variables with double curly braces.

Request body

Content-Type: application/json

  • sourceLanguage: string (required)
  • targetLanguage: string (required)
  • text: array (required)

Responses

CodeDescription
200Success.
400The request could not be operated by the server.
401The resource owner or authorization server denied the request.
404The requested resource could not be found.
422The request could not be validated by the server.
500The server encountered an unexpected condition. Please try again later.

200CreateTranslationResponseDto (application/json)

  • sourceLanguage: string (required)
  • targetLanguage: string (required)
  • text: string[] (required)

Example

{
"sourceLanguage": "en",
"targetLanguage": "de",
"text": [
"Hallo {{ name }}, wie geht es Ihnen?",
"Mir geht es gut, danke {{ anotherName }}. Ich freue mich, dass Sie ans Telefon gegangen sind.",
"<p>Keine Sorge, Sir, ich werde mich darum <b>kümmern</b>.</p>"
]
}