Update app.py
Browse files394 unmodified lines395396397398399400401402403404405394 unmodified linesAPI_USAGE[api_key] = 0# 3. Check Quota (The "Selling" Logic)# Example: "public_demo_key_789" only gets 5 triesif api_key in ["anak_mail_123", "sistem_gelap"] and API_USAGE[api_key] >= 5:return False, {"error": "Quota exceeded! Please buy the Premium Plan."}, 429# 4. Increment CounterAPI_USAGE[api_key] += 1394 unmodified lines395396397398399400401402403394 unmodified linesAPI_USAGE[api_key] = 0# 3. Check Quota (The "Selling" Logic)if api_key == "sistem_gelap" and API_USAGE[api_key] >= 10:logger.warning(f"Quota exceeded for user: {VALID_API_KEYS[api_key]}")return False, {"error": "Quota exceeded. Free tier is limited to 10 requests."}, 429# 4. Increment CounterAPI_USAGE[api_key] += 1
app.py+3-5