Skip to content

Releases: wan-huiyan/api-billing-toggle

v1.0.2 — correct 401 framing

Choose a tag to compare

@wan-huiyan wan-huiyan released this 27 Apr 10:35

Why this release

The 401 + "Please run /login" message that appears after running off.sh is the expected next step, not an error. v1.0.1 framed it as troubleshooting, which made users wonder whether the skill failed. It didn't — that's just Claude Code asking for subscription auth because there's no API key left in settings.json.

What changed

  • off.sh output now treats /login as part of the normal flow, with the 401 explicitly called out as expected
  • README's troubleshooting section leads with "this is the expected next step" instead of "this is an error"
  • Verified end-to-end via a real session: off.sh → Cmd-Q → reopen → prompt → 401 + /login prompt → /loginLogin successful → Pro/Max active

No code path changes. Output text only. Drop-in upgrade.

v1.0.1 — friendlier output + troubleshooting

Choose a tag to compare

@wan-huiyan wan-huiyan released this 27 Apr 10:31

Friendlier script output

Scripts now print:

  • ✓ Clear success/failure confirmation
  • A bullet list of what changed in settings.json
  • Next-step instructions (Cmd-Q + reopen, run /login if needed)
  • A jq command to verify

off.sh also detects the already-off case and gives a helpful hint about /login for users hitting the common 401-after-key-rotation scenario.

README troubleshooting

New section covering:

  • Why Please run /login · API Error: 401 looks like the skill failed but is actually Claude Code's own auth path failing on a revoked key
  • Cmd-Q vs close-window on macOS (the settings change isn't picked up otherwise)
  • First-run "No API key found in Keychain" — non-destructive, just retry after storing the key

No breaking changes. Drop-in upgrade.

v1.0.0 — Initial release

Choose a tag to compare

@wan-huiyan wan-huiyan released this 27 Apr 10:28

Initial release.

  • on.sh / off.sh scripts that toggle apiKeyHelper and env.ANTHROPIC_API_KEY in ~/.claude/settings.json
  • API key stored in macOS Keychain (service: claude-code-api-key, account: anthropic)
  • SKILL.md with ~25 natural-language trigger phrases ("switch to API key billing", "switch to Pro", "Console billing on/off", etc.)
  • Slash command templates for /api-billing-on and /api-billing-off
  • MIT licensed