Skip to content
anecho.ai
Start · API 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
apiKeystringRequired 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.
baseUrlstringhttps://api.anecho.aiOverride for self-hosted deployments.
strictRatebooleantrueThrows if a pushed block's rate differs from the session rate, instead of silently resampling. Leave it on.
timeoutMsnumber10000Applies to control-plane calls only, never to the audio path.
anecho.createSession(options)
Session options
OptionTypeDefaultNotes
modelstring'clearline-s'Model id. See the table below.
sampleRate8000 | 16000 | 480008000The rate of the blocks you will push. Nothing in the SDK resamples it — that is the point.
echoSuppressionbooleantrueClearline only. Removes residual echo the carrier's AEC left behind.
bandwidthExtensionbooleanfalseReconstructs 3.4–8 kHz after enhancement, never before. Off by default; measure it on your recogniser first.
splitPipelinebooleantrueEmit enhanced and raw as separate, sample-aligned outputs.
blockSizenumbermodel defaultSamples per process() call. Mismatched sizes are buffered, costing one hop.
vadbooleantrueRun Onset and populate frame.speech.
scorebooleantrueRun Nyquist and populate frame.score.
denoiseStrength0–11Scales the suppression gain floor. Lower it if deletions rise on your data.
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.