Add llm-provider-billing skill: DeepSeek balance query

This commit is contained in:
2026-09-01 18:23:59 +08:00
parent c6cc8b6b12
commit ed5340d7e0
2 changed files with 81 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# DeepSeek 余额实时查询 — 自动从 ~/.hermes/.env 读 key,无需手动 export
# 用法: bash deepseek-balance.sh (或 chmod +x 后直接执行)
set -euo pipefail
ENV_FILE="$HOME/.hermes/.env"
KEY=$(grep '^DEEPSEEK_API_KEY=' "$ENV_FILE" 2>/dev/null | cut -d= -f2- | tr -d '"' | tr -d "'")
if [ -z "$KEY" ]; then
echo "❌ 未在 $ENV_FILE 找到 DEEPSEEK_API_KEY" >&2
exit 1
fi
echo "🔍 查询 DeepSeek 余额 ..." >&2
curl -s --max-time 20 https://api.deepseek.com/user/balance \
-H "Accept: application/json" \
-H "Authorization: Bearer $KEY"
echo