docs/neuralwatt.md
The Neuralwatt provider reads account quota from the Neuralwatt Cloud API using an API key. Neuralwatt Cloud is an OpenAI-compatible inference API with energy-based pricing. Prepaid credits are a deplete-as-you-go USD balance: they do not reset on a billing cycle and are refilled by topping up. Active subscription usage is billed separately against a kWh allowance. The quota endpoint exposes both surfaces plus current-month spend and optional per-key spending allowances.
kwh_used / kwh_included) as the primary quota window, with the
subscription period end as its reset date.spent_usd / limit_usd) as an extra rate window when configured.Token vs Energy).Store the API key without opening Settings:
printf '%s' "$NEURALWATT_API_KEY" | codexbar config set-api-key --provider neuralwatt --stdin
This trims the piped key, writes it to CodexBar's config file (~/.config/codexbar/config.json
by default, or the legacy ~/.codexbar/config.json when already present), and enables Neuralwatt by
default. Use --no-enable to save the key without enabling the provider.
https://portal.neuralwatt.com/dashboardCodexBar also accepts these environment variables:
NEURALWATT_API_KEYFor tests or self-hosted/proxy setups, override the API base URL with NEURALWATT_API_URL.
GET https://api.neuralwatt.com/v1/quotaAuthorization: Bearer sk-...balance.credits_remaining_usd, balance.total_credits_usd,
balance.credits_used_usd, balance.accounting_method,
usage.current_month.cost_usd,
subscription.plan, subscription.current_period_end, subscription.kwh_included,
subscription.kwh_used, subscription.kwh_remaining,
key.allowance.limit_usd, key.allowance.spent_usd, key.allowance.periodcredits_used_usd is derived as total_credits_usd − credits_remaining_usd when the API omits it.subscription may be null; prepaid balance remains visible without a subscription window.Retry-After handling for rate limits.Set the key with codexbar config set-api-key --provider neuralwatt --stdin, add it in
Settings → Providers → Neuralwatt, set NEURALWATT_API_KEY, or configure a Neuralwatt token
account in CodexBar.
Confirm the API key is valid and that the current network can reach api.neuralwatt.com. The
quota endpoint is rate-limited to 1 request per second per customer; CodexBar refreshes on its
normal cycle so this should not be hit in practice.