Skip to main content

Interactive TUI for querying sub2api backend usage stats (Claude / OpenAI / Gemini)

Project description

sub2api-usage

CI PyPI Python License: MIT

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

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sub2api_usage-0.2.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sub2api_usage-0.2.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

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

Hashes for sub2api_usage-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c23ad30aac61cf8d1188594c74cf3ceab9c007d232b4910b02684a82861f95d9
MD5 85a87edaf767946983267e838b0b12a4
BLAKE2b-256 0a350f1d6e22993d7f64d8438e908ddf95af8cf3b63fd3002ae74fe42beb9a6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sub2api_usage-0.2.0.tar.gz:

Publisher: publish.yml on kadaliao/sub2api-usage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for sub2api_usage-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 69ba4d7af00b95d751004955cf36bd06ee02c6230b69cd129b0f5b13b525700f
MD5 635d1b159c23b5f1df6172419570452e
BLAKE2b-256 3596b97c182078407c4246943a4f151badd99486ba1c8b796c787f4d0f1f4e0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for sub2api_usage-0.2.0-py3-none-any.whl:

Publisher: publish.yml on kadaliao/sub2api-usage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page