mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-17 09:56:06 +00:00
chore: 移除弃用的 credit.py 模块
This commit is contained in:
@@ -1,19 +0,0 @@
|
|||||||
# OpenAI账号免费额度剩余查询
|
|
||||||
import requests
|
|
||||||
|
|
||||||
def fetch_credit_data(api_key: str, http_proxy: str) -> dict:
|
|
||||||
"""OpenAI账号免费额度剩余查询"""
|
|
||||||
proxies = {
|
|
||||||
"http":http_proxy,
|
|
||||||
"https":http_proxy
|
|
||||||
} if http_proxy is not None else None
|
|
||||||
|
|
||||||
resp = requests.get(
|
|
||||||
url="https://api.openai.com/dashboard/billing/credit_grants",
|
|
||||||
headers={
|
|
||||||
"Authorization": "Bearer {}".format(api_key),
|
|
||||||
},
|
|
||||||
proxies=proxies
|
|
||||||
)
|
|
||||||
|
|
||||||
return resp.json()
|
|
||||||
Reference in New Issue
Block a user