Skip to content

feat(keys): add granular API key limits - #73

Closed
mahdiwafy wants to merge 1 commit into
Vanszs:mainfrom
mahdiwafy:pr/api-key-limits
Closed

feat(keys): add granular API key limits#73
mahdiwafy wants to merge 1 commit into
Vanszs:mainfrom
mahdiwafy:pr/api-key-limits

Conversation

@mahdiwafy

Copy link
Copy Markdown

Summary

  • Adds optional API key limits: expiry, per-request max tokens, daily tokens, RPM/RPH/RPD, and rolling token windows.
  • Records API-key usage after successful upstream calls.
  • Exposes key limit fields in the dashboard key editor.

Scope

Focused only on API key limit storage/enforcement/UI.

PR #61 comparison

PR #61 adds allowed-model ACL columns. This PR adds limit fields and usage accounting. If PR #61 merges first, this branch may need a migration-number rebase, but the feature scope is separate.

Verification

  • npm run lint:undef

mahdiwafy added a commit to mahdiwafy/VansRouter that referenced this pull request Jul 30, 2026
…r, Tailscale loading fix

- pickProxyPoolId() supports targetProxyPoolIds for subset rotation
- NoAuthProxyCard: checkbox grid for pool selection, conditional UI
- apiKeyUsageRepo: getApiKeyUsageSnapshot with real-time metrics
- EndpointPageClient: card grid with status badges, quota progress bars
- Tailscale: fix endless loading when tunnelUrl is empty
- Supersedes PR Vanszs#67 and Vanszs#73
@mahdiwafy mahdiwafy closed this Jul 30, 2026
@mahdiwafy
mahdiwafy deleted the pr/api-key-limits branch July 30, 2026 05:06
@mahdiwafy
mahdiwafy restored the pr/api-key-limits branch July 30, 2026 05:15
@mahdiwafy mahdiwafy reopened this Jul 30, 2026
@Vanszs

Vanszs commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Request for revision / separate feature discussion.

API-key expiry, rate limits, and token quotas are relevant to VansRouter, but this should be treated as a separate coordinated feature rather than adopted as-is.

Before adoption, please split the work and address:

  • one unique, monotonic SQLite migration compatible with the existing migration registry;
  • schema, repository, CRUD API, import/export, and dashboard consistency;
  • centralized enforcement across the intended modalities, before provider lookup;
  • atomic check/reserve behavior for concurrent requests and multi-process deployments;
  • clear policy for whether /v1/models consumes request quota;
  • streaming disconnect/error accounting;
  • combo/fusion/fallback accounting;
  • preservation of VansRouter ACL (allowedProviders, allowedCombos, allowedKinds), trusted internal paths, proxy behavior, and RTK/Caveman/Ponytail.

The feature direction is welcome. Please revise it into focused migration, persistence, enforcement, and testable accounting changes before adoption.

@mahdiwafy

Copy link
Copy Markdown
Author

Superseded by focused #88 (tailscale) / #90 (api-key limits).

@mahdiwafy mahdiwafy closed this Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants