superdup95 commited on
Commit
3b9b623
1 Parent(s): 39d068f

Update api_usage.py

Browse files
Files changed (1) hide show
  1. api_usage.py +4 -5
api_usage.py CHANGED
@@ -28,10 +28,7 @@ def get_subscription(key):
28
  org = ""
29
  quota = ""
30
  try:
31
- r = requests.post(queryUrl, headers=headers, json=body_gpt4 if check_gpt4_availability() else body_turbo)
32
- rpm = r.headers['x-ratelimit-limit-requests']
33
- org = r.headers['openai-organization']
34
- quota = ""
35
  except Exception as e:
36
  error_message = str(e)
37
  if "You exceeded your current quota" in error_message:
@@ -46,7 +43,9 @@ def get_subscription(key):
46
  rpm = "";
47
  org = "";
48
  quota = f"Unexpected Error at check_key: {error_message}"
49
-
 
 
50
  #has_payment_method = results["has_payment_method"]
51
  # hard_limit = results["hard_limit"]
52
  #soft_limit_usd = results["soft_limit_usd"]
 
28
  org = ""
29
  quota = ""
30
  try:
31
+ r = requests.post(queryUrl, headers=headers, json=body_gpt4 if check_gpt4_availability() else body_turbo)
 
 
 
32
  except Exception as e:
33
  error_message = str(e)
34
  if "You exceeded your current quota" in error_message:
 
43
  rpm = "";
44
  org = "";
45
  quota = f"Unexpected Error at check_key: {error_message}"
46
+ rpm = r.headers['x-ratelimit-limit-requests']
47
+ org = r.headers['openai-organization']
48
+ quota = ""
49
  #has_payment_method = results["has_payment_method"]
50
  # hard_limit = results["hard_limit"]
51
  #soft_limit_usd = results["soft_limit_usd"]