Deepfake Generation API

The Deepfake Generation API allows you to create realistic voice conversions and text-to-speech outputs.

Text to Speech

/playground/text-to-speech

Generate speech from text

Request Parameters

text
string
required

The text to convert to speech

audio_file
file

Optional. Reference audio file to clone the voice from

transcript
string

Optional. Transcript of the reference audio

Example Request

curl -X POST "https://api.truly.ws/playground/text-to-speech" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "text=Hello, this is a test of the text to speech API" \
  -F "audio_file=@reference.wav"

Response

Returns the generated audio file as a streaming response with Content-Type: audio/wav.

Voice Conversion Models

/playground/voice-conversion/models

Get available voice conversion models

Example Response

{
  "models": [
    {
      "id": "male-deep",
      "name": "Male Deep Voice",
      "description": "Deep male voice with American accent"
    },
    {
      "id": "female-neutral",
      "name": "Female Neutral",
      "description": "Neutral female voice with British accent"
    }
  ]
}

Voice Conversion

/playground/voice-conversion

Convert voice using the specified model

Request Parameters

model_id
string
required

The ID of the voice conversion model to use

pitch_shift
integer

The amount to shift the pitch (in semitones). Range: -12 to 12. Default: 0

audio_file
file
required

The audio file to convert

Example Request

curl -X POST "https://api.truly.ws/playground/voice-conversion" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "model_id=male-deep" \
  -F "pitch_shift=2" \
  -F "audio_file=@input.wav"

Response

Returns the converted audio file as a streaming response with Content-Type: audio/wav.

Get Audio File

/playground/audio/{filename}

Get a previously generated audio file

Path Parameters

filename
string
required

The name of the audio file to retrieve

Example Request

GET /playground/audio/converted_voice_male-deep.wav

Response

Returns the audio file as a streaming response with Content-Type: audio/wav.