@teinai/cli 1.1.31 → 1.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +34 -0
  2. package/index.js +1706 -1136
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -129,6 +129,40 @@ Check the status of any queued generation job and download the output asset:
129
129
  tein status 673f8a9b1c2d3e4f5a6b7c8d --wait -o output.mp4
130
130
  ```
131
131
 
132
+ ### Balance, usage and balance history
133
+
134
+ Read only: nothing runs and nothing is charged. Each prints a short summary, and `--json` prints the API's own JSON (`GET /v1/balance`, `/v1/usage`, `/v1/balance/transactions`, the same as the MCP tools `get_balance`, `get_usage`, `get_balance_history`). They cover the whole workspace, wherever a run was started: the website, the API, MCP or this CLI.
135
+
136
+ ```bash
137
+ # Balance, what this key can spend, Auto top up, spend this month and in the last 30 days
138
+ tein balance
139
+
140
+ # Usage by model, channel, key and time
141
+ tein usage # last 30 days, one row a day (default)
142
+ tein usage --range week --channel api # last 12 weeks, API runs only
143
+ tein usage --range custom --from 2026-11-01 --to 2026-11-19 --model seedance-2-5 --json
144
+
145
+ # Balance history, newest first
146
+ tein transactions --limit 20 --type usage,refund
147
+ tein transactions --after <next_cursor> # the next page (printed under each page)
148
+ ```
149
+
150
+ | Option | Command | Values |
151
+ | ---------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
152
+ | `--range` | `usage` | `hour` (last 24 h), `day` (last 30 days, default), `week` (last 12 weeks), `month` (last 12 months, not this month), `custom` |
153
+ | `--from`, `--to` | `usage` | `YYYY-MM-DD` (UTC), with `--range custom` only, at most 366 days |
154
+ | `--model` | `usage` | a model id, e.g. `seedance-2-5` |
155
+ | `--channel` | `usage` | `website`, `api`, `mcp`, `cli` |
156
+ | `--limit` | `transactions` | 1 to 100, default 50 |
157
+ | `--type` | `transactions` | one or more of `usage`, `refund`, `topup`, `auto_topup`, `credit_grant`, `adjustment`, `referral`, `referral_cash`, `subscription`, `forfeit`, `starter` |
158
+ | `--after` | `transactions` | the `next_cursor` of the previous page |
159
+
160
+ `tein history` is the same as `tein transactions`. A bad value is refused with the API's message, for example `range must be one of hour, day, week, month, custom.`
161
+
162
+ ### `tein --version`
163
+
164
+ Prints the installed version, the same as `npm ls -g @teinai/cli`.
165
+
132
166
  ---
133
167
 
134
168
  ## Model Context Protocol (MCP) Integration