Skip to content

Instantly share code, notes, and snippets.

@calebpower
Created September 20, 2026 17:38
Show Gist options
  • Select an option

  • Save calebpower/d3c8c4ef6785a097137aca3610ce4ddb to your computer and use it in GitHub Desktop.

Select an option

Save calebpower/d3c8c4ef6785a097137aca3610ce4ddb to your computer and use it in GitHub Desktop.
Claude Usage Oracle
#!/usr/local/bin/bash
TOKEN=$(jq -r '.claudeAiOauth.accessToken' ~/.claude/.credentials.json)
curl -s https://api.anthropic.com/api/oauth/usage \
-H "Authorization: Bearer $TOKEN" -H "anthropic-beta: oauth-2025-04-20" \
| jq -rc '.limits[] | select(.kind != "session") | {model: .scope.model.display_name // "all", percent: .percent, resets_at: .resets_at}'
@calebpower

Copy link
Copy Markdown
Author

Good for giving long-running agents a window into their own usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment