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

# Get current monthly budget usage for apps and LLMs

> Returns usage of monthly budgets for apps and LLMs, with optional date range for total cost



## OpenAPI

````yaml /swagger/5.12/ai-studio-swagger.yml get /analytics/budget-usage
openapi: 3.0.1
info:
  title: Midsommar API
  description: This is the API for the Midsommar user and group management system.
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    url: http://www.swagger.io/support
    email: support@swagger.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: //localhost:8080/api/v1
security: []
paths:
  /analytics/budget-usage:
    get:
      tags:
        - Analytics
      summary: Get current monthly budget usage for apps and LLMs
      description: >-
        Returns usage of monthly budgets for apps and LLMs, with optional date
        range for total cost
      parameters:
        - name: start_date
          in: query
          description: Start date (YYYY-MM-DD) for total cost calculation
          schema:
            type: string
        - name: end_date
          in: query
          description: End date (YYYY-MM-DD) for total cost calculation
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/models.BudgetUsage'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
components:
  schemas:
    models.BudgetUsage:
      type: object
      properties:
        budget:
          type: number
        budget_start_date:
          type: string
        entity_id:
          type: integer
        entity_type:
          type: string
          description: '"LLM" or "App"'
        name:
          type: string
        spent:
          type: number
        total_cost:
          type: number
          description: cost for the specified date range
        total_tokens:
          type: integer
          description: total tokens for the specified date range
        usage:
          type: number
          description: percentage
        user_email:
          type: string
          description: Email of the user who owns the app (pointer to handle null case)
        user_id:
          type: integer
          description: ID of the user who owns the app
    models.ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              detail:
                type: string
              title:
                type: string

````