API
Translate text
Translate one or more strings with POST /v2/translate, or with the Google v2 and Azure v3 text endpoints.
Use POST /v2/translate to translate text. It has the same shape as the DeepL endpoint. The Google Translate v2 and Azure Translator v3 endpoints at the end of this page do the same work in their own formats.
Request
POST https://vibeql.com/v2/translate
Authorization: DeepL-Auth-Key YOUR_KEY
| Parameter | Required | Description |
|---|---|---|
text |
Yes | Text to translate. Repeat it to translate several strings in one request. Up to 50 values. |
target_lang |
Yes | Target language code, for example DE, PT-BR or EN-US. See Languages. |
source_lang |
No | Source language code, for example EN. Leave it out and the model reads the source language from the text. |
show_billed_characters |
No | Set to true or 1 to add billed_characters to each result. |
The request body can be up to 128 KB. Send the body as a form or as JSON.
curl https://vibeql.com/v2/translate \
-H "Authorization: DeepL-Auth-Key $VIBEQL_API_KEY" \
-d "text=Good morning" \
-d "text=Thank you" \
-d "target_lang=ES" \
-d "source_lang=EN"curl https://vibeql.com/v2/translate \
-H "Authorization: DeepL-Auth-Key $VIBEQL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": ["Good morning", "Thank you"], "target_lang": "ES", "source_lang": "EN"}'Response
The API returns one result for each text value, in the same order.
{
"translations": [
{ "detected_source_language": "EN", "text": "Buenos días" },
{ "detected_source_language": "EN", "text": "Gracias" }
]
}
With show_billed_characters=true:
{
"translations": [
{ "detected_source_language": "EN", "text": "Buenos días", "billed_characters": 12 }
]
}
Other DeepL parameters, such as formality, glossary_id, tag_handling or context, are ignored. See Migrate from DeepL.
Usage
Usage counts the characters of the source text that you send, not the translated text. Good morning counts as 12 characters in every target language. Check your total with GET /v2/usage.
Google Translate v2 format
GET or POST https://vibeql.com/language/translate/v2. Repeat q for several strings. source is optional; leave it out and the API detects the language.
curl "https://vibeql.com/language/translate/v2?key=$VIBEQL_API_KEY" \
-d "q=Good morning" \
-d "q=Thank you" \
-d "target=es"
{
"data": {
"translations": [
{ "translatedText": "Buenos días", "detectedSourceLanguage": "en" },
{ "translatedText": "Gracias", "detectedSourceLanguage": "en" }
]
}
}
See Migrate from Google Translate for all parameters.
Azure Translator v3 format
POST https://vibeql.com/translate?api-version=3.0&to=es. Send a JSON array of Text items. Repeat to for up to 10 target languages. from is optional.
curl "https://vibeql.com/translate?api-version=3.0&to=es" \
-H "Ocp-Apim-Subscription-Key: $VIBEQL_API_KEY" \
-H "Content-Type: application/json" \
-d '[{"Text": "Good morning"}]'
[
{
"detectedLanguage": { "language": "en", "score": 1 },
"translations": [{ "text": "Buenos días", "to": "es" }]
}
]
With several to languages, usage counts the source characters once for each target language. See Migrate from Azure Translator.