ccwire-oauth
API reference · Repository · Issues
A typed async client for the read-only Claude account endpoints an OAuth login (a Claude Code subscription login) can call:
- usage: the 5-hour and 7-day windows, extra usage, the meters
- profile: the account and its organization
- validate a token
- roles in the organization
- prepaid credits and the overage spend limit (read-only)
- the refresh grant, as a plain function: refresh token in, new tokens out
It writes nothing: no billing, payment or API-key endpoint, nothing that
changes the account. Token storage and locking are the caller's; see
TokenSet for the compare-and-swap a refresh needs.
Tokens are Secrets: redacted in Debug and Display, not
serializable, their own buffer zeroed on drop (best effort: see Secret
for the copies that aren't). Errors never carry a token or the account's
personal data.
This crate is not affiliated with or endorsed by Anthropic. The endpoints
are not publicly documented and may change: unknown fields land in each
type's extra map, and a field that is missing, null or of an
unexpected type reads as None instead of failing the call.
Install
While the initial crates.io publication is pending, install from Git:
[]
= { = "https://github.com/talaagent/ccwire" }
Rust 1.85 or newer and a Tokio runtime are required. Supply an existing Claude OAuth access token; this crate does not implement browser login or load credentials from disk.
Read usage
async
Run the complete example
with cargo run -p ccwire-oauth --example usage after setting
CLAUDE_ACCESS_TOKEN in your environment.
Refresh an expired token
use ;
async
License
Apache-2.0. See LICENSE.
For development and release instructions, see CONTRIBUTING.md.