Training Sets - Create
Creates a new training set.
PUT {endpoint}/customvoice/trainingsets/{id}?api-version=2026-01-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
endpoint
|
path | True |
string (uri) |
Supported Cognitive Services endpoints (protocol and hostname, for example: https://eastus.api.cognitive.microsoft.com). |
|
id
|
path | True |
string minLength: 3maxLength: 64 pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$ |
The ID of the resource. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
| Name | Required | Type | Description |
|---|---|---|---|
| locale | True |
string |
The locale of the training dataset. Locale code follows BCP-47. You can find the text to speech locale list here https://learn.microsoft.com/azure/ai-services/speech-service/language-support?tabs=tts. |
| projectId | True |
string minLength: 3maxLength: 64 pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$ |
Resource id |
| description |
string |
Training set description |
|
| displayName |
string minLength: 1 |
Training set name |
|
| properties |
Training set properties |
||
| status |
Status of a resource. |
||
| voiceKind |
Voice kind |
Responses
| Name | Type | Description |
|---|---|---|
| 201 Created |
The request has succeeded and a new resource has been created as a result. |
|
| Other Status Codes |
An unexpected error response. Headers x-ms-error-code: string |
Security
Ocp-Apim-Subscription-Key
Type:
apiKey
In:
header
OAuth2Auth
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name | Description |
|---|---|
| https://cognitiveservices.azure.com/.default |
Examples
Create a training set
Sample request
PUT {endpoint}/customvoice/trainingsets/Jessica-300?api-version=2026-01-01
{
"description": "300 sentences Jessica data in general style.",
"locale": "en-US",
"projectId": "Jessica",
"voiceKind": "Female"
}
Sample response
{
"description": "300 sentences Jessica data in general style.",
"createdDateTime": "2023-04-01T05:30:00.000Z",
"id": "Jessica-300",
"lastActionDateTime": "2023-04-02T10:15:30.000Z",
"locale": "en-US",
"projectId": "Jessica",
"status": "Succeeded",
"voiceKind": "Female"
}
Definitions
| Name | Description |
|---|---|
|
Azure. |
The error object. |
|
Azure. |
A response containing error details. |
|
Azure. |
An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors. |
| Status |
Status of a resource. |
|
Training |
Training set |
|
Training |
Training set properties |
|
Voice |
Voice kind |
Azure.Core.Foundations.Error
The error object.
| Name | Type | Description |
|---|---|---|
| code |
string |
One of a server-defined set of error codes. |
| details |
An array of details about specific errors that led to this reported error. |
|
| innererror |
An object containing more specific information than the current object about the error. |
|
| message |
string |
A human-readable representation of the error. |
| target |
string |
The target of the error. |
Azure.Core.Foundations.ErrorResponse
A response containing error details.
| Name | Type | Description |
|---|---|---|
| error |
The error object. |
Azure.Core.Foundations.InnerError
An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.
| Name | Type | Description |
|---|---|---|
| code |
string |
One of a server-defined set of error codes. |
| innererror |
Inner error. |
Status
Status of a resource.
| Value | Description |
|---|---|
| NotStarted |
NotStarted |
| Running |
Running |
| Succeeded |
Succeeded |
| Failed |
Failed |
| Disabling |
Disabling |
| Disabled |
Disabled |
TrainingSet
Training set
| Name | Type | Description |
|---|---|---|
| createdDateTime |
string (date-time) |
The timestamp when the object was created. The timestamp is encoded as ISO 8601 date and time format ("YYYY-MM-DDThh:mm:ssZ", see https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations). |
| description |
string |
Training set description |
| displayName |
string minLength: 1 |
Training set name |
| id |
string minLength: 3maxLength: 64 pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$ |
Resource id |
| lastActionDateTime |
string (date-time) |
The timestamp when the current status was entered. The timestamp is encoded as ISO 8601 date and time format ("YYYY-MM-DDThh:mm:ssZ", see https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations). |
| locale |
string |
The locale of the training dataset. Locale code follows BCP-47. You can find the text to speech locale list here https://learn.microsoft.com/azure/ai-services/speech-service/language-support?tabs=tts. |
| projectId |
string minLength: 3maxLength: 64 pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$ |
Resource id |
| properties |
Training set properties |
|
| status |
Status of a resource. |
|
| voiceKind |
Voice kind |
TrainingSetProperties
Training set properties
| Name | Type | Description |
|---|---|---|
| durationInSeconds |
number (double) |
Total duration of audio in seconds in this training set |
| isContextual |
boolean |
Indicates whether the training set is composed of contextual data |
| utteranceCount |
integer (int32) |
Utterance count in this training set |
VoiceKind
Voice kind
| Value | Description |
|---|---|
| Male |
Male |
| Female |
Female |