Prometheux is usable as a headless backend. You can host your own frontend anywhere — a static SPA, a mobile app, a server — and drive the platform over the REST API. This guide shows how to build a chat app over one ontology, end to end. Everything here uses only the public REST API. You need three things: The agent already knows your data — its concepts and context notes — and refuses off-topic questions, so a thin chat UI is often all you need.
1

Mint a token

Create a long-lived token to authenticate your app. Bootstrapping one requires an already-authenticated session (see Authentication):
expires_in_minutes: null mints a non-expiring key (cap: 1 year otherwise). The raw token is returned once — store it securely. You can revoke it anytime.
2

Stream a chat response

Send a message to the AI Agent and read the NDJSON stream. Render content as the answer and thinking as live progress:
Keep the same session_id across turns to preserve conversation context.
3

Add history and an editable context layer (optional)

  • Chat history — list, load, rename, and delete past conversations with Chat History. A loaded session’s id is a session_id you can keep chatting on to continue it.
  • Context — let users view and edit what the assistant knows via the Context Layer. To show the notes for your ontology: GET /knowledge/context?scope=ontology&scope_id={ontology_id}. Create and edit notes (including their activation) with POST/PATCH.
4

Deploy — keep the token server-side

CORS is open, so a browser app can call the API directly. That is fine for local development, but a token in browser code is visible to every visitor and grants full account access.For anything public, put a thin proxy in front: the browser calls your origin, the proxy adds the Authorization header and forwards to Prometheux. The token never reaches the client. Example — a Cloudflare Worker that serves a static SPA and proxies /api/*:
Point your frontend’s base URL at /api (same origin) instead of the direct Prometheux URL, and store the token as an encrypted secret on the proxy. The streaming passthrough above keeps thinking/content events incremental.
Prefer a higher-level wrapper? The Python SDK exposes the same agent chat and concept operations as functions. This guide covers the raw HTTP path for building custom (often browser) frontends.