Getting started

Authenticate with a 4Hz API key. Send multipart/form-data with required file field audio. The response contains the final result; no asynchronous task is created.

Choose a language for a complete request. Python requires requests (python -m pip install requests). Run JavaScript on a Node.js 22+ server: save it as detect.mjs, then run node detect.mjs. Set the FOURHZ_API_KEY environment variable and place a 1–10 second sample.wav in the current directory. Keep long-lived API keys out of browser code.

curl https://api.fourhz.ai/v1/detect/sync \
  -H "Authorization: $FOURHZ_API_KEY" \
  -F "audio=@sample.wav" \
  -F "model=general" \
  -F "threshold=0.9"

API reference

MethodPathResponse
POST/v1/detect/sync200: final detection result

The service endpoint is https://api.fourhz.ai. Authenticate with a 4Hz API key. Calls are priced per detection. See Pricing for public reference rates; your account quote and billing records determine the actual charge.

FieldRequiredDescription
audioYesAudio file · WAV, MP3, M4A, FLAC
modelYesSend one multipart text field with general or telephone. There is no default. If omitted, the API returns HTTP 400: The model field is required. Send general or telephone as a multipart text field.
thresholdNoFinite number sent as text, strictly between 0 and 1. Default: 0.9 for both models. Higher thresholds reduce false positives but increase missed synthetic audio. Invalid values return HTTP 400 invalid_threshold.

Maximum file size: 25 MiB; API duration must be 1–15 seconds. The service rejects audio longer than 15 seconds with HTTP 422 without truncating it. Playground recording and upload experiences accept up to 15 seconds. The extension must match the container. The required model text field selects general (General) or telephone (Telephone). See the request parameter table for threshold settings. Select the model in Playground’s Advanced settings. Telephone uses the first 4 seconds and repeats shorter audio; scores are not interchangeable between models. Guest Playground retains its WAV and 20 MB upload restrictions. Requests wait up to 110 seconds without automatic retries.

Response fields

Successful responses return fields at the top level. Values below illustrate the format.

{
  "request_id": "example-request-id",
  "label": "synthetic",
  "synthetic_score": 0.91,
  "processing_ms": 1200
}

Synthetic scores range from 0 to 1; higher scores indicate synthesis cues, not calibrated forgery probabilities. Labels are synthetic (Likely AI generated speech) or bonafide (Likely human speech). These are model predictions; API labels remain unchanged and parentheses are display explanations. The platform records usage for the authenticated account. The service may also return threshold. Use the returned threshold. Noise, compression, re-recording and short clips affect predictions; results do not guarantee authenticity.

Common statuses: 400/413/422 invalid upload or audio; 401 authentication failed; 403 unavailable key; 415 file content is not supported audio; 429 platform rate limit, concurrency limit or model at capacity (with Retry-After; retry later); 503 service not configured or unavailable; 502/504 connection failure or timeout. Every error body contains error_code and message. A failure is not evidence of authentic audio.

Threshold comparison: general labels scores strictly greater than threshold as synthetic; telephone uses greater than or equal to threshold. See the request parameter table for the range and defaults.