scorpiox-usageCore

● Linux x64 ● Linux ARM64 ● macOS ARM64 ● Windows x64

Description

Track and record AI token consumption per session, model, and provider. Logs input/output token counts, cache utilization, and rate-limit status for cost monitoring and quota management.

Flags & Options

Flag Short Description Takes Value
--branchGit branch (default: auto-detect)Yes
--cache-read-crNumber of tokens read from cacheYes
--cache-write-cwNumber of tokens written to cacheYes
--help-hShow help message and exitYes
--input-iInput token count for this requestYes
--model-mModel name (e.g. claude-sonnet-4-20250514)Yes
--output-oOutput token count for this requestYes
--projectProject name (default: cwd basename)Yes
--provider-pAI provider name (e.g. anthropic, openai)Yes
--rl-5hRate-limit 5-hour utilization (0.0–1.0)Yes
--rl-7dRate-limit 7-day utilization (0.0–1.0)Yes
--rl-claimRate-limit representative claimYes
--rl-overageRate-limit overage utilization (0.0–1.0)Yes
--rl-statusRate-limit status (allowed / throttled)Yes
--session-sSession identifier for grouping usageYes
--tier-tSubscription tier (e.g. free, pro, team)Yes

Usage Examples

# Record a basic usage event with input/output tokens scorpiox-usage --model claude-sonnet-4-20250514 --input 1500 --output 800 \ --provider anthropic --session abc123
# Track cache-aware usage (cache read + cache write tokens) scorpiox-usage -m claude-sonnet-4-20250514 -i 3200 -o 1100 -p anthropic \ -cr 2400 -cw 600 -s session-xyz
# Log rate-limit status alongside token counts scorpiox-usage -m claude-sonnet-4-20250514 -i 5000 -o 2000 -p anthropic \ --rl-status allowed --rl-5h 0.42 --rl-7d 0.18 \ --rl-overage 0.0 --rl-claim "200k tokens/5h"
# Specify project and branch for multi-repo tracking scorpiox-usage -m gpt-4o -i 800 -o 400 -p openai \ --project my-api-server --branch feature/auth \ --tier pro -s sess-9f1a
# Minimal invocation — just token counts and model scorpiox-usage -m claude-sonnet-4-20250514 -i 1024 -o 512
# Full telemetry: tokens + cache + rate limits + metadata scorpiox-usage \ --model claude-sonnet-4-20250514 \ --provider anthropic \ --input 12000 --output 4500 \ --cache-read 8000 --cache-write 1200 \ --session long-running-task \ --project scorpiox-code \ --branch main \ --tier team \ --rl-status allowed \ --rl-5h 0.67 --rl-7d 0.31 \ --rl-overage 0.0 \ --rl-claim "500k tokens/5h"

Source & Build Info

Source file
scorpiox/scorpiox-usage.c
Lines of code
536
Dependencies
libsxutil

Related Tools