Once you have acquired your keys, you can begin making requests. For each request you make, you have to include your Client ID in the X-Client-ID
header, and the API Key in the X-API-Key
header respectively:
curl -i -X POST \
-H "X-Client-Key:xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx" \
-H "X-Api-Key:yyyyyyyyyy-yyyyyyyyyy-yyyyyyyyyy" \
'https://api.charactr.com/v1/endpoint'
Before you request TTS or VC, you have to query the available voices first, and include the chosen voice's ID in the subsequent request. Please, find the TTS example below.
Querying TTS voices
curl -i -X GET \
-H "X-Client-Key:xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx" \
-H "X-Api-Key:yyyyyyyyyy-yyyyyyyyyy-yyyyyyyyyy" \
'https://api.charactr.com/v1/tts/voices'
Available voices response
[
{
"id": 24,
"name": "John Doe",
"description": "Hoarse voice of an elderly man."
},
{
"id": 35,
"name": "Jane Doe",
"description": "Warm and friendly female voice."
}
]
Actual TTS request
curl -i -X POST \
-H "X-Client-Key:xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx" \
-H "X-Api-Key:yyyyyyyyyy-yyyyyyyyyy-yyyyyyyyyy" \
-d '{"voiceId": 35, "text": "Hello world!"}' \
'https://api.charactr.com/v1/tts/convert'
The response to this request should contain the wav
file.