Skip to content

Cycle 23 Infrastructure: Anthropic Usage provider + rate-limit header parsing#678

Merged
rygel merged 2 commits into
developfrom
feat/cycle-23-infrastructure
Jun 26, 2026
Merged

Cycle 23 Infrastructure: Anthropic Usage provider + rate-limit header parsing#678
rygel merged 2 commits into
developfrom
feat/cycle-23-infrastructure

Conversation

@rygel

@rygel rygel commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Changes

  • task-103: Anthropic Usage/Cost provider via admin API. Uses x-api-key header. Two API calls (cost_report + usage_report/messages). Emits WindowedProviderUsage cards. 7 unit tests.
  • task-106: Rate-limit header parsing on ProviderBase. Moved TryParseHeaderDouble from GroqProvider to ProviderBase.TryGetHeaderDouble. Refactored ClaudeCodeProvider. 4 new tests.

Verification

  • Build: PASS
  • Tests: 1554 pass (1413 + 141 Monitor.Tests)

New AnthropicUsageProvider queries the Anthropic Admin API for daily
spending and token usage. Uses x-api-key header (not Bearer) with
anthropic-version header. Emits two WindowedProviderUsage cards:
Daily Cost and Daily Tokens. Falls back to StatusProviderUsage when
no data is available. 7 unit tests covering missing key, auth error,
valid responses, empty data, and header verification.
Move TryParseHeaderDouble from GroqProvider to ProviderBase as
TryGetHeaderDouble. Refactor ClaudeCodeProvider's ExtractRateLimitInfo
to use the shared method instead of inline TryGetValues+TryParse.
Added 4 unit tests for TryGetHeaderDouble (valid, decimal, missing,
malformed). 45 tests pass including all existing Groq and Claude
provider tests.
@rygel
rygel merged commit 2ad1d91 into develop Jun 26, 2026
17 checks passed
@rygel
rygel deleted the feat/cycle-23-infrastructure branch June 26, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants