Deepseek Usage logo

Deepseek Usage

Organization
OpenMinis
deepseek-usage

Check DeepSeek API usage (balance, this month's spending, token breakdown by model, daily breakdown, and cache hit rate). Access the DeepSeek Open Platform through browser_use, automatically log in, and export monthly data. Users must configure their DeepSeek account in local environment variables. Triggered when the user says "check usage," "view token consumption," "check spending," "how much balance is left," or "how much was used today."

Overview

PublisherOpenMinis
RepositoryMinisSkills
Skill namedeepseek-usage
Stars
543
Forks
86
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by OpenMinis on GitHub. Read the source before you install it.

Installation

Install the Deepseek Usage AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/OpenMinis/MinisSkills/tree/main/deepseek-usage
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/OpenMinis/MinisSkills.git /tmp/MinisSkills
mkdir -p .claude/skills
cp -r /tmp/MinisSkills/deepseek-usage .claude/skills/deepseek-usage
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Deepseek Usage in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Deepseek Usage on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Deepseek Usage is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

DeepSeek API Usage Query

⚠️ Security Notice This skill requires DeepSeek login credentials to work. Credentials are stored only in local environment variables. Minis does not upload them to any server. If you do not trust this method, delete this skill or do not set any credentials.

Prerequisite Configuration (first use only)

1. Set Environment Variables

Add the following two variables in Minis Settings → Environment Variables:

Variable NameDescriptionExample Value
DEEPSEEK_EMAILYour DeepSeek platform login email addressuser@example.com
DEEPSEEK_PASSWORDYour DeepSeek platform login passwordyour_password_here

🔗 Click here to open the environment variable settings

If your account uses a third-party login such as Google or WeChat, you cannot use this skill.

2. Verify the Configuration

bash
[ -n "$DEEPSEEK_EMAIL" ] && [ -n "$DEEPSEEK_PASSWORD" ] && echo "Configured" || echo "Not configured"

Query Process (requires only 2 tool calls)

Step 1: Navigate and Ensure Login (1 tool call)

yaml
Action:
  - set_user_agent: desktop_chrome
  - navigate: https://platform.deepseek.com/usage
  - If not logged in, fill DEEPSEEK_EMAIL / DEEPSEEK_PASSWORD from environment variables and submit the login form
  - wait_for_dom_stable

Step 2: Run the complete JS script in one step (1 execute_js)

The following JS script completes all logic: get token → download ZIP → unzip → parse CSV → output.

Run the entire JS script as the argument to execute_js --script in a single execution.

js
(async () => {
  // === Get summary text ===
  // Extract with get_readable (done outside execute_js)

  // === Get Token ===
  const token = JSON.parse(localStorage.getItem('userToken')).value;
  if (!token) return JSON.stringify({ error: 'no_token' });

  // === Download zip ===
  const resp = await fetch('https://platform.deepseek.com/api/v0/usage/export?month=5&year=2026', {
    headers: { 'Authorization': 'Bearer ' + token }
  });
  const blob = await resp.blob();

  // === Load JSZip ===
  const script = document.createElement('script');
  script.src = 'https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js';
  await new Promise(r => { script.onload = r; document.head.appendChild(script); });

  // === Unzip ===
  const zip = await JSZip.loadAsync(blob);
  const costText = await zip.file('cost-2026-5.csv').async('text');
  const amountText = await zip.file('amount-2026-5.csv').async('text');

  // === Parse cost (fees) ===
  // ⚠️ Header: user_id, utc_date, model, wallet_type, cost, currency
  const costLines = costText.trim().split('\n').slice(1);
  const modelCost = {};
  let totalCost = 0;
  for (const line of costLines) {
    const p = line.split(',');
    const model = p[2], cost = parseFloat(p[4]) || 0;
    modelCost[model] = (modelCost[model] || 0) + cost;
    totalCost += cost;
  }

  // === Parse amount (usage, filter by date as needed) ===
  // ⚠️ Header: user_id, utc_date, model, api_key_name, api_key(sensitive!), type, price, amount
  // ⚠️ Security warning: Column 5 is the plaintext api_key. Do not print entire lines! You must use index references.
  const allLines = amountText.trim().split('\n').slice(1);

  // Filtering rule: if the user asks about today's usage, filter to today; if the user asks about this month's usage, use the full month
  // Default is today. For today's usage, uncomment the following line:
  // const targetDate = 'current date in YYYY-MM-DD format';
  // const filteredLines = targetDate ? allLines.filter(l => l.split(',')[1] === targetDate) : allLines;
  const filteredLines = allLines; // Default: full month

  const models = {};
  for (const line of filteredLines) {
    const p = line.split(',');
    const model = p[2], type = p[5], amount = parseInt(p[7]) || 0;
    if (!models[model]) models[model] = { requests: 0, cache_hit: 0, cache_miss: 0, output: 0 };
    if (type === 'request_count') models[model].requests += amount;
    else if (type === 'input_cache_hit_tokens') models[model].cache_hit += amount;
    else if (type === 'input_cache_miss_tokens') models[model].cache_miss += amount;
    else if (type === 'output_tokens') models[model].output += amount;
  }

  // === Summary output ===
  let result = '';
  let gr = 0, go = 0, gh = 0, gm = 0;

  for (const [m, d] of Object.entries(models)) {
    const ti = d.cache_hit + d.cache_miss;
    const hr = ti > 0 ? (d.cache_hit / ti * 100).toFixed(1) : '0.0';
    const co = modelCost[m] || 0;
    result += `${m}|${d.requests}|${d.output}|${d.cache_hit}|${d.cache_miss}|${ti}|${hr}|${co.toFixed(2)}\n`;
    gr += d.requests; go += d.output; gh += d.cache_hit; gm += d.cache_miss;
  }

  const ti = gh + gm;
  const hr = ti > 0 ? (gh / ti * 100).toFixed(1) : '0.0';
  result += `TOTAL|${gr}|${go}|${gh}|${gm}|${ti}|${hr}|${totalCost.toFixed(2)}`;

  return result;
})();

⚠️ Note: execute_js returns text wrapped in JSON. The AI needs to parse data.text to get the actual result.

Step 3: Screenshot (1 tool call, optional)

yaml
screenshot: current page

Step 4: Report (memory_write is decided by the user)

Whether to write the results to the daily log is decided by the user. Write only when the user explicitly asks.

Output Format

Balance: ¥X.XX | Spent This Month: ¥X.XX

ModelRequestsOutput TokensCache HitsCache MissesTotal Input TokensCache Hit RateCost
deepseek-v4-proXXXXXX%¥X.XX
deepseek-v4-flashXXXXXX%¥X.XX
TotalXXXXXX%¥X.XX

⚠️ Security Precautions (must be followed)

API Key Leakage Risk

Column 5 (index 4) of the amount CSV is the api_key field and contains the user's DeepSeek API Key in plaintext.

Requirements:

  • When parsing CSV, use column index references such as p[2], p[5], and p[7]; do not reference the entire line
  • Do not directly or indirectly display api_key content in any reply, log, or screenshot
  • If you need to inspect CSV content during debugging, print only the header (row 1), not the data rows

Credential Security

  • Email and password are stored in Minis local environment variables and are not uploaded
  • The localStorage token is valid only for the current browser session
  • We recommend changing your password regularly

Troubleshooting Notes

IssueCauseSolution
Export button click has no effectThe export button is a <div>, not a <button>Use querySelector to match the text "Export", then call .click()
browser_use fetch returns Missing Tokenfetch does not include page cookiesUse execute_js instead to run fetch in the page context
JSZip fails to loadThe import() method is not supportedUse document.createElement('script') to dynamically load the CDN
CSV parses to 0 recordsIncorrect field indexes were guessedFirst confirm the headers (8 columns for amount, 6 columns for cost), then reference by index
amount.csv contains plaintext API KeyColumn 5 is api_keyUse column indexes during parsing; do not print the entire row
minis-browser-use CLI loses state across callsEach call is a separate processPut all JS logic in a single execute_js execution; do not pass state across navigate and execute_js

Frequently asked questions

What does the Deepseek Usage AI skill do?

Check DeepSeek API usage (balance, this month's spending, token breakdown by model, daily breakdown, and cache hit rate). Access the DeepSeek Open Platform through browser_use, automatically log in, and export monthly data. Users must configure their DeepSeek account in local environment variables. Triggered when the user says "check usage," "view token consumption," "check spending," "how much balance is left," or "how much was used today."

Why use Deepseek Usage on TypingMind?

Because you install it once and use it with any model. Deepseek Usage is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Deepseek Usage in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/OpenMinis/MinisSkills/tree/main/deepseek-usage. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Deepseek Usage?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Deepseek Usage?

As many as you like. As long as a model supports skills, you can use Deepseek Usage with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Deepseek Usage AI skill free?

Yes. It is published on GitHub by OpenMinis under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