Skip to content
StatusSupportDashboard

Add transcript

POST/v1/streams/{namespace}/transcripts

Ingest a single transcript segment for a livestream using a relative timestamp in milliseconds. The stream does not need to be created beforehand. Transcript timestamps are relative milliseconds from stream start and should be monotonically increasing within a stream so transcript context lines up correctly with later frames. This method returns immediately after the transcript has been accepted for processing.

Errors: 400 for an invalid body, with the reason in the message. 401 for a missing Authorization header. 403 for an invalid API key. 429 when the rate limit is exceeded. 5xx for transient internal failures. Retry 429 and 5xx with exponential backoff. Transcript ingestion is idempotent on transcript_id, so a retried request that already succeeded is ignored. Do not retry other 4xx errors, they indicate a problem with the request.

Path ParametersExpand Collapse
namespace: string

The namespace to ingest stream data into

Body ParametersJSONExpand Collapse
stream_id: string
text: string

Transcribed speech for this segment. Empty text is accepted. This field is required and must be a string.

timestamp: number
minimum0
transcript_id: string

Your unique identifier for this transcript segment. It is the idempotency key for the request, and if the segment is reviewed alongside a detected violation it is echoed back in the live_video.violation_detected webhook’s per-policy transcript_ids field.

ReturnsExpand Collapse
requestId: string
status: "accepted"

Add transcript

curl https://api.safetykit.com/v1/streams/$NAMESPACE/transcripts \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $SAFETYKIT_API_KEY" \
    -d '{
          "stream_id": "YOUR_STREAM_ID",
          "text": "This is an example transcript segment.",
          "timestamp": 5000,
          "transcript_id": "transcript-238493951"
        }'
{
  "requestId": "req_01h2m7qdmdjckc30e1mnq6xqfd",
  "status": "accepted"
}
Returns Examples
{
  "requestId": "req_01h2m7qdmdjckc30e1mnq6xqfd",
  "status": "accepted"
}