Skip to content

DeepSeek quota probe hardcodes USD symbol: CNY balance shown as \$76.88 instead of ¥76.88 #5692

Description

@Tcreatle

Client or integration

OpenCodex dashboard

Area

Provider adapter

Summary

The DeepSeek quota probe reports the account balance with a hardcoded $ prefix, regardless of the currency returned by the DeepSeek API. A CNY-denominated account with a balance of 76.88 CNY is displayed in the dashboard as "API balance ($76.88)", which misrepresents the currency. I expected the label to use the currency reported in balance_infos[].currency (e.g. "API balance (¥76.88)" for CNY).

The affected code is fetchDeepSeekQuota in src/providers/quota/vendor-probes-key.ts: the probe reads total_balance / granted_balance from balance_infos rows and prefers a USD row, but the label construction hardcodes $ for whichever row is selected. When the account only has a CNY row (the common case for DeepSeek accounts billed in CNY), the label is wrong.

Suggested fix: derive the symbol from the selected row's currency field (CNY → ¥, USD → $, otherwise show the currency code) instead of hardcoding $.

Reproduction

  1. Configure a DeepSeek provider (baseUrl: https://api.deepseek.com) with an API key from a CNY-billed account.
  2. Open the dashboard → Providers → DeepSeek → refresh quota (or call GET /api/providers/keys?name=deepseek&quota=1&refresh=1).
  3. Observe the quota label: API balance ($76.88).
  4. Call GET https://api.deepseek.com/user/balance with the same key: the payload reports "currency": "CNY" inside balance_infos, i.e. the amount is 76.88 CNY, not USD.

Version

2.64.0

Operating system

macOS 27.0 (arm64)

Provider and model

deepseek (quota probe; model-independent)

Logs or error output

# Dashboard quota label (wrong currency symbol):
API balance ($76.88)

# DeepSeek API response shape (redacted, amount kept as-is):
{
  "is_available": true,
  "balance_infos": [
    {
      "currency": "CNY",
      "total_balance": "76.88",
      "granted_balance": "0.00",
      "topped_up_balance": "76.88"
    }
  ]
}

Screenshots and supporting files

Dashboard screenshot available on request; the label line above is the complete visible defect.

Redacted configuration

{
  "providers": {
    "deepseek": {
      "baseUrl": "https://api.deepseek.com",
      "authMode": "api-key"
    }
  }
}

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

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

    account-poolOAuth, credentials, Codex pool, quota, failover, plansbugSomething isn't workingproviderProvider adapters, OpenAI-compat presets, upstream API quirks

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions