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

# Return an in-guest resource-usage snapshot for a running computer.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v2/computers/{computer_id}/stats
openapi: 3.1.0
info:
  title: Vers API
  description: >-
    REST API for creating, checkpointing, branching, and managing Vers computers
    and projects.
  version: 2.0.0
servers:
  - url: https://api.vers.sh
    description: Vers API
security:
  - bearerAuth: []
tags:
  - name: Computers
    description: Create, inspect, execute commands in, sleep, wake, and delete computers.
  - name: Branches
    description: Branch one or more computers from a live computer, checkpoint, or tag.
  - name: Checkpoints
    description: Capture, inspect, tag, and delete whole-computer checkpoints.
  - name: Projects
    description: >-
      Organize computers into projects with private service networks and grouped
      restores.
  - name: Operations
    description: Inspect and stream status events for asynchronous durable operations.
  - name: Images
    description: >-
      Import and manage custom OCI images, system images, and registry
      artifacts.
  - name: Repositories
    description: Manage checkpoint repositories, tags, and public catalog entries.
  - name: Domains
    description: Register and manage custom domains.
  - name: Environment Variables
    description: Manage account-level environment variables applied to new computers.
  - name: Account & System
    description: Inspect API key identity, usage, and control-plane health.
paths:
  /api/v2/computers/{computer_id}/stats:
    get:
      tags:
        - Computers
      summary: Return an in-guest resource-usage snapshot for a running computer.
      operationId: get_computer_stats
      parameters:
        - name: computer_id
          in: path
          description: Computer identity
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Resource usage snapshot
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VmStatsResponse'
        '401':
          description: Missing or invalid API key
        '404':
          description: Computer not found
        '409':
          description: Computer is sleeping
components:
  schemas:
    VmStatsResponse:
      type: object
      description: >-
        Response body for `GET /api/v2/computers/{computer_id}/stats`.


        A point-in-time snapshot of resource usage *inside* the guest, read from

        `/proc/{meminfo,stat,loadavg,uptime}` by the chelsea-agent. CPU times
        are

        cumulative tick counters since boot — sample twice `dt` apart and diff
        to

        derive utilization.
      required:
        - timestamp
        - uptime_secs
        - memory
        - cpu
        - load_avg
      properties:
        cpu:
          $ref: '#/components/schemas/VmCpuStats'
          description: CPU tick counters (parsed from `/proc/stat`).
        load_avg:
          $ref: '#/components/schemas/VmLoadAvg'
          description: Load averages (parsed from `/proc/loadavg`).
        memory:
          $ref: '#/components/schemas/VmMemoryStats'
          description: Memory usage (parsed from `/proc/meminfo`, values in KiB).
        timestamp:
          type: string
          description: >-
            RFC-3339 wall-clock timestamp captured by the agent when the
            snapshot was taken.
        uptime_secs:
          type: number
          format: double
          description: >-
            Seconds since the guest booted (`/proc/uptime`). OTel:
            `system.uptime`.
    VmCpuStats:
      type: object
      description: CPU tick counters from `/proc/stat`. Cumulative since boot.
      required:
        - num_cpus
        - clock_ticks_per_sec
        - total
        - per_cpu
      properties:
        clock_ticks_per_sec:
          type: integer
          format: int32
          description: >-
            USER_HZ ticks per second. Effectively always 100 on stock Linux
            kernels.
          minimum: 0
        num_cpus:
          type: integer
          format: int32
          description: Number of online CPUs (count of `cpuN` lines in `/proc/stat`).
          minimum: 0
        per_cpu:
          type: array
          items:
            $ref: '#/components/schemas/VmCpuTimes'
          description: Per-CPU breakdown (the `cpuN` lines). Indexed by CPU number.
        total:
          $ref: '#/components/schemas/VmCpuTimes'
          description: Aggregate counters across all CPUs (the `cpu` line).
    VmLoadAvg:
      type: object
      description: Load averages from `/proc/loadavg`.
      required:
        - load_1m
        - load_5m
        - load_15m
        - running_processes
        - total_processes
      properties:
        load_15m:
          type: number
          format: double
          description: '15-minute load average. OTel: `system.linux.cpu.load_average.15m`.'
        load_1m:
          type: number
          format: double
          description: '1-minute load average. OTel: `system.linux.cpu.load_average.1m`.'
        load_5m:
          type: number
          format: double
          description: '5-minute load average. OTel: `system.linux.cpu.load_average.5m`.'
        running_processes:
          type: integer
          format: int32
          description: Currently runnable processes.
          minimum: 0
        total_processes:
          type: integer
          format: int32
          description: Total processes (runnable + sleeping).
          minimum: 0
    VmMemoryStats:
      type: object
      description: Memory statistics, values in KiB to match `/proc/meminfo` units.
      required:
        - total_kib
        - free_kib
        - available_kib
        - buffers_kib
        - cached_kib
        - swap_total_kib
        - swap_free_kib
      properties:
        available_kib:
          type: integer
          format: int64
          description: >-
            Memory available for new allocations without swapping
            (`MemAvailable`).

            OTel: `system.linux.memory.available`. Falls back to
            `free+buffers+cached`

            on kernels older than 3.14.
          minimum: 0
        buffers_kib:
          type: integer
          format: int64
          description: 'Buffer cache. OTel: `system.memory.usage{state="buffers"}`.'
          minimum: 0
        cached_kib:
          type: integer
          format: int64
          description: 'Page cache. OTel: `system.memory.usage{state="cached"}`.'
          minimum: 0
        free_kib:
          type: integer
          format: int64
          description: >-
            Memory not used for anything (`MemFree`). OTel:
            `system.memory.usage{state="free"}`.
          minimum: 0
        swap_free_kib:
          type: integer
          format: int64
          description: Free swap (`SwapFree`).
          minimum: 0
        swap_total_kib:
          type: integer
          format: int64
          description: Total swap (`SwapTotal`).
          minimum: 0
        total_kib:
          type: integer
          format: int64
          description: Total usable physical memory (`MemTotal`).
          minimum: 0
    VmCpuTimes:
      type: object
      description: |-
        Cumulative CPU time counters in USER_HZ ticks. State labels match OTel
        `system.cpu.time` semconv exactly.
      required:
        - user
        - nice
        - system
        - idle
        - iowait
        - irq
        - softirq
        - steal
      properties:
        idle:
          type: integer
          format: int64
          description: Time spent idle.
          minimum: 0
        iowait:
          type: integer
          format: int64
          description: Time waiting for I/O.
          minimum: 0
        irq:
          type: integer
          format: int64
          description: Time servicing hardware interrupts.
          minimum: 0
        nice:
          type: integer
          format: int64
          description: Time in user mode with low priority (niced).
          minimum: 0
        softirq:
          type: integer
          format: int64
          description: Time servicing softirqs.
          minimum: 0
        steal:
          type: integer
          format: int64
          description: Time stolen by the hypervisor.
          minimum: 0
        system:
          type: integer
          format: int64
          description: Time in system (kernel) mode.
          minimum: 0
        user:
          type: integer
          format: int64
          description: Time in user mode.
          minimum: 0
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: 'Vers API key (`VERS_API_KEY`) sent as `Authorization: Bearer <key>`.'

````

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