Build with a coding agent
LoreOS docs are designed to be read by both humans and coding agents. If you are using an agent, give it the resources below in this order.
API key status
For local testing, issue a short-lived sandbox key directly from the API:
Demo keys are intentionally narrow: three characters, five sessions, sixty messages, 1,200 input characters, no image generation, no managed Telegram, no webhook delivery, no budget changes, no app creation, and no extra API keys. They are for copy-paste testing only.
LoreOS invite keys are still required for persistent apps, production deployments, and
surfaces disabled in the demo sandbox. Keep every LOREOS_KEY server-side.
Initial demo issuance does not require a browser challenge, so terminal coding agents can call it directly. If abuse appears, LoreOS may temporarily pause issuance or add a challenge to the public route.
Agent resource order
- Integration guide —
GET https://api.loreos.app/v1/llms.txt- Short, live API usage guide.
- Best first context for an agent that needs to make calls.
- Full docs context —
https://docs.loreos.app/llms-full.txt- Markdown corpus for the docs site.
- Best when the agent needs product and architecture context.
- API discovery —
https://docs.loreos.app/.well-known/api-catalog- Machine-readable API discovery.
- OpenAPI —
https://api.loreos.app/v1/openapi.json- Public /v1-only schema source of truth (point your SDK generator here). The raw
https://api.loreos.app/openapi.jsonis the whole server (includes internal admin/cbt) — do not generate against it.
- Public /v1-only schema source of truth (point your SDK generator here). The raw
- Page markdown — append
.mdto any docs page URL.- Use this when the agent is focused on one topic.
Only call /v1/*. Generate against https://api.loreos.app/v1/openapi.json (the public,
/v1-only schema). The raw https://api.loreos.app/openapi.json describes the whole server,
including internal /admin/* (operator cockpit) and /cbt/* (internal chat) surfaces. Those are
not for tenant apps — they are unversioned, not app-scoped, and may change without notice.
Instruct your agent to use only /v1 routes. /v1 itself is in
invite preview and is versioned via the schema_version field; pin generated clients to the
OpenAPI schema and re-check it when schema_version changes.
Golden path
Ask the agent to do this first:
The minimal flow is:
For docs validation, run this in a clean workspace where the agent cannot inspect the LoreOS repository. The agent should be able to build a tiny server-side app from the public docs, a self-issued demo key, and the machine-readable resources listed above.
The reply is asynchronous. POST /messages returns accepted and a cursor, not the
reply text. Poll events until you see:
Reliability contract
LoreOS APIs are structured so agents can call, recover, and continue.
- Every success response is wrapped as
{ "schema_version", "data", "next_actions" }. - Errors use
{ "detail": { "code", "message", "fix" } }. next_actionstells the agent what to call next.- Retry-safe sends: pass
Idempotency-Key: <unique-per-message>onPOST /messages. A same-key re-call (common on serverless/Vercel) returns the original cursor +{ "idempotent_replay": true }instead of creating a duplicate turn/reply. Dedupe event delivery by the monotoniccursor. - Long-running work is exposed through session events, runs, and delivery state.
- Usage caps return
402 budget_exceededbefore expensive model work starts. - Unknown or cross-app resources return
404, never tenant-identifying details. - Clients should ignore unknown additive fields.
Common mistakes
- Expecting a reply from
POST /messages. The reply arrives later on the event log. - Reading top-level response fields.
Use
response.data, notresponse.session_idorresponse.cursor. - Dropping the cursor.
Save
data.cursor, then poll withsince=<cursor>. - Treating
external_user_refas LoreOS auth. It is your own opaque end-user id. Your app owns end-user auth. - Putting
LOREOS_KEYin the browser. Keep the key server-side. Proxy browser requests through your backend. - Testing images before readiness. Upload an identity image and check visual readiness before image probes.
- Using a demo key as production auth. Demo keys are short-lived and capped. Use account keys for real apps.
- Assuming a failed sandbox-key call means the API is unavailable.
429means the issuance rate limit was reached.503 demo_sandbox_disabledmeans public issuance is temporarily paused; invite keys still work.
What a successful agent integration proves
A clean agent integration should prove:
- the app keeps
LOREOS_KEYserver-side; - the app creates or reuses a character;
- the app starts a session for an
external_user_ref; - the app sends a user message;
- the app polls session events with the returned cursor;
- the app displays a
message.createdevent withrole: "character".
If an agent cannot reach that result from the docs alone, the docs need another pass.
When to use LoreOS
Use LoreOS when you need persistent AI characters with memory, relationships, world continuity, daily-life context, visual identity, delivery, metering, and observability.
Do not use LoreOS if you only need a single stateless chatbot response and want to own all memory, delivery, and usage infrastructure yourself.