API Basics
Chronos can be used directly over REST, but for most developers we recommend using the SDK. The SDK wraps the API into a simpler runtime flow: append events → auto Brain → live NPC state updates.
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️⃣ Brain Think
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 (for example mood, flags, or memory-based state).
4️⃣ Rules (Optional)
POST /api/rules/set GET /api/rules/get
Stores and reads world behavior rules. For MVP we recommend editing rules from Vibe Console instead of direct REST calls.
For most developers, the SDK is the recommended path. Direct REST is best for custom engines, advanced debugging, or server-side integrations.
Chronos Engine Docs — Beta. Keep feedback coming.
