Skip to content

[est. 4–12h · ~0.3–1M tok · ~$3–20] Add a second DeepSeek prepaid-balance source #16

Description

@djbclark

Goal

DeepSeek is currently reported only by CodexBar. Add a second live client source for its prepaid account balance and preserve it as prepaid_balance / n/a (never a burn recommendation).

Evidence and preferred path

  • The 2026-07-30 aiuse -q --json source audit found DeepSeek only from CodexBar.
  • slkiser/opencode-quota already obtains DeepSeek balance via the official GET https://api.deepseek.com/user/balance route. First assess whether it has a stable, unattended, machine-readable export that aiuse can consume without scraping terminal display.
  • DeepSeek documents the same balance endpoint: https://api-docs.deepseek.com/api/get-user-balance.

Decision rule

  1. Prefer an existing external project only if it provides stable structured output, can be called with the normal collector timeout, and uses credentials the operator already manages.
  2. Otherwise implement a small optional native collector, following the OpenCode Zen pattern: resolve an explicit environment override first, then SecretSpec; validate the credential before saving; never put a key in TOML, snapshots, output, errors, argv, or logs.
  3. Do not substitute local cost/token telemetry for live balance.

Acceptance criteria

  • Produces an opencode-independent deepseek prepaid-balance row with documented provenance.
  • Cross-checks CodexBar when both report an account balance; disagreement is surfaced, not silently merged.
  • Missing credentials/tool are quiet opt-out; HTTP/auth errors are scoped to this collector.
  • Tests cover parsing, credential precedence/redaction, request failure, and cross-check behavior using fixtures with no real secrets.
  • README, docs index, source-coverage guide, JSON contract implications, and aiuse doctor behavior are updated as appropriate.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions