Skip to content

feat: add configurable relay balance and model usage monitor - #79

Open
MonoSeass wants to merge 2 commits into
BigPizzaV3:mainfrom
MonoSeass:upload/relay-balance
Open

feat: add configurable relay balance and model usage monitor#79
MonoSeass wants to merge 2 commits into
BigPizzaV3:mainfrom
MonoSeass:upload/relay-balance

Conversation

@MonoSeass

@MonoSeass MonoSeass commented Aug 20, 2026

Copy link
Copy Markdown

Summary

Adds a configurable Codex++ user script for monitoring relay balance and per-model usage.

Features

  • Displays the current relay balance in the Codex++ menu bar.
  • Supports today, yesterday, and custom date-range queries.
  • Shows per-model requests, input tokens, cache read tokens, cache write tokens, output tokens, total tokens, and actual cost.
  • Calculates the effective actual billing multiplier as actual_cost / cost for the selected range.
  • Supports automatic relay configuration from Codex++ and manual endpoint/API-key configuration.
  • Keeps manually entered configuration in local storage; no API key is bundled in the script.

Compatibility and limitations

  • Requires the Codex++ user-script environment; it is not a standalone browser/Tampermonkey script.
  • Defaults to the sub2api-compatible /v1/usage endpoint.
  • The usage response must provide balance or remaining, plus model_stats.
  • The actual multiplier is a weighted result for the selected query range, not a provider-wide pricing setting.
  • The upstream relay must expose the required balance and usage data.

Validation

  • node --check scripts/codex-relay-balance.js
  • Parsed index.json successfully.
  • Verified the registered SHA-256 hash matches the script:
    8196E88932C5631B92A9E3CA9CCD569465D4FD8668E34F3B7655F6095ED3D592
  • git diff --check passed.
  • Verified in the Codex++ environment with the configured relay.

Update in 0.3.3

  • Non-2xx responses now include the upstream error detail and requested path when available, so HTTP 500 responses can be diagnosed instead of showing only a generic status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant