> ## 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.

# Get GPU Machine Locations

> Returns current geographic locations of GPU machines, grouped by coordinates, for use in a geo map dashboard.



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/v0/metrics/gpu/locations/
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/metrics/gpu/locations/:
    get:
      tags:
        - Machines
      summary: Get GPU Machine Locations
      description: >-
        Returns current geographic locations of GPU machines, grouped by
        coordinates, for use in a geo map dashboard.
      responses:
        '200':
          description: >-
            Success. Returns `{success: true, locations: [{latitude, longitude,
            city, country_code, gpu_name, rented, verified, datacenter,
            num_gpus}]}`. Returns `needs_machine: true` with empty locations if
            host has no active machines.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Always true on success
                  needs_machine:
                    type: boolean
                    description: >-
                      True when caller is a host with no active machines;
                      locations will be empty
                  locations:
                    type: array
                    description: >-
                      One entry per distinct (lat, lon, gpu_name, rented,
                      verified, datacenter) combination
                    items:
                      type: object
                      properties:
                        latitude:
                          type: number
                          description: Latitude rounded to 4 decimal places
                        longitude:
                          type: number
                          description: Longitude rounded to 4 decimal places
                        city:
                          type: string
                          description: City name, or empty string if unknown
                        country_code:
                          type: string
                          description: ISO country code, or empty string if unknown
                        gpu_name:
                          type: string
                          description: GPU model name, or 'Unknown'
                        rented:
                          type: boolean
                          description: Whether this cluster of GPUs is currently rented
                        verified:
                          type: boolean
                          description: Whether these GPUs are verified
                        datacenter:
                          type: boolean
                          description: >-
                            True if hosting_type indicates a secure cloud /
                            datacenter host
                        num_gpus:
                          type: integer
                          description: >-
                            Number of GPUs at this location matching the other
                            attributes
              example:
                success: true
                locations:
                  - latitude: 37.7749
                    longitude: -122.4194
                    city: San Francisco
                    country_code: US
                    gpu_name: RTX 4090
                    rented: false
                    verified: true
                    datacenter: true
                    num_gpus: 8
        '403':
          description: 'Caller is not a host or admin: "Host or admin access required"'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - BearerAuth: []
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        msg:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key must be provided in the Authorization header

````