Skip to main content

POST /api/genesis/*

ZeqGenesis is the self-generating protocol engine. It takes a plain-text query, analyses it for gaps in the existing 234+ protocol catalogue, and — if a gap is found — generates a brand-new operator chain on the fly and executes it through the same 7-Step Wizard that powers /api/zeq/compute.

Use this when: the user's intent doesn't map to an existing protocol and you want the kernel to invent one rather than failing.


Endpoints

MethodEndpointPurpose
POST/api/genesis/analyzeAnalyse a query and report which existing protocols (if any) cover it
POST/api/genesis/generateGenerate a new protocol if analyze reports a gap
POST/api/genesis/executeExecute a generated (or inline) protocol through the 7-Step Wizard
GET/api/genesis/protocolsList protocols generated in the current session
GET/api/genesis/protocol/:idFetch a single generated protocol
POST/api/genesis/promote/:idPromote a generated protocol to the permanent catalogue
GET/api/genesis/gapsView the gap log
GET/api/genesis/statsEngine statistics
POST/api/genesis/query-to-equationConvert a query to its mathematical form

Authentication

All Genesis endpoints require Authorization: Bearer $ZEQ_API_KEY.


Quickstart: end-to-end Genesis call

1. Analyse the query for gaps

curl -X POST https://www.zeq.dev/api/genesis/analyze \
-H "Authorization: Bearer $ZEQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "query": "predict mango ripening from skin colour and ambient temperature" }'

2. Generate a protocol if a gap was found

curl -X POST https://www.zeq.dev/api/genesis/generate \
-H "Authorization: Bearer $ZEQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "query": "predict mango ripening from skin colour and ambient temperature" }'

Returns a protocolId and the auto-generated operator chain.

3. Execute it

curl -X POST https://www.zeq.dev/api/genesis/execute \
-H "Authorization: Bearer $ZEQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"protocolId": "genesis-1775510398395",
"inputs": { "hue": 0.18, "tempC": 22.0 },
"precisionTarget": 0.001,
"mode": "precise"
}'

POST /api/genesis/execute — request

{
"protocolId": "genesis-1775510398395",
"operators": ["KO42", "QM1"],
"domain": "bio",
"inputs": { "hue": 0.18, "tempC": 22.0 },
"precisionTarget": 0.001,
"mode": "precise",
"publish": false
}
FieldTypeRequiredNotes
protocolIdstringone of these twoLookup mode — execute a previously generated protocol
operators + domainstring[] + stringone of these twoInline mode — execute an ad-hoc chain
inputsobjectoptionalNumeric inputs
precisionTargetnumberoptionalRequired precision (default 0.001 = 0.1%)
modestringoptional"precise" or "vx" (ground-state fallback)
publishbooleanoptionalPaid tiers only — opt the row into the public feed

POST /api/genesis/execute — response

{
"protocol": {
"id": "genesis-1775510398395",
"operators": ["KO42", "QM1"],
"domain": "bio"
},
"execution": {
"mode": "precise",
"status": "completed",
"precisionTarget": 0.001,
"precisionActual": 0.000181,
"precisionMet": true
},
"computation": {
"value": 0.74,
"unit": "ripeness",
"uncertainty": 1.8e-4,
"S_t": 0.738,
"R_t": 0.74
},
"zeqState": { "operators": ["KO42","QM1"], "masterSum": 1.234, "phase": 0.5432, "zeqond": 2285084179 },
"protocol_steps": [],
"meta": { "computedAt": "2026-04-06T21:30:00.000Z", "totalMs": 12 }
}

ZeqState publish behavior

/api/genesis/execute publishes one row per successful execution:

  • endpoint: "/api/genesis/execute"
  • operatorChain: the (auto-generated or inline) operator chain
  • resultPreview: { protocolId, domain, value, unit, R_t, precisionMet }
  • proofValue: sha256-prefix digest of { ops, domain, R_t, zeqond }

The other Genesis endpoints (analyze, generate, promote, gaps, stats) do not publish.


Errors

CodeHTTPMeaning
INVALID_PAYLOAD400Neither protocolId nor (operators + domain) was supplied
PROTOCOL_NOT_FOUND404protocolId does not exist
OPERATOR_LIMIT_EXCEEDED400More than 3 non-KO42 operators
INVALID_PRECISION_TARGET400precisionTarget outside [0, 1]