You can use the following API to generate tts voice and voice clones.
The resources (image, video, voice) generated by our API are valid for 7 days. Please save the relevant resources as soon as possible to prevent expiration.

Get Voice List Result

GET https://openapi.akool.com/api/open/v3/voice/list

Request Headers

ParameterValueDescription
AuthorizationBearer tokenYour API Key used for request authorization. You can get from https://openapi.akool.com/api/open/v3/getToken api.

Response Attributes

ParameterTypeValueDescription
codeint1000Interface returns business status code(1000:success)
msgStringOKInterface returns status information
dataArray[{ voice_id: "xx", preview: "" }]voice_id: Used by talking photo interface and creating audio interface. preview: You can preview the voice via the link.

Example

Request

curl --location 'https://openapi.akool.com/api/open/v3/voice/list' \
--header 'Authorization: Bearer {{Authorization}}'

Response

{
    "code": 1000,
    "msg": "ok",
    "data": [
        {
            "_id": "65e980d7af040969db5be863",
            "create_time": 1687181385319,
            "uid": 1,
            "from": 3,
            "voice_id": "piTKgcLEGmPE4e6mEKli",
            "gender": "Female",
            "accent":"american",
            "name": "Nicole",
            "description":"whisper",
            "useCase":"audiobook",
            "type": 1,
            "preview": "https://storage.googleapis.com/eleven-public-prod/premade/voices/piTKgcLEGmPE4e6mEKli/c269a54a-e2bc-44d0-bb46-4ed2666d6340.mp3",
            "__v": 0
        }
    ]
}

Create TTS

POST https://openapi.akool.com/api/open/v3/audio/create

Request Headers

ParameterValueDescription
AuthorizationBearer tokenYour API Key used for request authorization. You can get from https://openapi.akool.com/api/open/v3/getToken api.

Body Attributes

ParameterTypeValueDescription
input_textStringEnter what talkingphoto to say
voice_idStringVoice id: get from https://openapi.akool.com/api/open/v3/voice/list api,the field is 【voice_id】
rateStringVoice speaking speed【field value ranges(0%-100%)】
webhookUrlStringCallback url address based on HTTP request

Response Attributes

ParameterTypeValueDescription
codeint1000Interface returns business status code(1000:success)
msgStringInterface returns status information
dataObject{ _id: "", status: 1 }_id: Interface returns data, status: the status of audio: 【1:queueing, 2:processing, 3:completed, 4:failed】

Example

Body

{
    "input_text": "Choose from male and female voices for various use-cases. For tailored options, refer to voice settings or read further.There are both male and female voices to choose from",
    "voice_id": "LcfcDJNUP1GQjkzn1xUU",
    "rate": "100%",
   "webhookUrl":"http://localhost:3007/api/open/v3/test/webhook" 
}

Request

curl --location 'https://openapi.akool.com/api/open/v3/audio/create' \
--header 'authorization: Bearer token' \
--header 'Content-Type: application/json' \
--data '{
    "input_text": "Choose from male and female voices for various use-cases. For tailored options, refer to voice settings or read further.There are both male and female voices to choose from",
    "voice_id": "LcfcDJNUP1GQjkzn1xUU",
    "rate": "100%",
    "webhookUrl":"http://localhost:3007/api/open/v3/test/webhook" 
}'

Response

{
    "code": 1000,
    "msg": "OK",
    "data": {
        "_id": "65f8017f56559aa67f0ecde7",
        "create_time": 1710752127995,
        "uid": 101690,
        "from": 3,
        "input_text": "Choose from male and female voices for various use-cases. For tailored options, refer to voice settings or read further.There are both male and female voices to choose from",
        "rate": "100%",
        "voice_model_id": "65e980d7af040969db5be854",
        "url": "https://drz0f01yeq1cx.cloudfront.net/1710752141387-e7867802-0a92-41d4-b899-9bfb23144929-4946.mp3",
        "status": 3,
        "__v": 0
    }
}

Create Voice Clone

POST https://openapi.akool.com/api/open/v3/audio/clone

Request Headers

ParameterValueDescription
AuthorizationBearer tokenYour API Key used for request authorization. You can get from https://openapi.akool.com/api/open/v3/getToken api.

