deepseek-token-query
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "deepseek-token-query" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-491a93b314445f3b1a980ce3d363af733ff6eba1d4699e9c69a0866f76961e00. Verify the upstream source and version against https://skillhub.cn/skills/user_213bfd3b/deepseek-token-query before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Use this skill when the user asks to check a DeepSeek account balance.
Introduction source: third_party · user_213bfd3b · 1.0.1 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Inputs and outputs
- Translation pending; see source documentation.
- Limits and differences
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: deepseek-token-query
description: Use this skill when the user asks to check DeepSeek account balance, remaining tokens, API usage, spending, query deepseek account, 查询 DeepSeek 余额/用量/Token/花费, 看看 DeepSeek 还有多少钱, 查一下 deepseek 的 token, deepseek token 查询, 我还有多少token, 我还有多少余额, 还剩多少token, token还剩多少. It automates browser login (with captcha solving via qwen-vl-image-reader) and retrieves balance and per-model token consumption from the DeepSeek Platform dashboard.
slug: deepseek-token-query
displayName: DeepSeek Token 查询
version: 1.0.1前置条件(必读)
必须的环境变量和技能
| 依赖 | 说明 |
|---|---|
DASHSCOPE_API_KEY |
阿里云百炼 API Key,用于 qwen-vl-image-reader 识别验证码 |
qwen-vl-image-reader 技能 |
必须已安装在 skills 目录,用于图片识别 |
browser_use 工具 |
用于操控浏览器登录 DeepSeek |
用户需要提供
| 信息 | 说明 |
|---|---|
| 📱 手机号 | DeepSeek 开放平台注册的手机号 |
| 🔢 短信验证码 | 每次运行需要用户提供收到的短信验证码(无法自动化) |
工作原理
用户说"查 DeepSeek 余额"
↓
Phase 1 (批处理) → 打开登录页 → 填手机号 → 发验证码 → 破解图形验证码
↓
Agent 交互 → 问用户要短信验证码
↓
Phase 2 (批处理) → 填验证码 → 登录 → 读取仪表盘 → 解析数据
↓
向用户汇报结果
执行流程
Phase 1: 自动发送验证码并破解图形验证码
步骤 1.1 — 打开 DeepSeek 登录页
browser_use(action="open", url="https://platform.deepseek.com/sign_in")
步骤 1.2 — 截图获取页面 refs
result = browser_use(action="snapshot")
# 从 result.snapshot 中提取 phone 输入框和 "Send code" 按钮的 ref
页面结构预期(ref 可能变化,需从快照中实时获取):
- 手机号输入框(
textbox "Phone number") - 发送验证码按钮(
button "Send code") - 密码登录按钮(
button "Login with password")
步骤 1.3 — 输入手机号
browser_use(action="type", ref="<phone_input_ref>", text="<用户手机号>")
步骤 1.4 — 点击"Send code"
browser_use(action="click", ref="<send_code_btn_ref>")
步骤 1.5 — 等待图形验证码弹窗出现(核心难点)
点击发送后 DeepSeek 会弹出一个数美(Shumei)行为验证码,提示文字如:
"Click on the smallest green cuboid in the picture""Click on the smallest green sphere in the picture""点击图片中最小的绿色长方体/球体"
弹窗覆盖整个页面,后续操作须先处理它。
步骤 1.6 — 获取验证码图片在页面中的位置
验证码弹窗内包含一个 <img> 元素,图片中是 5 个 3D 几何体水平排列。需要获取该图片的页面坐标:
result = browser_use(
action="evaluate",
code="var dlg = document.querySelector('.ds-modal-wrapper'); if(!dlg) return 'no captcha'; var imgs = dlg.querySelectorAll('img'); var rect = imgs[imgs.length-1].getBoundingClientRect(); return JSON.stringify({left:rect.left, top:rect.top, width:rect.width, height:rect.height});"
)
# 返回示例: '{"left":377,"top":260,"width":288,"height":144}'
同时从当前快照中提取验证码的指令文字(如 "Click on the smallest green cuboid"),后续传给脚本使用。
步骤 1.7 — 截图并分析验证码
浏览器截图在弹窗遮挡时会失败,使用 desktop 截图:
desktop_screenshot(path="<工作目录>/captcha.png")
然后用 qwen-vl-image-reader 分析截图,同时传入步骤 1.6 获取的图片位置信息和指令文字:
execute_shell_command(
command="python3 <skill_dir>/scripts/solve_captcha.py "
"--screenshot <工作目录>/captcha.png "
"--img-left 377 --img-top 260 "
"--img-width 288 --img-height 144 "
"--target-count 5 "
"--instruction 'click on the smallest green cuboid in the picture' "
"--snapshot-text '<从快照中提取的完整指令文本>'"
)
# 输出: {"click_x": 521, "click_y": 332, "target_index": 2, ...}
步骤 1.8 — 点击目标物体
browser_use(action="click", page_x=<click_x>, page_y=<click_y>)
步骤 1.9 — 验证验证码通过
等待片刻后截图检查是否出现 "Resend after 60s" 或 "verification code has been sent" 等文字:
browser_use(action="wait_for", wait_time=2)
snapshot_result = browser_use(action="snapshot")
# 检查快照文本中是否包含 "Resend after" 或 "验证码已发送"
如果验证失败(弹窗仍在),回到步骤 1.6 重试(最多 3 次)。
步骤 2: 等待用户提供短信验证码(人工交互)
# 告诉用户验证码已发送,请用户提供
# 用户回复验证码后继续
注意: 此步骤无法自动化。你必须等待用户回复短信验证码。
Phase 3: 登录并读取仪表盘
步骤 3.1 — 输入验证码
browser_use(action="type", ref="<code_input_ref>", text="<用户提供的验证码>")
步骤 3.2 — 点击"Log in"
browser_use(action="click", ref="<login_btn_ref>")
步骤 3.3 — 等待仪表盘加载
browser_use(action="wait_for", wait_time=3)
步骤 3.4 — 截取仪表盘快照
result = browser_use(action="snapshot")
# 快照包含以下关键信息:
# - "Topped-up balance ¥XX.XX CNY"
# - "June expenses (UTC+0) ¥X.XX CNY"
# - "deepseek-v4-pro API requests XXX"
# - "deepseek-v4-pro Tokens XX,XXX,XXX"
# - "deepseek-v4-flash API requests XXX"
# - "deepseek-v4-flash Tokens XX,XXX,XXX"
步骤 3.5 — 解析仪表盘数据
# 方法一:用解析脚本
execute_shell_command(
command="python3 <skill_dir>/scripts/parse_dashboard.py "
"--snapshot-file <工作目录>/snapshot.txt"
)
# 输出: JSON 格式的结构化数据
# 方法二:直接从快照文本中手动提取
# 快照文本格式示例(截取关键部分):
# text: ¥15.00 CNY June expenses (UTC+0) ¥4.99 CNY
# text: deepseek-v4-pro API requests 334
# text: Tokens 18,874,271
# text: deepseek-v4-flash API requests 245
# text: Tokens 5,988,123
步骤 3.6 — 向用户汇报
用整洁的表格展示结果:
## 💰 DeepSeek 账户概览
| 项目 | 数据 |
|:----|:----:|
| 💳 充值余额 | ¥15.00 CNY |
| 📆 本月已花费 | ¥4.99 CNY |
| 模型 | 请求次数 | Token 消耗 |
|:---|:-------:|:----------:|
| 🤖 deepseek-v4-pro | 334 | 18,874,271 |
| ⚡ deepseek-v4-flash | 245 | 5,988,123 |
批处理文件
本技能包含以下批处理和脚本文件:
scripts/phase1_send_code.json
自动化 Phase 1 中打开页面→输入手机号→点击发送→获取验证码图片位置的步骤。
调用方式:
run_tool_batch(
file_path="<该技能目录>/scripts/phase1_send_code.json",
args={
"phone_number": "176xxxxxxxx",
"skill_dir": "<该技能目录的绝对路径>",
"work_dir": "<当前工作目录>"
}
)
scripts/phase3_login_and_read.json
自动化 Phase 3 中输入验证码→登录→读取仪表盘→解析数据的步骤。
调用方式:
run_tool_batch(
file_path="<该技能目录>/scripts/phase3_login_and_read.json",
args={
"verification_code": "123456",
"login_btn_ref": "e8",
"code_ref": "e4",
"skill_dir": "<该技能目录的绝对路径>",
"work_dir": "<当前工作目录>"
}
)
Batch Parameters
phase1_send_code.json
| 参数 | 说明 |
|---|---|
phone_number |
用户的 DeepSeek 注册手机号 |
skill_dir |
该技能目录的绝对路径(从读取 SKILL.md 时的路径获取) |
work_dir |
当前工作目录,用于存放临时文件 |
phase3_login_and_read.json
| 参数 | 说明 |
|---|---|
verification_code |
用户提供的短信验证码 |
code_ref |
验证码输入框的 ref(从快照中获取,通常为 e4) |
login_btn_ref |
登录按钮的 ref(从快照中获取,通常为 e8) |
skill_dir |
该技能目录的绝对路径 |
work_dir |
当前工作目录 |
Batch failure handling
如果批处理执行失败:
- 检查所有
${args.<name>}参数都已传入实际值 - 确认验证码弹窗已关闭(尝试用
Escape键或 JS 移除弹窗) - 如果仍失败,按上文的 Step-by-step 流程手动执行
- 完成后告诉用户:批处理遇到问题已手动完成,是否需要优化批处理脚本
验证码破解详解
验证码特征
DeepSeek 使用数美(Shumei)行为验证码,特征如下:
| 特征 | 说明 |
|---|---|
| 触发时机 | 点击"Send code"后弹出 |
| 弹窗元素 | .ds-modal-wrapper 内的 dialog |
| 图片元素 | dialog 内最后一张 <img> |
| 提示文字 | dialog 内的 text 节点,如 "Click on the smallest green cuboid" |
| 物体数量 | 5 个 3D 几何体水平排列 |
| 目标选择 | 要求点击最小的某个颜色/形状的物体 |
| 验证方式 | 点击目标物体后弹窗自动关闭 |
自动破解方法
step-by-step 见上方 Phase 1 流程,核心思路:
- 定位图片位置 → 用
evaluate获取 img 元素的getBoundingClientRect() - 识别目标物体 → 用
desktop_screenshot+qwen-vl-image-reader分析图片内容 - 计算点击坐标 → 物体均匀分布,根据目标索引计算中心点坐标
- 点击验证 → 用
page_x/page_y参数执行精确坐标点击
注意事项
browser_use的截图在弹窗遮挡时会超时失败,此时必须用desktop_screenshot- 浏览器需以
headed=True模式启动,否则desktop_screenshot看不到浏览器窗口 - 验证码每次刷新会更换图片,但格式不变
- 如果
qwen-vl-image-reader分析结果不准确,切换--model qwen-vl-max可提高识别率
脚本参考
scripts/solve_captcha.py
验证码破解辅助脚本,封装了 qwen-vl 分析和坐标计算逻辑。
依赖: DASHSCOPE_API_KEY 环境变量
python3 <skill_dir>/scripts/solve_captcha.py \
--screenshot captcha.png \
--img-left 377 --img-top 260 \
--img-width 288 --img-height 144 \
--target-count 5 \
--instruction "click on the smallest green cuboid in the picture" \
--snapshot-text "完整快照文本"
输出示例:
{
"click_x": 521,
"click_y": 332,
"target_index": 2,
"target_count": 5
}
scripts/parse_dashboard.py
仪表盘数据解析脚本。
python3 <skill_dir>/scripts/parse_dashboard.py --snapshot-file snapshot.txt
输出示例:
{
"balance": 15.0,
"monthly_expenses": 4.99,
"expenses_month": "June",
"models": [
{
"model": "deepseek-v4-pro",
"api_requests": 334,
"tokens": 18874271
},
{
"model": "deepseek-v4-flash",
"api_requests": 245,
"tokens": 5988123
}
]
}
常见问题
验证码弹窗关不掉
# 方法一:按 Escape 键
browser_use(action="press_key", key="Escape")
# 方法二:用 JS 移除弹窗
browser_use(action="evaluate", code="document.querySelector('.ds-modal-wrapper')?.remove()")
# 方法三:禁用弹窗点击拦截
browser_use(action="evaluate", code="document.querySelector('.ds-modal-wrapper') ? (document.querySelector('.ds-modal-wrapper').style.pointerEvents = 'none') : null")
登录后没有跳转到仪表盘
如果登录后页面没有自动跳转,手动导航:
browser_use(action="navigate", url="https://platform.deepseek.com/usage")
验证码发送按钮被禁用(倒计时中)
按钮显示为 "Resend after 60s",等待倒计时结束即可重新发送。可以等待 60 秒或重启浏览器重新开始流程。
qwen-vl 识别不准确
如果 qwen-vl 的分析结果无法正确识别物体:
- 切换更强模型:
--model qwen-vl-max - 确保截图清晰包含整个验证码图片区域
- 手动从分析结果中推断目标物体的索引位置
Current listing version
1.0.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决用户查询 DeepSeek 账户余额、Token 消耗的实际需求
- 自动化浏览器登录与验证码破解,显著提升查询效率
- 支持多模型用量统计,信息展示清晰完整
Highlights
- 触发词覆盖中英文多种常见表达方式
- 边界清晰,不易与其他 Skill 混淆
Areas to improve
-
description写错位置 Reported severity: Minor
description 内容写在 skill_body 内部而非顶层 frontmatter
Recommendation: 建议将 description 移至顶层 frontmatter 中
Highlights
- 文档结构完整,包含前置条件、执行流程、批处理说明、脚本参考等
- Phase 划分清晰,步骤详细,有完整端到端示例
- frontmatter 信息完整(name、slug、version等)
Highlights
- 工具来源明确(browser_use、qwen-vl-image-reader)
- 参数说明详细,批处理文件调用方式清晰
- 覆盖主要异常场景(验证码重试、弹窗处理、登录跳转等)
- 不可逆操作(登录)需用户输入验证码确认
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 14
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- platform.deepseek.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.