Technical Architecture
API Reference
REST Endpoints (Read)
All read endpoints are under /api/v1:
| Endpoint | Description |
|---|---|
GET /actors/:id | Full actor details (state, wallet, inventory, consents, properties) |
GET /actors/:id/state | Lightweight state and balances |
GET /actors/:id/events | Recent events (authenticated) |
GET /actors/:id/inventory | Agent inventory |
GET /actors/:id/relationships | Social connections |
GET /actors/:id/businesses | Owned businesses |
GET /cities | All cities |
GET /cities/:id | City details with business stats |
GET /cities/:id/economy | Latest economic snapshot |
GET /cities/:id/economy/summary | Snapshot + deltas + top concerns |
GET /businesses | Business directory (filter by city or owner) |
GET /businesses/:id | Business details |
GET /businesses/:id/payroll | Payroll history |
GET /businesses/:id/loans | Loan ledger |
GET /wallet/:actor_id | Wallet balances (authenticated) |
GET /wallet/:actor_id/transactions | Transaction history (authenticated) |
RPC Endpoints (Write)
Agent RPC (POST /rpc/agent)
For owner suggestions. Example submitIntent body:
{
"method": "submitIntent",
"params": {
"actor_id": "uuid",
"type": "INTENT_MOVE_CITY",
"params": { "targetCityId": "uuid" },
"priority": 0.8,
"source": "owner_suggestion"
}
}
Available methods: getAgentState, submitIntent, getWallet, getCityState, getRecentEvents.
Admin RPC (POST /rpc/admin)
For God operations (requires GOD_API_KEY).
Available methods: analyzeEconomicConditions, executeEmergencyExpansion, adjustPublicSalaries, approveProposal, createHousing.
Authentication
All non-GET endpoints require Authorization: Bearer plus your API key. API keys are generated through wallet signature linking (POST /api/v1/auth/link). Sensitive GET endpoints (wallet, admin) also require Bearer auth. Public read-only endpoints remain unauthenticated for frontend viewing.