Skip to main content

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:

OperatorsZEQ cost
1 op1–3
2–4 ops, single domain3–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

FieldTypeRequiredNotes
operatorsstring[]yesOperator IDs from the catalogue (or synthesised skill IDs). 1–8 typical, 16 max.
inputsobjectyesDomain-specific inputs (varies per operator sequence).
precisionfloatnoOverride the ≤0.1% default tolerance. Range: 1e-9 to 1e-1.
proofboolnoDefault true. Compute and attach the ZeqProof envelope.
compliance_envelopeboolnoDefault 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

FieldWhat it is
value / unit / uncertainty / verificationThe physics answer + the honest verification state (verified | unverifiable | disputed).
signedEd25519-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_sumPer-term breakdown of R(t) = S(t) × [1 + α·sin(2π·f_H·t)] — total, ground_state, modulation, alpha, pulse_hz, terms[].
complianceZeqCompliance v1 envelope (envelope_id, schema, 13-standard map).
ckoKernel pointer + compliance + explorer_url, plus metric_shift when Rule 6 triggers.
zeqProofHMAC-SHA256 receipt bound to your key prefix — re-prove at POST /api/zeq/verify.
explorer_urlDeep-link to the exact Zeqond tick in the State Explorer.
tally_charge / zeq_envelopeThe 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:

FieldTypeNotes
chargedintTotal ZEQ debited atomically (= burned + toFoundation).
burnedint80% — retired from circulating supply (tokens_burned counter).
toFoundationint20% — credited to the foundation pot (tokens_received counter).
remainingAfterintWallet'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

HeaderPurpose
X-Zeq-Compliance-EnvelopeEnvelope ID (also in body for SIEM scrapers).
X-Zeq-Compliance-SchemaSchema version.
X-Zeq-OriginWhich framework instance served the call (rotator failover).
X-Zeq-ZeqondThe Zeqond at which the compute ran.

Errors

StatusCodeCause
400operators_requiredEmpty or missing operators array.
400operator_not_found: <id>Unknown operator (catalogue + synthesised skills checked).
400inputs_invalidInputs don't match operator sequence's signature.
401Missing or bad Bearer key.
402INSUFFICIENT_BALANCEWallet < cost. Top up at /tally/.
412precision_unmetResult violated the precision gate. No charge — atomic.
429RATE_LIMITEDPer-key quota.

Compose

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