Authenticating
- 1. Go to the dashboard and create an API Key
- 2. Include the API Key in your request under the Authorization header, like so:
Authorization: Bearer 12345678-abcd-1234-abcd-87654321
- (replacing the dummy value with your own key)
TTS
Path: https://cooltts.com/api/tts/base
Method: POST
Request body:
{
"text": string, // The text to convert to speech
"voiceId": string, // The voice ID you would like to use
"speed": number // Optional. Defaults to 1.0
}
Response format:
{
"audioUrl": string, // Make a GET request to this URL to retrieve the audio file
"billedAudioLength": number, // The number of seconds you were billed for this generation
}
List voices
Path: https://cooltts.com/api/tts/list-voices
Method: GET
Response format:
[
{
"voiceName": string,
"previewAudioUrl": string | null, // Will be adding support for this soon
"id": string, // Use this in the TTS request
"details": null | {
"voiceId": string, // Same as id
"description": string,
"previewImageUrl": string,
"originCountryCode": string, // ISO 3166-1 alpha-2 code
"genderCode": "M" | "F"
}
}
]