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

# Get database usage and billing

> Returns detailed database usage statistics and billing information for the current billing period. Includes compute hours, storage, data transfer, and branch counts with associated costs broken down by project.



## OpenAPI

````yaml /openapi.json get /database/v1/usage
openapi: 3.1.0
info:
  title: Case.dev API
  description: >-
    The AI-native platform for legal technology. Build smarter legal
    applications with our suite of AI-powered APIs.
  version: 1.0.0
  contact:
    name: Case.dev Support
    email: support@casemark.com
    url: https://case.dev
  license:
    name: Proprietary
    url: https://case.dev/terms
servers:
  - url: https://api.case.dev
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Vaults
    description: Secure document storage with semantic search and GraphRAG
  - name: Memory
    description: >-
      Persistent memory for AI agents with semantic search and 12 generic
      indexed tag fields
  - name: OCR
    description: Extract text from PDFs, images, and scanned documents
  - name: Voice
    description: Audio transcription and text-to-speech
  - name: LLMs
    description: Access 40+ language models through a unified API
  - name: Search
    description: Web search, AI answers, and deep research
  - name: Mail
    description: Managed inboxes for agent email workflows
  - name: Media
    description: Transcript retrieval and captioned media clip generation
  - name: Legal
    description: Legal research tools including citation verification
  - name: Privilege
    description: Privilege detection for e-discovery and litigation workflows
  - name: Compute
    description: Serverless GPU and CPU infrastructure
  - name: Format
    description: Document formatting and template rendering (MD/JSON to PDF/DOCX)
  - name: SuperDoc
    description: Document conversion and template automation
  - name: Webhooks
    description: Webhook endpoint management
  - name: System
    description: Public system metadata and discovery endpoints
  - name: Usage
    description: Usage reporting and webhook subscriptions
  - name: Database
    description: Serverless PostgreSQL databases with instant branching
  - name: Translation
    description: Language detection and translation for multilingual legal workflows
  - name: Skills
    description: Search and read legal AI skills for agents
  - name: Agents
    description: >-
      Create, manage, and execute AI agents with tool access, sandbox
      environments, and async run workflows
  - name: Matters
    description: Matter-native legal workspaces and orchestration primitives
  - name: Applications Projects
    description: Web application project management
  - name: Applications Deployments
    description: Web application deployment management
  - name: Applications Domains
    description: Custom domain configuration for applications
  - name: Applications Env Vars
    description: Environment variable management for applications
paths:
  /database/v1/usage:
    get:
      tags:
        - Database
      summary: Get database usage and billing
      description: >-
        Returns detailed database usage statistics and billing information for
        the current billing period. Includes compute hours, storage, data
        transfer, and branch counts with associated costs broken down by
        project.
      operationId: getDatabaseUsage
      responses:
        '200':
          description: Database usage statistics and billing information
          content:
            application/json:
              schema:
                type: object
                properties:
                  period:
                    type: object
                    properties:
                      start:
                        type: string
                        format: date-time
                        description: Start of the billing period
                      end:
                        type: string
                        format: date-time
                        description: End of the billing period
                  pricing:
                    type: object
                    description: Current pricing rates
                    properties:
                      computePerCuHour:
                        type: number
                        description: Cost per compute unit hour in dollars
                      storagePerGbMonth:
                        type: number
                        description: Cost per GB of storage per month in dollars
                      transferPerGb:
                        type: number
                        description: Cost per GB of data transfer in dollars
                      branchPerMonth:
                        type: number
                        description: Cost per branch per month in dollars
                      freeBranches:
                        type: integer
                        description: Number of free branches included
                  totals:
                    type: object
                    description: Aggregated totals across all projects
                    properties:
                      computeCuHours:
                        type: number
                        description: Total compute unit hours
                      storageGbMonths:
                        type: number
                        description: Total storage in GB-months
                      transferGb:
                        type: number
                        description: Total data transfer in GB
                      totalBranches:
                        type: integer
                        description: Total number of branches
                      computeCostDollars:
                        type: string
                        description: Total compute cost formatted as dollars
                      storageCostDollars:
                        type: string
                        description: Total storage cost formatted as dollars
                      transferCostDollars:
                        type: string
                        description: Total transfer cost formatted as dollars
                      branchCostDollars:
                        type: string
                        description: Total branch cost formatted as dollars
                      totalCostDollars:
                        type: string
                        description: Total cost formatted as dollars
                  projects:
                    type: array
                    description: Usage breakdown by project
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        projectId:
                          type: string
                        projectName:
                          type: string
                          nullable: true
                        computeCuHours:
                          type: number
                        storageGbMonths:
                          type: number
                        transferGb:
                          type: number
                        branchCount:
                          type: integer
                        costs:
                          type: object
                          properties:
                            compute:
                              type: string
                            storage:
                              type: string
                            transfer:
                              type: string
                            branches:
                              type: string
                            total:
                              type: string
                        lastUpdated:
                          type: string
                          format: date-time
                  projectCount:
                    type: integer
                    description: Total number of projects with usage
              example:
                period:
                  start: '2024-03-01T00:00:00.000Z'
                  end: '2024-03-31T23:59:59.999Z'
                pricing:
                  computePerCuHour: 0.102
                  storagePerGbMonth: 0.024
                  transferPerGb: 0.09
                  branchPerMonth: 0
                  freeBranches: 10
                totals:
                  computeCuHours: 45.2
                  storageGbMonths: 12.5
                  transferGb: 3.2
                  totalBranches: 8
                  computeCostDollars: '4.61'
                  storageCostDollars: '0.30'
                  transferCostDollars: '0.29'
                  branchCostDollars: '0.00'
                  totalCostDollars: '5.20'
                projects:
                  - id: usage_abc123
                    projectId: proj_xyz789
                    projectName: legal-documents-db
                    computeCuHours: 30.5
                    storageGbMonths: 8.2
                    transferGb: 2.1
                    branchCount: 5
                    costs:
                      compute: '3.11'
                      storage: '0.20'
                      transfer: '0.19'
                      branches: '0.00'
                      total: '3.50'
                    lastUpdated: '2024-03-15T10:30:00Z'
                projectCount: 1
        '401':
          description: Authentication required
        '403':
          description: Access denied - database or compute permission required
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key starting with `sk_case_`

````