Skip to content

Support Anthropic API key usage data (Admin API) #97

Description

@joshuadavidthomas

Currently the Claude provider's APIKeyStrategy exists only to detect API keys and tell users they can't see consumer plan usage with them. We should remove it for now and revisit when we can actually show useful data.

Regular API keys (sk-ant-api03-*) have zero access to any usage or billing endpoints. Admin API keys (sk-ant-admin-*) can access /v1/organizations/cost_report and /v1/organizations/usage_report/messages, which return cost-in-dollars and token count data — completely different from the consumer plan utilization percentages.

Future work:

  • Support Admin API keys as a separate strategy
  • Display cost/token data (not utilization %) — different presentation from Pro/Max usage
  • This is org-only (individual users can't generate Admin keys)

Background research: https://gist.github.com/joshuadavidthomas/f4ccc5432d9f7fb18489c03db8b0dbde

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions