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 | — | Optional. Used for hosted weight delivery and usage reporting; inference is on-device either way, so a local model runs without one. |
| engine | 'local' | 'local' | On-device inference. It is the only mode there is: no audio is sent anywhere. |
| modelBaseUrl | string | the manifest's URLs | Origin you serve weights from. Under Cross-Origin-Embedder-Policy a browser refuses a .onnx from a host that does not opt in, and your own origin does. |
| manifestUrl | string | — | Fetch the model manifest from here instead of the default. |
| manifest | Manifest | — | Pass a manifest object directly, for a build that ships its own. |
| cache | CacheMode | 'auto' | Whether decoded weights are kept between sessions. |
| runtimeUrl | string | jsDelivr | onnxruntime-web UMD build for the inference worker. Self-host it in production — most CDNs do not promise the CORP header require-corp needs. |
| wasmPaths | string | jsDelivr | Directory holding ort-wasm*.wasm. Same caveat. |
| transport | Transport | best available | Force a transport instead of letting the SDK pick. |
| onProgress | (p) => void | — | Weight-loading progress, for a determinate progress bar. |
| Option | Type | Default | Notes |
|---|---|---|---|
| model | string | 'clearline-s' | Model id. See the table below. |
| sampleRate | number | 8000 | The rate of the blocks you will push. Nothing in the SDK resamples it — that is the point. |
| splitPipeline | boolean | true | Emit enhanced and raw as separate, sample-aligned outputs. |
| engine | string | — | Override the engine backend for this session. |
| vad | boolean | true | Emit per-block speech and score alongside the audio. |
| signal | AbortSignal | — | Abort model loading and tear the session down. |
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. |