API reference — Speech-to-Text
API reference — Speech-to-Text
The contract for invoking a self-hosted Saaras v3 endpoint. Unlike the Managed API, the invoke contract lives in the SageMaker model container — this page is the reference for it.
Model identifier. Send model: saaras:v3 in every request. The Marketplace package is versioned saaras:v3.1 (the revision you subscribe to) — do not send saaras:v3.1 as the model id.
Real-time — InvokeEndpoint
multipart/form-data is the only content type the Saaras v3 endpoint accepts. Any other content type is rejected with a 4xx.
Request fields
Output modes
Response
timestamps is present only when with_timestamps is "true". The request_id format is YYYYMMDD_<uuid4> (not req_…).
Streaming — InvokeEndpointWithBidirectionalStream
For continuous, low-latency audio, open a two-way SigV4 HTTP/2 stream on port 8443 (client aws-sdk-sagemaker-runtime-http2): audio-in frames go up and transcript-out frames come back. This is a full-duplex bidirectional stream — not the one-way InvokeEndpointWithResponseStream response-streaming operation.
Query parameters — sent URL-encoded in the ModelQueryString:
Message protocol — send JSON frames, then read frames back:
The endpoint returns events frames (VAD signals, when vad_signals=true) and data frames (incremental transcripts).
Streaming accepts only 8 kHz or 16 kHz, mono, 16-bit PCM. Other sample rates or encodings are rejected.
Errors
Every non-2xx is delivered as HTTP 424 through InvokeEndpoint — branch on OriginalStatusCode and error.code, never on the HTTP status. See Error handling on SageMaker for the collapse rule, the boto3 branch snippet, and the shared envelope.
Bad request — OriginalStatusCode 400, code: invalid_request_error. Causes: a wrong model id (send saaras:v3, not saaras:v3.1), audio over 30 s on the real-time path, empty / unreadable / truncated audio, a missing file, or any content type other than multipart/form-data.
Overload — OriginalStatusCode 429, code: service_overloaded. The container sheds fast rather than queueing; back off using the body retry_after.
Fix 400s and never retry them; back off on 429 service_overloaded using retry_after; retry other 5xx once, then report error.request_id.