> ## Documentation Index
> Fetch the complete documentation index at: https://vastai-80aa3a82-auto-openapi-update-79df5d46.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List Host Machines

> Returns all machines owned by the authenticated host, with aggregated GPU, CPU, disk, network, job stats, and listing information.



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/v0/machines/
openapi: 3.1.0
info:
  title: Vast.ai API
  description: >-
    Vast.ai REST API for managing GPU cloud instances, machine operations, and
    AI/ML workflows.


    ## AI Agent Quick-Start


    Install the CLI skill for your agent (Claude Code, Cursor, Windsurf, etc.):
      npx skills add vast-ai/vast-cli

    CLI reference:
    https://raw.githubusercontent.com/vast-ai/vast-cli/master/vastai/SKILL.md

    SDK reference:
    https://raw.githubusercontent.com/vast-ai/vast-cli/master/vastai_sdk/SKILL.md


    ## Auth

    All endpoints require `Authorization: Bearer $VAST_API_KEY`.

    Get your key at: https://cloud.vast.ai/manage-keys/


    ## Key Quirks

    - `gpu_ram` in CLI = GB; in REST API = MB (CLI auto-converts)

    - SSH keys must be registered BEFORE creating an instance (VM: no recovery;
    Docker: can add post-create)

    - `onstart` field is limited to 4048 characters -- gzip+base64 for longer
    scripts

    - `POST /api/v0/asks/{id}/` (create instance) returns `new_contract` as the
    instance ID, not `id`

    - Poll trap: if `actual_status` becomes `exited`, `unknown`, or `offline` it
    will never reach `running` -- destroy and retry
  version: 1.0.0
  contact:
    name: Vast.ai Support
    url: https://discord.gg/vast
servers:
  - url: https://console.vast.ai
    description: Production server
security:
  - BearerAuth: []
paths:
  /api/v0/machines/:
    get:
      tags:
        - Machines
      summary: List Host Machines
      description: >-
        Returns all machines owned by the authenticated host, with aggregated
        GPU, CPU, disk, network, job stats, and listing information.
      parameters:
        - name: user_id
          in: query
          required: true
          description: The ID of the user whose machines are being requested.
          schema:
            type: string
      responses:
        '200':
          description: >-
            Returns {machines: [...]} with full machine details including GPU
            occupancy, pricing, job stats, and maintenance info
          content:
            application/json:
              schema:
                type: object
                properties:
                  machines:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          description: Machine ID
                        machine_id:
                          type: integer
                          description: Machine ID (duplicate field)
                        hostname:
                          type: string
                          description: Machine hostname
                        geolocation:
                          type: string
                          description: Physical location of the machine
                        timeout:
                          type: number
                          description: >-
                            Seconds since machine was last active; 0 if
                            currently online
                        num_gpus:
                          type: integer
                          description: Total number of GPUs
                        gpu_name:
                          type: string
                          description: GPU model name
                        gpu_ram:
                          type: number
                          description: GPU VRAM in bytes
                        cpu_name:
                          type: string
                          description: CPU model name
                        cpu_ram:
                          type: number
                          description: CPU RAM in bytes
                        cpu_cores:
                          type: integer
                          description: Number of CPU cores
                        listed:
                          type: boolean
                          description: Whether the machine has active offers
                        listed_gpu_cost:
                          type: number
                          description: Host-facing GPU price per hour when listed
                        listed_storage_cost:
                          type: number
                          description: Host-facing storage cost per month when listed
                        listed_volume_cost:
                          type: number
                          description: Host-facing volume cost per month when listed
                        listed_inet_up_cost:
                          type: number
                          description: Host-facing upload bandwidth cost when listed
                        listed_inet_down_cost:
                          type: number
                          description: Host-facing download bandwidth cost when listed
                        min_bid_price:
                          type: number
                          description: Minimum interruptible bid price per hour
                        gpu_occupancy:
                          type: string
                          description: >-
                            Space-separated string of per-GPU occupancy codes
                            (D/R/I/x)
                        disk_space:
                          type: number
                          description: Available disk space in bytes
                        inet_up:
                          type: number
                          description: Current upload bandwidth in Mbps
                        inet_down:
                          type: number
                          description: Current download bandwidth in Mbps
                        earn_hour:
                          type: number
                          description: Earnings in the last hour
                        earn_day:
                          type: number
                          description: Earnings in the last day
                        current_rentals_running:
                          type: integer
                          description: Number of currently running rentals
                        current_rentals_resident:
                          type: integer
                          description: Number of resident (loaded) rentals
                        reliability2:
                          type: number
                          description: Machine reliability score
                        public_ipaddr:
                          type: string
                          description: Machine's public IP address
                        driver_version:
                          type: string
                          description: GPU driver version
                        cuda_max_good:
                          type: string
                          description: Maximum supported CUDA version
                        hosting_type:
                          type: integer
                          description: Hosting type flag (e.g. 1 = datacenter)
                    description: List of machine detail objects
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key must be provided in the Authorization header

````