Skip to content

leohenon/pi-anthropic-oauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pi-anthropic-oauth

npm node

Use Claude Pro/Max in Pi with browser OAuth.

Features

  • Claude Pro/Max login from /login anthropic
  • Automatic token refresh
  • Claude Code-compatible OAuth headers and prompt shaping
  • No API key or extra usage needed.
  • Uses Pi's Anthropic model registry
  • Adds Claude Opus 4.7 by default
  • Auto-creates ~/.Claude Code~/.pi symlink when missing

Quick start

pi install npm:pi-anthropic-oauth

Start Pi, then run:

/login anthropic

Choose:

Claude Pro/Max

Warning

Use at your own risk. This may go against Anthropic's terms.

Note

Anthropic auth changes are closely monitored for quick compatibility updates.

Extra models

To add another Anthropic model, create ~/.pi/agent/models.json:

{
  "providers": {
    "anthropic": {
      "baseUrl": "https://api.anthropic.com",
      "apiKey": "REQUIRED_BY_PI_FOR_CUSTOM_MODELS",
      "api": "anthropic-messages",
      "models": [
        {
          "id": "your-model-id",
          "name": "Your Model Name"
        }
      ]
    }
  }
}

Note

Pi requires baseUrl, apiKey, and api when defining custom models in models.json. With this extension, requests normally authenticate through Claude Pro/Max OAuth after /login anthropic, so apiKey is present to satisfy Pi's config requirements and does not need to be a valid Anthropic API key.

Troubleshooting

  • Re-run /login anthropic if auth looks stale
  • If local callback login does not complete, paste the final callback URL or code#state when prompted
  • If something breaks, please open an issue with your Pi version, extension version, and error output

License

MIT

About

Pi extension for Anthropic OAuth with Claude Pro/Max.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors