Skip to main content
POST
/
v1
/
tts
Text to Speech
curl --request POST \
  --url https://api.voxnexus.ai/v1/tts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "text": "Hello, this is a test message.",
  "voice_id": "vl-xiaoxiao",
  "language": "zh-CN",
  "format": "mp3",
  "sample_rate": 16000,
  "bit_rate": 128,
  "speed": 1,
  "pitch": 0,
  "volume": 1,
  "ssml": false,
  "voice_config": {
    "style": "cheerful",
    "role": "Girl",
    "degree": 0.5
  }
}
'
"<string>"

Authorizations

Authorization
string
header
required

Authenticate using Bearer Token, where the token is an API Key

Body

application/json
text
string
required

Text to convert (required)

Example:

"Hello, this is a test message."

voice_id
string
required

Voice unique identifier (required)

Example:

"vl-xiaoxiao"

language
string

Language code, ISO 639-1 (optional)

Example:

"zh-CN"

format
enum<string>
default:mp3

Audio format (optional, default: mp3)

Available options:
mp3,
wav,
ogg,
pcm,
webm
sample_rate
enum<integer>
default:16000

Sample rate (optional, default: 16000)

Available options:
8000,
16000,
22050,
24000,
44100,
48000
bit_rate
integer
default:128

Bit rate (kbps), only valid for compressed formats (optional, default: 128)

Example:

128

speed
number<float>
default:1

Speech rate multiplier, range: 0.5 - 2.0, default: 1.0 (optional)

Required range: 0.5 <= x <= 2
pitch
integer
default:0

Pitch offset (semitones), range: -12 - 12, default: 0 (optional)

Required range: -12 <= x <= 12
volume
number<float>
default:1

Volume multiplier, range: 0.0 - 1.0, default: 1.0 (optional)

Required range: 0 <= x <= 1
ssml
boolean
default:false

Whether to use SSML format for text (optional, default: false)

voice_config
object

Voice-specific configuration (optional, use according to configuration items supported by voice_id)

Example:
{
"style": "cheerful",
"role": "Girl",
"degree": 0.5
}

Response

Successfully returns audio stream

The response is of type file.