The Do TTS Common API allows you to generate high-quality speech using a selection of predefined, high-quality voices. By choosing a voiceId from our standard library, you can synthesize natural-sounding audio for various languages and use cases.
voiceId from the Common Voice List to use as the audioId.taskId.audioUrl.Enum: application/json
Bearer authentication token. Example: Bearer {{APIKey}}.
The unique identifier of the chosen voice. Visit the Voice List, navigate to the "Common" version section, and copy the desired voiceId.
The text string to be converted into speech.
The target language code for the voice output (e.g., en, zh-CN, es).
Returns 0 for success, or a specific error code.
Returns "success" or a descriptive error message.
The unique identifier for the synthesis task. Use this ID with the Polling API to retrieve the generated audio.
Use the Polling API to retrieve the processing results.
Alternatively, you can enable Callback to receive task results automatically upon completion.
{
"code": 0,
"message": "success",
"data": {
"audios": [
{
"audioUrl": "https://s3.amazonaws.com/pt-tts-new/oneshot_tts_result/20241113/_/4169774.wav",
"audioType": ".wav"
}
],
"task": {
"taskId": "9af2a0cee7734bbdabea229265d09869",
"status": 3,
"executionTime": 17232,
"expire": 1769586737611,
"taskType": "tts_common"
}
}
}curl -X POST 'https://api.newportai.com/api/async/do_tts_common' \
-H "Authorization: Bearer {{key}}" \
-H 'Content-Type: application/json' \
-d '{
"audioId": "41995cfdb1a84924a21aa31492573fc1",
"text": "let us see this world",
"lan": "en"
}'{
"code": 0,
"message": "success",
"data": {
"taskId": "32da4d099e51496d20fd83f49bbe985d"
}
}