Try this endpoint →
Service endpoints Service URL: https://api.fourhz.ai
Method / Protocol Path Content-Type / Frames Auth POST /v1/asr/pre-recorded/uploadapplication/octet-stream Authorization: <API Key>POST /v1/asr/pre-recorded/transcriptapplication/json Authorization: <API Key>GET /v1/asr/pre-recorded/transcriptquery Authorization: <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
Parameter Type Required Description filebinary No Audio file; use the returned upload_url as audio_url; choose it or audio_url. audio_urlstring No URL of an uploaded file; choose it or file. speech_modelstring No Transcribes only the selected enrolled speaker. Default fourhz-focus fourhz_enrollment_idstring No Complete enrolled voiceprint ID; no default. speaker_vadboolean No Optional; defaults to false when omitted. Set true to enable auxiliary speaker activity detection. reject_background_speechboolean Defaults to false. Set true to enable background speech rejection.
Field Type Meaning and availability idstring Transcript ID for polling and deletion; not a task_id alias. statusstring queued, 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.
cURL Python JavaScript
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": "REPLACE_WITH_UPLOAD_URL",
"speech_model": "fourhz-focus"
}'# pip install requests
import os
import requests
from contextlib import ExitStack
url = "https://api.fourhz.ai/v1/asr/pre-recorded/transcript"
headers = {"Authorization": os.environ["FOURHZ_API_KEY"]}
with ExitStack() as stack:
payload = {"audio_url":"REPLACE_WITH_UPLOAD_URL","speech_model":"fourhz-focus"}
response = requests.request("POST", url, headers=headers, timeout=300, json=payload)
response.raise_for_status()
print(response.json() if response.content else {"status": response.status_code})// Node.js 22+
import {readFile} from 'node:fs/promises';
const url = "https://api.fourhz.ai/v1/asr/pre-recorded/transcript";
const headers = {"Authorization": process.env.FOURHZ_API_KEY};
headers["Content-Type"] = "application/json";
const body = JSON.stringify({
"audio_url": "REPLACE_WITH_UPLOAD_URL",
"speech_model": "fourhz-focus"
});
const response = await fetch(url, {method: "POST", headers, body, signal: AbortSignal.timeout(300000)});
if (!response.ok) throw new Error(await response.text());
console.log(response.status === 204 ? {status: 204} : await response.json());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 Parameter Type Required Description filebinary No Audio file; use the returned upload_url as audio_url; choose it or audio_url. audio_urlstring No URL of an uploaded file; choose it or file. speech_modelstring No Transcribes only the selected enrolled speaker. Default fourhz-focus fourhz_enrollment_idstring No Complete enrolled voiceprint ID; no default. speaker_vadboolean No Optional; defaults to false when omitted. Set true to enable auxiliary speaker activity detection. reject_background_speechboolean Defaults to false. Set true to enable background speech rejection.
Response fields Field Type Meaning and availability upload_urlstring URL used to create the transcript after upload. idstring Created transcript ID. statusstring queued, processing, completed, or error.
Request examples cURL Python JavaScript
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# pip install requests
import os
import requests
from contextlib import ExitStack
url = "https://api.fourhz.ai/v1/asr/pre-recorded/upload"
headers = {"Authorization": os.environ["FOURHZ_API_KEY"]}
with ExitStack() as stack:
audio = stack.enter_context(open("audio.wav", "rb"))
headers["Content-Type"] = "application/octet-stream"
response = requests.request("POST", url, headers=headers, timeout=300, data=audio)
response.raise_for_status()
print(response.json() if response.content else {"status": response.status_code})// Node.js 22+
import {readFile} from 'node:fs/promises';
const url = "https://api.fourhz.ai/v1/asr/pre-recorded/upload";
const headers = {"Authorization": process.env.FOURHZ_API_KEY};
headers["Content-Type"] = "application/octet-stream";
const body = await readFile("audio.wav");
const response = await fetch(url, {method: "POST", headers, body, signal: AbortSignal.timeout(300000)});
if (!response.ok) throw new Error(await response.text());
console.log(response.status === 204 ? {status: 204} : await response.json());cURL Python JavaScript
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
}'# pip install requests
import os
import requests
from contextlib import ExitStack
url = "https://api.fourhz.ai/v1/asr/pre-recorded/transcript"
headers = {"Authorization": os.environ["FOURHZ_API_KEY"]}
with ExitStack() as stack:
payload = {"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 = requests.request("POST", url, headers=headers, timeout=300, json=payload)
response.raise_for_status()
print(response.json() if response.content else {"status": response.status_code})// Node.js 22+
import {readFile} from 'node:fs/promises';
const url = "https://api.fourhz.ai/v1/asr/pre-recorded/transcript";
const headers = {"Authorization": process.env.FOURHZ_API_KEY};
headers["Content-Type"] = "application/json";
const body = JSON.stringify({
"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
});
const response = await fetch(url, {method: "POST", headers, body, signal: AbortSignal.timeout(300000)});
if (!response.ok) throw new Error(await response.text());
console.log(response.status === 204 ? {status: 204} : await response.json());Response examples {"upload_url":"https://api.fourhz.ai/v1/asr/pre-recorded/upload/fup_example"}{"id":"tr_01J...","status":"queued"}List transcripts Request parameters Parameter Type Required Description limitinteger No Page size, default 20; the server caps the maximum. statusstring No Filter by queued, processing, completed, or error. after_idstring No Continue pagination after this ID.
Response fields Field Type Meaning and availability page_detailsobject Pagination metadata: limit, result_count, current_url, prev_url, next_url. transcriptsarray Transcript records on this page. transcripts[].idstring Transcript ID. transcripts[].statusstring Current processing status.
Request example cURL Python JavaScript
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"# pip install requests
import os
import requests
from contextlib import ExitStack
url = "https://api.fourhz.ai/v1/asr/pre-recorded/transcript?limit=20&status=completed&after_id=tr_01J..."
headers = {"Authorization": os.environ["FOURHZ_API_KEY"]}
with ExitStack() as stack:
response = requests.request("GET", url, headers=headers, timeout=300)
response.raise_for_status()
print(response.json() if response.content else {"status": response.status_code})// Node.js 22+
import {readFile} from 'node:fs/promises';
const url = "https://api.fourhz.ai/v1/asr/pre-recorded/transcript?limit=20&status=completed&after_id=tr_01J...";
const headers = {"Authorization": process.env.FOURHZ_API_KEY};
const response = await fetch(url, {method: "GET", headers, signal: AbortSignal.timeout(300000)});
if (!response.ok) throw new Error(await response.text());
console.log(response.status === 204 ? {status: 204} : await response.json());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 Parameter Type Required Description idstring Yes Transcript ID in the path.
Response fields Field Type Meaning and availability idstring Transcript ID for polling and deletion; not a task_id alias. statusstring queued, 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 Python JavaScript
curl -X GET 'https://api.fourhz.ai/v1/asr/pre-recorded/transcript/TRANSCRIPT_ID' \
-H "Authorization: $FOURHZ_API_KEY"# pip install requests
import os
import requests
from contextlib import ExitStack
url = "https://api.fourhz.ai/v1/asr/pre-recorded/transcript/TRANSCRIPT_ID"
headers = {"Authorization": os.environ["FOURHZ_API_KEY"]}
with ExitStack() as stack:
response = requests.request("GET", url, headers=headers, timeout=300)
response.raise_for_status()
print(response.json() if response.content else {"status": response.status_code})// Node.js 22+
import {readFile} from 'node:fs/promises';
const url = "https://api.fourhz.ai/v1/asr/pre-recorded/transcript/TRANSCRIPT_ID";
const headers = {"Authorization": process.env.FOURHZ_API_KEY};
const response = await fetch(url, {method: "GET", headers, signal: AbortSignal.timeout(300000)});
if (!response.ok) throw new Error(await response.text());
console.log(response.status === 204 ? {status: 204} : await response.json());Response example {"id":"tr_01J...","status":"completed","text":"Hello world.","audio_duration":4.2,"language_code":"en","words":[]}Delete transcript Request parameters Parameter Type Required Description idstring Yes Transcript ID in the path.
Response fields Field Type Meaning and availability statusinteger Successful deletion returns HTTP 204 with no body.
Request example cURL Python JavaScript
curl -X DELETE 'https://api.fourhz.ai/v1/asr/pre-recorded/transcript/TRANSCRIPT_ID' \
-H "Authorization: $FOURHZ_API_KEY"# pip install requests
import os
import requests
from contextlib import ExitStack
url = "https://api.fourhz.ai/v1/asr/pre-recorded/transcript/TRANSCRIPT_ID"
headers = {"Authorization": os.environ["FOURHZ_API_KEY"]}
with ExitStack() as stack:
response = requests.request("DELETE", url, headers=headers, timeout=300)
response.raise_for_status()
print(response.json() if response.content else {"status": response.status_code})// Node.js 22+
import {readFile} from 'node:fs/promises';
const url = "https://api.fourhz.ai/v1/asr/pre-recorded/transcript/TRANSCRIPT_ID";
const headers = {"Authorization": process.env.FOURHZ_API_KEY};
const response = await fetch(url, {method: "DELETE", headers, signal: AbortSignal.timeout(300000)});
if (!response.ok) throw new Error(await response.text());
console.log(response.status === 204 ? {status: 204} : await response.json());Response example 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.
HTTP Code Meaning
400 invalid_request / invalid_configmalformed field, unknown field, or conflicting combination (the message names the field)
400 unsupported_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.