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

# Get Organization Usage

> Get aggregated usage statistics for your entire organization within a date range. Supports aggregation by different time periods and optional grouping by user, model, or custom fields.

Get aggregated usage statistics for your entire organization within a date range. Supports aggregation by different time periods and optional grouping by user, member, API key, model, or custom fields.


## OpenAPI

````yaml GET /v1/manage/org/usage
openapi: 3.0.3
info:
  title: Requesty API
  description: Requesty API for AI model routing and key management
  version: 1.0.0
servers:
  - url: https://api-v2.requesty.ai
    description: Management API endpoint
  - url: https://router.requesty.ai
    description: Inference router endpoint
security:
  - BearerAuth: []
paths:
  /v1/manage/org/usage:
    servers:
      - url: https://api-v2.requesty.ai
        description: Management API endpoint
    get:
      summary: Get organization usage
      description: >-
        Get aggregated usage statistics for your entire organization within a
        date range. Supports aggregation by different time periods and optional
        grouping by user, model, or custom fields.
      operationId: getOrgUsage
      parameters:
        - name: start
          in: query
          required: true
          schema:
            type: string
            format: date-time
            example: '2025-01-01T00:00:00Z'
          description: >-
            Start date in RFC3339 format (e.g., 2025-01-01T00:00:00Z). Required.
            The date range cannot exceed 100 days from start to end.
        - name: end
          in: query
          required: false
          schema:
            type: string
            format: date-time
            example: '2025-01-31T23:59:59Z'
          description: >-
            End date in RFC3339 format (e.g., 2025-01-31T23:59:59Z). Optional.
            Defaults to 24 hours from start if not specified. Must be after
            start date. The date range cannot exceed 100 days.
        - name: resolution
          in: query
          required: false
          schema:
            type: string
            enum:
              - hour
              - day
              - month
            default: day
          description: Time resolution for aggregation
        - name: group_by
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
          description: >-
            Fields to group by: group_name, group_id, member_id, member_email,
            user_id, api_key_id, model_requested, model_used, provider_used,
            is_byok, origin_title, or extra.<field_name>. Can be specified
            multiple times.
      responses:
        '200':
          description: Successfully retrieved usage data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrgUsageResponse'
        '400':
          description: Bad request - malformed payload or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - missing or empty Authorization header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Payment required - organization balance exhausted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - invalid token or model not in access list.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found - provider/model not supported.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded. Retry after the Retry-After header value.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Bad gateway - upstream provider returned an invalid response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    GetOrgUsageResponse:
      type: object
      properties:
        usage:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/OrgUsageEntry'
          description: Map of period (string) to usage entry
      required:
        - usage
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - origin
            - message
          properties:
            origin:
              type: string
              enum:
                - router
                - provider
              description: >-
                Whether the error originated from Requesty's router or an
                upstream provider.
            message:
              type: string
              description: Human-readable error description.
    OrgUsageEntry:
      type: object
      properties:
        completions_requests:
          type: integer
          description: Number of chat completion requests
        embedding_requests:
          type: integer
          description: Number of embedding requests
        image_requests:
          type: integer
          description: Number of image generation requests
        speech_requests:
          type: integer
          description: Number of text-to-speech requests
        transcription_requests:
          type: integer
          description: Number of speech-to-text requests
        total_requests:
          type: integer
          description: Total number of requests across all modalities
        spend:
          type: number
          format: decimal
          description: Total spend for the period
        input_tokens:
          type: integer
          description: Total input tokens consumed
        output_tokens:
          type: integer
          description: Total output tokens generated
        total_tokens:
          type: integer
          description: Total tokens (input + output)
        grouped_data:
          type: array
          items:
            $ref: '#/components/schemas/OrgUsageGrouped'
          description: >-
            Breakdown by the requested group_by fields. Only present when
            group_by is specified.
    OrgUsageGrouped:
      type: object
      properties:
        group_by_values:
          type: object
          additionalProperties: true
          description: Map of group_by field names to their values for this group
        completions_requests:
          type: integer
        embedding_requests:
          type: integer
        image_requests:
          type: integer
        speech_requests:
          type: integer
        transcription_requests:
          type: integer
        total_requests:
          type: integer
        spend:
          type: number
          format: decimal
        input_tokens:
          type: integer
        output_tokens:
          type: integer
        total_tokens:
          type: integer
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key for authentication

````