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

# Get spending

> Returns the total amount spent within the specified date range.
Useful for answering questions like "How much have I spent this week?"



## OpenAPI

````yaml GET /api/v1/billing/spending
openapi: 3.0.1
info:
  title: Sequentum Cloud API
  description: API endpoints for Sequentum Cloud
  version: v1
servers: []
security:
  - ApiKey: []
    Bearer: []
paths:
  /api/v1/billing/spending:
    get:
      tags:
        - ApiBilling
      summary: Get spending summary for a date range
      description: |-
        Returns the total amount spent within the specified date range.
        Useful for answering questions like "How much have I spent this week?"
      parameters:
        - name: startDate
          in: query
          description: >-
            Start date for the range (ISO format, defaults to start of current
            week)
          schema:
            type: string
            format: date-time
        - name: endDate
          in: query
          description: End date for the range (ISO format, defaults to now)
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Returns the spending summary
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendingSummaryApiModel'
        '400':
          description: If the date range is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '401':
          description: If the API key is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    SpendingSummaryApiModel:
      type: object
      properties:
        totalSpent:
          type: number
          description: Total amount spent in the date range
          format: double
        startDate:
          type: string
          description: Start date of the range
          format: date-time
        endDate:
          type: string
          description: End date of the range
          format: date-time
        organizationId:
          type: integer
          description: Organization ID
          format: int32
        currentBalance:
          type: number
          description: Current available credits balance
          format: double
      additionalProperties: false
      description: Response model for spending summary
    BadRequestError:
      type: object
      properties:
        statusCode:
          type: integer
          format: int32
        statusDescription:
          type: string
          nullable: true
        message:
          type: string
          nullable: true
          readOnly: true
        severity:
          $ref: '#/components/schemas/ErrorSeverity'
        errorCode:
          type: string
          description: "Optional machine-readable error code. When present, clients should switch on this\r\nvalue rather than parsing Sequentum.Enterprise.Core.ControllerError.Message. Omitted from the response when null."
          nullable: true
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    ErrorSeverity:
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
      type: integer
      description: >-
        `0` = `Error`; `1` = `Unexpected`; `2` = `Fatal`; `3` = `Warning`; `4` =
        `Info`
      format: int32
  securitySchemes:
    ApiKey:
      type: apiKey
      description: >-
        API Key authorization header. Example: "Authorization: ApiKey
        {your-api-key}"
      name: Authorization
      in: header
    Bearer:
      type: http
      description: 'OAuth 2.0 Bearer token. Example: "Authorization: Bearer {access-token}"'
      scheme: bearer
      bearerFormat: JWT

````