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

> Retrieve one row per day of the month with the organization's total cost and token usage. Days with no usage return zero. Requires an organization API key.

> [!NOTE]
>
> Use an organization API key. Team keys and user keys return `403 Forbidden`. See [Export usage and spend](https://dev.writer.com/home/consumption-export.md) for examples and error handling.


## OpenAPI

````yaml get /api/billing/v1/organization/{organizationId}/consumption/daily
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:
    get:
      tags:
        - Consumption API
      summary: Retrieve daily usage
      description: >-
        Retrieve one row per day of the month with the organization's total cost
        and token usage. Days with no usage return zero. Requires an
        organization API key.
      operationId: getDailyConsumption
      parameters:
        - $ref: '#/components/parameters/organization_id'
        - $ref: '#/components/parameters/month'
      responses:
        '200':
          description: Daily series for the organization.
          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: 120
                    total_tokens: 4500
                  - 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
    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
  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.

````