Skip to main content

Stream Music with Details

POST 

https://api.knoxstudio.ai/v1/music/detailed/stream

Same body as POST /v1/music/detailed. The response is SSE: audio chunks plus metadata events. Billed at $0.20 per generated minute.

Request​

Query Parameters​

NameTypeRequiredDescription
output_formatStringNoDefault auto. Allowed: auto, mp3_48000_128, mp3_48000_192, mp3_48000_240, mp3_48000_320, 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.

Request Headers​

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

Request Body​

Same fields as Compose music with details. sign_with_c2pa is not used on this path.

cURL Example​

curl -N -X POST "https://api.knoxstudio.ai/v1/music/detailed/stream" \
-H "Authorization: Bearer $KNOXCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A short jazz piano loop",
"music_length_ms": 15000,
"with_waveform_visual": true
}'

Response​

Success Response (200)​

text/event-stream events with audio and optional timestamps / waveform metadata.

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.