Skip to main content

Text to Speech

Knox exposes ElevenLabs-compatible text-to-speech endpoints at https://api.knoxstudio.ai/v1 for KnoxStudio. Authenticate with your Knox API key (Authorization: Bearer sk-... or xi-api-key). The same routes are also served by https://api.knox.chat/v1.

This is not Realtime speech-to-speech, and it is not sending audio into /v1/chat/completions. TTS turns text into audio.

Typical flow:

  1. List models — GET /v1/text-to-speech/models
  2. Pick a voice_id from Voices (GET /v1/voices or GET /v2/voices)
  3. Convert — POST /v1/text-to-speech/{voice_id}
https://api.knoxstudio.ai/v1
Authorization: Bearer sk-...

A commonly used public voice is 21m00Tcm4TlvDq8ikWAM (Rachel).

Models and billing​

curl https://api.knoxstudio.ai/v1/text-to-speech/models
model_idLatency / useMax charactersPrice
eleven_multilingual_v2Default, 29 languages10,000$0.15 / 1K characters
eleven_v3Most expressive, 70+ languages5,000$0.15 / 1K characters
eleven_v3_conversationalVoice agents, ~280ms5,000$0.10 / 1K characters
eleven_flash_v2_5Ultra-low latency multilingual, ~75ms40,000$0.10 / 1K characters
eleven_flash_v2Ultra-low latency English, ~75ms30,000$0.10 / 1K characters
eleven_turbo_v2_5Deprecated; prefer Flash v2.540,000$0.10 / 1K characters
eleven_turbo_v2Deprecated; prefer Flash v230,000$0.10 / 1K characters

Default model_id is eleven_multilingual_v2. Unauthenticated catalog requests are limited to 60/minute and may be cached for 5 minutes.

Create speech​

text is required. Streaming variants do not support WAV output_format values.

curl -X POST "https://api.knoxstudio.ai/v1/text-to-speech/21m00Tcm4TlvDq8ikWAM?output_format=mp3_44100_128" \
-H "Authorization: Bearer $KNOXCHAT_API_KEY" \
-H "Content-Type: application/json" \
-o speech.mp3 \
-d '{
"text": "Hello from Knox. This is text to speech.",
"model_id": "eleven_multilingual_v2"
}'
GoalEndpoint
List / search voicesGET /v1/voices, GET /v2/voices
Stream audioPOST /v1/text-to-speech/{voice_id}/stream
Character timestampsPOST /v1/text-to-speech/{voice_id}/with-timestamps
Stream + timestampsPOST /v1/text-to-speech/{voice_id}/stream/with-timestamps
Chunked text over WebSocket/v1/text-to-speech/{voice_id}/stream-input
Multiple concurrent contexts/v1/text-to-speech/{voice_id}/multi-stream-input

Use HTTP convert when the full text is available. Use WebSocket when text arrives in chunks (for example an LLM stream). Plain HTTP to a WebSocket path returns 400.

Optional voice_settings: stability (default 0.5), similarity_boost (0.75), style (0), speed (1.0), use_speaker_boost (true). Up to 3 pronunciation_dictionary_locators and 3 previous_request_ids / next_request_ids. seed is 0–4294967295.

apply_text_normalization is auto, on, or off. language_code is ISO 639-1 and is ignored by eleven_multilingual_v2.

Errors​

422 uses { "detail": [{ "loc": [...], "msg": "...", "type": "value_error" }] }. Other errors use { "detail": "..." }.

Common statuses: 401 missing/invalid key, 402 insufficient credits, 403 model not allowed, 422 missing text, over the character limit, or invalid output_format.