Saltar al contenido principal

Calling a protocol

Protocols are pre-composed, pre-verified operator products. Instead of hand-selecting operators, you pick a protocol from the 235-entry registry and pass it parameters.

The call

const cko = await zeq.run(protocolId, params);

That's the entire API.

  • protocolId — one of the 235 IDs in the registry. Browse them in Reference → Protocols.
  • params — a JSON object. The protocol's parameter schema is in its reference page.

The SDK handles:

  • Serialization to the API.
  • Signing the request.
  • Converting any Unix timestamps to Zeqond via ZTB1.
  • Verifying the response CKO signature.

The response — CKO

Every protocol call returns a Compiled Kinematic Output:

{
"protocol": "zeq-propagation",
"version": "1.287.5",
"zeqond_at": 72380021.4,
"operators": ["KO42", "QM9", "GR35"],
"ko42": {
"mode": "KO42.1",
"alpha": 0.00129,
"error_band": 0.00043,
"within_bound": true
},
"master_reduction": "Box phi - mu^2 phi + phi_42 (C_QM9 + C_GR35) = J_ext",
"E": {
/* the actual result — protocol-specific */
},
"timebase": {
"ztb1_applied": true,
"input_base": "unix",
"output_base": "zeq"
},
"signature": "ed25519:...",
"public_key_id": "zeq-edge-2026-04"
}

Fields you'll use most:

  • cko.E — the computed result.
  • cko.ko42.within_bound — always true if the CKO was issued; false means your composition broke the error bound.
  • cko.zeqond_at — the signed timestamp.
  • cko.signature — verifiable against the public key listed in public_key_id.

Errors

The SDK wraps server errors into typed exceptions:

  • KO42ViolationError — the composition exceeded the error bound. The error includes the best-achievable band and a suggested simpler composition.
  • ProtocolNotFoundError — unknown protocolId.
  • ProtocolParameterError — missing / wrong-type parameters. The error includes the expected schema.
  • RateLimitError — hosted API rate limit hit. Upgrade tier or back off.
  • AuthError — missing or revoked API key.

Batching

For high-throughput callers, the SDK supports batch submission:

const ckos = await zeq.batch([
{ protocolId: "zeq-formulation", params: {/* ... */} },
{ protocolId: "zeq-propagation", params: {/* ... */} },
{ protocolId: "zeq-diagnostic", params: {/* ... */} },
]);
// Returns an array of CKOs in request order.

Batches execute in parallel on the server, each CKO independently signed. Batch size cap is 100 per request (larger batches get chunked client-side).

Streaming

For long-running protocols (full-field simulations, large-N problems), use streaming:

for await (const partial of zeq.stream("zeq-ocean", params)) {
// partial is a CKO with cumulative progress
console.log(partial.progress); // 0.0 → 1.0
console.log(partial.E.current_state);
}
// The final partial is the complete CKO.

Each streamed chunk is a valid CKO — KO42-verified — so you can terminate early and keep a partial result.

Next

Use from your preferred language → SDKs.