feat(usage): add GET /usage endpoint for account-level usage data - #146
Merged
Merged
Conversation
Adds Usage service exposing resend.usage().get(), returning email, contacts, segments, broadcasts, AI credits, automation runs, domains and rate limit quotas.
Contributor
There was a problem hiding this comment.
1 issue found across 10 files
Confidence score: 4/5
- In
src/main/java/com/resend/services/usage/Usage.java,Usage.get()may fail for production keys if they lack permission to access/usage; verify existing key permissions before relying on this SDK method.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/main/java/com/resend/services/usage/Usage.java">
<violation number="1" location="src/main/java/com/resend/services/usage/Usage.java:36">
P2: Custom agent: **API Key Permission Check SDK Methods**
`Usage.get()` adds a new account-level operation, but the change does not confirm that production keys can access `/usage`; verify existing keys have the required permission or Full access before release to avoid authorization failures.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…xture typo - Fixes a used/sent+received mismatch in the monthly fixture (5422 -> 5442). - Adds assertions for daily/monthly/automation_runs resets_at and monthly sent/received, which were previously unasserted.
klotty
approved these changes
Sep 25, 2026
klotty
left a comment
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Adds a read-only GET /usage client method and its response models for account usage/quota data, with unit tests covering success and API-error paths. The change is purely additive and bounded.
Re-trigger cubic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Usageservice exposingresend.usage().get(), for account-level usage/quotas (emails, contacts, segments, broadcasts, AI credits, automation runs, domains, rate limit).Part of the
/usageGA rollout (DEV-2183). Reference implementation: resend-node#1111.Summary by cubic
Adds a
Usageservice exposingresend.usage().get()so callers can retrieve account-level usage and quota data as part of the/usageGA rollout (DEV-2183).Written for commit 48e3cb9. Summary will update on new commits.