gotgenes/pi-anthropic-auth

Pi extension package for Anthropic OAuth compatibility

What it solves

This project provides a compatibility layer for the Pi AI agent framework, allowing users to use their Claude Pro or Max subscriptions via OAuth instead of relying solely on API keys. It ensures that requests made through Pi are recognized as coming from a legitimate subscription, preventing billing errors and ensuring access to the models available to subscribers.

How it works

The extension acts as a thin transport wrapper around Pi's native Anthropic transport. It detects when an Anthropic OAuth access token is being used and "shapes" the requests—specifically by adding necessary billing headers (like the Claude Code version) to make them compatible with Anthropic's subscription-based authentication.

Who it’s for

Users of the Pi AI agent framework who have a Claude Pro or Max subscription and want to use those subscription limits rather than paying for API usage separately.

Highlights

  • Transparent Integration: Preserves Pi's native /login anthropic flow and API-key behavior.
  • Automatic Versioning: Automatically handles the claude_code_version_too_old error by updating the reported Claude Code version in the billing header.
  • Multi-Provider Support: Can be configured to support multiple Anthropic provider registrations (e.g., anthropic-2, anthropic-3).
  • Diagnostic Tools: Includes a /anthropic-auth:status command to verify extension loading and check subscription status.

Related

  • Project
  • Project
  • Project
  • Project