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

# Get Resource Usage

> Get the current CPU, memory and disk usage of the server.



## OpenAPI

````yaml get /user/usage
openapi: 3.0.3
info:
  title: Medama Analytics API
  version: 0.5.0
  description: |
    This is the Medama Analytics OpenAPI 3.0 specification.
  contact:
    email: hello@ayuhito.com
    name: Medama Analytics
    url: https://medama.io/contact
  license:
    url: https://github.com/medama-io/medama/blob/main/core/LICENSE
    name: Apache License 2.0
servers:
  - url: http://localhost:8080
    description: Local Server
security: []
tags:
  - name: Authentication
    description: Authentication
  - name: Event
    description: Page Events
  - name: User
    description: User Management
  - name: Website
    description: Website Management
  - name: Stats
    description: Statistics
paths:
  /user/usage:
    get:
      tags:
        - User
      summary: Get Resource Usage
      description: Get the current CPU, memory and disk usage of the server.
      operationId: get-user-usage
      parameters:
        - $ref: '#/components/parameters/SessionAuth'
      responses:
        '200':
          description: OK
          headers:
            X-Api-Commit:
              $ref: '#/components/headers/X-Api-Commit'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserUsageGet'
        '401':
          $ref: '#/components/responses/UnauthorisedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - CookieAuth: []
components:
  parameters:
    SessionAuth:
      name: _me_sess
      in: cookie
      description: Session token for authentication.
      required: true
      schema:
        type: string
        example: _me_sess=token; Path=/; HttpOnly; SameSite=Lax; Secure
  headers:
    X-Api-Commit:
      description: >-
        A custom header used to identify the commit of the API. This can be used
        to force reload the client if the API has been updated.
      schema:
        type: string
        example: 97dd2ae
  schemas:
    UserUsageGet:
      type: object
      title: UserUsageGet
      description: Response body for getting CPU, memory and disk usage of the server.
      properties:
        cpu:
          type: object
          properties:
            usage:
              type: number
              format: float
            cores:
              type: integer
            threads:
              type: integer
          required:
            - usage
            - cores
            - threads
        memory:
          type: object
          properties:
            used:
              type: integer
              format: int64
            total:
              type: integer
              format: int64
          required:
            - used
            - total
        disk:
          type: object
          properties:
            used:
              type: integer
              format: int64
            total:
              type: integer
              format: int64
          required:
            - used
            - total
      required:
        - cpu
        - memory
        - disk
  responses:
    UnauthorisedError:
      description: 401 Unauthorised.
      headers:
        X-Api-Commit:
          $ref: '#/components/headers/X-Api-Commit'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                additionalProperties: false
                properties:
                  code:
                    type: integer
                    format: int32
                    default: 401
                  message:
                    type: string
                required:
                  - code
                  - message
            required:
              - error
    InternalServerError:
      description: 500 Unexpected Internal Server Error.
      headers:
        X-Api-Commit:
          $ref: '#/components/headers/X-Api-Commit'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                additionalProperties: false
                properties:
                  code:
                    type: integer
                    format: int32
                    default: 500
                  message:
                    type: string
                required:
                  - code
                  - message
            required:
              - error
  securitySchemes:
    CookieAuth:
      name: _me_sess
      in: cookie
      type: apiKey
      description: Session token for authentication.

````