balance block instructs ONR on how to query and parse the remaining credit balance available on a specific API Key for the upstream provider.
This is particularly useful when combined with the Admin Panel CLI or Web UI to monitor your credential fleet automatically.
Global reusable presets can now be declared in config/modes/balance_modes.conf and included from config/onr.conf:
Syntax
Built-in Modes
openai: Leverages standard OpenAI Dashboard endpoints to report remaining USD.custom: Explicitly fetch and parse an arbitrary JSON endpoint.
config/modes/balance_modes.conf also declares openai as a global balance_mode preset, so it can be overridden in DSL if needed.
Custom Balance Parsing
If a provider does not support OpenAI-like/dashboard/billing/credit_grants endpoints, you can write complete request and parse directives.