superdup95
commited on
Commit
•
5381b58
1
Parent(s):
e131090
Update api_usage.py
Browse files- api_usage.py +2 -2
api_usage.py
CHANGED
@@ -25,13 +25,13 @@ def get_subscription(key):
|
|
25 |
gpt4_avai = check_gpt4_availability()
|
26 |
|
27 |
if check_key_availability():
|
28 |
-
rpm =
|
29 |
org = ""
|
30 |
quota = ""
|
31 |
r = requests.post(queryUrl, headers=headers, json=body_gpt4 if gpt4_avai else body_turbo)
|
32 |
result = r.json()
|
33 |
if "id" in result:
|
34 |
-
rpm = r.headers['x-ratelimit-limit-requests']
|
35 |
org = r.headers['openai-organization']
|
36 |
quota = check_key_type("gpt-4" if gpt4_avai else "gpt-3.5-turbo", rpm)
|
37 |
else:
|
|
|
25 |
gpt4_avai = check_gpt4_availability()
|
26 |
|
27 |
if check_key_availability():
|
28 |
+
rpm = 0
|
29 |
org = ""
|
30 |
quota = ""
|
31 |
r = requests.post(queryUrl, headers=headers, json=body_gpt4 if gpt4_avai else body_turbo)
|
32 |
result = r.json()
|
33 |
if "id" in result:
|
34 |
+
rpm = int(r.headers['x-ratelimit-limit-requests'])
|
35 |
org = r.headers['openai-organization']
|
36 |
quota = check_key_type("gpt-4" if gpt4_avai else "gpt-3.5-turbo", rpm)
|
37 |
else:
|