Skip to content

feat(usage): add support for the GET /usage endpoint - #289

Merged
dielduarte merged 4 commits into
mainfrom
feat/usage-endpoint
Sep 25, 2026
Merged

dielduarte merged 4 commits into
mainfrom
feat/usage-endpoint

Conversation

@dielduarte

@dielduarte dielduarte commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds resend.Usage.get() / resend.Usage.get_async() for account-level usage/quotas (emails, contacts, segments, broadcasts, ai_credits, automation_runs, domains, rate_limit).
  • Live-tested against two real accounts — correct, distinct data returned for each, matching the spec exactly.

Part of the /usage GA rollout (DEV-2183). Reference implementation: resend-node#1111.


Summary by cubic

Adds resend.Usage.get() and resend.Usage.get_async() to fetch account-level usage and quota data for emails, contacts, segments, broadcasts, AI credits, automation runs, domains, and rate limit.

Rollout and testing

  • Part of the /usage GA rollout (DEV-2183), mirroring the Node.js reference implementation.
  • Includes sync and async unit tests plus runnable examples, and was live-tested against two accounts with distinct responses.
  • Bumps the package version to 2.48.0.

Written for commit de69d32. Summary will update on new commits.

Review in cubic

Adds resend.Usage.get()/get_async() to retrieve the caller's
account-level usage and quota data, following the existing
single-resource module conventions (logs, domains, segments).

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed against the latest diff

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread tests/usage_test.py
Comment thread resend/usage/_usage.py
Comment thread resend/usage/_usage.py

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 7 files

Requires human review: Auto-approval blocked because this review re-detected 2 unresolved issues already reported by Cubic.

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Requires human review: Adds new public Usage API (GET /usage) client with sync/async methods, types, tests, and examples. Because this expands the SDK's public API surface, human sign-off is required for the GA rollout.

Re-trigger cubic

@dielduarte
dielduarte marked this pull request as ready for review September 25, 2026 18:03

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 a new public Usage API client (GET /usage) with sync/async methods, types, tests, and examples. Expands the SDK's public contract, requiring product/API design sign-off.

Re-trigger cubic

@dielduarte
dielduarte merged commit f6ad2be into main Sep 25, 2026
32 checks passed
@dielduarte
dielduarte deleted the feat/usage-endpoint branch September 25, 2026 18:30
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