#Anthropic OAuth 403 error
1 messages · Page 1 of 1 (latest)
This OAuth 403 error typically means your Anthropic token is missing the required user:profile scope.
To fix this:
- Go to your Anthropic Console
- Navigate to API Keys or OAuth Applications
- Check your OAuth app settings and ensure the
user:profilescope is enabled - Generate a new access token with the correct scopes
- Update your Clawdbot config with the new token
In your clawdbot.json, make sure the Anthropic provider config has a valid token with proper scopes:
{
"anthropic": {
"apiKey": "your-new-token-here"
}
}
If you set this up through OAuth flow (not a manual API key), you may need to re-authenticate to get a token with all required scopes.
Let me know if that resolves it! 🦐
I used the OAuth method and not API Key, to use my subscription. How can I grant this OAuth the user:profile scope?
The user:profile scope is typically required for OAuth flows that need to verify subscription access. A few questions to help diagnose:
-
What type of Anthropic account/subscription do you have? (Free, Pro, Team, Enterprise?)
-
What OAuth flow are you using? Are you setting this up through:
- Clawdbot's built-in OAuth flow (
clawdbot configure anthropic)? - A custom OAuth application you registered with Anthropic?
- Clawdbot's built-in OAuth flow (
The issue: Standard OAuth for Anthropic API access is designed for applications acting on behalf of users, not for personal subscription access. For personal subscriptions, direct API keys from console.anthropic.com are the standard approach.
Quick solution: Instead of OAuth, try:
- Go to console.anthropic.com
- Create a new API Key
- Use that directly in your Clawdbot config under
anthropic.apiKey
If you must use OAuth (e.g., for Team/Enterprise), you may need to register an OAuth application through Anthropic's developer portal and ensure it requests the correct scopes.
What's your setup? 🦐
- Pro plan
- Yes, the anthropic configure
I don’t want to use the API Key because I would need to add budget instead of using my subscription
Based on my investigation of the code, here's what's happening:
The Issue: claude setup-token creates an OAuth token that works for inference but may not include the user:profile scope required for the usage API endpoint.
Good news: Clawdbot already has a fallback mechanism! If you set either of these environment variables, it will use your Claude.ai web session instead:
-
Option A - Session Key (preferred):
export CLAUDE_AI_SESSION_KEY="sk-ant-web-..."Get this from your browser cookies on claude.ai (look for
sessionKey) -
Option B - Full Cookie:
export CLAUDE_WEB_COOKIE="cookie: sessionKey=sk-ant-web-..."