Skip to content

feat: add Anthropic quota support#22

Open
Kagameow wants to merge 1 commit intovbgate:mainfrom
Kagameow:pr/feat-anthropic-quota
Open

feat: add Anthropic quota support#22
Kagameow wants to merge 1 commit intovbgate:mainfrom
Kagameow:pr/feat-anthropic-quota

Conversation

@Kagameow
Copy link
Copy Markdown

Summary

Add Anthropic / Claude quota support to mystatus using existing OpenCode auth storage.

What changed

  • add AnthropicAuthData to the shared auth types
  • add an Anthropic quota module that reads OAuth credentials from ~/.local/share/opencode/auth.json
  • display Anthropic quota in mystatus output
  • add i18n strings and README updates for Anthropic support

How it works

The Anthropic checker reads the existing anthropic OAuth credentials from OpenCode auth storage and queries the OAuth usage endpoint to display:

  • 5-hour limit
  • 7-day limit
  • reset countdowns
  • extra usage, when available

This is intended to work with setups using opencode-claude-auth.

Notes

  • Anthropic quota support relies on the OAuth usage endpoint and existing OpenCode auth data.
  • I do not know Chinese, so the Chinese translations in this PR are autogenerated. Please verify them before merge.

Difference from #20

This PR takes a different approach from #20:

  • it uses the Anthropic OAuth usage endpoint directly
  • it does not make a probe request to the Messages API
  • it does not add Admin API fallback support
  • it does not include the Antigravity / Google Claude model matching changes

So this PR is narrower in scope and focused only on adding Anthropic quota visibility to mystatus.

Add Claude quota checks using existing OpenCode Anthropic OAuth credentials and display 5-hour and 7-day usage in mystatus output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant