fetch from Node 18+ or the browser.
The smallest complete solve
Errors
Every failure rejects with anEddyError carrying .code (the API’s error code), .message and .status (the HTTP status; 0 for a client-side TRANSPORT / TIMEOUT).
Async jobs
A202 is followed through poll to the result by default; pass { wait: false } as the call’s options to get the handle, then await eddy.waitForJob(job) or for await (const [event, status] of eddy.jobEvents(job.job_id)) ....
Blobs and fields
eddy.blob(id) fetches bytes through a BlobCache (in-memory by default; fileBlobCache(dir) from @eddy-solve/client/node persists to a directory — a blob id names its bytes forever). eddy.field(result, "displacement") decodes an SSFLD1 blob into { components, count, values: Float64Array }.
Webhooks, usage and limits
An async solve can carrywebhook: { url, secret } — the engine POSTs the finished job record to url, signed (x-eddy-signature: blake3=<hex>, a keyed BLAKE3 MAC over the body), three attempts, the delivery log on the job record ((await eddy.getJob(id)).webhook). eddy.usage() is the caller’s own meter (the events under the presented key, the summed cost). A 429 is retried only when it carries retry-after (a rate limit); once the retries are spent a 429 / 503 rejects with .retryAfter — the seconds the engine asked for. The conventions for one key per tenant are on the tenancy page.
In a page
Every engine serves its own client:<script src="/sdk/eddy.global.js"></script> defines globalThis.EddySDK (new EddySDK.Eddy({ baseUrl: "" }) talks to the engine that served the page); /sdk/eddy.mjs, /sdk/eddy.cjs and /sdk/eddy.d.ts are the module builds. The engine’s own pages are consumers of it.
Reference
One method per operation, named by the operation id — the API reference names each. Path parameters are positional, then the JSON body (typed by its request interface; extra keys pass through), thenquery, then the call options ({ wait, signal, timeoutMs }). request(method, path, { json, data, contentType, query, admin, accepted, idempotent, options }) is the untyped escape hatch the typed methods share.