agentctl-auth
Unified auth pool and Claude API client for managing multiple AI provider credentials with automatic token rotation.
Features
- Auth Pool: Manage credentials for multiple providers in a single TOML file
- Token Rotation: Automatic rotation on 429 rate limits (supports multiple tokens per provider)
- Claude Client: Messages API with OAuth stealth headers for Claude Max Plan integration
- Credential Testing: Validate API keys against provider endpoints
- Import: Import from auth-profiles.json format (OpenClaw/RustClaw compatible)
- Usage Tracking: Record success/failure, cooldowns, and last-used timestamps
Quick Start
use ;
async
Auth Pool Format
[]
= { = "anthropic", = "token", = "sk-ant-..." }
= { = "anthropic", = "oauth", = "sk-ant-..." }
[]
= "anthropic:default"
[]
= "anthropic:default"
= "anthropic:backup"
Claude Client Features
- Stealth Headers: Mimics Claude Code CLI for Max Plan access
- Auto-rotation: On 429, switches to next credential in order
- Cooldown Management: Skips credentials in cooldown period
- Usage Tracking: Records success/failure for each credential
Testing Credentials
use ;
let pool = load?;
// Test single credential
let result = test_credential.await;
println!;
// Test all credentials
let results = test_all.await;
Import from auth-profiles.json
let mut pool = default;
pool.import_from_auth_profiles_file?;
pool.save?;
License
Dual-licensed under MIT or Apache-2.0.