> ## 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.

# Retrieve daily usage for an entity

> Retrieve one row per day of the month for one user, team, playbook, or billing group. Days with no usage return zero. When a team filter applies, from `team_id` or a legacy team API key, the series counts only the user's or playbook's usage in that team, so one that isn't in the team returns zero for every day.

> [!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/daily/{scope}/{scopeId}
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/daily/{scope}/{scopeId}:
    get:
      tags:
        - Consumption API
      summary: Retrieve daily usage for an entity
      description: >-
        Retrieve one row per day of the month for one user, team, playbook, or
        billing group. Days with no usage return zero. When a team filter
        applies, from `team_id` or a legacy team API key, the series counts only
        the user's or playbook's usage in that team, so one that isn't in the
        team returns zero for every day.
      operationId: getDailyConsumptionForEntity
      parameters:
        - $ref: '#/components/parameters/organization_id'
        - $ref: '#/components/parameters/scope'
        - $ref: '#/components/parameters/scope_id'
        - $ref: '#/components/parameters/month'
        - $ref: '#/components/parameters/team_id'
      responses:
        '200':
          description: Daily series for the entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/consumption_daily_series'
              example:
                currency: USD
                generated_at: '2026-10-20T12:00:00Z'
                days:
                  - date: '2026-10-01'
                    cost_in_cents: 40
                    total_tokens: 1500
                  - date: '2026-10-02'
                    cost_in_cents: 0
                    total_tokens: 0
        '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
    scope_id:
      name: scopeId
      in: path
      required: true
      description: >-
        ID of one entity in the scope. User, team, and billing group IDs are
        integers. Playbook IDs are strings.
      schema:
        type: string
    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_daily_series:
      type: object
      required:
        - currency
        - generated_at
        - days
      properties:
        currency:
          type: string
          description: Currency of `cost_in_cents`.
          example: USD
        generated_at:
          type: string
          format: date-time
          description: >-
            ISO 8601 time the cost series was calculated. Token counts are read
            at request time.
        days:
          type: array
          description: One row for every day in the month, including days with no usage.
          items:
            $ref: '#/components/schemas/consumption_daily_point'
    consumption_daily_point:
      type: object
      required:
        - date
        - cost_in_cents
        - total_tokens
      properties:
        date:
          type: string
          format: date
          description: Day in `YYYY-MM-DD` format.
        cost_in_cents:
          type: integer
          format: int64
          description: Cost for that day, in cents.
        total_tokens:
          type: integer
          format: int64
          description: Tokens used that day.
    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.

````