Stream Speech to Speech
POSThttps://api.knoxstudio.ai/v1/speech-to-speech/:voice_id/stream
Same multipart body as Convert speech to speech, but audio is streamed. WAV output_format values are not allowed.
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| voice_id | String | Yes | Target ElevenLabs voice ID. |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| output_format | String | No | WAV is not allowed. Allowed: mp3_22050_32, mp3_24000_48, mp3_44100_32, mp3_44100_64, mp3_44100_96, mp3_44100_128, mp3_44100_192, pcm_8000, pcm_16000, pcm_22050, pcm_24000, pcm_32000, pcm_44100, pcm_48000, ulaw_8000, alaw_8000, opus_48000_32, opus_48000_64, opus_48000_96, opus_48000_128, opus_48000_192. WAV is not allowed. |
| enable_logging | Boolean | No | Default true. false requests zero-retention mode. |
| optimize_streaming_latency | Integer | No | Deprecated. 0–4 latency/quality tradeoff. |
Request Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | String | Yes | Bearer <token> Knox API key. xi-api-key is also accepted. |
| Content-Type | String | Yes | multipart/form-data |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| audio | File | Yes | Source audio that supplies content and emotion. |
| model_id | String | No | eleven_multilingual_sts_v2 (default) or eleven_english_sts_v2. TTS IDs are rejected. |
| file_format | String | No | pcm_s16le_16 or other. |
| seed | Integer | No | 0–4294967295. Best-effort determinism. |
| voice_settings | String (JSON object) | No | JSON-encoded object, for example stability / similarity_boost. |
| remove_background_noise | Boolean | No | true / false / 1 / 0. Isolates speech before conversion. |
cURL Example
curl -X POST "https://api.knoxstudio.ai/v1/speech-to-speech/21m00Tcm4TlvDq8ikWAM/stream?output_format=mp3_44100_128" \
-H "Authorization: Bearer $KNOXCHAT_API_KEY" \
-F "audio=@speech.wav" \
-F "model_id=eleven_multilingual_sts_v2" \
-o changed.mp3
Response
Success Response (200)
Streaming converted audio bytes.
Error Responses
Validation uses HTTP 422:
{
"detail": [
{
"loc": ["body", "field"],
"msg": "…",
"type": "value_error"
}
]
}
Other errors use { "detail": "message" }.
| Status | When |
|---|---|
400 | WebSocket path called without Upgrade: websocket. |
401 | Missing or invalid API key. |
402 | Insufficient credits. |
403 | Token is not allowed to use this model. |
404 | Resource not found. |
422 | Validation error. |
429 | Rate limit exceeded. |
500 | Internal server error. |