The undocumented Anthropic usage endpoint
Confident about how it's used today; the endpoint itself is not public and could change or disappear without notice.
I run a scheduler (I call it trud) that launches autonomous Claude Code jobs when there’s spare subscription quota, and backs off when there isn’t. To decide that, it needs to know how much of my 5-hour and weekly usage windows are left — and there’s no documented API for that.
the endpointhttps://api.anthropic.com/api/oauth/usage — not in the public API docs, read with the
OAuth access token Claude Code already keeps in ~/.claude/.credentials.json.
It’s read-only: the scheduler never touches the refresh token, only the access token Claude Code already maintains for its own use. But it’s not a stable, published contract, and Anthropic could change or remove it without notice.
So the failure mode matters more than the happy path. If the endpoint breaks — wrong shape, timeout, anything — the scheduler fails safe rather than fails loud in the wrong direction:
- bad or missing usage data never stops or pauses a job that’s already running
- a paused job only resumes once a fresh, confirmed reading says quota actually recovered
- new work never launches without a confirmed reading either
A broken endpoint degrades to “no new launches, no unparks” — never to killed jobs. That asymmetry is deliberate: the cost of a missed batch run is a few idle minutes; the cost of guessing wrong and killing something mid-task is losing the work.