← Audio Normalizer
Your token

Audio Normalizer API

Measuring and normalizing run free in the browser and need no API: your audio never leaves your device. The API is for the one metered step: send the levels the page measured (before and after normalizing) and its checks against the destination, get back a short fix list for every check that did not pass.

Base URL: https://api.skillsafe.ai/v1/app-api. Every response is {"data": ...} or {"error": {"code", "message"}}; read error.code and error.message rather than the HTTP status alone.

The task field

This app has one task. Always send "task": "fix_plan".

taskWhat it doesReply
fix_planWrites one plain-words action for every check whose status is warn or fail, plus a one or two sentence summary. Never invents a measurement.One JSON object

Input fields

FieldTypeMeaning
taskstring"fix_plan"
destinationstringWhere the audio is going and what it asks for, e.g. "Podcast or voice: -16 LUFS, true peak at most -1 dBTP ...".
notestringYour words about the recording, at most 300 characters; may be empty.
filesstringJSON text: at most 12 of {"id", "name", "seconds", "channels", "before", "after", "gain_db", "limited_pct"}. before and after hold lufs, true_peak, peak, rms, lra, noise_floor, lead_quiet, tail_quiet, clipped_spots, dc_offset_pct.
checksstringJSON text: a list of {"file", "check", "status", "value", "want"}. check is one of loudness, true_peak, rms, peak, noise_floor, room_tone, clipping, dc_offset, dynamics, boost, limiting; status is pass, warn or fail.

The reply

job.output.output is JSON text: {"task": "fix_plan", "summary": "...", "steps": [{"file", "check", "do"}]}. There is one step per warn or fail check, failures first, and none for checks that pass. The page drops any step that names a check it did not send or one that already passes, fills any missing step with its own tip, and flags any number the reply quotes that it did not measure. If the balance ran low, truncated is true and the object may stop early.

Worked example

Input (input.json), for the page's quiet voice memo going to an audiobook:

{
  "task": "fix_plan",
  "destination": "Audiobook (ACX): RMS between -23 and -18 dB, peaks at most -3 dB, noise floor at most -60 dB, 0.5 to 1 s of room tone at the start and 1 to 5 s at the end (ACX)",
  "note": "",
  "files": "[{\"id\":\"f1\",\"name\":\"voice-memo.wav\",\"seconds\":14,\"channels\":1,\"before\":{\"lufs\":-33,\"true_peak\":-18.7,\"peak\":-18.7,\"rms\":-33.6,\"lra\":6.8,\"noise_floor\":-72.2,\"lead_quiet\":0.7,\"tail_quiet\":2.5,\"clipped_spots\":0,\"dc_offset_pct\":0},\"after\":{\"lufs\":-19.4,\"true_peak\":-5.2,\"peak\":-5.2,\"rms\":-20,\"lra\":6.8,\"noise_floor\":-58.6,\"lead_quiet\":0.7,\"tail_quiet\":2.5,\"clipped_spots\":0,\"dc_offset_pct\":0},\"gain_db\":13.6,\"limited_pct\":0}]",
  "checks": "[{\"file\":\"f1\",\"check\":\"rms\",\"status\":\"pass\",\"value\":\"-20.0 dB\",\"want\":\"-23 to -18 dB\"},{\"file\":\"f1\",\"check\":\"peak\",\"status\":\"pass\",\"value\":\"-5.2 dB\",\"want\":\"at most -3 dB\"},{\"file\":\"f1\",\"check\":\"noise_floor\",\"status\":\"fail\",\"value\":\"-58.6 dB\",\"want\":\"at most -60 dB\"},{\"file\":\"f1\",\"check\":\"room_tone\",\"status\":\"pass\",\"value\":\"0.7 s at the start, 2.5 s at the end\",\"want\":\"0.5 to 1 s at the start, 1 to 5 s at the end\"}]"
}

Reply:

{
  "task": "fix_plan",
  "summary": "The level, peaks and room tone are fine for ACX, but the background noise is not ready: it measures -58.6 dB against the limit of -60 dB. Fix the noise first.",
  "steps": [
    {
      "file": "f1",
      "check": "noise_floor",
      "do": "Run a light noise reduction on the original voice-memo.wav before normalizing, or re-record somewhere quieter and a little closer to the microphone. Boosting the quiet recording also raised the hiss, and ACX wants the noise floor at most -60 dB."
    }
  ]
}

On the page, each step is shown under the check it answers, next to the page's own measurement.

Errors

HTTPWhat to do
401The token is missing, expired or a guest token on a run. Get a personal token on the token page.
402The balance is below what the run reserves. Top up at skillsafe.ai/account/billing.
400The body is not a JSON object of the fields above.
429Wait and retry with the same Idempotency-Key.

Step 1 — a tiny client helper

One function that sends JSON and unwraps the {data, error} envelope.

BASE="https://api.skillsafe.ai/v1/app-api"
TOKEN="paste-your-token-here"   # from https://audio-normalizer.skillsafe.ai/tokens.html
api() { # api METHOD PATH [JSON-BODY]
  curl -s -X "$1" "$BASE$2" -H "Content-Type: application/json" \
    ${TOKEN:+-H "Authorization: Bearer $TOKEN"} ${3:+--data "$3"}
}

Step 2 — a token

A guest token is enough for /me and /estimate. A run is metered, so it needs your personal token: sign in on the token page and copy it.

# a guest token (enough for /me and /estimate); a run needs your personal token from /tokens.html
TOKEN=$(curl -s -X POST "$BASE/guest" -H "Content-Type: application/json" -d '{"slug":"audio-normalizer"}' | jq -r '.data.token')

Step 3 — who am I, and my balance

subject_type is guest or user; credits is the balance (1 credit = $0.0001).

api GET /me | jq '.data | {subject_type, credits}' 

Step 4 — price a run for free

/estimate charges nothing and starts no job. hold_credits is the amount reserved while a run is in flight, not the price; the run is charged what it uses.

# input.json: the run input object - {"task": "fix_plan", "destination": "...", "note": "", "files": "[...]", "checks": "[...]"}
api POST /estimate "$(cat input.json)" | jq '.data | {hold_credits, min_credits, model, model_alias, markup_bps, warnings}' 

Step 5 — run it and wait for the job

Send an Idempotency-Key derived from the input: a retry with the same key is never billed twice.

KEY="audio-normalizer:fix_plan:$(shasum -a 256 input.json | cut -c1-16):a1"
JOB=$(curl -s -X POST "$BASE/run" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: $KEY" --data @input.json | jq -r '.data.job_id')
while :; do
  J=$(api GET "/jobs/$JOB"); S=$(echo "$J" | jq -r '.data.status')
  case "$S" in succeeded|failed|cancelled) break;; esac; sleep 2
done
echo "$J" | jq -r '.data.output.output' > reply.json   # one JSON object: summary, steps
echo "$J" | jq '.data | {charged_credits, truncated}' 

Step 6 — or stream it

/run-stream sends Server-Sent Events while the job runs and the finished job at the end.

# Server-Sent Events: tick/delta events while the job runs, then a final event with the job
curl -N -s -X POST "$BASE/run-stream" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: audio-normalizer:fix_plan:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json