Make maximum API key limit configurable via environment variables #8452

Closed
opened 2026-02-21 18:25:46 -05:00 by yindo · 1 comment
Owner

Originally created by @stealthinu on GitHub (Feb 20, 2025).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

In the current implementation, each application is limited to a maximum of 10 API keys, as hardcoded in api/controllers/console/apikey.py (max_keys = 10). This limitation can be restrictive for applications that require more API keys for different environments, services, or integration purposes. Having the ability to configure this limit would provide more flexibility in managing API keys according to specific project needs.

2. Additional context or comments

The proposed enhancement would involve:

Moving the max_keys value from being hardcoded to being configurable through the .env file
This change would allow administrators to set appropriate limits based on their security requirements and usage patterns
The default value could remain at 10 to maintain current behavior for existing installations

This improvement would make the system more flexible while maintaining security through configurable limits.

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @stealthinu on GitHub (Feb 20, 2025). ### Self Checks - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. In the current implementation, each application is limited to a maximum of 10 API keys, as hardcoded in api/controllers/console/apikey.py (max_keys = 10). This limitation can be restrictive for applications that require more API keys for different environments, services, or integration purposes. Having the ability to configure this limit would provide more flexibility in managing API keys according to specific project needs. ### 2. Additional context or comments The proposed enhancement would involve: Moving the max_keys value from being hardcoded to being configurable through the .env file This change would allow administrators to set appropriate limits based on their security requirements and usage patterns The default value could remain at 10 to maintain current behavior for existing installations This improvement would make the system more flexible while maintaining security through configurable limits. ### 3. Can you help us with this feature? - [x] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 18:25:46 -05:00
yindo closed this issue 2026-02-21 18:25:46 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 23, 2025):

Hi, @stealthinu. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • Proposal to make the maximum API key limit configurable via environment variables.
  • Current limit is fixed at 10, which may not suit all applications.
  • You expressed interest in contributing to this feature.
  • No further comments or activity have been recorded.

Next Steps:

  • Please confirm if this issue is still relevant to the latest version of the Dify repository by commenting here.
  • If there is no further activity, this issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Mar 23, 2025): Hi, @stealthinu. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - Proposal to make the maximum API key limit configurable via environment variables. - Current limit is fixed at 10, which may not suit all applications. - You expressed interest in contributing to this feature. - No further comments or activity have been recorded. **Next Steps:** - Please confirm if this issue is still relevant to the latest version of the Dify repository by commenting here. - If there is no further activity, this issue will be automatically closed in 15 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8452