feat: add usage resource - #1111
Merged
Merged
Conversation
Adds resend.usage.get() for GET /usage, exposing account-level usage/quotas (emails, contacts, segments, broadcasts, ai_credits, automation_runs, domains, rate_limit). Extracted from the shared headless-dashboard preview branch and fixed ai_credits.limit to allow null, matching the actual API response. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
commit: |
Contributor
There was a problem hiding this comment.
1 issue found across 6 files
Confidence score: 5/5
src/usage/interfaces/get-usage.interface.tsomits the documentedgenerated_atfield, preventingresend.usage.get()consumers from reading when the usage snapshot was generated; addgenerated_at: stringto the response type.
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/usage/interfaces/get-usage.interface.ts">
<violation number="1" location="src/usage/interfaces/get-usage.interface.ts:3">
P3: `GetUsageResponseSuccess` omits the documented top-level `generated_at` field, so `resend.usage.get()` consumers can't read when the usage snapshot was generated. Add `generated_at: string;` to the type.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
dielduarte
commented
Sep 25, 2026
| headers: {}, | ||
| }); | ||
|
|
||
| const resend = new Resend('re_zKa4RCko_Lhm9ost2YjNCctnPjbLw8Nop'); |
Contributor
Author
There was a problem hiding this comment.
this is a fake api evey tests uses btw!
Contributor
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.
Requires human review: Adds resend.usage.get() for GET /usage, exports usage interfaces, and bumps the package to 6.30.0. This is a new public SDK API surface and release tied to a GA rollout.
Re-trigger cubic
a-carciu
approved these changes
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
resend.usage.get()forGET /usage, exposing account-level usage/quotas (emails, contacts, segments, broadcasts, ai_credits, automation_runs, domains, rate_limit).Notes
preview-headless-dashboardbranch (feat: preview-headless-dashboard #1043) — this PR only touches theusageresource, none of that branch's other bundled/unrelated preview features.ai_credits.limitto allownull(wasnumber-only there), matching the actual API response./usageGA rollout (DEV-2183).Summary by cubic
Adds
resend.usage.get()for theGET /usageendpoint, exposing account-level usage and quotas for emails, contacts, segments, broadcasts, AI credits, automation runs, domains, and rate limit.New Features
Usageresource on theResendclient and exports its interfaces from the package root.ai_credits.limitasnumber | nullto match the actual API response.6.30.0.Written for commit c8e9c49. Summary will update on new commits.