{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "ghuntley-underclass--pool-subscriptions-for-opencode",
 "repo": "ghuntley/underclass",
 "repo_url": "https://github.com/ghuntley/underclass",
 "repo_slug": "ghuntley-underclass",
 "title": "Point opencode at a pool of coding subscriptions",
 "page_title": "How to point opencode at a pool of coding subscriptions with Underclass",
 "summary": "Run one local endpoint that spreads opencode requests across several Codex or Copilot accounts.",
 "who": "A developer who uses opencode daily and has more than one ChatGPT/Codex or Copilot subscription, and hits quota limits on a single account.",
 "problem": "Each subscription has its own quota, so one account running out interrupts coding sessions and forces manual switching between logins.",
 "outcome": "opencode talks to one local URL, sessions stay pinned to one account, and exhausted accounts leave rotation until their window resets.",
 "steps": [
  "Clone the repo and, from its root, run `UNDERCLASS_PROXY_KEY=\"$(openssl rand -hex 32)\" UNDERCLASS_UI_TOKEN=\"$(openssl rand -hex 32)\" cargo run -- serve` and keep the generated values in a password manager. (inferred, check the README)",
  "Open http://127.0.0.1:8080/ in a browser, paste the value you set as UNDERCLASS_UI_TOKEN, click Add account, and sign in to each ChatGPT/Codex or Copilot subscription you want in the pool.",
  "In a second terminal, run `cargo run -- connect` to write the provider block into your global opencode config.",
  "Run `opencode --provider underclass --model underclass/gpt-5.5` and send a prompt.",
  "Check the admin page to confirm the request was attributed to one account and that its prompt cache key appears in the usage rows."
 ],
 "agent_prompt": "In the underclass repo at <repo path>, start the server with the proxy key and UI token set as environment variables, run `cargo run -- connect`, then run one opencode prompt against the underclass provider. Expected output: a completed response and a usage row in the admin page for <account label>. Verify that the admin page lists the account as healthy after the request.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "45 minutes",
 "basis": "readme",
 "caveat": "The README says state lives in ~/.local/share/underclass/pool.db and that deleting it starts fresh, so losing that file means re-adding every account.",
 "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": [
  {
   "tag": "account-pooling",
   "notice": "Pooling several personal subscriptions behind one endpoint may conflict with the terms of the providers that issued them, so check those terms first."
  },
  {
   "tag": "credentials",
   "notice": "The proxy stores provider credentials in a local SQLite database, so protect the database and the minted keys."
  }
 ],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/ghuntley-underclass/pool-subscriptions-for-opencode/",
 "md": "https://dedupedai.com/use-cases/ghuntley-underclass/pool-subscriptions-for-opencode/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--pool-subscriptions-for-opencode.json",
 "api_version": "v1"
}
