{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "ghuntley-underclass--audit-token-use-and-stream-failures",
 "repo": "ghuntley/underclass",
 "repo_url": "https://github.com/ghuntley/underclass",
 "repo_slug": "ghuntley-underclass",
 "title": "Audit token use and stream failures over the last week",
 "page_title": "How to audit token use and stream failures over the last week with Underclass",
 "summary": "Summarize requests, tokens, and failed streams per model or account from the local database.",
 "who": "A developer or team lead who wants to know which models and accounts used the pool and where streams failed.",
 "problem": "Without a record, it is hard to tell whether failures came from capacity, policy errors, quota, or upstream stream breaks.",
 "outcome": "A table of requests, tokens in and out, concurrency, failed streams, and events for the chosen window, plus a dry run of any Codex rollout backfill.",
 "steps": [
  "With the server running, run `underclass stats --since 7d --by model` to see totals per model. (inferred, check the README)",
  "Run `underclass stats --since 7d --by account` to compare accounts. (inferred, check the README)",
  "Read the failed streams and the overloaded, policy, quota, cooling, and saturated event columns.",
  "Run `underclass stats import-codex --dry-run` to preview any capacity or policy errors that can be backfilled from Codex rollout logs. (inferred, check the README)",
  "Run `underclass stats --since 7d --by model --json` if you need the output in a script. (inferred, check the README)"
 ],
 "agent_prompt": "In the underclass repo at <repo path>, with the server running, run `underclass stats --since 7d --by model` and save the output. Expected output: a UTC table with requests, tokens in and out, and event columns. Verify that the totals match the sum of the per-model rows.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "The README says historical rows remain queryable after account removal, but statistics are kept only for the retention set in stats_retention_days, which defaults to 730 days.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "rust",
 "requirements": [
  "Rust toolchain with cargo, to run `cargo run -- serve` from the repo",
  "openssl available on the machine, to generate the proxy key and UI token",
  "At least one ChatGPT/Codex, GitHub Copilot, or Claude Code subscription you are entitled to use",
  "opencode installed if you want to use the OpenAI-compatible path from that client",
  "Read each provider's terms before pooling accounts; the README does not address this"
 ],
 "risk": "sensitive",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.7,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/ghuntley-underclass/audit-token-use-and-stream-failures/",
 "md": "https://dedupedai.com/use-cases/ghuntley-underclass/audit-token-use-and-stream-failures/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/ghuntley-underclass--audit-token-use-and-stream-failures.json",
 "api_version": "v1"
}
