# Deepseek Balance

> Query DeepSeek Open Platform account balance. Triggered when user asks "DeepSeek balance", "API balance", "how much credit left", "check my quota". Requires DEEPSEEK_APIKEY env var.

- Skill: `wmy2981/deepseek-balance` (Agent Skill, multi-file: 5 files)
- Install (CLI): `npx skillmds@latest add wmy2981/deepseek-balance`
- Raw SKILL.md: https://api.skillmd.com/api/skills/wmy2981/deepseek-balance/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: wmy2981 (https://skillmd.com/u/wmy2981)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/wmy2981/deepseek-balance

---


# DeepSeek Open Platform Balance Query

Use this skill when the user asks about their DeepSeek account balance.

## Execution Rule

Run the user's requested command directly without pre-checking dependencies, environment variables, or configuration. If something is wrong, the script will fail with a clear error — check and fix only then.

## Usage

The script reads the API key from the `DEEPSEEK_APIKEY` environment variable, calls the balance API, and outputs raw JSON to stdout. Configure it in `~/.wmyskills/.env` (shared across skills) or `scripts/.env` (takes priority); use `scripts/.env.example` as the template — add the variable to `~/.wmyskills/.env`, never overwriting an existing file.

```bash
python scripts/check_balance.py
```

## Output Format

The script outputs raw JSON (no pretty-printing):

**Success:**
```json
{"is_available":true,"balance_infos":[{"currency":"CNY","total_balance":"110.00","granted_balance":"10.00","topped_up_balance":"100.00"}]}
```

**Error** (missing API key or network failure):
```json
{"error": "DEEPSEEK_APIKEY environment variable not set"}
```

## Fields

| Field | Description |
|-------|-------------|
| `is_available` | Whether the balance is sufficient for API calls |
| `currency` | Currency type, `CNY` or `USD` |
| `total_balance` | Total available balance (including granted + topped-up) |
| `granted_balance` | Unexpired granted balance |
| `topped_up_balance` | Topped-up balance |

## Notes

- Only report the balance number. Do not volunteer pricing or conversion advice (e.g. "how many tokens this covers") unless the user asks.
- The `DEEPSEEK_APIKEY` environment variable must be set (or configured in `~/.wmyskills/.env` or `scripts/.env`).

