You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -80,39 +80,39 @@ For more information on Translator service selected network and private endpoint
80
80
81
81
Request headers include:
82
82
83
-
| Headers | Description |
84
-
| --- | --- |
85
-
|**Authentication headers**|_Required request header_.<br/>See [available options for authentication](../reference/authentication.md). |
86
-
|**Content-Type**|_Required request header_.<br/>Specifies the content type of the payload. Accepted values are: `application/json`; `charset=UTF-8`|
87
-
|**Content-Length**|_Optional_.<br/>The length of the request body. |
88
-
|**X-ClientTraceId**|_Optional_.<br/>A client-generated GUID to uniquely identify the request. You can omit this optional header if you include the trace ID in the query string using a query parameter named `ClientTraceId`. |
83
+
| Headers |Required|Description |
84
+
| --- | --- |---|
85
+
|**Authentication headers**|****True****|*See*[available options for authentication](../reference/authentication.md). |
86
+
|**Content-Type**|****True****|Specifies the content type of the payload. Accepted values are: `application/json`; `charset=UTF-8`|
87
+
|**Content-Length**|False|The length of the request body. |
88
+
|**X-ClientTraceId**|False|A client-generated GUID to uniquely identify the request. You can omit this optional header if you include the trace ID in the query string using a query parameter named `ClientTraceId`. |
89
89
90
90
#### Request parameters
91
91
92
92
Request parameters passed with the request are as follows:
93
93
94
94
| Parameter | Type | Required | Description |
95
95
| --- | --- | --- | --- |
96
-
|**api-version**|string|True|Version of the API requested by the client. Accepted value is 2025-05-01-preview.|
97
-
|**text**| string | True | Source text for translation. |
96
+
|**api-version**|string|**True**|Version of the API requested by the client. Accepted value is 2025-05-01-preview.|
97
+
|**text**| string |**True**| Source text for translation. |
98
98
|**language**| string | False | Specifies the language code for the `source` text. If not specified, the system autodetects the language of the source text. Accepted values are list of language code supported by the specified model. |
99
99
|**script**| string | False | Specifies the script of the source text. |
100
100
|**textType**| string | False | Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, complete element. Accepted values are: plain (default) or html. |
101
101
||||
102
-
|**targets**| array | True | User-specified values for the translated (target) text. |
103
-
|**targets.language**| string | True |The language code for the translated (target) text *specified in the targets array*. Accepted values are [supported language](../../../language-support.md) codes for the translation operation.|
102
+
|**targets**| array |**True**| User-specified values for the translated (target) text. |
103
+
|**targets.language**| string |**True**|The language code for the translated (target) text *specified in the targets array*. Accepted values are [supported language](../../../language-support.md) codes for the translation operation.|
104
104
105
105
#### Targets array (user-specified values for translated text)
106
106
107
107
| Parameter | Type | Required? | Description |
108
108
| --- | --- | --- | --- |
109
-
|**targets.language**| string | True |The language code for the translated (`target`) text *specified in the `targets` array*. Accepted values are [supported language](../../../language-support.md) codes for the translation operation.|
109
+
|**targets.language**| string |**True**|The language code for the translated (`target`) text *specified in the `targets` array*. Accepted values are [supported language](../../../language-support.md) codes for the translation operation.|
110
110
|**targets.script**| string | False | Specify the script of the transliterated text. |
111
111
|**targets.deploymentName**| string | False |• Default is `general`, which uses a neural machine translation (NMT) system.<br>•`your-model-name-gpt-4o-mini` is an example deployment name for the GPT-4o-mini model. For more information, *see*[Translate using GPT-4o mini and NMT deployments](translate-api.md#translate-using-gpt-4o-mini-deployment-and-nmt)<br>•`<categoryID>` uses the custom `NMT` model trained by customer. For more information, *see*[Train a custom model in Azure AI Foundry](../../custom-translator/azure-ai-foundry/how-to/train-model.md)<br> |
112
112
|**targets.tone**| string | False | Desired tone of target translation. Accepted values are `formal`, `informal`, or `neutral`. |
113
113
|**targets.gender** (For more information, *see*[Gender-specific translations](#gender-specific-translations))| string | False | Desired gender of target translation. Accepted values are `female`, `male`, or `neutral`.|
114
114
|**targets.adaptiveDatasetId**| string | False | Reference dataset ID having sentence pair to generate adaptive customized translation. The maximum number of reference text pairs to generate adaptive customized translation is five (5).|
115
-
|**targets.allowFallback**| string | False | If the desired model doesn't support a particular pair of source and target languages, an alternative approach may be employed. In such cases, the service may default to utilizing a general system as a substitute. This action ensures that translations can still be provided even when the preferred model is unavailable. Default is `true`. If `false` system returns an error if language pair isn't supported. |
115
+
|**targets.allowFallback**| string | False | If the desired model doesn't support a particular pair of source and target languages, an alternative approach may be employed. In such cases, the service may default to utilizing a general system as a substitute. This action ensures that translations can still be provided even when the preferred model is unavailable. Default is `True`. If `False` system returns an error if language pair isn't supported. |
116
116
|**targets.referenceTextPairs**| string | False | Reference text pairs to generate adaptive customized translation. |
117
117
|**targets.referenceTextPairs.source**| string | False | Source text in reference text pair. If provided, `adaptiveDatasetId` is ignored. |
118
118
|**targets.referenceTextPairs.target**| string | False | Target text in reference text pair. |
For more information on Translator service selected network and private endpoint configuration and support, *see*[**Virtual Network Support**](../reference/authentication.md#virtual-network-support).
31
+
***Linux or macOS***
26
32
27
-
## Request parameters
33
+
```bash
34
+
curl -X POST "https://api.cognitive.microsofttranslator.com/transliterate?api-version=2025-05-01-preview" \
Request parameters passed on the query string are:
42
+
Your custom domain endpoint is a URL formatted with your resource name and hostname and is available in the Azure portal. When you created your Translator resource, the value that you entered in the `Name` field is the custom domain name parameter for the endpoint.
30
43
31
-
| Query parameter | Description |
32
-
| --- | --- |
33
-
| api-version |*Required parameter*.<br/>Version of the API requested by the client. Value must be `3.0`. |
34
-
| language |*Required parameter*.<br/>Specifies the language of the text to convert from one script to another. Possible languages are listed in the `transliteration` scope obtained by querying the service for its [supported languages](get-languages.md). |
35
-
| fromScript |*Required parameter*.<br/>Specifies the script used by the input text. Look up [supported languages](get-languages.md) using the `transliteration` scope, to find input scripts available for the selected language. |
36
-
| toScript |*Required parameter*.<br/>Specifies the output script. Look up [supported languages](get-languages.md) using the `transliteration` scope, to find output scripts available for the selected combination of input language and input script. |
44
+
**Send a `POST` request**:
45
+
46
+
***Windows***
47
+
48
+
```bash
49
+
curl -X POST "https://<your-resource-name>.cognitiveservices.azure.com//transliterate?api-version=2025-05-01-preview"^
For more information on Translator service selected network and private endpoint configuration and support, *see*[**Virtual Network Support**](../reference/authentication.md).
| Content-Type |_Required request header_.<br/>Specifies the content type of the payload. Possible values are: `application/json`|
44
-
| Content-Length |_Optional_.<br/>The length of the request body. |
45
-
| X-ClientTraceId |_Optional_.<br/>A client-generated GUID to uniquely identify the request. You can omit this header if you include the trace ID in the query string using a query parameter named `ClientTraceId`. |
71
+
| Headers | Required| Description |
72
+
| --- | --- |---|
73
+
|**Authentication headers**|**True**|*See*[available options for authentication](../reference/authentication.md). |
74
+
|**Content-Type**|**True**| Specifies the content type of the payload. Accepted values are: `application/json`; `charset=UTF-8`|
75
+
|**Content-Length**|False| The length of the request body. |
76
+
|**X-ClientTraceId**|False| A client-generated GUID to uniquely identify the request. You can omit this optional header if you include the trace ID in the query string using a query parameter named `ClientTraceId`. |
77
+
78
+
## Request parameters
79
+
80
+
Request parameters passed on the query string areas are as follows:
81
+
82
+
| Parameter |Type| Required | Description |
83
+
| --- | --- |---|---|
84
+
|**api-version**|string|**True**|Version of the API requested by the client. Accepted value is 2025-05-01-preview.|
85
+
|**fromScript**| string|**True**| Specifies the script used by the input text. Look up [supported languages](get-languages.md) using the `transliteration` scope, to find input scripts available for the selected language. |
86
+
|**toScript**|string|**True**| Specifies the output script. Look up [supported languages](get-languages.md) using the `transliteration` scope, to find output scripts available for the selected combination of input language and input script. |
87
+
|**language**| string | False | Specifies the language code for the `source` text. If not specified, the system autodetects the language of the source text. Accepted values are list of language code supported by the specified model. |
46
88
47
89
## Request body
48
90
@@ -82,7 +124,21 @@ An example JSON response is:
82
124
83
125
| Headers | Description |
84
126
| --- | --- |
85
-
| X-RequestId | Value generated by the service to identify the request and used for troubleshooting purposes. |
127
+
|**X-RequestId**| Value generated by the service to identify the request and used for troubleshooting purposes. |
128
+
129
+
## Example
130
+
131
+
The following example shows how to convert two Japanese strings into Romanized Japanese.
@@ -100,17 +156,9 @@ The following are the possible HTTP status codes that a request returns.
100
156
101
157
If an error occurs, the request also returns a JSON error response. The error code is a 6-digit number combining the 3-digit HTTP status code followed by a 3-digit number to further categorize the error. Common error codes can be found on the [Status code reference page](../reference/status-response-codes.md).
102
158
103
-
## Examples
104
-
105
-
The following example shows how to convert two Japanese strings into Romanized Japanese.
0 commit comments