Anthropic OAuth

Overview

mouaif runs the public Anthropic OAuth browser flow against https://platform.claude.com. The user signs in once; the resulting access and refresh tokens are stored in the OS keychain under mouaif/anthropic, scoped to the signed-in email. Subsequent calls to the Messages API use Authorization: Bearer <access_token> with the anthropic-beta: oauth-2025-04-20 header required by user_oauth credentials.

The flow mirrors the official ant CLI auth login, including the public client_id, the PKCE S256 challenge, the loopback callback, and the state validation on the token exchange.

Usage

Behavior