# Method: projects.locations.adaptiveMtTranslate

- [HTTP request](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#body.AdaptiveMtTranslateResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#body.aspect)
- [ReferenceSentenceConfig](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#ReferenceSentenceConfig)
  - [JSON representation](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#ReferenceSentenceConfig.SCHEMA_REPRESENTATION)
- [ReferenceSentencePairList](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#ReferenceSentencePairList)
  - [JSON representation](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#ReferenceSentencePairList.SCHEMA_REPRESENTATION)
- [ReferenceSentencePair](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#ReferenceSentencePair)
  - [JSON representation](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#ReferenceSentencePair.SCHEMA_REPRESENTATION)
- [AdaptiveMtTranslation](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#AdaptiveMtTranslation)
  - [JSON representation](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#AdaptiveMtTranslation.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#try-it)

Translate text using Adaptive MT.

### HTTP request

`POST https://translate.googleapis.com/v3/{parent=projects/*/locations/*}:adaptiveMtTranslate`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. Location to make a regional call. Format: `projects/{project-number-or-id}/locations/{location-id}`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "dataset": string, "content": [ string ], "referenceSentenceConfig": { object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#ReferenceSentenceConfig`) } } ``` |

| Fields ||
|---|---|
| `dataset` | `string` Required. The resource name for the dataset to use for adaptive MT. `projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}` |
| `content[]` | `string` Required. The content of the input in string format. |
| `referenceSentenceConfig` | ``object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#ReferenceSentenceConfig`)`` Configuration for caller provided reference sentences. |

### Response body

An locations.adaptiveMtTranslate response.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "translations": [ { object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#AdaptiveMtTranslation`) } ], "languageCode": string } ``` |

| Fields ||
|---|---|
| `translations[]` | ``object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#AdaptiveMtTranslation`)`` Output only. The translation. |
| `languageCode` | `string` Output only. The translation's language code. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-translation`
- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/).

## ReferenceSentenceConfig

Message of caller-provided reference configuration.

| JSON representation |
|---|
| ``` { "referenceSentencePairLists": [ { object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#ReferenceSentencePairList`) } ], "sourceLanguageCode": string, "targetLanguageCode": string } ``` |

| Fields ||
|---|---|
| `referenceSentencePairLists[]` | ``object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#ReferenceSentencePairList`)`` Reference sentences pair lists. Each list will be used as the references to translate the sentence under "content" field at the corresponding index. Length of the list is required to be equal to the length of "content" field. |
| `sourceLanguageCode` | `string` Source language code. |
| `targetLanguageCode` | `string` Target language code. |

## ReferenceSentencePairList

A list of reference sentence pairs.

| JSON representation |
|---|
| ``` { "referenceSentencePairs": [ { object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#ReferenceSentencePair`) } ] } ``` |

| Fields ||
|---|---|
| `referenceSentencePairs[]` | ``object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations/adaptiveMtTranslate#ReferenceSentencePair`)`` Reference sentence pairs. |

## ReferenceSentencePair

A pair of sentences used as reference in source and target languages.

| JSON representation |
|---|
| ``` { "sourceSentence": string, "targetSentence": string } ``` |

| Fields ||
|---|---|
| `sourceSentence` | `string` Source sentence in the sentence pair. |
| `targetSentence` | `string` Target sentence in the sentence pair. |

## AdaptiveMtTranslation

An AdaptiveMt translation.

| JSON representation |
|---|
| ``` { "translatedText": string } ``` |

| Fields ||
|---|---|
| `translatedText` | `string` Output only. The translated text. |