RouteNexRouteNex / docs
GitHub ↗
SYSTEM ARCHITECTURE

Architecture, Security & API Reference

Hono.js proxy pipeline, circuit breaker lifecycle, and endpoints.

Core Subsystems

• RouteEngine: Deterministic candidate evaluator with LKGP, headroom, cache-affinity, and cost sorting.
• CircuitBreaker: 3-state state machine (CLOSED, OPEN, HALF_OPEN) with cooldown lockout.
• PromptCompressor: LexiPack multi-language rules and whitespace compaction saving 30-55% tokens.
• AdminStore: AES-256-GCM keystore and SHA-256 virtual key manager.

Key API Endpoints

POST /v1/chat/completions — OpenAI-compatible chat proxy
POST /v1/messages — Anthropic Messages API proxy
GET /v1/models — Dynamic model catalog with pricing metadata
POST /v1/router/explain — Dry-run route explainability simulator
POST /v1/mcp — Built-in Model Context Protocol server
GET /health/live — Liveness probe and provider connectivity