Try this endpoint →

Service endpoints

Service URL: https://api.fourhz.ai

Method / ProtocolPathContent-Type / FramesAuth
POST/v1/asr/pre-recorded/uploadapplication/octet-streamAuthorization: <API Key>
POST/v1/asr/pre-recorded/transcriptapplication/jsonAuthorization: <API Key>
GET/v1/asr/pre-recorded/transcriptqueryAuthorization: <API Key>
GET/v1/asr/pre-recorded/transcript/{id}—Authorization: <API Key>
DELETE/v1/asr/pre-recorded/transcript/{id}—Authorization: <API Key>

Authentication

Use the raw API key without Bearer. Put it in the HTTP Authorization header; keep long-lived keys on the server.

Authorization: $FOURHZ_API_KEY

Create transcript

Upload the audio first, then create the transcript with upload_url. Upload and creation are two requests in the same PRE flow.

Request parameters

ParameterTypeRequiredDescription
filebinaryNoAudio file; use the returned upload_url as audio_url; choose it or audio_url.
audio_urlstringNoURL of an uploaded file; choose it or file.
speech_modelstringNoTranscribes only the selected enrolled speaker. Default fourhz-focus
fourhz_enrollment_idstringNoComplete enrolled voiceprint ID; no default.
speaker_vadbooleanNoOptional; defaults to false when omitted. Set true to enable auxiliary speaker activity detection.
reject_background_speechbooleanDefaults to false. Set true to enable background speech rejection.

Response fields

FieldTypeMeaning and availability
upload_urlstringURL used to create the transcript after upload.
idstringCreated transcript ID.
statusstringqueued, processing, completed, or error.

Request examples

curl -X POST 'https://api.fourhz.ai/v1/asr/pre-recorded/upload' \
  -H "Authorization: $FOURHZ_API_KEY" \
  -H "Content-Type: application/octet-stream" \
  --data-binary @audio.wav
curl -X POST 'https://api.fourhz.ai/v1/asr/pre-recorded/transcript' \
  -H "Authorization: $FOURHZ_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "audio_url": "https://api.fourhz.ai/v1/asr/pre-recorded/upload/fup_example",
  "speech_model": "fourhz-focus",
  "fourhz_enrollment_id": "enr_example",
  "speaker_vad": true
}'

Response examples

{"upload_url":"https://api.fourhz.ai/v1/asr/pre-recorded/upload/fup_example"}
{"id":"tr_01J...","status":"queued"}

List transcripts

Request parameters

ParameterTypeRequiredDescription
limitintegerNoPage size, default 20; the server caps the maximum.
statusstringNoFilter by queued, processing, completed, or error.
after_idstringNoContinue pagination after this ID.

Response fields

FieldTypeMeaning and availability
page_detailsobjectPagination metadata: limit, result_count, current_url, prev_url, next_url.
transcriptsarrayTranscript records on this page.
transcripts[].idstringTranscript ID.
transcripts[].statusstringCurrent processing status.

Request example

curl -X GET 'https://api.fourhz.ai/v1/asr/pre-recorded/transcript?limit=20&status=completed&after_id=tr_01J...' \
  -H "Authorization: $FOURHZ_API_KEY"

Response example

{"page_details":{"limit":20,"result_count":1,"current_url":"/v1/asr/pre-recorded/transcript?limit=20","prev_url":null,"next_url":null},"transcripts":[{"id":"tr_01J...","status":"completed","text":"Hello world."}]}

Get transcript info

Request parameters

ParameterTypeRequiredDescription
idstringYesTranscript ID in the path.

Response fields

FieldTypeMeaning and availability
idstringTranscript ID for polling and deletion; not a task_id alias.
statusstringqueued, processing, completed, or error.
textstring?Full transcript after completion.
audio_durationnumber?Audio duration in seconds when returned by PRE.
errorstring?Failure reason; stop polling on error.
language_codestring?Detected language code.
wordsarray?Word-level timestamps when returned.
confidencenumber?Overall confidence when returned.
utterancesarray?Utterance list; diarization includes speaker.

Request example

curl -X GET 'https://api.fourhz.ai/v1/asr/pre-recorded/transcript/TRANSCRIPT_ID' \
  -H "Authorization: $FOURHZ_API_KEY"

Response example

{"id":"tr_01J...","status":"completed","text":"Hello world.","audio_duration":4.2,"language_code":"en","words":[]}

Delete transcript

Request parameters

ParameterTypeRequiredDescription
idstringYesTranscript ID in the path.

Response fields

FieldTypeMeaning and availability
statusintegerSuccessful deletion returns HTTP 204 with no body.

Request example

curl -X DELETE 'https://api.fourhz.ai/v1/asr/pre-recorded/transcript/TRANSCRIPT_ID' \
  -H "Authorization: $FOURHZ_API_KEY"

Response example

HTTP/1.1 204 No Content

Error codes

Every HTTP error body contains error_code (machine-readable) and message (human-readable). Legacy fields such as detail, code/msg or an upstream error object are kept and status codes are unchanged. Clients should read error_code and message first.

HTTPCodeMeaning
400invalid_request / invalid_configmalformed field, unknown field, or conflicting combination (the message names the field)
400unsupported_featurerequested a capability the chosen model does not serve: speaker parameters or fourhz_hotword_pool_id under Spectrum, timestamps=true on any model, ...
401 / 402—authentication failed / insufficient balance
404—transcript or upload not found or not owned by your account (another account's upload ID returns the same 404 as a missing one)
413 / 422—upload over 512 MiB / remote audio download or decode failure
429—rate limited; response carries Retry-After

Speaker VAD

speaker_vad · boolean

Optional. PRE conditioned mode defaults to false when omitted; pass true to enable auxiliary speaker activity detection. gate_only mode requires true. Set false to disable auxiliary speaker activity detection. Target-speaker recognition still uses fourhz_enrollment_id; acoustic VAD and duration-based segmentation remain enabled.

"speaker_vad": false