dsh-arckep
在Web端显示第三方账户余额、消费详情与配置 适合使用arckep.ru服务的用户,可在会话头部直观监控API余额与开销。
安裝
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:gmen1057/dsh-arckep說明文件
閱讀完整 README ↗dsh-arckep
English | Русский
Shows the balance and spending of your arckep.ru account right inside the DeepSeek Harness (DSH) web UI: a small badge with the balance in the session header, a panel with the details, and a settings page for the API key.
Unofficial. This is a community plugin. It is not made by, endorsed by or affiliated with DeepSeek. arckep.ru is the third-party service the plugin connects to; you need your own arckep.ru account and API key.
What you get
- Badge in the header of an open session: the balance as
1 234,50 ₽. It turns to a warning colour when the balance is below your threshold (default 100 ₽) or when the forecast says the money lasts less than 3 days. Click it to open the panel. - Panel: balance (with a note for a corporate wallet), spending for today / 7 days / 30 days, the top 5 models by cost, "enough for about N days", "updated N min ago" and a refresh button.
- Settings → Arckep: the API key field (it is cleared after saving and only shows that a key is set), Save / Delete key, "count spending for this key only", the polling interval (default 300 s, minimum 60 s), the warning threshold and the interface language.
- Russian and English interface, following the DSH language (Russian when it cannot be determined, English for other DSH languages). DSH itself ships English and Chinese, so a Russian reader can switch the plugin to Russian in Settings → Arckep. Colours come from the DSH theme, so light and dark themes work.
- If arckep.ru is unreachable, the last good numbers stay on screen and are marked "data is out of date".
The badge lives in the session header, so it appears once a session is open (not on the empty start screen).
Requirements
- DSH 0.2.0-rc.2 or newer with the web UI (
dsh web). DSH is a developer preview and its plugin APIs are still changing, see Compatibility. DSH itself needs Node.js 22.19+ (or 24+); the plugin has no other requirement. - A DSH profile that includes the web app (the shipped
webprofile does). - An arckep.ru API key with the
balance:readscope.
Install
The package is not on npm yet; install it from GitHub:
dsh plugin --profile web add github:gmen1057/dsh-arckep
dsh web
(web is the profile name; use your own profile if you have one.) There is no build step and
no install script, so nothing else needs to be allowed or built. To pin an exact version append a
commit or tag: github:gmen1057/dsh-arckep#.
Once it is published to npm the command will be:
dsh plugin --profile web add dsh-arckep
Check that the layer is active with dsh --profile web --dump-config (look for the
# == dsh-arckep block). Remove the plugin with dsh plugin --profile web remove dsh-arckep.
Set the key
- On arckep.ru open Settings → API and create a key. It needs access to the balance
(
balance:read). New keys have it by default; a dedicated key with only this scope is the safest choice. - In DSH open Settings → Arckep, paste the key and press Save. The field is cleared and the page says "Key is set".
Alternatively export ARCKEP_API_KEY before starting DSH. DSH's rule applies: an environment
variable wins over a stored key, and the settings page then shows the key as read-only.
Settings
| Setting | Default | Where it is stored |
|---|---|---|
| API key | none | DSH credential store (ARCKEP_API_KEY), see Privacy |
| Count spending for this key only | off | this browser |
| Polling interval | 300 s (minimum 60 s) | this browser |
| Warn when the balance is below | 100 ₽ | this browser |
| Interface language | same as DSH | this browser |
The three display settings above the language can also get deployment-wide defaults by overriding the arckep row in your
profile's cordis.patch.yml ($DSH_HOME/profiles/ /cordis.patch.yml):
- id: arckep
config:
refreshSeconds: 600
warnBelowRub: 300
keyOnly: false
Anything the user changes in Settings → Arckep overrides these defaults in that browser.
How it behaves
- The DSH server calls arckep.ru, never the browser. The browser only talks to DSH.
- Requests are made only while a DSH page is open and visible, and only when the cached answer is older than the polling interval. There are no background timers on the server.
- One request at a time, 10 s timeout, no redirects followed. After errors the next automatic
attempt is delayed 30 s, 60 s, 120 s ... up to 30 minutes (and by
Retry-Afterfor HTTP 429). - 401 (wrong key) and 403 (missing scope) are not retried automatically; press Refresh after you fix the key.
- Spending details come from
GET /api/v1/usage. If the arckep.ru server does not provide that endpoint yet (HTTP 404), the plugin keeps showing the balance and hides the spending block without any error. It probes again from time to time.
Privacy and security
- The plugin talks to
https://arckep.ruonly:GET /api/v1/balanceandGET /api/v1/usage?days=30&key_only=.... The host and the https scheme are checked in code; a redirect (any 3xx answer) is treated as an error and never followed. - No telemetry, no analytics, no third-party requests. The plugin writes no files of its own;
the only thing persisted by DSH is the key, in its credential store. The display settings
live in your browser's
localStorage. - The key is sent in the
Authorization: Bearerheader to arckep.ru and nowhere else. It is never put incordis.patch.yml, in the URL, in logs, in error messages, or in anything sent to the browser; the browser only learns whether a key is set and where it comes from. - The plugin's four routes live on DSH's own authenticated
/apichannel, so they are protected by DSH's Host/Origin checks and its browser-session cookie. State-changing requests additionally require a JSON content type and a same-origin request. - Know where the key is stored. DSH's local credential store is a file in
$DSH_HOME(~/.dsh/.credentials.yaml, mode 600). Tools that DSH's agent runs execute as the same OS user, so they can read it. That is a property of DSH, not of this plugin. Limit the damage: create a key that only hasbalance:read, and revoke it on arckep.ru if you suspect it leaked. - The standard proxy variables that DSH honours (see DSH's network-proxy guide) apply, because the
plugin uses the host's regular
fetch. I have not tested a proxied setup.
Report vulnerabilities privately, see SECURITY.md.
Troubleshooting
| You see | Meaning |
|---|---|
| "arckep.ru rejected the key (401)" | wrong or revoked key; paste a new one |
| "The key lacks the required access (balance:read)" | create a key with the balance scope |
| "Cannot reach arckep.ru" / "did not answer within 10 seconds" | network problem; the last numbers stay, marked out of date |
| "Spending details are not available on arckep.ru yet" | the server has no /usage endpoint (yet); the balance still works |
| no badge at all | open a session (the badge is in the session header); make sure the plugin is listed by dsh --profile web --dump-config |
| "The key comes from an environment variable" | unset ARCKEP_API_KEY to manage the key in Settings |
Compatibility
DSH is a developer preview; its plugin interfaces can change between releases, and this
plugin depends on the web client's slots (conversation.session.header.utilities,
settings.section) and on ctx.connection.fetch and ctx.credentials of the Host.
| DSH version | Status |
|---|---|
0.2.0-rc.2 (latest) | tested: installs (from a local path, a tarball and a git URL), loads, badge, panel, settings, key storage, live disable/enable |
0.2.1-alpha.2 (alpha) | tested: installs from a tarball, loads, badge, panel, settings, key storage |
Only the web UI (dsh web) was exercised. The TUI has no web client and is not supported; the
desktop app was not tested.
Development
npm ci
npm run check # syntax + manifest checks
npm test # node --test, no network
node scripts/mock-arckep.mjs 39100 # a local stand-in for the API
DSH_ARCKEP_TEST_ORIGIN=http://127.0.0.1:39100 dsh web # point DSH at the mock
DSH_ARCKEP_TEST_ORIGIN exists for development only. It is accepted only when it names a
loopback address over plain http with a port of 1024 or more (for example
http://127.0.0.1:39100); any other value is ignored and logged. It cannot be set through the
plugin configuration, so a profile file cannot redirect the key. Do not set it in a real setup.
The client half (lib/client.js) is a single hand-written file in DSH's lazy-CommonJS client
module format, so the repository needs no build step to be installed from GitHub.
Acknowledgements
The public plugins dsh-cost-meter and dsh-web-billing were a helpful reference for how a DSH web plugin is wired (slots, the credential store, the client module format). No code was copied from them.
License
MIT © 2026 gmen1057