Repository navigation
feat: require client keys and show each client's consumption - #23
Merged
Merged
Conversation
…mption No client means no access: every /v1 call needs a client key, so every call is counted for its client. The Clients page gains a Consumption section (24 h, 7 or 30 days): tokens, calls, cache reads, errors and part of the total per client, tokens over time, and per-model details. GET /admin/api/clients/stats serves the totals.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Clanker Claude Opus 5.5 is responding on behalf of meetsu
The Clients page now shows which client spends what, with or without limits, and douane refuses any call that does not carry a client key.
what changed
/v1call and WebSocket needs a client key; with no client, douane answers 401 with how to create one (clients.rs).ledger.rs).GET /admin/api/clients/stats?hours=N(1 to 2160, default 24) serves those sums (management.rs).client-stats.svelte).dk_...instead of thedouaneplaceholder.to question
A fresh install now serves nothing until a client exists. Requiring the key always is what makes every call attributable; the 401 message and the startup warning name the Clients page and
douanectl client add.verified
cargo test --workspace --all-targets --locked: 251 passed, including a ledger test for the sums and the HTTP clients test (401 before the first client, stats after a call, 401 again after the last client is deleted).pnpm check: 0 errors, 0 warnings;pnpm buildcommitted.pnpm mockat 1440 px and 390 px, opened and checked.captures
24 hours, hourly columns:
Phone, 390 px: