GiantGKL / dsh-cost

목록에 있음

업스트림 저장소에 설명이 없습니다.

main기타 소스 보기

설치

npm install dsh-cost

이 명령은 GitHub 저장소 주소에서 생성됩니다. 실행 전에 업스트림 README와 소스를 검토하고 재현성이 필요하면 release 또는 commit을 고정하세요.

README

유지 관리자가 작성한 문서 스냅샷입니다.

GitHub에서 보기 ↗
커밋 1080268동기화 2026. 8. 18.

dsh-cost

中文

DSH plugin for the DeepSeek Harness: live conversation cost and DeepSeek account balance in the composer stats row. Currency follows the UI locale: RMB (¥) in the Chinese UI, USD ($) in the English UI.

Features

  • Conversation cost: cumulative token usage over the whole session log × official DeepSeek pricing, shown as a live estimate — ¥ 0.0123 in the Chinese UI, $ 0.0018 in the English UI. Hover for the input/output/cache-read token breakdown and the pricing tier.
  • Account balance: queries the official DeepSeek GET /user/balance endpoint. A USD account is converted to RMB in the Chinese UI; a CNY account is converted to USD in the English UI (estimated rate, noted in the tooltip). Click to refresh, auto-poll every 60 s.
  • DeepSeek only: the cost hides itself for non-DeepSeek models; without a configured API key the balance shows "余额 — / Balance —".
  • Supported models: deepseek-v4-pro / deepseek-v4-flash / deepseek-chat / deepseek-reasoner (other DeepSeek models are estimated with the v4-pro tier).

Install

npm install dsh-cost

Then mount it in the deployment's cordis.yml (or a profile's cordis.patch.yml):

plugins:
  - name: 'dsh-cost'

The web client is composed automatically via the dsh.client declaration (platform: web); no further configuration is required.

Config

The Host half follows the llm-deepseek adapter settings ($DSH_HOME/settings.yaml):

SettingDefaultMeaning
llm-deepseek.apiKeyEnvDEEPSEEK_API_KEYCredential reference (environment-variable name) for the API key, resolved through the credentials service ($DSH_HOME/.credentials.yaml / environment / .env)
llm-deepseek.baseURLhttps://api.deepseek.comBase URL of the balance endpoint

Without an API key the balance shows "余额 — / Balance —"; the cost display is unaffected.

Pricing (USD, per 1M tokens)

ModelInputOutputCache read
deepseek-v4-pro$0.435$0.87$0.003625
deepseek-v4-flash$0.14$0.28$0.0028
deepseek-chat$0.28$0.42$0.07
deepseek-reasoner$0.55$2.19$0.14
  • Cache writes are billed at the input price (DeepSeek has no separate write fee).
  • Official DeepSeek USD pricing (the v4 tiers match the deployment's bundled pi-ai data). In the Chinese UI the same tiers are displayed in RMB.
  • Balance conversion uses the estimated rate 1 USD ≈ ¥6.79 (2026-08 central parity 6.7888). To follow official price or rate changes, edit the PRICING table in lib/client.js and USD_CNY in lib/index.js.

Privacy

  • The API key is resolved through the credentials service and used only to send the Bearer request to api.deepseek.com — it is never logged, never placed on a command line, and never returned to the browser.
  • The balance route lives on the harness web server's same-origin path /api/plugins/dsh-cost/balance; responses carry balance numbers only (no key) with Cache-Control: no-store.
  • The balance request runs inside the Host process (native fetch), not through a sandboxed subprocess.

Limitations

  • DeepSeek models and the official DeepSeek balance endpoint only.
  • Balance conversion uses a hard-coded estimated rate, not a live rate.
  • The cost is an estimate based on official pricing (token counts come from the Harness tokenUsage projection; discounts and taxes are not included).

License

MIT © 2026 GiantGKL

저장소 정보

언어
JavaScript
라이선스
MIT
마지막 업데이트
2026. 8. 13. 오후 4:45

신중하게 설치하기

소스 코드, 권한, 수명 주기 스크립트, 의존성 및 네트워크 접근을 검토하고 신뢰하지 않는 플러그인은 격리 환경에서 테스트하세요.