POST /api/zeq/compute
The core compute endpoint. Compose operators, send numeric inputs,
receive a deterministic result. Every response carries an
Ed25519-signed claim (signed — verifiable offline by anyone, no
secrets), the generative mathematics (equations[] +
master_sum), the HMAC zeqProof receipt, a ZeqCompliance envelope
mapped to 13 regulatory standards, a deep-link explorer_url to the
exact Zeqond tick, and the tally_charge field showing exactly what
was deducted from your wallet.
Method POST Path /api/zeq/compute Precision ≤0.1%
(KO42 metric tensor)
Auth
Authorization: Bearer zeq_ak_…. Account-scoped key.
Cost
Atomic, scales with the operator sequence length:
| Operators | ZEQ cost |
|---|---|
| 1 op | 1–3 |
| 2–4 ops, single domain | 3–7 |
| Cross-domain (4–7 ops) | 7–13 |
| Heaviest (8+ ops, contracts, ZSP envelope) | 13–20 (cap) |
Charged before the compute runs. If the wallet has insufficient
balance, returns HTTP 402 INSUFFICIENT_BALANCE and nothing is
performed — no partial charges.
Request
curl -X POST https://YOUR-FRAMEWORK/api/zeq/compute \
-H "Authorization: Bearer zeq_ak_..." \
-H "Content-Type: application/json" \
-d '{
"operators": ["KO42", "GR37"],
"inputs": { "mass": 1.98892e30 }
}'
Body
| Field | Type | Required | Notes |
|---|---|---|---|
operators | string[] | yes | Operator IDs from the catalogue (or synthesised skill IDs). 1–8 typical, 16 max. |
inputs | object | yes | Domain-specific inputs (varies per operator sequence). |
precision | float | no | Override the ≤0.1% default tolerance. Range: 1e-9 to 1e-1. |
proof | bool | no | Default true. Compute and attach the ZeqProof envelope. |
compliance_envelope | bool | no | Default true. Attach the 13-standard envelope. |
Response · 200 OK
Schwarzschild radius of a solar-mass body (GR37, r_s = 2GM/c²).
Truncated to the load-bearing keys — the real envelope also carries
mode, protocol_steps, uncertainty, _kernelUrl:
{
"value": 2954.0077,
"unit": "m",
"uncertainty": 2.954,
"verification": "verified",
"operator_id": "GR37",
"zeqState": {
"operators": ["KO42", "GR37"],
"domain": "General Relativity",
"masterEquation": "R(t) = S(t) × [1 + α·sin(2π·f_H·t)]",
"zeqond": 2292305743,
"phase": 0.412,
"precision": 0.001
},
"result": {
"S_t": 1.0,
"R_t": 1.000295,
"value": 2954.0077,
"unit": "m",
"uncertainty": 2.954,
"inputs": { "mass": 1.98892e30 }
},
"meta": {
"registry_version": "9c41f2… (sha256 of the canonical operator registry)",
"apiVersion": "1.287.5"
},
"signed": {
"alg": "ed25519",
"public_key": "64-hex node identity key — also at GET /api/identity",
"claim": {
"registry_version": "9c41f2…",
"operators": ["KO42", "GR37"],
"inputs": { "mass": 1.98892e30 },
"value": 2954.0077,
"unit": "m",
"uncertainty": 2.954,
"verification": "verified",
"zeqond": 2292305743,
"phase": 0.412
},
"signature": "128-hex Ed25519 over canonicalJson(claim)",
"verify_hint": "ed25519-verify(canonicalJson(claim), signature, public_key) — key at GET /api/identity; recompute per COMPUTE-DETERMINISM.md §3"
},
"equations": [
{ "index": 0, "operator_id": "KO42", "name": "HulyaPulse Ground State",
"domain": "Kinematic", "equation": "R(t) = S(t) × [1 + α·sin(2π·f_H·t)]",
"role": "ground_state" },
{ "index": 1, "operator_id": "GR37", "name": "Schwarzschild Radius",
"domain": "General Relativity", "equation": "r_s = 2GM/c²",
"role": "domain" }
],
"master_sum": {
"total": 1.000295,
"ground_state": 1.0,
"modulation": 0.000295,
"alpha": 0.001,
"pulse_hz": 1.287000000001287,
"sin_term": 0.2951,
"formula": "R(t) = S(t) × [1 + α·sin(2π·f_H·t)]",
"terms": [ "… one row per operator: contribution + fraction …" ]
},
"compliance": {
"envelope_id": "env_…",
"schema": "zeq.compliance.v1"
},
"cko": {
"kernel_url": "…/api/kernel",
"compliance": { "…": "same envelope" },
"explorer_url": "/state/detail.html?slug=<machine>&zeqond=2292305743"
},
"zeqProof": "64-hex HMAC-SHA256 receipt, bound to your key prefix",
"explorer_url": "/state/detail.html?slug=<machine>&zeqond=2292305743",
"tally_charge": {
"charged": 5,
"burned": 4,
"toFoundation": 1,
"remainingAfter": 138
},
"zeq_envelope": {
"token_id": "…",
"value_zqt": 5,
"funding": { "free_zqt": 0, "paid_zqt": 5 }
}
}
Field map
| Field | What it is |
|---|---|
value / unit / uncertainty / verification | The physics answer + the honest verification state (verified | unverifiable | disputed). |
signed | Ed25519-signed claim — exactly the fields a stranger needs to re-derive the result (registry_version, operators, inputs, value, unit, uncertainty, verification, zeqond, phase). Verifiable offline; absent only when the result is non-finite (nothing honest to sign). |
equations[] | The generative mathematics — one row per operator (index, operator_id, name, domain, equation, role); KO42 is always index 0. |
master_sum | Per-term breakdown of R(t) = S(t) × [1 + α·sin(2π·f_H·t)] — total, ground_state, modulation, alpha, pulse_hz, terms[]. |
compliance | ZeqCompliance v1 envelope (envelope_id, schema, 13-standard map). |
cko | Kernel pointer + compliance + explorer_url, plus metric_shift when Rule 6 triggers. |
zeqProof | HMAC-SHA256 receipt bound to your key prefix — re-prove at POST /api/zeq/verify. |
explorer_url | Deep-link to the exact Zeqond tick in the State Explorer. |
tally_charge / zeq_envelope | The wallet receipt and the minted ZEQ envelope (see below). |
Verify this result
Two independent checks — neither needs a key or any secret:
# 1 · CLI — Ed25519 signature + independent recompute
curl -s … /api/zeq/compute -d '…' | zeq verify -
# 2 · Ask ANY mesh node to attest — pass the envelope's signed block
curl -X POST https://ANY-ZEQ-NODE/api/attest \
-H "Content-Type: application/json" \
-d '{
"claim": { …signed.claim… },
"signature": "…signed.signature…",
"origin_public_key": "…signed.public_key…"
}'
# → { "protocol": "ZeqAttest", "ok": true, "attestation": { "verdict": "agree", … } }
The attesting node re-runs the physics from claim.inputs against the
registry pinned by claim.registry_version and returns its own
Ed25519-signed verdict. The verdict is computed, not negotiated.
tally_charge — the per-call wallet receipt
Every API-mode call returns this field. It tells you exactly what hit your wallet and what split happened:
| Field | Type | Notes |
|---|---|---|
charged | int | Total ZEQ debited atomically (= burned + toFoundation). |
burned | int | 80% — retired from circulating supply (tokens_burned counter). |
toFoundation | int | 20% — credited to the foundation pot (tokens_received counter). |
remainingAfter | int | Wallet's tokens_remaining immediately after this charge. |
If the call was made by a keyless caller (e.g. via the wizard's open
endpoints), tally_charge is null — there's no wallet to charge.
Headers on the response
| Header | Purpose |
|---|---|
X-Zeq-Compliance-Envelope | Envelope ID (also in body for SIEM scrapers). |
X-Zeq-Compliance-Schema | Schema version. |
X-Zeq-Origin | Which framework instance served the call (rotator failover). |
X-Zeq-Zeqond | The Zeqond at which the compute ran. |
Errors
| Status | Code | Cause |
|---|---|---|
400 | operators_required | Empty or missing operators array. |
400 | operator_not_found: <id> | Unknown operator (catalogue + synthesised skills checked). |
400 | inputs_invalid | Inputs don't match operator sequence's signature. |
401 | — | Missing or bad Bearer key. |
402 | INSUFFICIENT_BALANCE | Wallet < cost. Top up at /tally/. |
412 | precision_unmet | Result violated the precision gate. No charge — atomic. |
429 | RATE_LIMITED | Per-key quota. |
Compose
- Chain with
/api/zeq/latticefor multi-node coherence - Use
/api/zeq/verifyto re-prove a stored result - Drive from any language SDK — the wrappers all return the same
tally_chargefield - Subscribe to wallet movements live via
GET /api/tally/credits/:zid
SDK example
import { ZeqClient } from "@zeq-os/sdk";
const z = new ZeqClient({
origin: "https://YOUR-FRAMEWORK",
apiKey: "zeq_ak_...",
});
const r = await z.compute({
operators: ["KO42", "NM19"],
inputs: { m: 2, v: 3 }
});
console.log("Result:", r.result.value);
console.log("Charged:", r.tally_charge.charged, "ZEQ");
console.log("Wallet now:", r.tally_charge.remainingAfter);
Reference
- Source:
shared/api-core/src/routes/zeq.ts - Group: Zeq Core
- Economy: ZEQ economy ·
OPERATION_COSTS - Compliance:
POST /api/zeq/compliance/verify - Papers: Zeq Paper · Zeq Framework