Body Attributes

ParameterTypeRequiredValueDescription
input_textStringtrueEnter what avatar in video to say
rateStringtrueVoice speaking speed【field value ranges(0%-100%)】
voice_urlStringfalseVoice url address
webhookUrlStringCallback url address based on HTTP request
voice_id and voice_url must provide one

Response Attributes

ParameterTypeValueDescription
codeint1000Interface returns business status code(1000:success)
msgStringInterface returns status information
dataObject{ _id: "", status: 1, url:"" }_id: Interface returns data, status: the status of audio: 【1:queueing, 2:processing, 3:completed, 4:failed】, url: Links to the generated audio resources,You can use it in the interface https://openapi.akool.com/api/open/v3/avatar/createVideo api.

Example

Body

{
  "input_text": "Hello, this is Akool's AI platform!",
  "rate": "100%",
  "voice_url":"https://drz0f01yeq1cx.cloudfront.net/1713168740392-4022bc91-5502-4e79-a66a-8c45b31792e4-4867.mp3",
  "webhookUrl":"http://localhost:3007/api/open/v3/test/webhook"  
}

Request

curl --location 'https://openapi.akool.com/api/open/v3/audio/clone' \
--header 'authorization: Bearer token' \
--header 'Content-Type: application/json' \
--data '{
  "input_text": "Hello, this is Akool'\''s AI platform!",
  "rate": "100%",
  "voice_url":"https://drz0f01yeq1cx.cloudfront.net/1713168740392-4022bc91-5502-4e79-a66a-8c45b31792e4-4867.mp3",
  "webhookUrl":"http://localhost:3007/api/open/v3/test/webhook"  
}'

Response

{
  "code": 1000,
  "msg": "OK",
  "data": {
    "create_time": 1712113285547,
    "from": 3,
    "input_text": "Hello, this is Akool's AI platform!",
    "rate": "100%",
    "voice_model_id": "65e813955daad44c2267380d",
    "url": "https://drz0f01yeq1cx.cloudfront.net/1712113284451-fe73dd6c-f981-46df-ba73-0b9d85c1be9c-8195.mp3",
    "status": 3,
    "_id": "660cc685b0950b5bf9bf4b55"
  }
}

Get Audio Info Result

GET https://openapi.akool.com/api/open/v3/audio/infobymodelid?audio_model_id=65f8017f56559aa67f0ecde7

Request Headers

ParameterValueDescription
AuthorizationBearer tokenYour API Key used for request authorization. You can get from https://openapi.akool.com/api/open/v3/getToken api.

Query Attributes

ParameterTypeValueDescription
audio_model_idStringaudio db id:You can get it based on the _id field returned by https://openapi.akool.com/api/open/v3/audio/create or https://openapi.akool.com/api/open/v3/audio/clone api.

Response Attributes

ParameterTypeValueDescription
codeint1000Interface returns business status code(1000:success)
msgStringOKInterface returns status information
dataObject{status:1,_id:"", url:""}status: the status of audio:【1:queueing, 2:processing, 3:completed, 4:failed】_id: Interface returns data.url: Generated audio resource url

Example

Request

curl --location 'https://openapi.akool.com/api/open/v3/audio/infobymodelid?audio_model_id=65f8017f56559aa67f0ecde7' \
--header 'Authorization: Bearer token'

Response

{
    "code": 1000,
    "msg": "OK",
    "data": {
        "_id": "65f8017f56559aa67f0ecde7",
        "create_time": 1710752127995,
        "uid": 101690,
        "from": 3,
        "input_text": "Choose from male and female voices for various use-cases. For tailored options, refer to voice settings or read further.There are both male and female voices to choose from",
        "rate": "100%",
        "voice_model_id": "65e980d7af040969db5be854",
        "url": "https://drz0f01yeq1cx.cloudfront.net/1710752141387-e7867802-0a92-41d4-b899-9bfb23144929-4946.mp3", // Generated audio resource url
        "status": 3,   // current status of audio: 【1:queueing(The requested operation is being processed),2:processing(The requested operation is being processing),3:completed(The request operation has been processed successfully),4:failed(The request operation processing failed, the reason for the failure can be viewed in the audio details.)】
        "__v": 0
    }
}