Skip to content

feat: public usage endpoint GET /v1/usage for member token metrics #102

Open

Description

@sre-helmcode

Members can currently only see their token usage through the cloud-ui dashboard. This feature adds a public, documented, rate-limited GET /v1/usage on api.nan.builders so they (and their own tooling) can query their usage programmatically.

Scope

  • cloud-api: new public route with OpenAI-style auth (Bearer sk-), member-level numbers matching the dashboard, window capped at 90 inclusive days, cursor pagination, per-member rate limit (30 rpm), 60s snapshot cache, all-time block.
  • website: /usage documented in the Scalar-rendered OpenAPI spec + getting-started guides (EN/ES).

Decisions (user-confirmed)

  • Hybrid OpenAI-like envelope (usage.report), member-level scope, 90-day window + all_time block.

Tracking

  • cloud-api PR: helmcode/nan-cloud-api
  • website PR: helmcode/nan
  • Reviews: Security / UX / QA blocked until APPROVED (Opus rounds: security 2x APPROVED, ux 2x APPROVED, qa 3 rounds -> APPROVED).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions