Implement LLM-WP-0008: provider-scoped account balance CLI
Add pluggable balance registry, OpenRouter credits/key limit client, and llm-connect balance with one-shot --provider that does not change library defaults.
This commit is contained in:
parent
c0d5c4ad08
commit
ed7c632155
11 changed files with 783 additions and 14 deletions
10
README.md
10
README.md
|
|
@ -64,6 +64,11 @@ llm-connect cost estimate --model moonshotai/kimi-k3 \
|
|||
llm-connect spend week # current week: Mon 00:00 → now
|
||||
llm-connect spend week --last # previous week: Mon → Sun
|
||||
llm-connect spend week --json
|
||||
|
||||
# Provider prepaid / key remaining (backend-scoped; does not change defaults)
|
||||
llm-connect balance # current default provider
|
||||
llm-connect balance --provider openrouter # one-shot backend select
|
||||
llm-connect balance --json
|
||||
```
|
||||
|
||||
Usage events append to a JSONL ledger (default
|
||||
|
|
@ -71,6 +76,11 @@ Usage events append to a JSONL ledger (default
|
|||
`LLM_CONNECT_USAGE_LEDGER`). Costs are list-price estimates (USD rate table +
|
||||
EUR via snapshot or `LLM_CONNECT_EUR_PER_USD`).
|
||||
|
||||
`balance` is **provider-scoped**: it reports the selected backend’s prepaid /
|
||||
key remaining (OpenRouter today). `--provider` applies only to that
|
||||
invocation and does not switch the library default provider or model.
|
||||
Unsupported backends fail clearly instead of falling back to OpenRouter.
|
||||
|
||||
| Env | Purpose |
|
||||
|---|---|
|
||||
| `LLM_CONNECT_USAGE_LEDGER` | Usage JSONL path; enables library/server auto-recording when set |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue