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 Keep the same
content as the answer and thinking as live progress: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
idis asession_idyou 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 theiractivation) withPOST/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 Point your frontend’s base URL at
Authorization header and forwards to Prometheux.
The token never reaches the client. Example — a Cloudflare Worker that serves a
static SPA and proxies /api/*:/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.

