Skip to content

feat: Add OAuth rate limits and usage dashboard #8911

Closed

Description

@mguttmann

Summary

Add visibility into OAuth rate limits and usage information, particularly useful for Claude Max users who need to monitor their 5-hour and 7-day usage limits.

Problem

Users with Claude Max subscriptions currently have no visibility into their rate limits. This makes it difficult to:

  • Know when they're approaching limits
  • Understand why requests might be failing
  • See which OAuth account is currently active (for multi-account setups)

Proposed Solution

Desktop App

Add a new dialog accessible from the sidebar that displays:

  • Provider list with account counts
  • Anthropic Usage Limits: 5-hour and 7-day utilization with progress bars
  • Account Status: Active/inactive state, cooldown status, request counts
  • Color-coded progress bars (green → yellow → red)
  • Reset time countdown

CLI

Add a new opencode auth usage command that displays:

  • Account status per provider
  • Request success/failure counts
  • Cooldown state
  • Anthropic rate limit percentages

API

Add GET /auth/usage endpoint that returns usage data for all OAuth providers.

Technical Approach

  1. Backend

    • Add Auth.OAuthPool.getUsage() - Returns account health and status
    • Add Auth.OAuthPool.fetchAnthropicUsage() - Fetches rate limits from Anthropic's OAuth usage API
    • Add /auth/usage API endpoint
  2. Frontend

    • New DialogAuthUsage component with SolidJS
    • Progress bar visualization with color coding
    • Sidebar button integration
  3. CLI

    • New AuthUsageCommand subcommand

Additional Context

This feature builds on the OAuth multi-account failover system. It leverages the existing health tracking to provide meaningful usage statistics.

The Anthropic usage API (https://api.anthropic.com/api/oauth/usage) provides utilization percentages and reset times for:

  • 5-hour rolling limit
  • 7-day limit (all models)
  • 7-day limit (Sonnet-specific)

Activity

  1. github-actions commented on Jan 16, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

    Both issues focus on improving the OAuth experience for multi-account setups and providing visibility into account status. #8591 implements automatic credential rotation and health tracking, which provides foundational work that #8911 builds upon to add usage visualization.

  2. mguttmann commented on Jan 17, 2026

    @mguttmann
    Author

    Closing to rework - will resubmit with improved documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions