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

# Get Billing Monthly By User

> API key permission: Admin.



## OpenAPI

````yaml /api-reference/openapi.json get /billing/monthly-by-user
openapi: 3.1.0
info:
  title: Neural Factory API
  version: 0.1.0
  description: >-
    The endpoints a program can call with an API key. Exchange the key's secret
    for a token at POST /apikeys/token and send it as a Bearer token.
servers:
  - url: https://api.neuralfactory.ai
    description: SaaS
  - url: https://{apiHost}
    description: 'Enterprise: the API address of your own deployment'
    variables:
      apiHost:
        default: api.example.com
        description: Your deployment's API host
security:
  - bearerAuth: []
tags:
  - name: API keys
  - name: Chat
  - name: Runs
  - name: Agents
  - name: Workflows
  - name: Schedules
  - name: Knowledge bases
  - name: Documents
  - name: Search
  - name: Skills
  - name: Toolkits
  - name: Files
  - name: Interactions
  - name: Usage and billing
  - name: Catalogue
  - name: Browser
  - name: Users
  - name: Groups
  - name: Builds
paths:
  /billing/monthly-by-user:
    get:
      tags:
        - Usage and billing
      summary: Get Billing Monthly By User
      description: 'API key permission: Admin.'
      operationId: get_billing_monthly_by_user_billing_monthly_by_user_get
      parameters:
        - name: year
          in: query
          required: false
          schema:
            type: integer
            description: 'Year (default: current year)'
            title: Year
          description: 'Year (default: current year)'
        - name: month
          in: query
          required: false
          schema:
            type: integer
            maximum: 12
            minimum: 1
            description: 'Month number 1-12 (default: current month)'
            title: Month
          description: 'Month number 1-12 (default: current month)'
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Page number
            default: 1
            title: Page
          description: Page number
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Items per page
            default: 20
            title: Page Size
          description: Items per page
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Search by user name or email
            title: Search
          description: Search by user name or email
        - name: sort_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Sort field
            title: Sort By
          description: Sort field
        - name: sort_order
          in: query
          required: false
          schema:
            type: string
            description: 'Sort order: asc or desc'
            default: desc
            title: Sort Order
          description: 'Sort order: asc or desc'
        - name: env
          in: query
          required: false
          schema:
            title: Env
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingMonthlyByUserResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    BillingMonthlyByUserResponse:
      properties:
        month:
          type: string
          title: Month
        year:
          type: integer
          title: Year
        total_cost:
          type: number
          title: Total Cost
        total_requests:
          type: integer
          title: Total Requests
        users:
          items:
            $ref: '#/components/schemas/BillingUserItem'
          type: array
          title: Users
        total:
          type: integer
          title: Total
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
        total_pages:
          type: integer
          title: Total Pages
      type: object
      required:
        - month
        - year
        - total_cost
        - total_requests
        - users
        - total
        - page
        - page_size
        - total_pages
      title: BillingMonthlyByUserResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BillingUserItem:
      properties:
        user_id:
          type: string
          title: User Id
        user_name:
          type: string
          title: User Name
        email:
          type: string
          title: Email
        total_cost:
          type: number
          title: Total Cost
        request_count:
          type: integer
          title: Request Count
        percentage:
          type: number
          title: Percentage
      type: object
      required:
        - user_id
        - user_name
        - email
        - total_cost
        - request_count
        - percentage
      title: BillingUserItem
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        The access_token returned by POST /apikeys/token for an API key's
        secret.

````

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