Skip to main content

Create Sound Effect

POST 

https://api.knoxstudio.ai/v1/sound-generation

Generate a clip from text. Duration 0.5–30 seconds. Billed at $0.17/minute (estimated 5s if duration_seconds is omitted). Guide: Sound Effects.

Request​

Query Parameters​

NameTypeRequiredDescription
output_formatStringNoAllowed: 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 and mp3_48000_* are not allowed.

Request Headers​

NameTypeRequiredDescription
AuthorizationStringYesBearer <token> Knox API key. xi-api-key is also accepted.
Content-TypeStringYesapplication/json

Request Body​

NameTypeRequiredDescription
textStringYesPrompt that is converted into a sound effect.
model_idStringNoMust be eleven_text_to_sound_v2 if set. Default eleven_text_to_sound_v2.
duration_secondsNumberNo0.5–30. Optional; the model may pick a length.
prompt_influenceNumberNo0–1. Default 0.3. Higher follows the prompt more closely.
loopBooleanNoSeamless loop. Only valid for eleven_text_to_sound_v2.

cURL Example​

curl -X POST "https://api.knoxstudio.ai/v1/sound-generation?output_format=mp3_44100_128" \
-H "Authorization: Bearer $KNOXCHAT_API_KEY" \
-H "Content-Type: application/json" \
-o sfx.mp3 \
-d '{
"text": "Spacious cinematic braam",
"duration_seconds": 4.5,
"prompt_influence": 0.3,
"model_id": "eleven_text_to_sound_v2"
}'

Response​

Success Response (200)​

The generated audio file. Content-Type follows output_format.

Error Responses​

Validation uses HTTP 422:

{
"detail": [
{
"loc": ["body", "field"],
"msg": "…",
"type": "value_error"
}
]
}

Other errors use { "detail": "message" }.

StatusWhen
400WebSocket path called without Upgrade: websocket.
401Missing or invalid API key.
402Insufficient credits.
403Token is not allowed to use this model.
404Resource not found.
422Validation error.
429Rate limit exceeded.
500Internal server error.