Skip to content

Quota & usage support: client.me() / client.usage() + typed 429 #188

Description

@amarcozzi

The v2 API shipped create-time usage quotas (epic silvxlabs/FastFuels-API-v2#340). The SDK should expose the read surface and handle the new error path. Additive — not a breaking change — but the 429 is a new error every create can now raise, so SDK users need a typed way to handle it.

New features

  1. client.me()GET /users/me — returns {id, kind, tier, quotas}.
  2. client.usage()GET /users/me/usage — per-resource-type usage vs limits (active / total / storage), plus domains / api_keys and a lifecycle block.
  3. Typed QuotaExceededError for 429 with detail.reason == "QUOTA_EXCEEDED" — surface the structured detail (quota, current, limit, message) and the Retry-After header (present on active-job limits), instead of a generic HTTP error. Every resource-create method can raise it.

Notes

  • Source of truth: the OpenAPI schemas (/users/me, /users/me/usage, QuotaExceededDetail).
  • Document the new error path in the SDK's usage/errors docs.
  • Ships as a minor version (new feature, backward compatible).

Metadata

Metadata

Assignees

Labels

✨ featureNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions