> ## Documentation Index
> Fetch the complete documentation index at: https://dev.writer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List usage by scope

> List cost and token usage for each entity in the requested scope for one month. Rows are ordered by cost from highest to lowest, then by `scope_id`. With `team_id`, the `user` and `playbook` scopes list only usage in that team.

> [!NOTE]
>
> Use an organization API key (**All teams**). An existing legacy team key can read the `team`, `user`, and `playbook` scopes for its own team only. See [Export usage and spend](https://dev.writer.com/home/consumption-export.md) for examples, pagination, and error handling.


## OpenAPI

````yaml get /api/billing/v1/organization/{organizationId}/consumption/breakdown/{scope}
openapi: 3.0.3
info:
  title: Consumption API
  version: '1.0'
  description: >-
    Read monthly cost and token usage for an organization by user, team,
    playbook, or billing group.
servers:
  - url: https://api.writer.com
security:
  - bearerAuth: []
tags:
  - name: Consumption API
paths:
  /api/billing/v1/organization/{organizationId}/consumption/breakdown/{scope}:
    get:
      tags:
        - Consumption API
      summary: List usage by scope
      description: >-
        List cost and token usage for each entity in the requested scope for one
        month. Rows are ordered by cost from highest to lowest, then by
        `scope_id`. With `team_id`, the `user` and `playbook` scopes list only
        usage in that team.
      operationId: listConsumptionBreakdown
      parameters:
        - $ref: '#/components/parameters/organization_id'
        - $ref: '#/components/parameters/scope'
        - $ref: '#/components/parameters/month'
        - $ref: '#/components/parameters/team_id'
        - name: limit
          in: query
          required: false
          description: Maximum number of rows to return.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: offset
          in: query
          required: false
          description: Number of rows to skip before the first row in the response.
          schema:
            type: integer
            minimum: 0
            default: 0
      responses:
        '200':
          description: One page of breakdown rows.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/consumption_breakdown_page'
              example:
                scope: user
                currency: USD
                data:
                  - scope_id: '42'
                    scope_name: Ada Lovelace
                    cost_in_cents: 1250
                    total_tokens: 480000
                  - scope_id: '17'
                    scope_name: grace.hopper@example.com
                    cost_in_cents: 120
                    total_tokens: 4500
                pagination:
                  limit: 50
                  offset: 0
                  total: 2
        '400':
          $ref: '#/components/responses/bad_request'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
components:
  parameters:
    organization_id:
      name: organizationId
      in: path
      required: true
      description: ID of the organization the API key belongs to.
      schema:
        type: integer
        format: int64
    scope:
      name: scope
      in: path
      required: true
      description: >-
        Dimension to report on. The scope must be enabled in the Consumption
        view for your organization.
      schema:
        type: string
        enum:
          - user
          - team
          - playbook
          - billing_group
    month:
      name: month
      in: query
      required: true
      description: Calendar month to read, in UTC, in `YYYY-MM` format.
      schema:
        type: string
        pattern: ^[0-9]{4}-[0-9]{2}$
        example: 2026-10
    team_id:
      name: team_id
      in: query
      required: false
      description: >-
        ID of one team. Limits the `user` and `playbook` scopes to usage in that
        team. Any other scope returns `400`. A legacy team API key can pass only
        its own team's ID.
      schema:
        type: integer
        format: int64
        minimum: 1
  schemas:
    consumption_breakdown_page:
      type: object
      required:
        - scope
        - currency
        - data
        - pagination
      properties:
        scope:
          type: string
          enum:
            - user
            - team
            - playbook
            - billing_group
          description: The scope from the path.
        currency:
          type: string
          description: Currency of `cost_in_cents`.
          example: USD
        data:
          type: array
          items:
            $ref: '#/components/schemas/consumption_breakdown_row'
        pagination:
          $ref: '#/components/schemas/consumption_pagination'
    consumption_breakdown_row:
      type: object
      required:
        - scope_id
        - scope_name
        - cost_in_cents
        - total_tokens
      properties:
        scope_id:
          type: string
          description: >-
            Entity ID. User, team, and billing group IDs are integers sent as
            strings.
        scope_name:
          type: string
          description: >-
            Display name of the entity. For a user, the first and last name, or
            the email address when the user has no name.
        cost_in_cents:
          type: integer
          format: int64
          description: Cost for the month, rounded to the nearest cent.
        total_tokens:
          type: integer
          format: int64
          description: Tokens used in the month.
    consumption_pagination:
      type: object
      required:
        - limit
        - offset
        - total
      properties:
        limit:
          type: integer
          description: Page size used for this response.
        offset:
          type: integer
          format: int64
          description: Rows skipped before this page.
        total:
          type: integer
          description: Total rows across all pages.
    consumption_error:
      type: object
      properties:
        tpe:
          type: string
          description: Error category.
        errors:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
                description: Field or error key.
              description:
                type: string
                description: Readable description of the error.
  responses:
    bad_request:
      description: >-
        The month is missing, malformed, or earlier than the first month with
        consumption data. The scope is unknown, the scope ID is malformed, or
        `limit` or `offset` is out of range. `team_id` isn't a positive integer,
        or is sent with a scope other than `user` or `playbook`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/consumption_error'
    unauthorized:
      description: The API key is missing or invalid.
    forbidden:
      description: >-
        The API key belongs to a different organization, is a user key, or can't
        read the requested scope or team, such as a legacy team key that passes
        another team's `team_id`. The scope isn't enabled for the organization.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/consumption_error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your [Writer API
        key](https://dev.writer.com/api-reference/api-keys). User keys can't
        read consumption data.

````