Quickstart
Everything below uses the base URL https://api.loreos.app and your key as
Authorization: Bearer $LOREOS_KEY. Replies are asynchronous — you send a message,
then read the reply from the session’s events.
Using Cursor, Claude Code, Codex, Devin, or another coding agent? Read Build with a coding agent first, then come back here for the raw API flow.
1. Create a character
slug and display_name are the only required fields. (Add a persona, voice, and a face
for selfies later — see Characters and Visual assets in the API Reference.)
Representative response:
2. Start a session
A session is one character talking to one of your end-users. You choose the
external_user_ref — any opaque id you control (your user’s id in your system). LoreOS
never logs your end-user in; it’s just a reference.
Save the session_id from the response’s data.
Representative response:
3. Send a message
Representative response:
4. Read the reply
The character replies asynchronously. Poll the session’s events until the reply lands:
Look for a character event after the user-message cursor:
Replies arrive as message.created (role character). An authored greeting — or a
proactive message the character sends first — arrives as character.initiated. Both
carry payload.bubbles (an ordered list of message bubbles); payload.text is the
joined convenience form. Render bubbles when present.
Prefer a live push? Stream instead: GET /v1/sessions/{session_id}/events/stream (SSE).
What the responses look like
Every response is wrapped in an envelope:
Errors are nested under detail: { "detail": { "code", "message", "fix" } } — read
body.detail.code, not a top-level code. The full model — async runs, end-users, usage
and limits — is in Core concepts.