Read the detailed billing record for a workspace
Returns the expanded billing detail behind the subscription summary. Requires a Clerk session and the `billing:read` workspace permission.
apiKeyAuthorizationBearer <snoze_sk_…>Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.
workspaceId*stringSuccess
application/json- response
data*curl -X GET 'https://api.snoze.dev/v1/workspaces/string/billing/detail'{ "data": { "invoices": [ { "id": "string", "createdAt": "string", "amountCents": 0, "currency": "string", "status": "string", "paid": true, "invoiceUrl": "string", "description": "string", "invoiceNumber": "string", "reason": "string", "lines": [ { "label": "string", "amountCents": 0 } ] } ], "paymentMethod": { "type": "card", "brand": "string", "last4": "string", "expMonth": 0, "expYear": 0 }, "invoicesUnavailable": true, "invoicesHasMore": true, "paymentMethodUnavailable": true, "accountCredit": { "amountCents": 0, "currency": "string" } }}Read the workspace AI usage snapshot
Returns the current AI usage snapshot for the workspace and the calling user, including the balance and whether top-up packs are available. Any workspace member with a Clerk session may call it; API keys are rejected.
Preview a subscription plan change
Quotes moving the existing subscription to the requested plan and billing interval without changing anything. A more expensive plan on the same interval applies now and returns the prorated charge (per-second, before tax and discounts); cheaper plans and interval switches are scheduled for the renewal. Requires a Clerk session with a synced profile and the `billing:manage` workspace permission; the caller's pricing-experiment variant is applied.