feat(usage): add support for GET /usage endpoint - #165
Merged
Merged
Conversation
Adds IResend.UsageAsync() to retrieve account-level usage and quota data (emails, contacts, segments, broadcasts, AI credits, automation runs, domains, and the account's rate limit), following the same partial-class/DTO conventions as other read-only resources like EmailMetrics and Segments.
There was a problem hiding this comment.
All reported issues were addressed across 15 files
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 MomentReset 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 2 files (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 read-only GET /usage support via UsageAsync and DTOs, with a mock API controller and integration tests; the change is additive, follows existing SDK patterns, and alters no existing behavior.
Re-trigger cubic
dielduarte
marked this pull request as ready for review
September 25, 2026 18:08
drish
approved these changes
Sep 25, 2026
This was referenced Sep 25, 2026
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
IResend.UsageAsync()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
IResend.UsageAsync()for retrieving account-level usage and quota data (emails, contacts, segments, broadcasts, AI credits, automation runs, domains, and rate limit), part of the/usageGA rollout (DEV-2183). Bumps the package version to 0.21.0. No breaking changes.Changes
Usageand nested DTOs following the existing read-only resource conventions.UsageControllerto the test API server for integration coverage, including assertions for reset timestamps and monthly sent/received counts.Written for commit 716f7cb. Summary will update on new commits.