Inference
Using these endpoints, you can create an inference request, and then check the status of the request, and finally download the output of the request once it is done processing.
Create Inference Request
Creates an inference request. This will send a request to the model to generate audio for the texts, using the other fields specified in the request body to influence the audio generation. The request will return a requestId, which can be used in future requests to track the status of this inference and eventually download the audio output.
Method: POST
Endpoint: https://api.revoiceit.com/inference
Request:
{
//Required Parameters:
"texts": array<string>,
"styles": array<string>,
"model": string,
"languageId": string,
"voice": string,
//Optional Parameters:
"glossaryIds": array<string>,
"externalRequestId": string,
"advancedSettings":{
"seed": number,
"diversity": number,
"expressivity": number,
"audioQuality": {
"outputBitrate": number,
"outputSamplingRate": number
}
}
}
Request Fields:
Field | Type | Description | Required |
texts | array<string> | An array of all of the lines of text for which audio should be generated. Each element of the array should be a single line of text | Required |
styles | array<string> | An array of all of the styles that should be applied to each line. For a list of available styles use the Get Voice Styles endpoint | Required |
model | string | The name of the model that should be used. For a list of models use the Get Models endpoint | Required |
languageId | string | The id of the language that should be used for the inference. A list of languages can be obtained from the Get Languages endpoint | Required |
voice | string | The name of the voice that should be used for inference. A list of voices can be obtained from the Get Voices endpoint | Required |
glossaryIds | array<string> | The ids of glossaries that should be used for this request. Any glossaries listed will be used for every line in the request. A list of glossaries that belong to this workspace can be obtained from the Get Glossaries endpoint | Optional |
externalRequestId | string | An id parameter used to track inference requests on the platform’s usage page. Helpful for identifying and organizing usage by custom tags. | Optional |
seed | number | A seed number can be used to enforce consistency across multiple requests | Optional |
diversity | number | A decimal number between 0 and 1. Lower diversity results in more consistent pronunciation and prosody, while higher diversity increases variation but may produce less natural-sounding takes. | Optional |
expressivity | number | A decimal number between 0 and 1. Higher expressivity adds more emotion but can reduce stability, while lower expressivity creates a less emotional but more stable output. | Optional |
outputBitrate | number | The bitrate of the output. Default: 16. | Optional |
outputSamplingRate | number | The sampling rate of the output. Default: 44100. | Optional |
Response:
{
"requestId": string
}
Returned HTTP Codes
Http Code | Description |
201 | Inference created successfully |
400 | Invalid input |
500 | Internal server error |
Get Inference Request Status
Returns a status for the inference request specified by the requestId provided in the request url.
Method: GET
Endpoint: https://api.revoiceit.com/inference/{requestId}/status
Query Parameters:
Field | Type | Description | Required |
line_index | number | Can be specified to view the status of a specific line | Optional |
page | number | Can be specified to get a specific page of paginated statuses (1-indexed). For example, with the limit set to 3, page:1 will return results for the first 3 lines and page:2 will return the results for the next 3 | Optional |
limit | number | A number between 1 and 1000 to limit how many statuses should be returned. If left empty, this field will default to 50 | Optional |
Response without query parameters:
{
"requestId": string,
"status": string,
"progress": string //Progress displayed as a percentage
}
Response with query parameter line_index:
{
"requestId": string,
"line": {
"index": number,
"status": string
}
}
Response with query parameters (paginated):
{
"requestId": string,
"page": number,
"limit": number,
"lines": [
{
"index": number,
"status": string
}
]
}
Returned HTTP Codes
Http Code | Description |
200 | Success |
400 | Invalid input |
404 | Request not found |
500 | Internal server error |
Download Inference Request Output
Returns a URL pointing to the audio output of the inference request. Each line in the original input will correspond to a separate file URL. The files are 0-indexed and maintain the order of lines as provided in the request.
Method: GET
Endpoint: https://api.revoiceit.com/inference/{requestId}/download
Query Parameters:
Field | Type | Description | Required |
line_index | number | Can be specified to view the status of a specific line | Optional |
page | number | Can be specified to get a specific page of paginated statuses (1-indexed). For example, with the limit set to 3, page:1 will return results for the first 3 lines and page:2 will return the results for the next 3 | Optional |
limit | number | A number between 1 and 1000 to limit how many statuses should be returned. If left empty, this field will default to 50 | Optional |
return_type | string | Can be specified as "url" or "audio". The "audio" option can only be used when a single line is specified, and returns the audio directly in the response. Conversely, the url option will return a url of the audio file. | Optional |
Response with query parameter line_index:
{
// a URL string or a Base64-encoded string,
// depending on the value of the return_type parameter.
}
Response with query parameters (paginated):
{
"page": number,
"limit": number,
"urls": array<string>
}
Returned HTTP Codes
Http Code | Description |
200 | Success |
404 | Not found |
500 | Internal server error |
Analyse Audio Emotion
Analyses audio and returns emotion and confidence values.
Method: POST
Endpoint: https://api.revoiceit.com/emotion/analyse
Request:
{
// Required Parameters:
"languageId": string
"audio": string
}
Query Parameters:
Field | Type | Description | Required |
languageId | string | Language id for the audio to be analysed. | Required |
audio | string | Audio in base64 format to be analysed. | Required |
Response:
{
"emotion": string,
"confidence": number
/* e.g.
{
"emotion": "NEUTRAL",
"confidence": 0.523
}
*/
}
Returned HTTP Codes
Http Code | Description |
200 | Success |
400 | Invalid input |
500 | Internal server error |