Files changed (1) hide show
  1. app.py +0 -18
app.py CHANGED
@@ -54,24 +54,6 @@ if st.button("Get Answer"):
54
 
55
 
56
 
57
- # 取得する期間(日付のフォーマットは YYYY-MM-DD)
58
- start_date = (datetime.datetime.utcnow() - datetime.timedelta(days=7)).strftime('%Y-%m-%d') # 7日前から
59
- end_date = datetime.datetime.utcnow().strftime('%Y-%m-%d') # 今日まで
60
-
61
- url = f"https://api.openai.com/v1/dashboard/billing/usage?start_date={start_date}&end_date={end_date}"
62
- headers = {
63
- "Authorization": f"Bearer {openai_api_key}",
64
- "Content-Type": "application/json"
65
- }
66
-
67
- response = requests.get(url, headers=headers)
68
-
69
- if response.status_code == 200:
70
- st.write(response.json()) # 使用量データを表示
71
- else:
72
- st.write("エラー:", response.status_code, response.text)
73
-
74
-
75
 
76
 
77
 
 
54
 
55
 
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
 
59