yangtb24 commited on
Commit
cf63fc8
·
verified ·
1 Parent(s): 5c4a8ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -0
app.py CHANGED
@@ -268,6 +268,38 @@ def billing_usage():
268
  "total_usage": 0
269
  })
270
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
  @app.route('/handsome/v1/chat/completions', methods=['POST'])
272
  def handsome_chat_completions():
273
  if not check_authorization(request):
 
268
  "total_usage": 0
269
  })
270
 
271
+ @app.route('/handsome/v1/dashboard/billing/subscription', methods=['GET'])
272
+ def billing_subscription():
273
+ if not check_authorization(request):
274
+ return jsonify({"error": "Unauthorized"}), 401
275
+
276
+ total_balance = get_billing_info()
277
+
278
+ return jsonify({
279
+ "object": "billing_subscription",
280
+ "has_payment_method": False,
281
+ "canceled": False,
282
+ "canceled_at": None,
283
+ "delinquent": None,
284
+ "access_until": int(datetime(9999, 12, 31).timestamp()),
285
+ "soft_limit": 0,
286
+ "hard_limit": total_balance,
287
+ "system_hard_limit": total_balance,
288
+ "soft_limit_usd": 0,
289
+ "hard_limit_usd": total_balance,
290
+ "system_hard_limit_usd": total_balance,
291
+ "plan": {
292
+ "name": "SiliconFlow API",
293
+ "id": "siliconflow-api"
294
+ },
295
+ "account_name": "SiliconFlow User",
296
+ "po_number": None,
297
+ "billing_email": None,
298
+ "tax_ids": [],
299
+ "billing_address": None,
300
+ "business_address": None
301
+ })
302
+
303
  @app.route('/handsome/v1/chat/completions', methods=['POST'])
304
  def handsome_chat_completions():
305
  if not check_authorization(request):