Evom Labs API Reference

Loly 3.5

Create stream token

Exchanges the voice key for a short-lived token that opens the WebSocket. The allowance is deducted here.

POST/api/v1/tts/stream-token
On this page

Code examples

curl -X POST https://studio.evomlabs.com/api/v1/tts/stream-token \
  -H "Authorization: Bearer vc_sk_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text_length": 200}'

Authorization

Bearer credential

Send the credential in the Authorization header. Account and voice keys are accepted only where the endpoint contract permits them.

Request

FieldTypeRequiredDescription
text_lengthintegerYesInteger from 1 through 10,000; allowance is deducted when the token is issued.
voice_idstringNoRequired with an account key. Omit with a voice key; if provided, it must match the key-bound voice.

Response

JSON
{
  "ok": true,
  "data": {
    "stream_token": "SHORT_LIVED_TOKEN",
    "ws_url": "wss://studio.evomlabs.com/ws/tts/stream",
    "max_length": 200,
    "chars_deducted": 200,
    "expires_in": 60
  }
}

Errors

REST failures use the documented error envelope. Handle the error code instead of matching the human-readable message.

Error codes

Was this page helpful?

Evom Labs API documentation