JavaScript — fetch() today, native package planned
There is no published npm package yet — npm install zeq does not exist. The in-repo TypeScript client (@zeq-os/sdk, app/packages/sdk/) is private and unpublished; releasing it is pending the self-hosted package-registry decision. Today you get full parity through three real surfaces: the terminal CLI (/cli/), raw HTTP / fetch() (below — what every client wraps), and zeq.py (Python — single file, fetched from any node). When the package ships it will wrap exactly this wire format.
Every node serves the terminal CLI with a sha256-pinned installer — the fastest way onto the framework:
curl -fsSL https://zeqstate.com/install.sh | sh # any node works as the origin
zeq tutorial # guided: account → machine → first compute → verify
Full install notes + the complete command reference: /cli/.
First call — public, no key
fetch() is built into every browser and Node ≥ 18 — nothing to install:
const p = await (await fetch("https://zeqapi.com/api/zeq/pulse")).json();
console.log(`Zeqond ${p.zeqond} · phase ${p.phase.toFixed(3)} · R(t) ${p.R_t}`);
GET /api/zeq/pulse — no authentication, no rate limit beyond the public quota. Use it for live cadence on dashboards, status pages, or as the first heartbeat in an observer agent.
Authed call — POST /api/zeq/compute
const res = await fetch("https://zeqapi.com/api/zeq/compute", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.ZEQ_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
operators: ["KO42", "QM5", "GR40"],
domain: "cross",
inputs: { t: 0 },
}),
});
const r = await res.json();
console.log(r.value, r.unit, "± " + r.uncertainty);
console.log(r.signed.claim.registry_version); // Ed25519-signed claim
console.log(r.zeqProof); // HMAC receipt
console.log(r.explorer_url); // deep-link to the Zeqond tick
Every compute returns a zeqState (the math), an Ed25519-signed claim (signed — verifiable offline by anyone, no secrets), the HMAC zeqProof receipt, equations[] + master_sum (the generative mathematics), and a ZeqCompliance v1 envelope. The wire envelope is identical from Python, curl, or any other surface.
What you get back
| Field | Shape | Use |
|---|---|---|
value / unit / uncertainty | numeric | the closed-form answer |
signed | object | Ed25519 { claim, signature, public_key } — verify offline or via POST /api/attest |
equations[] / master_sum | array / object | per-operator equations + R(t) term breakdown |
zeqProof | 64-hex | HMAC receipt — re-prove at /api/zeq/verify |
zeqState | object | domain, masterEquation, operator sequence, zeqond, phase |
compliance | zeq.compliance.v1 | per-call regulatory envelope |
explorer_url | string | the exact Zeqond tick in the State Explorer |
tally_charge | object | per-call wallet receipt |
Master-equation solve + register dump
The compute endpoint runs the textbook-dispatch path. For the master-equation runtime (full trajectory + register dump + functional energy E = P_φ · Z), POST to the framework routes:
const post = (path, body) =>
fetch("https://zeqapi.com" + path, {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.ZEQ_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify(body),
}).then((r) => r.json());
// Single-body
const r = await post("/api/framework/solve", {
prompt: "feather drop",
mass: 1e-4,
location: "earth",
medium: "air",
koSettings: { KO42: 1.0 },
});
console.log("registerDump: ", r.registerDump);
console.log("functionalEnergy:", r.functionalEnergy, "= P_φ·Z");
// Multi-body
const mb = await post("/api/framework/multibody", {
prompt: "sun-earth-moon",
bodies: [
{ mass: 1.989e30, location: "sun", object: "sun" },
{ mass: 5.972e24, location: "earth", object: "earth" },
{ mass: 7.342e22, location: "moon", object: "moon" },
],
koSettings: { KO42: 1.0, NM21: 0.5, GR35: 0.3 },
});
for (const body of mb.bodies) console.log(body.object, body.registerDump);
These routes are server-only — they require an API key (don't ship the key to a browser). /api/framework/solve-strict runs the ≤0.1% autotune loop. See /api/framework/ for the full request/response schema and every optional field (useOperatorModules, coreOnly, referenceMode, pairwiseCoupling, …).
Compose with
- TypeScript — the planned typed client (same wire shape).
- Hosted API reference — every route, body, response, error.
- HTTP / curl — the full wire-format walkthrough (attest, verify, headers).
- Observer Agents — drop the universal sensor into the same project.
Status & source
- Native npm package: planned — the in-repo client is
@zeq-os/sdk(app/packages/sdk/), private and unpublished pending the self-hosted package-registry decision. - The wire contract it wraps is live today and documented in full at HTTP / curl and the API reference.