> ## Documentation Index
> Fetch the complete documentation index at: https://www.papers.bot/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Monthly workspace usage and reported SMS costs

> Owner/admin sessions only. Optional month=YYYY-MM (UTC, default current month). Shows customer usage charges from the prepaid ledger; null means unsettled. Based on message creation time, not an invoice or provider billing period.



## OpenAPI

````yaml /openapi.json get /workspace/usage
openapi: 3.1.0
info:
  title: Papers API
  version: 0.1.0
  description: >-
    Email, SMS, and workspace resources for Papers. Authenticate resource
    requests with a scoped API key or OAuth token. Administrative endpoints
    require a human session.
servers:
  - url: https://www.papers.bot/v1
security:
  - bearerAuth: []
paths:
  /workspace/usage:
    get:
      tags:
        - Workspace
      summary: Monthly workspace usage and reported SMS costs
      description: >-
        Owner/admin sessions only. Optional month=YYYY-MM (UTC, default current
        month). Shows customer usage charges from the prepaid ledger; null means
        unsettled. Based on message creation time, not an invoice or provider
        billing period.
      operationId: getWorkspaceUsage
      parameters:
        - name: month
          in: query
          schema:
            type: string
            pattern: ^20[0-9]{2}-(0[1-9]|1[0-2])$
      responses:
        '200':
          description: Successful JSON response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceUsage'
        '429':
          description: >-
            Request rate limit or communication quota exceeded. Rate-limit
            responses include Retry-After.
          headers:
            Retry-After:
              description: >-
                Seconds until the request-rate window resets (rate_limited
                errors)
              schema:
                type: integer
                minimum: 1
                maximum: 60
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Request rejected
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - sessionCookie: []
components:
  schemas:
    WorkspaceUsage:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        month:
          type: string
          pattern: ^20\d{2}-(0[1-9]|1[0-2])$
        timezone:
          type: string
          const: UTC
        start:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
        endExclusive:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
        email:
          type: array
          items:
            type: object
            properties:
              direction:
                type: string
                enum:
                  - inbound
                  - outbound
              messages:
                type: integer
                minimum: 0
                maximum: 9007199254740991
            required:
              - direction
              - messages
            additionalProperties: false
        sms:
          type: array
          items:
            type: object
            properties:
              direction:
                type: string
                enum:
                  - inbound
                  - outbound
              currency:
                type:
                  - string
                  - 'null'
              messages:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              messagesWithCost:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              messagesWithSegments:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              reportedSegments:
                anyOf:
                  - type: integer
                    minimum: 0
                    maximum: 9007199254740991
                  - type: 'null'
              chargedAmount:
                anyOf:
                  - type: string
                    pattern: ^\d+(\.\d+)?([eE][+-]?\d+)?$
                  - type: 'null'
            required:
              - direction
              - currency
              - messages
              - messagesWithCost
              - messagesWithSegments
              - reportedSegments
              - chargedAmount
            additionalProperties: false
        basis:
          type: string
          const: message_created_at
        costSource:
          type: string
          const: papers_ledger
        billingStatus:
          type: string
          const: prepaid
      required:
        - month
        - timezone
        - start
        - endExclusive
        - email
        - sms
        - basis
        - costSource
        - billingStatus
      additionalProperties: false
    Error:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            request_id:
              type: string
            retryable:
              type: boolean
            details:
              anyOf:
                - type: object
                  properties:
                    approvalId:
                      type: string
                      minLength: 1
                  required:
                    - approvalId
                  additionalProperties: false
                - type: array
                  items:
                    type: object
                    properties:
                      code:
                        type: string
                      path:
                        type: array
                        items:
                          type:
                            - string
                            - number
                      message:
                        type: string
                    required:
                      - code
                      - path
                      - message
                    additionalProperties: false
          required:
            - code
            - message
            - request_id
            - retryable
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Workspace API key or delegated OAuth access token with /v1 resource
        audience. Administrative routes require the Better Auth browser session
        instead.
    sessionCookie:
      type: apiKey
      in: cookie
      name: __Secure-better-auth.session_token
      description: >-
        Better Auth session with selected organization. Mutations also require
        the trusted Origin header.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.