Zum Hauptinhalt springen

POST /api/zeq/agent/generate-html

LLM-driven page generator. Your model writes the HTML; the framework hashes + commits it to your entangled state via the same pipeline as a manual upload (HOST1 operator), and serves it from /s/<slug>/<path>.

Auth

Authorization: Bearer zeq_ak_…. Owner of the target slug only.

Cost

100 ZEQ atomic. The most expensive single action in the framework because it can burn 5–20K LLM tokens (input + output). At list price that's $1.00 covering ~$0.03–$0.15 of upstream cost — the markup funds the entangled state write + rest of the platform.

Request

curl -X POST https://YOUR-FRAMEWORK/api/zeq/agent/generate-html \
-H "Authorization: Bearer zeq_ak_..." \
-H "Content-Type: application/json" \
-d '{
"slug": "zeq07090490306",
"path": "/",
"title": "My state-machine page",
"prompt": "A landing page with three feature cards: real-time compute, ZeqProof verified, ≤0.1% precision",
"style": "chat",
"credential_id": "5b7a9c12-...",
"include_chat": true,
"publish": true
}'

Body

FieldTypeRequiredNotes
slugstringyesTarget chain. Must be admin+ on it.
pathstringnoDefault /. Where the page lands under /s/<slug>/.
titlestringyesPage <title>.
promptstringyesPlain-language description of what to build (≤4000 chars).
styleenumno"chat" (default — full-page chatbot), "qore", "minimal", "documentation", "landing".
credential_iduuidyesBYOK credential to use. Required — there's no free-tier path for this endpoint.
include_chatboolnoDefault true. Embeds the agent rail / Pulse when style ≠ chat.
publishboolnoDefault false. When true, commits to chain + serves immediately. When false, returns the generated HTML for review.

Response · 200 OK (publish=true)

{
"ok": true,
"slug": "zeq07090490306",
"path": "/",
"url": "https://YOUR-FRAMEWORK/s/zeq07090490306/",
"sha256": "f3a1...",
"bytes": 14220,
"transition_id": "tx_2026-05-10T13:08:32Z_...",
"tally_charge": {
"charged": 100,
"burned": 80,
"toFoundation": 20,
"remainingAfter": 43
}
}

Response · 200 OK (publish=false)

{
"ok": true,
"html": "<!doctype html><html>...",
"review_url": null,
"tally_charge": { /* same shape as above */ }
}

Errors

StatusCodeCause
400style_invalidNot in the enum list.
400prompt_requiredMissing or > 4000 chars.
402INSUFFICIENT_BALANCEWallet < 100 ZEQ. Top up at /tally/ or upgrade tier.
403not_ownerCaller isn't admin+ on target machine.
409path_conflictpath already exists and publish=true without overwrite=true.

How the page lands

When publish=true:

  1. Atomic 100 ZEQ charge.
  2. LLM call (BYOK).
  3. SHA-256 of the generated bytes.
  4. New state_machine_sites row with the bytes + hash.
  5. Chain transition writes operator HOST1 with the hash payload.
  6. siteHost.ts serves it next request to /s/<slug>/<path>.

The Pulse / agent rail injection on the new page is governed by the chain's inject_pulse_orb / inject_agent_rail toggles (per Phase L3).