deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
PROJECT README
Real-time session cost preview for DeepSeek Harness: a live cost readout under the composer, a today-usage overlay chart, and
price_estimate/session_costagent tools — with prices kept in sync with the DeepSeek official pricing page (peak / off-peak aware).
price_estimate (per-call estimate) and session_cost (full-session usage read from the same source as the Web stats strip), so your agent can quote its own burn rate mid-task.workspace agent-pricing.json (1) your override — wins over everything
↓ absent
official pricing page scrape (2) DeepSeek rows, incl. announced peak/off-peak tiers
↓ down / HTML changed
this repo's prices.json (3) edit it on GitHub → every install re-aligns,
↓ down no reinstall needed
built-in table (4) offline fallback — ships with announced tiers
DeepSeek peak/off-peak billing (announced effective 16:00 UTC 2026-08-16, peak hours 01:00–04:00 & 06:00–10:00 UTC) is computed per usage event at its own timestamp: calls made before the switch stay at flat rates, peak-hour calls bill at peak rates automatically.
Requirements: DeepSeek Harness (Web profile), 0.1.0-rc.6 verified.
dsh-agent-pricing, click 安装 / Install.dsh web) and refresh the page.dsh plugin --profile web add github:Way2LOose4/dsh-agent-pricing
# then restart the Web profile.
Clone into %DSH_HOME%/profiles/web/node_modules/dsh-agent-pricing and append to %DSH_HOME%/profiles/web/cordis.patch.yml:
- insert:
- id: agent-pricing
name: dsh-agent-pricing
Restart DSH. The Web profile's HMR is disabled — code changes only take effect on restart.
session_cost, and quote before-the-fact numbers with price_estimate.Drop an agent-pricing.json into your workspace root to fully override the price table — same shape as prices.json in this repo:
{ "models": [{ "keys": ["my-model"], "label": "My Model", "input": 1.0, "output": 2.0 }] }
Optional per-row fields: cacheRead, cacheWrite, and tiers ({ "effectiveAt", "peakHoursUtc", "peak": {...}, "offPeak": {...} }). The file is re-read on activation and on every periodic refresh. Models that match no row cost 0 and are listed in the result's note.
| Endpoint | Method | Description |
|---|---|---|
/api/pricing/session-cost?sessionId=…¤cy=CNY |
GET | Full-session usage + cost |
/api/pricing/today?currency=CNY |
GET | Today's tokens/cost + hourly series + price source |
/api/pricing/estimate?model=…&input_tokens=…&output_tokens=… |
GET | Single-call estimate |
/api/pricing/debug |
GET | Price-source layers, sync state, tier rows |
/api/pricing/reload |
ANY | Force a price-table refresh |
Model tools registered: price_estimate, session_cost.
DeepSeek rows re-align automatically from the official page. For other vendors, update prices.json: every installation refetches it every 30 minutes. A workspace-level agent-pricing.json still wins when present.
├─ package.json bundle manifest (dsh.client + dsh.bundle.patch)
├─ cordis.patch.yml profile mount row
├─ prices.json repo-hosted price table (auto-fetched by installs)
├─ lib/
│ ├─ index.js host: routes, tools, price layers, official-page parser
│ └─ client.js browser: cost readout + today overlay
├─ test.mjs official-page parser + pricing math (peak/off-peak, CNY/USD)
└─ test-refresh.mjs price-layer precedence: file > official > repo > builtin
Run the tests against a saved copy of the official pricing page:
node test.mjs official-pricing.html
node test-refresh.mjs official-pricing.html
/user/balance endpoint; this plugin deliberately stays read-only on public data and needs no API key.prices.json.| DSH version | Status |
|---|---|
| 0.1.0-rc.6 | ✅ verified |
MIT — see LICENSE.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。