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

# Get daily usage data

> Get daily credit usage data for the authenticated organization. Use currentContract=true to automatically scope to the active contract period, or provide startDate and endDate. Child organizations linked to a parent billing organization cannot access this endpoint.



## OpenAPI

````yaml https://api.ropes.ai/api/docs/openapi.json get /api/public/usage
openapi: 3.0.0
info:
  title: Ropes Public API
  version: 1.0.0
  description: >-
    Public API for Ropes. Authenticate using your API key in the x-api-key
    header.
servers:
  - url: https://api.ropes.ai
    description: Production server
  - url: http://localhost:3001
    description: Local development server
security: []
paths:
  /api/public/usage:
    get:
      tags:
        - Usage
      summary: Get daily usage data
      description: >-
        Get daily credit usage data for the authenticated organization. Use
        currentContract=true to automatically scope to the active contract
        period, or provide startDate and endDate. Child organizations linked to
        a parent billing organization cannot access this endpoint.
      parameters:
        - schema:
            type: string
            description: Start date in YYYY-MM-DD format
          required: false
          description: Start date in YYYY-MM-DD format
          name: startDate
          in: query
        - schema:
            type: string
            description: End date in YYYY-MM-DD format
          required: false
          description: End date in YYYY-MM-DD format
          name: endDate
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: If "true", automatically use the current contract date range
          required: false
          description: If "true", automatically use the current contract date range
          name: currentContract
          in: query
        - schema:
            type: string
            default: '1'
            description: 'Page number (default: 1)'
          required: false
          description: 'Page number (default: 1)'
          name: page
          in: query
        - schema:
            type: string
            default: '100'
            description: 'Number of items per page (default: 100, max: 365)'
          required: false
          description: 'Number of items per page (default: 100, max: 365)'
          name: pageSize
          in: query
        - schema:
            type: string
            description: >-
              IANA timezone for daily bucketing (e.g. "America/Los_Angeles").
              Defaults to UTC.
          required: false
          description: >-
            IANA timezone for daily bucketing (e.g. "America/Los_Angeles").
            Defaults to UTC.
          name: timezone
          in: query
      responses:
        '200':
          description: Successfully retrieved usage data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageResponse'
        '400':
          description: Bad request - Missing or invalid date parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageErrorResponse'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageErrorResponse'
        '404':
          description: No active contract found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    UsageResponse:
      type: object
      properties:
        usage:
          type: array
          items:
            $ref: '#/components/schemas/DailyUsageRow'
          description: Daily usage data
        pagination:
          $ref: '#/components/schemas/UsagePagination'
        startDate:
          type: string
          description: Start date of the queried range (YYYY-MM-DD)
        endDate:
          type: string
          description: End date of the queried range (YYYY-MM-DD)
      required:
        - usage
        - pagination
        - startDate
        - endDate
    UsageErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
        details:
          type: array
          items:
            type: object
            additionalProperties:
              nullable: true
          description: >-
            Validation error details (Zod issue array), present on query
            parameter validation failures
      required:
        - error
    DailyUsageRow:
      type: object
      properties:
        date:
          type: string
          description: Date in YYYY-MM-DD format
        assessmentCredits:
          type: number
          description: Number of assessment credits used on this date
        videoScreeningCredits:
          type: number
          description: Number of video screening credits used on this date
      required:
        - date
        - assessmentCredits
        - videoScreeningCredits
    UsagePagination:
      type: object
      properties:
        page:
          type: number
          description: Current page number
        pageSize:
          type: number
          description: Number of items per page
        totalItems:
          type: number
          description: Total number of items across all pages
        totalPages:
          type: number
          description: Total number of pages
      required:
        - page
        - pageSize
        - totalItems
        - totalPages
      description: Pagination metadata
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````