Notes :
- In POST v1/synthesize, added support for modelver 'v5.0' which is trained with StyleTTS on a dataset of around 278 hours.
- Supports new speakers : ml_male_<1-12>, ml_female_<1-13>, en_male_<1-185>, en_female_<1-241>
- Speakers starting with ml_ are native malaylam speakers, starting with en_ are native english speakers
- Default v5.0
Notes :
- In POST v1/synthesize, added support for model v4.0
- Model removes some high frequency noise seen with earlier versions
- Added support for noise_scale where the noise filtering can be controlled
- Default v4.0 (older models supported under v3.3, v3.2, v3.1, v3.0, v2.0, v1.x)
Notes :
- In POST v1/synthesize, added support for model v3.3 which supports dynamic pitch/pace transformation
- Default v3.3 (older models supported under v3.2, v3.1, v3.0, v2.0, v1.x)
Notes :
- In POST v1/synthesize, added support for model v3.2 which is more efficient for synthesizing breaks
- Default v3.2 (older models supported under v3.1, v3.0, v2.0, v1.x)
Notes :
- In POST v1/synthesize, added support for model v3.1 with support for punctuation and read along
- Default v3.1 (older models supported under v3.0, v2.0, v1.x)
Notes :
- In POST v1/synthesize, added support for model v3.0 with support for punctuation
- Default v3.0 (older models supported under v2.0, v1.x)
Notes :
- In POST v1/synthesize, added support for multiple model versions
- Default v2.0, older models supported under v1.x)
Notes :
- Initial release
Please read carefully on how to invalidate the tokens, if you suspect that the tokens got compromised In case you suspect access_token got compromised, please use the ‘revoke’ command in the Token Management API. Using ‘signout’ in the Token Management API signouts the user from all devices.
Resource : POST v1/synthesize
URL base : https://api.mozhi.me/
Submit the job for synthesizing audio from text. If the input arguments are proper, return the job id.
a) Job is submitted successfully and return
statusCode : 201
body : {
'status' : 'PROCESSING',
'jobid' : <jobdid>, # alphanumeric string corresponding to the job submitted
'timestamp' : <timestamp>
}
b) If this request is previously successfully completed, then returns the filename.
statusCode : 200
body : {
'status' : 'SUCCESS',
'output' : <output>, # alphanumeric string pointing to the output file of synthesized audio
'timestamp' : <timestamp>
'durations' : list of list with each element of the list having [word(s), start_seconds, duration_seconds, end_seconds]
}
c) If same request is submitted within 60 seconds, previously submitted job id is returned
statusCode : 202
body : {
'status' : 'SUCCESS',
'jobid' : <jobid> # alphanumeric string corresponding to the previous job submitted
}
StatusCode :
- 400 : input arguments not proper
- 401 : Unauthorized access
- 402 : Payment Required
- 500 : Server error, Please contact
import requests
import json
api_url = 'https://api.mozhi.me/v1/synthesize'
headers = {
'authorization': <access_token>',
'Content-Type': 'application/json'
}
body = {'text' : 'hello' , 'spkr' : 'FEMALE1_CUSTOM', 'num': 'ml', 'pace_scale' : 1.0, 'pitch_scale' : 1.0, 'pitch_shift' : 0,}
response = requests.request("POST", api_url, headers=headers, data=json.dumps(body))
curl --location --request POST 'https://api.mozhi.me/v1/synthesize' --header 'Authorization:<access_token>' -H 'Content-Type: application/json' --data-raw "{'text' : 'dum dum' , 'pace_scale' : 1.0, 'pitch_scale' : 1.0, 'pitch_shift' : 0, 'spkr' : 'FEMALE1_CUSTOM'}"
Resource : GET v1/status
URL base : https://api.mozhi.me/
Get the status of the job id
a) If this request is previously successfully completed, then returns the filename.
statusCode : 200
body : {
'output' : <ouput> is the alphanumeric string pointing to the output file of synthesized audio
'status' : SUCCESS
}
b) Job is still under process
statusCode : 201
body : {
'status' : PROCESSING
}
statusCode :
- 400 : Job id not provided
- 403 : Forbidden to query job id by this user
- 404 : Job id does not exist
- 500 : Server Error, Please contact
import requests
api_url = 'https://api.mozhi.me/v1/status'
headers = {
'authorization': '<access_token>',
'Content-Type': 'application/json'
}
body = "{'jobid' : '<jobid>'}"
response = requests.request("GET", api_url, headers=headers, data=body)
curl --location --request GET 'https://api.mozhi.me/v1/status' --header 'Authorization:<access_token>' -H 'Content-Type: application/json' --data-raw "{'jobid' : '<jobid>'}"
Resource : GET v1/tokens
URL base : https://api.mozhi.me/
'command' : (mandatory) - ‘refresh’ #issues command to generate access token using the refresh_token provided in the header - ‘revoke’ : Revokes all of the access tokens generated by the refresh_token provided in the header - ‘signout’ : Signs out users from all devices. It also invalidates all refresh tokens issued to a user.
a) command : ‘refresh’
statusCode : 200
body : {
'AccessToken' : Alphanumeric string to be used in header for authorizing the requests
}
b) command : revoke
statusCode : 200
body : 'all access_tokens generated by provided refresh_token revoked'
c) command : signout
statusCode : 200
body' : 'all refresh_tokens invalidated'
statusCode :
- 400 : Valid command not provided
- 401 : Unauthorized access_token has expired
- 403 : access_token or refresh_token revoked
- 500 : Server Error, Please contact
import requests
api_url = 'https://api.mozhi.me/v1/tokens'
headers = {
'Authorization' : '<access_token>',
'refresh_token' : '<refresh_token>',
'Content-Type' : 'application/json'
}
body = "{ 'command' : 'refresh'}"
response = requests.request("POST", api_url, headers=headers, data=body)
curl --location --request POST 'https://api.mozhi.me/v1/tokens' \
--header 'Authorization:<access_token> \
-H 'refresh_token: <refresh_token> \
-H 'Content-Type: application/json' \
--data-raw "{'command' : 'refresh'}"