> ## Documentation Index
> Fetch the complete documentation index at: https://vastai-80aa3a82-host-2752-sla-api-documentation.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# show machines

> Fetches data for multiple machines associated with the authenticated user.

The `--raw` CLI output includes listing and SLA fields (`price_gpu`, `end_date`, `sla_r_claim`, `sla_sigma_x`, etc.) used for read-modify-write before partial SLA updates. See [SLA Offers — Partial updates](/host/sla-offers#api-for-automation).

CLI Usage: `vastai show machines [--user_id <user_id>]`



## 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
  license:
    name: Vast.ai Terms of Service
    url: https://vast.ai/terms/
servers:
  - url: https://console.vast.ai
    description: Production server
security:
  - BearerAuth: []
paths:
  /api/v0/machines:
    get:
      tags:
        - Machines
      summary: show machines
      description: >-
        Fetches data for multiple machines associated with the authenticated
        user.


        The `--raw` CLI output includes listing and SLA fields (`price_gpu`,
        `end_date`, `sla_r_claim`, `sla_sigma_x`, etc.) used for
        read-modify-write before partial SLA updates. See [SLA Offers — Partial
        updates](/host/sla-offers#api-for-automation).


        CLI Usage: `vastai show machines [--user_id <user_id>]`
      operationId: getMachines
      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: A list of machines
          content:
            application/json:
              schema:
                type: object
                properties:
                  machines:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: The unique identifier for the machine.
                        name:
                          type: string
                          description: The name of the machine.
                        price_gpu:
                          type: number
                          description: >-
                            GPU rental price in $/hour (when present in raw
                            listing output).
                        end_date:
                          type: number
                          description: >-
                            Offer expiration as Unix timestamp (when present in
                            raw listing output).
                        min_chunk:
                          type: integer
                          description: Minimum GPUs rented together (GPU slicing).
                        sla_r_claim:
                          type: number
                          description: >-
                            Host reliability claim. Values above 0 mean SLA is
                            enabled on the ask.
                        sla_sigma_x:
                          type: number
                          description: SLA confidence spread around the claim.
                        sla_max_beta:
                          type: number
                          description: >
                            Optional cap on client-derived β for this ask
                            (support-directed). Hosts do not

                            set β; leave unset for uncapped.
              example:
                machines:
                  - id: '12345'
                    name: my-h100
                    price_gpu: 3.5
                    end_date: 1735689600
                    min_chunk: 1
                    sla_r_claim: 0.99
                    sla_sigma_x: 0.5
        '401':
          description: Unauthorized - User authentication failed
        '429':
          description: Too Many Requests - Rate limit exceeded
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key must be provided in the Authorization header

````