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

# Get usage consumption for a user within a time window



## OpenAPI

````yaml /api-reference/admin/admin-openapi.yml get /projects/{projectId}/customers/{customerId}/users/{userId}/consumption
openapi: 3.1.0
info:
  title: Admin API
  version: 0.1.0
  description: >
    The Admin API provides programmatic access to Corti's self-service Console
    platform. This API is intended for administrators.
servers:
  - url: https://api.console.corti.app/functions/v1/public
    description: Production Admin API
security: []
tags:
  - name: Auth
    description: Operations related to authentication
  - name: Customers
    description: Operations related to customer management
  - name: Users
    description: Operations related to user management
paths:
  /projects/{projectId}/customers/{customerId}/users/{userId}/consumption:
    get:
      tags:
        - Users
      summary: Get usage consumption for a user within a time window
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/CustomerId'
        - $ref: '#/components/parameters/UserId'
        - name: from
          in: query
          required: true
          schema:
            type: string
            format: date-time
            example: '2026-01-05T00:00:00Z'
          description: Start of the time range (inclusive) in RFC 3339 format
        - name: to
          in: query
          required: true
          schema:
            type: string
            format: date-time
            example: '2026-01-17T00:00:00Z'
          description: End of the time range (inclusive) in RFC 3339 format
        - name: windowTimeZone
          in: query
          required: false
          schema:
            type: string
            default: UTC
          description: >-
            Time zone name as defined by the IANA Time Zone Database (defaults
            to UTC)
      responses:
        '200':
          description: Consumption for the requested user and window
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserConsumption'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      security:
        - BearerAuth: []
components:
  parameters:
    ProjectId:
      name: projectId
      in: path
      required: true
      schema:
        type: string
        example: consoleproject
      description: >
        Unique identifier of your project in the Corti API Console.


        To find it, open your project at
        [console.corti.app](https://console.corti.app/), go to Settings, and
        copy the value from the Project ID field.
    CustomerId:
      name: customerId
      in: path
      required: true
      schema:
        type: string
        example: contosohospital
      description: The unique identifier for a Customer
    UserId:
      name: userId
      in: path
      required: true
      schema:
        type: string
        format: uuid
        example: 123e4567-e89b-12d3-a456-426614174000
      description: The ID of the user
  schemas:
    UserConsumption:
      type: object
      properties:
        consumption:
          type: number
          format: double
          description: Total credits consumed in the requested window
      required:
        - consumption
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message
        code:
          type: string
          description: Machine-readable error code
        details:
          type: object
          additionalProperties: true
          description: Additional error details
      required:
        - error
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Entity not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServiceUnavailable:
      description: External service unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        JWT access token obtained from the /auth/token endpoint.


        > This `Admin API` is separate from the `Corti API` used for speech
        recognition, text generation, and agentic workflows. Authentication and
        scope for the `Admin API` uses email-and-password to obtain a bearer
        token via
        [/auth/token](/api-reference/admin/auth/authenticate-user-and-get-access-token).
        This token is only used for API administration.

````