Retrieve a statement

View as MarkdownOpen in Claude
Returns one month's statement as JSON: the totals for the month, company-wide usage by kind, and usage per project. Filter the breakdown with `kind` and `project`. `/api/space/billing_statement.json` returns the same response. For the same statement as a file, use [Download a statement as CSV](/docs/apis/rest/space/billing/get-billing-statement-csv) or [Download a statement as PDF](/docs/apis/rest/space/billing/get-billing-statement-pdf). The statement is computed on request from the usage reporting pipeline, so the response is `502` when that pipeline is unavailable. #### Permissions Authenticate with a [Personal access token](/docs/apis/authorization#personal-access-tokens) whose holder is an owner or admin of the space. A project API token is not accepted on this endpoint, and a Personal access token has no scopes: the holder's role in the space is the whole authorization decision.

Authentication

AuthorizationBasic
Personal access token authentication for space-wide administration. Send HTTP Basic auth with an empty username and the Personal access token as the password. A Personal access token carries your own authority rather than a project's: it is created from your user menu in the Dashboard, is prefixed `pat_`, and has no scopes. The holder must be an owner or admin of the space named by the subdomain, and the token acts only on that space. Example: ``` Authorization: Basic base64(:pat_...) ```

Query parameters

monthstringRequiredformat: "^\d{4}-\d{2}$"

The calendar month, as YYYY-MM. A month before the space existed is rejected with month_precedes_space_creation, and a future month with month_is_in_the_future.

kindlist of stringsOptional

Return only these usage kinds in usage_by_kind and in each project’s breakdown. Repeat the parameter for each kind.

projectlist of stringsOptional

Restrict the per-project breakdown to these project ids. Repeat the parameter for each project.

Response

The request has succeeded.
typeenum

The object type. Always billing_statement.

monthstring

The calendar month the statement covers, as YYYY-MM.

summaryobject
The totals for the month.
usage_by_kindlist of objects

Company-wide usage broken down by kind.

projectslist of objects
Usage per project, each with its own breakdown by kind.

Errors

401
Unauthorized Error
422
Unprocessable Entity Error
500
Internal Server Error
502
Bad Gateway Error