Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/commands/quota/show.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ export default defineCommand({

if (config.quiet) {
for (const m of models) {
const remaining = m.current_interval_total_count - m.current_interval_usage_count;
console.log(`${m.model_name}\t${m.current_interval_usage_count}\t${m.current_interval_total_count}\t${remaining}`);
// NOTE: current_interval_usage_count from the API actually contains the REMAINING value, not usage.
// We rename it here for clarity and compute the actual used amount.
const remaining = m.current_interval_usage_count;
const total = m.current_interval_total_count;
const used = Math.max(0, total - remaining);
console.log(`${m.model_name}\t${used}\t${total}\t${remaining}`);
}
return;
}
Expand Down