Skip to content

feat(billing): add usage.get method, update usage.paygo endpoint#2772

Merged
vaishakdinesh merged 1 commit into
nextfrom
sync/billing-2026-05-21
May 21, 2026
Merged

feat(billing): add usage.get method, update usage.paygo endpoint#2772
vaishakdinesh merged 1 commit into
nextfrom
sync/billing-2026-05-21

Conversation

@vaishakdinesh
Copy link
Copy Markdown
Member

Sync billing resource from staging-next

Brings in the previously-deferred billing resource changes. SDK call site is
unchanged for existing callers; the deferred "breaking" label was driven by an
internal endpoint URL change, not by an SDK surface change.

Source: origin/staging-next (billing-only checkout)
Base: origin/next

Local Validation (all gates pass)

Gate Result
npx tsc --noEmit pass
eslint . pass
./scripts/detect-breaking-changes origin/next pass (exit 0)

What changed

SDK call site: unchanged.

// Same call, same params, same return type
client.billing.usage.paygo({ account_id: '...' });

New (additive):

  • client.billing.usage.get({ account_id, from?, to?, metric? }) -- new endpoint
    GET /accounts/{account_id}/billable/usage returning a FinOps FOCUS v1.3
    cost-and-usage dataset (UsageGetResponse).
  • UsagePaygoResponse.Record.ServiceFamilyName? -- new optional field.

Internal:

  • client.billing.usage.paygo() now calls
    GET /accounts/{account_id}/paygo-usage instead of
    GET /accounts/{account_id}/billing/usage/paygo. Method signature, params,
    and return type are unchanged.

Why this is not user-breaking

  • detect-breaking-changes (which lints the OLD test files against the NEW
    SDK) passes with exit 0 -- the SDK-level API contract is preserved.
  • The change-analyzer (scripts/common/summarize-diff.ts) flags the
    endpoint URL change as "breaking" because it tracks underlying API path
    changes, but that's a server-side concern (the API team must keep the old
    path alive or redirect during transition), not a code change anyone using
    the SDK needs to make.

What's still deferred

The other 5 previously-deferred resources still have SDK-surface breaking
changes and remain out of this PR: addressing, api-gateway, cache,
email-security, realtime-kit.

@vaishakdinesh vaishakdinesh merged commit c0f6e4f into next May 21, 2026
10 checks passed
@vaishakdinesh vaishakdinesh deleted the sync/billing-2026-05-21 branch May 21, 2026 16:10
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.

1 participant