Skip to navigation

Get Workspace Usage Report

Beta

What the workspace’s usage cost over a window, grouped by model, project or API key, readable with an API key. Each group carries the metered quantity in its product’s unit and its cost in US dollars, priced at the workspace’s plan rates. Use it to charge usage back to your own customers or to see what moved the bill. The figures are informational: an invoice also carries fees, credits and taxes this report does not.

The window defaults to the calendar month (UTC) to date. For that window total_cost_usd is the balance read’s monthly_spend (GET /v1/workspaces/current/balance) as of as_of, the same figure the workspace budget is enforced on. For any other window the total is the sum of its groups. A window may start at most 100 days ago; an older starting_at is refused with 400. An ending_at later than now reads to now.

Each group’s cost is its share of the total in proportion to what the usage rated at, rounded to the micro-dollar by largest remainder, so the groups add up to total_cost_usd to the micro-dollar: round a sum of them to 6 decimal places to match it exactly. When there is nothing to apportion monthly_spend by (no usage rated yet, or a credit among the groups), each group keeps what it rated at and the total is their sum. A group is one value for one product: the same model can appear once for tts and once for calls.

Figures can be up to a minute old; as_of is when they were read. Groups are ordered by value, the null group last, and paginate with cursor while has_more is true. Every page of one walk reads the figures and the window its first page read, even after the month turns, so the pages add up to the total each carries; a cursor names its window by itself, and a group_by, starting_at or ending_at sent with it that names another window is refused with 400. A cursor stays usable for at least 15 minutes after as_of, after which it is refused with 400 and the query must be repeated.

Reading figures that are not cached asks the billing provider, so each workspace may do so 12 times a minute; past that, or when every workspace together reads too fast, the request is refused with 429 and a Retry-After header. Repeating a query within a minute is answered from cache and does not count.

Requires an API key granted billing:read (or an unrestricted key). A key pinned to a project is refused with 403, as on every workspace-level read, and so is a key whose owner may not view the workspace’s usage.

Authentication

AuthorizationBearer

Enter your API key with the Bearer prefix, e.g. ‘Bearer sk_…’.

Headers

Speechify-VersionstringOptional

Query parameters

group_byenumRequired

What to group usage by: model (the model id, such as simba-3.5), project_id (the project’s proj_ id; usage in the Default project groups as null) or api_key_id (the key’s key_ id; usage made without an API key, such as from the console, groups as null).

Allowed values:
starting_atdatetimeOptional

Start of the window, inclusive, as an RFC 3339 timestamp; a date alone (2026-11-01) reads as midnight UTC. Defaults to the start of the calendar month (UTC) the window ends in. At most 100 days ago.

ending_atdatetimeOptional

End of the window, exclusive, in the same form as starting_at. Defaults to now, and a later value reads to now.

cursorstringOptional
Opaque pagination cursor from a previous response.
limitintegerOptional1-200Defaults to 50

Max items per page (default 50, max 200).

Response headers

Speechify-Request-IdstringOptional

Unique identifier for this request, present on every response (2xx and non-2xx alike). If the caller sends a Speechify-Request-Id request header the server echoes it back (sanitized and length-capped) so one logical request can be traced end-to-end; otherwise the server generates a fresh value. Log it on every response and quote it in support requests

  • it is the stable handle that ties your observation to Speechify’s server-side logs, and it matches the request_id field in the error envelope.

The legacy alias X-Request-ID carries the same value and is still accepted on requests, until 2027-07-24. Prefer the un-prefixed name (RFC 6648).

Response

The window's usage, grouped.
next_cursorstring or null

Opaque keyset cursor for the next page. Pass back as the cursor request parameter. null when the caller has reached the end of the list (has_more is also false in that case).

has_moreboolean
True when more rows exist beyond this page.
starting_atdatetime
Start of the window the report covers, inclusive.
ending_atdatetime
End of the window, exclusive. For a window that runs to now, the moment the figures were read.
group_byenum
The property the groups are keyed by, as requested.
Allowed values:
total_cost_usddouble

What the window’s usage cost, in US dollars to the micro-dollar (at most 6 decimal places). For the calendar month to date it is the balance read’s monthly_spend; otherwise the sum of the groups. Below zero only when credits priced into the plan outweigh the usage.

groupslist of objects
as_ofdatetime
When the figures were read.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error
502
Bad Gateway Error
503
Service Unavailable Error