Text To Speech

Endpoint for generating audio from text.

Generate Speech

post
/v1/tts

Converts a string of text into high-quality audio using the voice associated with the specified agent. Cost: 3 Credits per 100 characters (rounded up, min 1 credit).

Authorizations
Body
agentIdstringRequired

The ID of the agent whose voice should be used.

textstringRequired

The text to convert to speech.

Responses
200

The generated audio file.

audio/mpeg
Responsestring · binary
post
/v1/tts
POST /v1/tts HTTP/1.1
Host: api.kex.gg
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 32

{
  "agentId": "text",
  "text": "text"
}
binary