> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voxnexus.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Translate Text

> Translate one or more texts into a single target language. Source language is auto-detected when not specified.



## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/translate
openapi: 3.0.0
info:
  title: VoxNexus API
  version: 1.0.0
  description: VoxNexus API Documentation
  contact:
    name: API Support
    url: https://voxnexus.ai/support
    email: support@voxnexus.ai
servers:
  - url: https://api.voxnexus.ai
security: []
paths:
  /v1/translate:
    post:
      tags:
        - translate
      summary: Translate Text
      description: >-
        Translate one or more texts into a single target language. Source
        language is auto-detected when not specified.
      operationId: translateText
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TranslateRequest'
      responses:
        '200':
          description: Translation successful
          headers:
            X-Request-ID:
              schema:
                type: string
              description: Request ID
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TranslatedItem'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Insufficient credits or rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Translation provider error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: No available translation provider
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    TranslateRequest:
      type: object
      description: Text translation request
      properties:
        texts:
          type: array
          description: Texts to translate (max 100 items / 50,000 characters)
          items:
            type: string
          example:
            - 第一句
            - 第二句
        source_language:
          type: string
          description: >
            Source language code. Omit (or pass `auto`) for automatic detection;
            providing this forces the source language.

            VoxNexus translation language codes use the `<ISO 639-3>_<Script>`
            form: an ISO 639-3 language code, `_`, and an ISO 15924 script code,
            e.g. `eng_Latn`, `arb_Arab`, `hin_Deva`, `zho_Hans`, `zho_Hant`.
            Other common forms are accepted and normalized, case-insensitively
            and with `-` or `_`: ISO 639-1 (`en`, `ar`), ISO 639-3 (`eng`) and
            BCP 47 tags (`zh-Hans`, `zh-TW`, `pt-BR`). A region subtag only
            selects the script and is then dropped (`zh-TW` → `zho_Hant`,
            `pt-BR` → `por_Latn`).
          example: zho_Hans
        target_language:
          type: string
          description: >-
            Target language code (required). Same format as `source_language`;
            see `GET /v1/models/{model_id}` →
            `translate_capability.target_languages` for the codes a model
            supports.
          example: eng_Latn
        model_id:
          type: string
          description: Translation model ID (e.g. vn-translate-basic).
          example: vn-translate-basic
      required:
        - texts
        - target_language
        - model_id
    TranslatedItem:
      type: object
      description: A single translated text item
      properties:
        text:
          type: string
          description: Translated text
          example: Hello
        detected_source_language:
          type: string
          description: >-
            When `source_language` is specified (not blank or `auto`), it is
            echoed unchanged (e.g. `en`, `EN_us`) and takes precedence over the
            detected language. Otherwise the detected language is returned as a
            `<ISO 639-3>_<Script>` code (e.g. `zho_Hans`, `eng_Latn`).
          example: zho_Hans
      required:
        - text
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
          example: Invalid request parameters
        code:
          type: string
          description: Error code
          example: INVALID_REQUEST
        details:
          type: string
          description: Detailed error information (optional)
          example: Detailed error information
        request_id:
          type: string
          description: Request ID (optional)
          example: req_1234567890
      required:
        - error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: Authenticate using X-Api-Key header

````