API Basics
Chronos works in three simple steps: append events → run Brain → fetch NPC state.
1️⃣ Append Event
POST /api/events/append
Authorization: Bearer CHRONOS_...
{
"world_id": "ghost_village",
"entity_id": "player_1",
"event_type": "door_opened",
"payload": { "door": "gate" },
"significant": true
}Writes to the append-only world memory log.
2️⃣ Run Brain
POST /api/brain/think
Authorization: Bearer CHRONOS_...
{
"world_id": "ghost_village",
"npc_id": "guard_1",
"max_events": 50
}Evaluates recent events + world rules + current NPC state and produces a new decision.
3️⃣ Get NPC State
GET /api/npc/state?world_id=ghost_village&npc_id=guard_1 Authorization: Bearer CHRONOS_...
Returns the derived NPC projection (e.g. mood, flags, memory-based state).
For most developers, we recommend using the SDK instead of calling REST directly. The SDK wraps these endpoints into simple methods: append_event → brain_think → get_npc_state.
Chronos Engine Docs — Beta. Keep feedback coming.
