Skip to content

A Simple and Universal Swarm Intelligence Engine, Predicting Anything. 简洁通用的群体智能引擎,预测万物

Remove unused balance check script for OpenRouter API

666ghjed8bfec21936
diff --git "a/\344\275\231\351\242\235\346\237\245\350\257\242.py" "b/\344\275\231\351\242\235\346\237\245\350\257\242.py"
deleted file mode 100644
index 78f28747..00000000
--- "a/\344\275\231\351\242\235\346\237\245\350\257\242.py"
+++ /dev/null
@@ -1,36 +0,0 @@
-import requests
-
-def check_openrouter_balance(api_key):
- url = "https://openrouter.ai/api/v1/credits"
-
- headers = {
- "Authorization": f"Bearer {api_key}",
- "Referer": "https://your-site.com",
- "X-Title": "Balance Check Script"
- }
-
- try:
- response = requests.get(url, headers=headers)
- response.raise_for_status() # 检查请求是否成功
-
- data = response.json().get("data", {})
-
- total_credits = data.get("total_credits", 0) # 总充值/赠送金额
- total_usage = data.get("total_usage", 0) # 总消耗金额
-
- # 计算剩余余额
- balance = total_credits - total_usage
-
- print(f"💰 总额度 (Total Credits): ${total_credits}")
- print(f"📉 已使用 (Total Usage): ${total_usage}")
- print(f"💵 剩余余额 (Balance): ${balance:.4f}")
-
- return balance
-
- except requests.exceptions.RequestException as e:
- print(f"查询失败: {e}")
- return None
-
-# 替换你的 API Key
-MY_API_KEY = ""
-check_openrouter_balance(MY_API_KEY)
\ No newline at end of file