---
title: ai_translate function
description: Learn the syntax of the ai\_translate function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/ai_translate
---

# `ai_translate` function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime

> [!NOTE]
> **Preview**
>
> This functionality is in [Public Preview](https://docs.databricks.com/aws/en/release-notes/release-types.md) and [HIPAA compliant](https://docs.databricks.com/aws/en/security/privacy/hipaa.md#regional-support-for-features).
>
> During the preview:
>
> * The underlying language model can handle several languages, but this AI Function is tuned for English.
> * See [Features with limited regional availability](https://docs.databricks.com/aws/en/resources/feature-region-support.md) for AI Functions region availability.

The `ai_translate()` function allows you to invoke a state-of-the-art AI model to translate text to a specified target language using SQL.

This function uses a chat model serving endpoint made available by [Databricks Foundation Model APIs](https://docs.databricks.com/aws/en/machine-learning/foundation-model-apis/index.md) and supports the following languages.

The `to_lang` argument accepts [IETF BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) language codes (based on [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1)), full language names, or descriptive phrases:

| Language   | Code |
| ---------- | ---- |
| English    | `en` |
| French     | `fr` |
| German     | `de` |
| Hindi      | `hi` |
| Italian    | `it` |
| Portuguese | `pt` |
| Spanish    | `es` |
| Thai       | `th` |

## Requirements

**Apache 2.0 license**

The underlying models that might be used at this time are licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0), Copyright © The Apache Software Foundation. Customers are responsible for ensuring compliance with applicable model licenses.

Databricks recommends reviewing these licenses to ensure compliance with any applicable terms. If models emerge in the future that perform better according to Databricks's internal benchmarks, Databricks might change the model (and the list of applicable licenses provided on this page).

* This function is only available on workspaces in regions that support [AI Functions optimized for batch inference](https://docs.databricks.com/aws/en/resources/feature-region-support.md#ai-aws).
* This function is not available on Databricks SQL Classic.
* Databricks Runtime 15.4 LTS or above is required. For an upcoming change to this requirement, see [AI Functions require Databricks Runtime 17.3 LTS or above](https://docs.databricks.com/aws/en/release-notes/whats-coming.md#ai-functions-runtime-support). Databricks Runtime 18.2 or above is recommended for the best performance and access to the latest features.
* Check the [Databricks SQL pricing page](https://www.databricks.com/product/pricing/databricks-sql).

## Syntax

```
ai_translate(content, to_lang)
```

## Arguments

* `content`: A `STRING` expression, the text to be translated.
* `to_lang`: A `STRING` expression, the target language code to translate the content to.

## Returns

A `STRING`.

If `content` is `NULL`, the result is `NULL`.

## Examples

```sql
> SELECT ai_translate('Hello, how are you?', 'es');
 "Hola, ¿cómo estás?"

> SELECT ai_translate('La vida es un hermoso viaje.', 'en');
 "Life is a beautiful journey."
```

## <a id="limits" />Limitations

This function is not available on Databricks SQL Classic.

## Related functions

* [`ai_summarize` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/ai_summarize.md)
* [`ai_fix_grammar` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/ai_fix_grammar.md)
* [`ai_query` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/ai_query.md)
