API Reference
The ForbocAI API provides RESTful endpoints for the Multi-Round Protocol — the API is the “Mind” that orchestrates all npc decisions, while the SDK is the “Body” that executes them locally. Endpoints are protocol verbs, not CRUD operations. The primary runtime route is /npcs/{npcId}/process (atomic continuation), and compatibility phase routes remain available: /npcs/{npcId}/directive, /npcs/{npcId}/context, and /npcs/{npcId}/verdict.
Base URL
Authentication
API requests require a bearer token in the Authorization header:
POST /npcs/{npcId}/verdict returns signature in the response body. Use it as the canonical validation proof; if your backend needs an explicit header for downstream checks, forward it as X-Forboc-Signature.
API Categories
Initialize and manage local SLM inference engines
Register npcs and execute the multi-round protocol (/process primary; directive/context/verdict compatibility)
API-directed memory recall and storage (local vector DB)
Standalone action validation against game rules
Export and import portable npc state
Run automated QA testing with headless npcs
Register directive rule sets for game-agnostic logic
Health check and API version info
Response Format
Multi-round protocol responses use domain-specific shapes. Key examples:
Directive Response (Step 2 — API tells SDK what to recall):
Context Response (Step 4 — API sends SLM prompt):
Verdict Response (Step 6 — API validates + instructs):
Error Handling
Errors return appropriate HTTP status codes with details:
Rate Limits
Note: Billing tiers are planned. The current API uses per-key rate limiting (100 requests/60s). The tiers below reflect the intended production model.
SDKs
Official SDK libraries wrap this API for common platforms:
