Update app.py
Browse files
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 |
-
|
| 399 |
-
|
| 400 |
-
|
| 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
|