This billing cycle's credits and the next plan refill. Matches the Workspace Credits card on the account usage page. The period is the plan's monthly renewal window (yearly plans are divided into monthly windows), or the UTC calendar month for a workspace without an active plan. credits.available is the workspace's Yapper credit balance; GET /usage reports a linked external wallet.
Authorization
bearerAuth usage:readIn: header
Scope: usage:read
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/usage/cycle"{ "period": { "start": "2019-08-24T14:15:22Z", "end": "2019-08-24T14:15:22Z", "source": "subscription" }, "credits": { "available": 0, "spentThisCycle": 0, "remainingPercent": 0, "runningLow": true }, "nextGrant": { "date": "2019-08-24T14:15:22Z", "credits": 0, "planCredits": 0, "capped": true }}{ "error": { "code": "string", "message": "string", "requestId": "string" }}{ "error": { "code": "string", "message": "string", "requestId": "string" }}{ "error": { "code": "string", "message": "string", "requestId": "string" }}Get credit spend breakdown GET
Credit spend over time by model and by source, net of refunds, with runs and gross spent/refunded totals. Matches the Credit Spend card on the account usage page. week, month, and quarter return one bucket per UTC day (the last 7, 30, or 90 days including today); year returns the last 12 calendar months and all returns every month since the first with spend. Omit memberIds for the whole workspace. Summing other members' spend requires the key's member to be a team owner or admin; your own user id is always allowed. source limits the figures to one source and splits it by model when modelsAvailable is true. sessionId limits them to one session (any key may read a session's total); it cannot be combined with memberIds. Returns usage_breakdown_unavailable (409) until the workspace's usage history has been indexed.
Read a workspace item GET
Reads one workspace item. A folder returns its direct children; a text document returns its text a page at a time (pass nextOffset as offset for the rest); another uploaded file returns its name, type, size and download URL; an image, video or audio item returns its asset, shaped like GET /assets/{assetId}. Only item is returned when the backing record is gone. Uses the processes:read scope.