(date: str)
| 21 | |
| 22 | |
| 23 | async def fetch_usage(date: str) -> dict[str, Any]: |
| 24 | headers = {"Authorization": f"Bearer {api_key}"} |
| 25 | url = f"https://api.openai.com/v1/usage?date={date}" |
| 26 | async with aiohttp.ClientSession() as session: |
| 27 | async with session.get(url, headers=headers) as resp: |
| 28 | return await resp.json() |
| 29 | |
| 30 | |
| 31 | async def get_usage_for_past_n_days( |
no test coverage detected
searching dependent graphs…