AIVAX

Translations

Use Translations to translate text, the visible text in images, and the speech in audio into any language. It fits product content, support messages, signs and screenshots, and voice notes that need to reach users in another language.

Before calling this endpoint, create an API key and make sure the account has a positive balance.

Endpoint #

POST /api/v1/generations/translate

Request behavior #

PropertyTypeRequiredDescription
toLanguageStringYesLanguage to translate into.
fromLanguageStringNoLanguage of the documents. When omitted, it is detected from each document’s content.
documentsContent part arrayYesOne or more documents as OpenAI-compatible content parts: text, image_url, or input_audio.

Languages are free-form: a name such as Japanese, a code such as pt-BR, or a variant such as Spanish (Mexico, informal). The same languages apply to every document in the request.

The service returns only the translated content and preserves formatting, Markdown, code, URLs, numbers, and proper names. Content is always treated as text to translate, not as instructions. For images, it translates the visible text; for audio, the spoken content. Other content types, such as files or video, return 400 Bad Request.

JSON
{
  "fromLanguage": "English",
  "toLanguage": "Brazilian Portuguese",
  "documents": [
    {
      "type": "text",
      "text": "Your order has shipped and should arrive within three business days."
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://example.com/sign.png"
      }
    }
  ]
}

Read the response #

data contains one translated string per document, in the same order as documents. If any document fails, the request returns an error instead of partial results. Documents that finished before the failure are still billed, so fix or remove the failing document before retrying.

JSON
{
  "message": null,
  "data": [
    "Seu pedido foi enviado e deve chegar em até três dias úteis.",
    "Proibido estacionar"
  ]
}

Translations are model-generated. Review them before publishing legal, medical, financial, or other consequential content.

Async generation #

Add "async": true to queue the translation. The API answers with HTTP 202 and an ID, and you fetch the stored result later or receive a webhook when it is done. See Async generations.

JSON
{
  "fromLanguage": "English",
  "toLanguage": "Brazilian Portuguese",
  "documents": [
    { "type": "text", "text": "Your order has shipped." }
  ],
  "async": true
}

Pricing and limits #

Translations are billed in processing units (PUs), covering input and output usage, and the plan multiplier applies.

The number of translation requests per minute and per day depends on the plan; see Data processing limits. The limit counts HTTP requests, not documents. A request that would exceed any active window returns 429 Too Many Requests.

The embedded API reference contains the server-maintained request, response, authentication, and error details:

Type to search the documentation.