Skip to content
anecho.ai
Start · SDK reference

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.

new Anecho(options)
Constructor options
OptionTypeDefaultNotes
apiKeystringOptional. 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.
modelBaseUrlstringthe manifest's URLsOrigin 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.
manifestUrlstringFetch the model manifest from here instead of the default.
manifestManifestPass a manifest object directly, for a build that ships its own.
cacheCacheMode'auto'Whether decoded weights are kept between sessions.
runtimeUrlstringjsDelivronnxruntime-web UMD build for the inference worker. Self-host it in production — most CDNs do not promise the CORP header require-corp needs.
wasmPathsstringjsDelivrDirectory holding ort-wasm*.wasm. Same caveat.
transportTransportbest availableForce a transport instead of letting the SDK pick.
onProgress(p) => voidWeight-loading progress, for a determinate progress bar.
anecho.createSession(options)
Session options
OptionTypeDefaultNotes
modelstring'clearline-s'Model id. See the table below.
sampleRatenumber8000The rate of the blocks you will push. Nothing in the SDK resamples it — that is the point.
splitPipelinebooleantrueEmit enhanced and raw as separate, sample-aligned outputs.
enginestringOverride the engine backend for this session.
vadbooleantrueEmit per-block speech and score alongside the audio.
signalAbortSignalAbort model loading and tear the session down.
session.process(block)
signature
process(block: Float32Array): {
  enhanced: Float32Array;
  raw: Float32Array;
  speech: boolean;
  score: number;
  latencyMs: number;
}
Processed frame fields
FieldTypeNotes
enhancedFloat32ArrayProcessed audio, same length as the input block.
rawFloat32ArrayThe input block, delayed to match `enhanced` exactly. Never re-align by hand.
speechbooleanOnset's decision for this block.
scorenumberNyquist's call-quality estimate, 0–1. Low values predict downstream failure.
latencyMsnumberAlgorithmic latency of the configured model. Constant for a session.
Models
Model ids and what each one is for
IdModelRoleVariants
clearlineClearlineFLAGSHIP — primary-speaker isolation at 8 kHz, enrollment-free, streamingclearline-xsclearline-sclearline-m
chamberChamberWideband (16/48 kHz) speech enhancement + primary-speaker isolationchamber-xschamber-schamber-m
onsetOnsetVoice activity detection and turn-takingonset-xsonset-sonset-m
nyquistNyquistCall-audio quality scoring and failure predictionnyquist-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.

Errors
Error codes
CodeHTTPMeaning
invalid_key401The key is malformed, revoked, or scoped to a different environment.
rate_limited429Test keys are capped per minute. Retry with backoff; the audio path is unaffected.
unsupported_sample_rate400Pass 8000, 16000 or 48000 and match it to your transport.
model_not_found404Model id does not exist or is not enabled for this account.
quota_exhausted402Free-tier minutes are spent. Processing continues on the raw passthrough path rather than dropping your call.