MCPcopy
hub / github.com/567-labs/instructor / fetch_usage

Function fetch_usage

instructor/cli/usage.py:23–28  ·  view source on GitHub ↗
(date: str)

Source from the content-addressed store, hash-verified

21
22
23async 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
31async def get_usage_for_past_n_days(

Callers 1

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…