Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -122,7 +122,7 @@ def usage():
|
|
122 |
|
123 |
remaining_requests = max(0, REQUEST_LIMIT - user_data["count"])
|
124 |
reset_time = user_data["reset_time"].strftime("%Y-%m-%d %H:%M:%S UTC")
|
125 |
-
|
126 |
return jsonify({
|
127 |
"api_key": api_key,
|
128 |
"requests_used": user_data["count"],
|
@@ -146,6 +146,7 @@ def generate_api_key():
|
|
146 |
random_part = secrets.token_hex(16)
|
147 |
signature = hmac.new(SECRET_KEY.encode(), random_part.encode(), hashlib.sha256).hexdigest()[:16]
|
148 |
api_key = f"TrueSyncAI-{random_part}-{signature}"
|
|
|
149 |
return jsonify({"api_key": api_key})
|
150 |
|
151 |
# ✅ Chat API with configurable parameters
|
|
|
122 |
|
123 |
remaining_requests = max(0, REQUEST_LIMIT - user_data["count"])
|
124 |
reset_time = user_data["reset_time"].strftime("%Y-%m-%d %H:%M:%S UTC")
|
125 |
+
logger.info("📊 API Usage requested")
|
126 |
return jsonify({
|
127 |
"api_key": api_key,
|
128 |
"requests_used": user_data["count"],
|
|
|
146 |
random_part = secrets.token_hex(16)
|
147 |
signature = hmac.new(SECRET_KEY.encode(), random_part.encode(), hashlib.sha256).hexdigest()[:16]
|
148 |
api_key = f"TrueSyncAI-{random_part}-{signature}"
|
149 |
+
logger.info("🔑 API Key requested")
|
150 |
return jsonify({"api_key": api_key})
|
151 |
|
152 |
# ✅ Chat API with configurable parameters
|