offrouter-core
v0.7.0
Published
Core routing engine for OffRouter — subscription-first model routing for coding agents.
Readme
offrouter-core
Core routing engine for OffRouter — subscription-first model routing for coding agents.
Features
- Policy engine — evaluate routing policies against provider capability, cost, and user-defined rules
- Credential chain auth — OAuth PKCE flow + API key auth with automatic discovery
- Provider catalog — discover available providers, models, and subscription tiers
- Usage tracking — real-time usage counters with near-limit detection and fallback triggers
- Multi-account subscriptions — aggregate capacity across multiple accounts on the same provider
- Audit logging — structured, redactable audit trail with configurable persistence
Install
npm install offrouter-coreQuick example
import { routeRequest, evaluatePolicy, loadConfig } from 'offrouter-core'
const config = await loadConfig('~/.config/offrouter/config.json')
const result = await routeRequest(
{ prompt: 'Explain quantum computing', model: 'sonnet' },
config
)
console.log(result.chosenProvider, result.chosenModel)Links
Claude Code primary model is unchanged in V1; OffRouter routes delegated work.
