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

# List Autojob Workergroups

> Returns all active workergroups (autojobs) belonging to the authenticated user, with endpoint and API key details.



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/v0/autojobs
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/autojobs:
    get:
      tags:
        - Serverless
      summary: List Autojob Workergroups
      description: >-
        Returns all active workergroups (autojobs) belonging to the
        authenticated user, with endpoint and API key details.
      operationId: listAutojobWorkergroups
      responses:
        '200':
          description: >-
            Returns {success: true, results: [{id, min_load, target_util,
            cold_mult, cold_workers, template_hash, template_id, search_query,
            launch_args, gpu_ram, endpoint_name, endpoint_id, api_key,
            created_at, user_id}, ...]}
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Always true on success.
                  results:
                    type: array
                    description: List of workergroup objects.
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          description: Workergroup ID.
                        min_load:
                          type: number
                          description: Minimum load threshold.
                        target_util:
                          type: number
                          description: Target utilization ratio.
                        cold_mult:
                          type: number
                          description: Cold worker multiplier.
                        cold_workers:
                          type: integer
                          description: Number of cold (standby) workers.
                        template_hash:
                          type: string
                          description: Hash ID of the associated template.
                        template_id:
                          type: integer
                          description: ID of the associated template.
                        search_query:
                          type: object
                          description: Machine search query parameters.
                        launch_args:
                          type: string
                          description: CLI launch arguments for workers.
                        gpu_ram:
                          type: number
                          description: Required GPU RAM in GB.
                        endpoint_name:
                          type: string
                          description: Name of the associated endpoint.
                        endpoint_id:
                          type: integer
                          description: ID of the associated endpoint.
                        api_key:
                          type: string
                          description: Auth token for the user.
                        created_at:
                          type: number
                          description: Unix timestamp when the workergroup was created.
                        user_id:
                          type: integer
                          description: ID of the owning user.
              example:
                success: true
                results:
                  - id: 7
                    min_load: 0
                    target_util: 0.9
                    cold_mult: 3
                    cold_workers: 5
                    template_hash: abc123
                    template_id: 101
                    search_query:
                      verified:
                        eq: true
                    launch_args: '--image pytorch/pytorch'
                    gpu_ram: 8
                    endpoint_name: my-endpoint
                    endpoint_id: 3
                    api_key: tok_abc
                    created_at: 1700000000
                    user_id: 55
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key must be provided in the Authorization header

````