• Your Name's avatar
    fix: Use API key from OAuth2 token exchange instead of raw OAuth2 token · 9bb2c090
    Your Name authored
    Claude Code doesn't use the OAuth2 access token directly for API requests.
    Instead, it exchanges the OAuth2 token for an API key via:
      POST https://api.anthropic.com/api/oauth/claude_cli/create_api_key
      Authorization: Bearer {oauth_access_token}
    
    This returns a 'raw_key' which is the actual API key used for API requests.
    
    Changes:
    - claude_auth.py: Add create_api_key() and get_api_key() methods
      - create_api_key(): Exchanges OAuth2 token for API key
      - get_api_key(): Gets stored API key or creates one if needed
    - providers.py: Update _get_sdk_client() to use API key instead of OAuth2 token
    
    This matches the Claude Code flow in vendors/claude/src/services/oauth/client.ts
    9bb2c090
Name
Last commit
Last update
aisbf Loading commit data...
config Loading commit data...
docs Loading commit data...
static Loading commit data...
templates Loading commit data...
.gitignore Loading commit data...
.providers.json.swp Loading commit data...
=0.5.0 Loading commit data...
AI.PROMPT Loading commit data...
API_EXAMPLES.md Loading commit data...
CHANGELOG.md Loading commit data...
CLAUDE_OAUTH2_DEEP_DIVE.md Loading commit data...
CLAUDE_OAUTH2_SETUP.md Loading commit data...
DEBUG_GUIDE.md Loading commit data...
DOCUMENTATION.md Loading commit data...
LICENSE.txt Loading commit data...
MANIFEST.in Loading commit data...
PYPI.md Loading commit data...
README.md Loading commit data...
TODO.md Loading commit data...
aisbf.sh Loading commit data...
build.sh Loading commit data...
clean.sh Loading commit data...
cli.py Loading commit data...
main.py Loading commit data...
pyproject.toml Loading commit data...
requirements.txt Loading commit data...
screenshot.png Loading commit data...
setup.py Loading commit data...
start_proxy.sh Loading commit data...
test_google.sh Loading commit data...
test_kiro_models_origin.py Loading commit data...
test_proxy.sh Loading commit data...
test_response_cache.py Loading commit data...