WanIrfan commited on
Commit
e8d3d27
·
verified ·
1 Parent(s): 2752432

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -395,11 +395,9 @@ def check_api_key(request_data):
395
  API_USAGE[api_key] = 0
396
 
397
  # 3. Check Quota (The "Selling" Logic)
398
- # Example: "public_demo_key_789" only gets 5 tries
399
- if api_key in ["anak_mail_123", "sistem_gelap"] and API_USAGE[api_key] >= 5:
400
- return False, {
401
- "error": "Quota exceeded! Please buy the Premium Plan."
402
- }, 429
403
 
404
  # 4. Increment Counter
405
  API_USAGE[api_key] += 1
 
395
  API_USAGE[api_key] = 0
396
 
397
  # 3. Check Quota (The "Selling" Logic)
398
+ if api_key == "sistem_gelap" and API_USAGE[api_key] >= 10:
399
+ logger.warning(f"Quota exceeded for user: {VALID_API_KEYS[api_key]}")
400
+ return False, {"error": "Quota exceeded. Free tier is limited to 10 requests."}, 429
 
 
401
 
402
  # 4. Increment Counter
403
  API_USAGE[api_key] += 1