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

# Query Usage



## OpenAPI

````yaml /openapi.json post /v2/scribe/open-api/usage/query
openapi: 3.1.0
info:
  title: Cortexa Scribe Open API
  description: >-
    Authorized EHR access to Cortexa Scribe. All clinical resources are scoped
    to a partner grant.
  version: 2.0.0
servers:
  - url: https://sandbox.api.cortexanote.com
security: []
paths:
  /v2/scribe/open-api/usage/query:
    post:
      tags:
        - Scribe Open API
      summary: Query Usage
      operationId: scribe_api_usage_query
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UsageQuery'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageRead'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '422':
          description: Business rule violation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      security:
        - CortexaApiKey: []
        - ScribeApiJWT: []
components:
  schemas:
    UsageQuery:
      properties:
        name:
          type: string
          const: user_daily_report
          title: Name
          default: user_daily_report
        since:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Since
        until:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Until
        offset:
          type: integer
          minimum: 0
          title: Offset
          default: 0
        limit:
          type: integer
          maximum: 2000
          minimum: 1
          title: Limit
          default: 100
      additionalProperties: false
      type: object
      title: UsageQuery
    UsageRead:
      properties:
        name:
          type: string
          title: Name
          default: user_daily_report
        timezone:
          type: string
          title: Timezone
          default: UTC
        data:
          items:
            $ref: '#/components/schemas/DailyUsage'
          type: array
          title: Data
        has_more:
          type: boolean
          title: Has More
        next_offset:
          anyOf:
            - type: integer
            - type: 'null'
          title: Next Offset
      additionalProperties: false
      type: object
      required:
        - data
        - has_more
        - next_offset
      title: UsageRead
    ApiErrorResponse:
      type: object
      properties:
        message:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ApiErrorDetail'
        context:
          type: object
          additionalProperties:
            type: string
          description: Explicitly public context for handling business errors.
      required:
        - message
        - errors
    DailyUsage:
      properties:
        report_date:
          type: string
          format: date
          title: Report Date
        grant_id:
          type: string
          title: Grant Id
        external_user_id:
          type: string
          title: External User Id
        workspace_id:
          type: string
          title: Workspace Id
        sessions:
          type: integer
          title: Sessions
          default: 0
        consult_notes:
          type: integer
          title: Consult Notes
          default: 0
        documents:
          type: integer
          title: Documents
          default: 0
        transcription_minutes:
          type: number
          title: Transcription Minutes
          default: 0
        dictation_minutes:
          type: number
          title: Dictation Minutes
          default: 0
        structured_responses:
          type: integer
          title: Structured Responses
          default: 0
        tasks:
          type: integer
          title: Tasks
          default: 0
      additionalProperties: false
      type: object
      required:
        - report_date
        - grant_id
        - external_user_id
        - workspace_id
      title: DailyUsage
    ApiErrorDetail:
      type: object
      properties:
        field:
          type: string
        code:
          type: string
      required:
        - code
  securitySchemes:
    CortexaApiKey:
      type: apiKey
      in: header
      name: Cortexa-Api-Key
    ScribeApiJWT:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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