Skip to main content

Add Source Segment

POST 

https://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​

NameTypeRequiredDescription
project_idStringYesDubbing project ID.

Request Headers​

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

Request Body​

NameTypeRequiredDescription
textStringYesSource text.
speaker_idStringYesSpeaker ID.
start_sNumberYesStart time in seconds (≥ 0).
end_sNumberYesEnd 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" }.

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.