POST /api/zeq/compute
The core compute endpoint. Compose operators, send numeric inputs,
receive a deterministic result. Every response carries a ZeqProof
envelope (offline-verifiable), a Zeqond phase stamp, a ZeqCompliance
envelope mapped to 13 regulatory standards, and — crucially —
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", "NM19"],
"inputs": { "m": 2, "v": 3 }
}'
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
{
"ok": true,
"result": {
"value": 42.000891,
"operators": ["KO42", "NM19"],
"inputs": { "m": 2, "v": 3 },
"zeqond": "2289003912",
"phase": 0.412,
"precision_pct": 0.0089
},
"proof": {
"digest": "f3a1c2b8...",
"signature": "...",
"verifiable_offline": true
},
"compliance_envelope": "env_2026-05-10T13:08:32Z_..." ,
"tally_charge": {
"charged": 5,
"burned": 4,
"toFoundation": 1,
"remainingAfter": 138
}
}
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