One class, one session, one frame.
The JavaScript, Python and plugin surfaces are the same three objects with the same field names. If you learn @anecho/sdk, you have learned all of them.
| Option | Type | Default | Notes |
|---|---|---|---|
| apiKey | string | — | Required unless engine is 'local'. Never ship a live key to a browser. |
| engine | 'cloud' | 'local' | 'cloud' | 'local' runs the ONNX model on the machine you call from; no audio leaves it. |
| baseUrl | string | https://api.anecho.ai | Override for self-hosted deployments. |
| strictRate | boolean | true | Throws if a pushed block's rate differs from the session rate, instead of silently resampling. Leave it on. |
| timeoutMs | number | 10000 | Applies to control-plane calls only, never to the audio path. |
| Option | Type | Default | Notes |
|---|---|---|---|
| model | string | 'clearline-s' | Model id. See the table below. |
| sampleRate | 8000 | 16000 | 48000 | 8000 | The rate of the blocks you will push. Nothing in the SDK resamples it — that is the point. |
| echoSuppression | boolean | true | Clearline only. Removes residual echo the carrier's AEC left behind. |
| bandwidthExtension | boolean | false | Reconstructs 3.4–8 kHz after enhancement, never before. Off by default; measure it on your recogniser first. |
| splitPipeline | boolean | true | Emit enhanced and raw as separate, sample-aligned outputs. |
| blockSize | number | model default | Samples per process() call. Mismatched sizes are buffered, costing one hop. |
| vad | boolean | true | Run Onset and populate frame.speech. |
| score | boolean | true | Run Nyquist and populate frame.score. |
| denoiseStrength | 0–1 | 1 | Scales the suppression gain floor. Lower it if deletions rise on your data. |
process(block: Float32Array): {
enhanced: Float32Array;
raw: Float32Array;
speech: boolean;
score: number;
latencyMs: number;
}| Field | Type | Notes |
|---|---|---|
| enhanced | Float32Array | Processed audio, same length as the input block. |
| raw | Float32Array | The input block, delayed to match `enhanced` exactly. Never re-align by hand. |
| speech | boolean | Onset's decision for this block. |
| score | number | Nyquist's call-quality estimate, 0–1. Low values predict downstream failure. |
| latencyMs | number | Algorithmic latency of the configured model. Constant for a session. |
| Id | Model | Role | Variants |
|---|---|---|---|
| clearline | Clearline | FLAGSHIP — primary-speaker isolation at 8 kHz, enrollment-free, streaming | clearline-xsclearline-sclearline-m |
| chamber | Chamber | Wideband (16/48 kHz) speech enhancement + primary-speaker isolation | chamber-xschamber-schamber-m |
| onset | Onset | Voice activity detection and turn-taking | onset-xsonset-sonset-m |
| nyquist | Nyquist | Call-audio quality scoring and failure prediction | nyquist-xsnyquist-snyquist-m |
Clearline is the flagship and the default. -xs is the browser-capable variant, -s the default for server-side real-time work, -m the quality-first variant for offline or generously-provisioned paths. Real-time factor and algorithmic latency for every engine we have measured — competitors included — are on the leaderboard. Our own rows land there the same way everyone else’s did, and not before.
| Code | HTTP | Meaning |
|---|---|---|
| invalid_key | 401 | The key is malformed, revoked, or scoped to a different environment. |
| rate_limited | 429 | Test keys are capped per minute. Retry with backoff; the audio path is unaffected. |
| unsupported_sample_rate | 400 | Pass 8000, 16000 or 48000 and match it to your transport. |
| model_not_found | 404 | Model id does not exist or is not enabled for this account. |
| quota_exhausted | 402 | Free-tier minutes are spent. Processing continues on the raw passthrough path rather than dropping your call. |