Skip to main content

Create Forced Alignment

POST 

https://api.knoxstudio.ai/v1/forced-alignment

Both file and text are required. Files up to 3GB, audio 100ms–10 hours, transcript at most 675,000 characters. Billed at $0.27/hour. Guide: Forced Alignment.

Request​

Query Parameters​

NameTypeRequiredDescription
enable_loggingBooleanNoDefault true. false requests zero-retention mode.

Request Headers​

NameTypeRequiredDescription
AuthorizationStringYesBearer <token> Knox API key. xi-api-key is also accepted.
Content-TypeStringYesmultipart/form-data

Request Body​

NameTypeRequiredDescription
fileFileYesAudio file to align.
textStringYesTranscript to align. Max 675,000 characters.

cURL Example​

curl -X POST https://api.knoxstudio.ai/v1/forced-alignment \
-H "Authorization: Bearer $KNOXCHAT_API_KEY" \
-F "file=@speech.wav" \
-F "text=Hello from Knox. This is forced alignment."

Response​

Success Response (200)​

JSON:

NameTypeDescription
charactersarraytext, start, end, optional loss.
wordsarraytext, start, end, optional loss.

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.