Translate
You can get machine translation and translation quality scores from the
/translate
REST API endpoint or any of the official SDKs (Python, Go, Rust,
JS, or cURL).
Under the hood, the /translate
endpoint simultaneously leverages multiple
state-of-the-art LLM and machine translation models to perform translations. The
translations from these models are scored and ranked using reference-free quality
estimation models. This allows us to select the highest quality machine translation
for the given source and target languages.
The /translate endpoint will return a JSON object response with two fields:
Best translation
- The translated text.Score
- A score from -1.0 to 1.0 representing the translation quality. Higher the score better the quality.
Additionally, you can opt to use third-party translation engines such as OpenAI, DeepL, and Google. By default, the use of these commercial engines is set to false.
Our translation API supports a wide range of languages, including but not limited to English, Hindi, French, Spanish, German, and more.
Generate a Translation
To generate a translation, you can use the following code examples. Depending on your preference or requirements, select the appropriate method for your application.
The output will look something like:
This approach presents a straightforward way for readers to choose and apply the code example that best suits their needs for generating text completions using either Python, Go, Rust, JS, or cURL.