superdup95 commited on
Commit
63bc79a
1 Parent(s): b787119

Update api_usage.py

Browse files
Files changed (1) hide show
  1. api_usage.py +4 -4
api_usage.py CHANGED
@@ -30,14 +30,14 @@ def get_subscription(key):
30
  r = requests.post(queryUrl, headers=headers, json=body_gpt4 if check_gpt4_availability() else body_turbo)
31
  result = r.json()
32
  if (r.headers['x-ratelimit-limit-requests']):
 
 
 
 
33
  e = result["error"]["code"]
34
  rpm = "";
35
  org = "";
36
  quota = f"Error: {e}"
37
- else:
38
- rpm = r.headers['x-ratelimit-limit-requests']
39
- org = r.headers['openai-organization']
40
- quota = ""
41
 
42
  #has_payment_method = results["has_payment_method"]
43
  # hard_limit = results["hard_limit"]
 
30
  r = requests.post(queryUrl, headers=headers, json=body_gpt4 if check_gpt4_availability() else body_turbo)
31
  result = r.json()
32
  if (r.headers['x-ratelimit-limit-requests']):
33
+ rpm = r.headers['x-ratelimit-limit-requests']
34
+ org = r.headers['openai-organization']
35
+ quota = ""
36
+ else:
37
  e = result["error"]["code"]
38
  rpm = "";
39
  org = "";
40
  quota = f"Error: {e}"
 
 
 
 
41
 
42
  #has_payment_method = results["has_payment_method"]
43
  # hard_limit = results["hard_limit"]