Ana içerik geç

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:

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", "NM19"],
"inputs": { "m": 2, "v": 3 }
}'

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

{
"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:

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