Pages

Generates a self-contained HTML page from a prompt and serves it at a new short link. Responds with an application/x-ndjson stream, one JSON event per line: start (maxOutputTokens), heartbeat (elapsedMs, outputChars) at least every 10 seconds while the page is generated, then exactly one terminal event - done (page) or error (code, status, message). code is prompt_rejected (400), generation_failed (502), generation_timeout (504), link_refused (the status the link write was refused with) or internal_error (500). Refusals decided before generation starts are ordinary JSON replies with their status code.

post/links/page

Request

Request body

DomainIdnumber required

Domain ID where the page will be created

pathstring

Short link path (auto-generated if omitted)

titlestring

Link title (taken from the generated page's <title> if omitted)

promptstring required

What the page should be. The HTML is generated from it and cannot be edited directly

Example request

{
  "prompt": "A one-page menu for a small Italian bakery, warm colours, with opening hours"
}

Changes