Feature Request: Provide a Bearer-authenticated, real-time usage / quota aggregation API for third-party tools (e.g. CodexBar)
Submitted by: A DeepSeek API user + CodexBar (steipete/CodexBar) contributor
Use case: macOS menu-bar usage monitor + similar third-party tools across the ecosystem
TL;DR
Please expose a Bearer-authenticated, real-time, aggregated usage / quota endpoint under api.deepseek.com so tools like CodexBar can visualize DeepSeek consumption the way they already do for OpenAI Codex, Claude, Cursor, Gemini, etc.
This unlocks the entire third-party monitoring ecosystem for DeepSeek — power users who live in the terminal / menu bar / dashboards need a programmatic way to read their own consumption without opening a browser.
What I'm asking for
At minimum, an endpoint equivalent to OpenAI's Usage API in spirit. Reference fields:
| Field |
Why it matters |
current_window_remaining_percent |
5h rolling quota remaining (matches CodexBar's "session" bar) |
current_window_resets_at |
ISO 8601 reset timestamp |
weekly_remaining_percent |
weekly quota bar |
weekly_resets_at |
weekly reset |
today_token_used |
today token count |
today_cost_usd |
today cost (USD) |
month_token_used |
month token count |
month_cost_usd |
month cost (USD) |
last_refresh_at |
for cache / staleness checks |
Standard Authorization: Bearer <api_key> should work — no session cookies, no CSRF, no web login flow.
Why — what's blocking us today
https://api.deepseek.com/user/balance is Bearer-authenticated, but only returns the cash balance, not token / cost breakdowns.
https://platform.deepseek.com/api/v0/usage/amount and /usage/cost are exactly what third-party tools need — but they live under the web console domain and only authenticate via session cookies, not Bearer. From an API key's perspective, they return HTTP 200 + {"code": 40003, "msg": "Authorization Failed"} — a successful-looking response with an application-level error that is very easy to miss.
- The per-request
usage field from /chat/completions only gives per-call data, not aggregated dashboards.
- The web dashboard has noticeable delay; users have no real-time channel to monitor their own consumption.
Concrete user impact — the bug my PR hit
I previously submitted CodexBar PR #1166 (92598f8d feat: add DeepSeek usage summaries, merged into v0.32.2) implementing a DeepSeekAPIFetchStrategy against the platform.deepseek.com usage endpoints with Bearer auth. The PR was merged in good faith — but in practice, the dashboard silently shows "balance only" for 100% of Bearer-authenticated users because:
- The fetcher's
guard response.statusCode == 200 else { throw } is satisfied (status IS 200).
- The parser sees
data: null → throws parseFailed("Missing amount biz_data").
completedOptionalUsageSummary discards the error silently inside a 2s grace window.
- The UI sees
snapshot?.deepSeekUsage == nil and hides the whole dashboard section.
There is no telemetry, no log line, and no UI hint to surface this failure to the user — every layer swallows the error. So end users think "CodexBar's DeepSeek integration just doesn't have a usage breakdown feature", when in reality the API server is rejecting every call.
If DeepSeek exposes a Bearer-authenticated real-time endpoint, the CodexBar fix becomes trivial: swap the strategy from cookie-style to Bearer-style. I (the PR author) am happy to send the fix immediately.
Suggested endpoint shape (sketch)
GET https://api.deepseek.com/v1/usage
Authorization: Bearer <api_key>
200 OK
{
"balance_usd": "12.34",
"today": {
"prompt_tokens": 1234567,
"completion_tokens": 234567,
"total_tokens": 1469134,
"cost_usd": "3.21"
},
"month": { "...": "..." },
"current_window": {
"remaining_percent": 78.5,
"resets_at": "2026-06-09T03:00:00Z"
},
"weekly": { "...": "..." },
"last_refresh_at": "2026-06-08T23:30:00Z"
}
A one-team / one-sprint change that unlocks CodexBar, Hammerspoon scripts, Slack bots, Prometheus exporters, etc.
Reference
Thanks for the great models — looking forward to seeing usage visibility improve. Happy to collaborate on the CodexBar side as soon as the endpoint is live.
Feature Request: Provide a Bearer-authenticated, real-time usage / quota aggregation API for third-party tools (e.g. CodexBar)
Submitted by: A DeepSeek API user + CodexBar (steipete/CodexBar) contributor
Use case: macOS menu-bar usage monitor + similar third-party tools across the ecosystem
TL;DR
Please expose a Bearer-authenticated, real-time, aggregated usage / quota endpoint under
api.deepseek.comso tools like CodexBar can visualize DeepSeek consumption the way they already do for OpenAI Codex, Claude, Cursor, Gemini, etc.This unlocks the entire third-party monitoring ecosystem for DeepSeek — power users who live in the terminal / menu bar / dashboards need a programmatic way to read their own consumption without opening a browser.
What I'm asking for
At minimum, an endpoint equivalent to OpenAI's Usage API in spirit. Reference fields:
current_window_remaining_percentcurrent_window_resets_atweekly_remaining_percentweekly_resets_attoday_token_usedtoday_cost_usdmonth_token_usedmonth_cost_usdlast_refresh_atStandard
Authorization: Bearer <api_key>should work — no session cookies, no CSRF, no web login flow.Why — what's blocking us today
https://api.deepseek.com/user/balanceis Bearer-authenticated, but only returns the cash balance, not token / cost breakdowns.https://platform.deepseek.com/api/v0/usage/amountand/usage/costare exactly what third-party tools need — but they live under the web console domain and only authenticate via session cookies, not Bearer. From an API key's perspective, they returnHTTP 200 + {"code": 40003, "msg": "Authorization Failed"}— a successful-looking response with an application-level error that is very easy to miss.usagefield from/chat/completionsonly gives per-call data, not aggregated dashboards.Concrete user impact — the bug my PR hit
I previously submitted CodexBar PR #1166 (
92598f8d feat: add DeepSeek usage summaries, merged into v0.32.2) implementing aDeepSeekAPIFetchStrategyagainst theplatform.deepseek.comusage endpoints with Bearer auth. The PR was merged in good faith — but in practice, the dashboard silently shows "balance only" for 100% of Bearer-authenticated users because:guard response.statusCode == 200 else { throw }is satisfied (status IS 200).data: null→ throwsparseFailed("Missing amount biz_data").completedOptionalUsageSummarydiscards the error silently inside a 2s grace window.snapshot?.deepSeekUsage == niland hides the whole dashboard section.There is no telemetry, no log line, and no UI hint to surface this failure to the user — every layer swallows the error. So end users think "CodexBar's DeepSeek integration just doesn't have a usage breakdown feature", when in reality the API server is rejecting every call.
If DeepSeek exposes a Bearer-authenticated real-time endpoint, the CodexBar fix becomes trivial: swap the strategy from cookie-style to Bearer-style. I (the PR author) am happy to send the fix immediately.
Suggested endpoint shape (sketch)
A one-team / one-sprint change that unlocks CodexBar, Hammerspoon scripts, Slack bots, Prometheus exporters, etc.
Reference
Sources/CodexBarCore/Providers/DeepSeek/Thanks for the great models — looking forward to seeing usage visibility improve. Happy to collaborate on the CodexBar side as soon as the endpoint is live.