# Translate texts

- **Method:** `POST`
- **Path:** `/api/v1/translate`
- **Operation ID:** `translate_api_v1_translate_post`
- **Tags:** Translation

## Effective servers

- `http://127.0.0.1:8100`

  Voice Creator Pro on this computer

## Request body

**Required:** `true`

**Content type:** `application/json`

schema: `TranslateRequest`

- **`target_lang` (required)**: `string`

  Target language code or English name
- **`texts` (required)**: `array of string`

  Texts to translate, one result returned per input in input order
- **`candidates`**: `integer`, default: `1`

  Phrasings to sample per text. 1 returns a plain translation.
- **`fit_seconds`**: `(array of (number | null)) | null`

  Per-text time slot in seconds. Requires candidates > 1.
- **`glossary`**: `(array of object) | null`

  Terminology entries: {source, target, keep}
- **`source_lang`**: `string | null`

  Source language, when known. Inferred if omitted.

**Example:**

```json
{
  "texts": [
    "Hello there."
  ],
  "target_lang": "fr",
  "source_lang": "en",
  "glossary": [
    {
      "additionalProperty": "anything"
    }
  ],
  "fit_seconds": [
    1
  ],
  "candidates": 16
}
```

## Responses

### 200 Successful Response

**Content type:** `application/json`

`any`

**Example:**

```json
null
```

### 422 Validation Error

**Content type:** `application/json`

schema: `HTTPValidationError`

- **`detail`**: `array`

  **Items:**

  schema: `ValidationError`
  - **`loc` (required)**: `array of (string | integer)`
  - **`msg` (required)**: `string`
  - **`type` (required)**: `string`
  - **`ctx`**: `object`
  - **`input`**: `any`

**Example:**

```json
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": null,
      "ctx": {}
    }
  ]
}
```

## Schemas

- `HTTPValidationError` — shown above.
- `TranslateRequest` — shown above.
- `ValidationError` — shown above.
