Add Source Segment
POSThttps://api.knoxstudio.ai/v1/dubbing/project/:project_id/transcript/segment
Insert a source segment. Span must be 0.1–25 seconds. Not billed.
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| project_id | String | Yes | Dubbing project ID. |
Request Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | String | Yes | Bearer <token> Knox API key. xi-api-key is also accepted. |
| Content-Type | String | Yes | application/json |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| text | String | Yes | Source text. |
| speaker_id | String | Yes | Speaker ID. |
| start_s | Number | Yes | Start time in seconds (≥ 0). |
| end_s | Number | Yes | End time in seconds. end_s - start_s must be 0.1–25. |
cURL Example
curl -X POST https://api.knoxstudio.ai/v1/dubbing/project/proj_123/transcript/segment \
-H "Authorization: Bearer $KNOXCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Hello there","speaker_id":"spk_1","start_s":1.0,"end_s":3.2}'
Response
Success Response (200)
Created segment JSON, including segment_id.
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. |