Create Forced Alignment
POSThttps://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
| Name | Type | Required | Description |
|---|---|---|---|
| enable_logging | Boolean | No | Default true. false requests zero-retention mode. |
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 |
|---|---|---|---|
| file | File | Yes | Audio file to align. |
| text | String | Yes | Transcript 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:
| Name | Type | Description |
|---|---|---|
| characters | array | text, start, end, optional loss. |
| words | array | text, start, end, optional loss. |
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. |