Repository navigation
feat(keys): key policies, per-key spend and prompt-cache prices - #24
Merged
Merged
Conversation
The Keys page shows each key's policy and its spend against its caps, edits the policy in a dialog and sets rates when minting; team leads do it for their team's keys only. The model editor takes cache read and write prices and the prompt_cache capability. Proto synced from KTMS; the e2e test covers policy and spend and runs against the 1.0 release branches.
…the team GET /api/proxy/key-spend reads every visible active key's spend at most eight at a time, with caps from GetSpend, so wildcard caps show and team leads see their keys' spend; an unreadable key says unknown. The policy dialog offers the team's allowed models when it has a list, else the gateway's, else a text field.
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.
Console side of ai-process/docs#78 (KTMS #94–#96).
APIKeyPolicy,SetAPIKeyPolicy,GetSpend, cache prices,TokensUsage.cache_*).PUT /api/proxy/keys/{name}/policy(admins; team leads for their team's keys) andGET /api/proxy/spend(global readers; team users for their team and its keys). Key ownership check shared with revoke.prompt_cachecapability.scripts/e2e.refsnow points at the 1.0 release branches (tags once they exist). Passes locally against KTMS and light-tokenmeter release/v1.0.0.