Interactive TUI for querying sub2api backend usage stats (Claude / OpenAI / Gemini)
Project description
sub2api-usage
sub2api 后台用量查询的命令行工具。终端里直接看请求数、Token、成本、明细,支持今天 / 7 天 / 30 天 / 全部切换。
安装
# 推荐:uv tool install (隔离环境)
uv tool install sub2api-usage
# 或者用 pipx
pipx install sub2api-usage
# 或者直接 pip
pip install sub2api-usage
用法
# 首次运行会引导填写账号、密码、后台地址、时区,
# 配置保存到 ~/.config/sub2api-usage/config.json (chmod 600)
sub2api-usage
# 重新配置账号
sub2api-usage setup
# 非交互打印 (脚本 / 管道用)
sub2api-usage print
sub2api-usage print --period week --list --page-size 20
sub2api-usage print --period month --json
交互面板键位
| 键 | 功能 |
|---|---|
1 / 2 / 3 / 4 |
今天 / 7 天 / 30 天 / 全部 |
← / → |
在标签间切换 |
n / p |
下一页 / 上一页 |
r |
刷新 |
q |
退出 |
单位
数量统一用计算机领域的 K/M/G/T,耗时按 ms/s/min/h/d 自动选择最适合的尺度。
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sub2api_usage-0.2.0.tar.gz.
File metadata
- Download URL: sub2api_usage-0.2.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c23ad30aac61cf8d1188594c74cf3ceab9c007d232b4910b02684a82861f95d9
|
|
| MD5 |
85a87edaf767946983267e838b0b12a4
|
|
| BLAKE2b-256 |
0a350f1d6e22993d7f64d8438e908ddf95af8cf3b63fd3002ae74fe42beb9a6e
|
Provenance
The following attestation bundles were made for sub2api_usage-0.2.0.tar.gz:
Publisher:
publish.yml on kadaliao/sub2api-usage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sub2api_usage-0.2.0.tar.gz -
Subject digest:
c23ad30aac61cf8d1188594c74cf3ceab9c007d232b4910b02684a82861f95d9 - Sigstore transparency entry: 1630257240
- Sigstore integration time:
-
Permalink:
kadaliao/sub2api-usage@571dc63ff38488896ed7cd3acecd8093447664ab -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/kadaliao
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@571dc63ff38488896ed7cd3acecd8093447664ab -
Trigger Event:
push
-
Statement type:
File details
Details for the file sub2api_usage-0.2.0-py3-none-any.whl.
File metadata
- Download URL: sub2api_usage-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69ba4d7af00b95d751004955cf36bd06ee02c6230b69cd129b0f5b13b525700f
|
|
| MD5 |
635d1b159c23b5f1df6172419570452e
|
|
| BLAKE2b-256 |
3596b97c182078407c4246943a4f151badd99486ba1c8b796c787f4d0f1f4e0d
|
Provenance
The following attestation bundles were made for sub2api_usage-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on kadaliao/sub2api-usage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sub2api_usage-0.2.0-py3-none-any.whl -
Subject digest:
69ba4d7af00b95d751004955cf36bd06ee02c6230b69cd129b0f5b13b525700f - Sigstore transparency entry: 1630257265
- Sigstore integration time:
-
Permalink:
kadaliao/sub2api-usage@571dc63ff38488896ed7cd3acecd8093447664ab -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/kadaliao
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@571dc63ff38488896ed7cd3acecd8093447664ab -
Trigger Event:
push
-
Statement type: