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

# AI Translate

> [!WARNING]
>
> Before call make sure that AI Translate feature enabled on admin dashboard,
> otherwise you will get 405 error.

Supported language codes:

| Language | Code |
| - | - |
| English | en |
| Spanish | es |
| Chinese simplified | zh-Hans |
| Chinese traditional | zh-Hant |
| French | fr |
| German | de |
| Japanese | ja |
| Korean | ko |
| Italian | it |
| Russian | ru |
| Portuguese | pt |
| Arabic | ar |
| Hindi | hi |
| Turkish | tr |
| Dutch | nl |
| Polish | pl |
| Ukrainian | uk |
| Albanian | sq |
| Armenian | hy |
| Azerbaijani | az |
| Basque | eu |
| Belarusian | be |
| Bengali | bn |
| Bosnian | bs |
| Bulgarian | bg |
| Catalan | ca |
| Croatian | hr |
| Czech | cs |
| Danish | da |
| Estonian | et |
| Finnish | fi |
| Galician | gl |
| Georgian | ka |
| Greek | el |
| Gujarati | gu |
| Hungarian | hu |
| Indonesian | id |
| Irish | ga |
| Kannada | kn |
| Kazakh | kk |
| Latvian | lv |
| Lithuanian | lt |
| Macedonian | mk |
| Malay | ms |
| Maltese | mt |
| Mongolian | mn |
| Nepali | ne |
| Norwegian | no |
| Pashto | ps |
| Persian | fa |
| Punjabi | pa |
| Romanian | ro |
| Sanskrit | sa |
| Serbian | sr |
| Sindhi | sd |
| Sinhala | si |
| Slovak | sk |
| Slovenian | ur |
| Uzbek | uz |
| Vietnamese | vi |
| Welsh | cy |

#### Body Params

**smart\_chat\_assistant\_id** `string` *required*

AI Agent id.

**text** `string` *required*

Text to translate. The maximum length for the text is 2000 symbols.

**to\_language** `string` *required*

Translation language code. Defaults to `en`.

#### Headers

**QB-Token** `string` *required*

A user or application session token. See [Authentication](https://docs.quickblox.com/reference/authentication.md)
page to learn more about session tokens.

#### Responses

> [accordion] 200
>
> A successful response
>
> **answer** `string`

> [accordion] 400
>
> An error response
>
> **errors** `array of strings`

> [accordion] 404
>
> An error response
>
> **errors** `array of strings`

> [accordion] 405
>
> An error response
>
> **errors** `array of strings`

```bash cURL theme={null}
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
  "smart_chat_assistant_id": "65d5f3473d5d68095462165d",
  "text": "Hola",
  "to_language": "en"
}' \
https://api.quickblox.com/ai/ai_extensions/ai_translate
```

```json 200 theme={null}
{
  "answer": "Hello"
}
```

```json 400 theme={null}
{
  "errors": [
    "Validation Error: to_language: Wrong language code, available languages: en, es, zh-Hans, zh-Hant, fr, de, ja, ko, it, ru, pt, ar, hi, tr, nl, pl, uk, sq, hy, az, eu, be, bn, bs, bg, ca, hr, cs, da, et, fi, gl, ka, el, gu, hu, id, ga, kn, kk, lv, lt, mk, ms, mt, mn, ne, no, ps, fa, pa, ro, sa, sr, sd, si, sk, sl, ur, uz, vi, cy"
  ]
}
```

```json 404 theme={null}
{
  "errors": [
    "The resource wasn't found"
  ]
}
```

```json 405 theme={null}
{
  "errors": [
    "AiTranslate is disabled"
  ]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.