1Panel-dev / 1Panel-dev/1Panel

[Feature] Add user token usage limits (weekly / monthly / total)

Open
#13,856 1 comment 0 reactions 1 assignee View on GitHub

@wanghe-fit2cloud is already working on this.

Since Sep 18, 2026.

type: ai-gateway type: feature-request
Dominant language
Go
Stars
37k
Forks
3.4k
Avg merge
9h 16m
Merged PRs (30d)
105

Description

1Panel Version

v2.3.1

Please describe your needs or suggestions for improvements
Background

Currently, API tokens (or user tokens) created in 1Panel have no call count or usage limits. In multi-user collaboration scenarios or when exposing the 1Panel API to external services, a leaked or abused token can generate a large number of requests, consume server resources, and be difficult to track and control.

I would like to request support for token usage limits, so administrators can manage quotas per user or per token.

Desired functionality

Add usage limit configuration for each user or each API token, with support for the following dimensions:

  • Weekly usage limit: maximum usage allowed per calendar week
  • Monthly usage limit: maximum usage allowed per calendar month
  • Total usage limit: maximum total usage allowed over the lifetime of the token
  • (Optional) Daily usage limit and hourly usage limit

Each limit should be independently enabled or disabled, with a configurable value. The usage metric should be selectable as needed:

  • Request count
  • Data transfer volume
  • Number of specific business operations

When a limit is reached, the following behavior should be supported:

  • Reject subsequent requests and return a clear error code/message
  • Send an alert when a certain percentage is reached (e.g. 80%)
  • Automatically disable the token
  • Allow administrators to manually reset usage

The admin UI should also provide:

  • Current-period usage and remaining quota for each token
  • Reset period and next reset time
  • Ability for administrators to view, filter, and export usage records
  • Support for manually resetting usage for a specific token
Use cases
  1. Shared 1Panel in a team: Assign different API tokens to different members and limit each member's usage to prevent excessive use by any individual.
  2. Public API service: Prevent a single user or third-party application from making unlimited calls to the 1Panel API.
  3. Security protection: If a token is accidentally leaked, an attacker cannot cause large-scale resource consumption within a short period.
  4. Cost and resource control: Make it easier to evaluate API usage by week/month and allocate resources reasonably.
Additional notes
  • It may be helpful to reference quota management designs from other platforms, such as cloud provider API gateways.
  • If this feature is better suited for the Pro edition, please also consider providing a basic version in the Community edition.
  • It would be ideal to configure and view this directly in the UI, rather than only through configuration files.

Thank you for your work!

Please describe the solution you suggest

No response

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.