-
Notifications
You must be signed in to change notification settings - Fork 605
feat: add ANTHROPIC_OAUTH_TOKEN support for Claude Pro/Max subscriptions #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add ANTHROPIC_OAUTH_TOKEN support for Claude Pro/Max subscriptions #52
Conversation
Allow users to authenticate using their OAuth token as an alternative to API keys. This enables Claude Pro subscribers to use the moltworker gateway without needing separate API billing. - Add ANTHROPIC_OAUTH_TOKEN to MoltbotEnv type - Pass OAuth token through environment builder - Update validation to accept either API key or OAuth token - Add logging for OAuth token presence
Remove unnecessary 'config.channels.telegram.dm' initialization that was causing configuration issues. The dmPolicy is set directly without needing the intermediate dm object.
| config.channels.telegram = config.channels.telegram || {}; | ||
| config.channels.telegram.botToken = process.env.TELEGRAM_BOT_TOKEN; | ||
| config.channels.telegram.enabled = true; | ||
| config.channels.telegram.dm = config.channels.telegram.dm || {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this change needs to be reverted
| config.channels.telegram = config.channels.telegram || {}; | ||
| config.channels.telegram.botToken = process.env.TELEGRAM_BOT_TOKEN; | ||
| config.channels.telegram.enabled = true; | ||
| config.channels.telegram.dm = config.channels.telegram.dm || {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this change needs to be reverted
|
Only issue with this is that the oauth token is short lived and needs to be refreshed periodically. |
Summary
This PR adds support for
ANTHROPIC_OAUTH_TOKENas an alternative authentication method, allowing Claude Pro/Max subscribers to use moltworker without needing separate API billing.Changes:
ANTHROPIC_OAUTH_TOKENto theMoltbotEnvtype definitionUsage
Users can now set their OAuth token instead of an API key:
wrangler secret put ANTHROPIC_OAUTH_TOKEN # paste token from: claude config get oauth_tokenCloses #34
Test Plan
ANTHROPIC_OAUTH_TOKENset (no API key)ANTHROPIC_API_KEYflow still works