Skip to content

feat(usage): add support for GET /usage - #248

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, exposing 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 to fetch account-level usage and quota data (emails, contacts, segments, broadcasts, AI credits, automation runs, domains, and rate limit) from the /usage endpoint, and bumps the version to 1.17.0. Also fixes the spec to assert on the string-keyed nested fields the API actually returns.

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

Review in cubic

Adds Resend::Usage.get, exposing account-level usage and quota data
(emails, contacts, segments, broadcasts, ai_credits, automation_runs,
domains, rate_limit).

@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 3 files

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

Re-trigger cubic

Comment thread spec/usage_spec.rb Outdated
Comment thread spec/usage_spec.rb
process_response only symbolizes top-level keys; nested hashes keep
the string keys from the raw JSON response. The mock and assertions
used symbol keys throughout, so the test passed without exercising
real field access. Also fixes a used/sent+received mismatch in the
monthly fixture (5422 -> 5442).
klotty
klotty previously approved these changes Sep 25, 2026

@klotty klotty left a comment

Copy link
Copy Markdown

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.

Auto-approved: Adds a read-only Resend::Usage.get wrapper and specs for the existing /usage endpoint; it is an additive, bounded SDK surface change with no modifications to existing behavior, auth, or data handling.

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.

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread lib/resend/version.rb
@cubic-dev-ai
cubic-dev-ai Bot dismissed klotty’s stale review September 25, 2026 18:07

Dismissed because Cubic found issues in a newer review.

@dielduarte
dielduarte marked this pull request as ready for review September 25, 2026 18:08
@dielduarte
dielduarte merged commit 96d3171 into main Sep 25, 2026
8 checks passed
@dielduarte
dielduarte deleted the feat/usage-endpoint branch September 25, 2026 18:31
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.

3 participants