Do TTS Common

POSThttps://api.newportai.com/api/async/do_tts_common

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.

  • Select a voiceId from the Common Voice List to use as the audioId.
  • Submit a POST request to the Do TTS Common API to obtain a taskId.
  • Submit a POST request to the Polling API to retrieve the final audioUrl.
  • Configure a Callback URL to receive results automatically on completion.

Request Headers

Content-Type string Required

Enum: application/json

Authorization string Required

Bearer authentication token. Example: Bearer {{APIKey}}.

Request Body

audioId string Required

The unique identifier of the chosen voice. Visit the Voice List, navigate to the "Common" version section, and copy the desired voiceId.

text string Required

The text string to be converted into speech.

lan string Required

The target language code for the voice output (e.g., en, zh-CN, es).

Response

code integer

Returns 0 for success, or a specific error code.

message string

Returns "success" or a descriptive error message.

data object
taskId string

The unique identifier for the synthesis task. Use this ID with the Polling API to retrieve the generated audio.

Errors

10192Illegal param

Polling

Use the Polling API to retrieve the processing results.

Callback

Alternatively, you can enable Callback to receive task results automatically upon completion.

0Task Completed
{
    "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"
        }
    }
}
Request
cURL
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"
}'
0Successful
{
    "code": 0,
    "message": "success",
    "data": {
        "taskId": "32da4d099e51496d20fd83f49bbe985d"
    }
}