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

# vastai search instances

Search for instance types using custom query

## Usage

```bash theme={null}
vastai search offers [--help] [--api-key API_KEY] [--raw] <query>
```

## Arguments

<ParamField path="query" type="string" required>
  Query to search for. default: 'external=false rentable=true verified=true', pass -n to ignore default
</ParamField>

## Options

<ParamField path="-t" type="string" default="on-demand">
  Show 'on-demand', 'reserved', or 'bid'(interruptible) pricing. default: on-demand (alias: `--type`)
</ParamField>

<ParamField path="-i" type="string">
  Alias for `--type=bid` (alias: `--interruptible`)
</ParamField>

<ParamField path="-b" type="string">
  Alias for `--type=bid` (alias: `--bid`)
</ParamField>

<ParamField path="-r" type="string">
  Alias for `--type=reserved` (alias: `--reserved`)
</ParamField>

<ParamField path="-d" type="string">
  Alias for `--type=on-demand` (alias: `--on-demand`)
</ParamField>

<ParamField path="-n" type="boolean">
  Disable default query (alias: `--no-default`)
</ParamField>

<ParamField path="--new" type="boolean">
  New search exp
</ParamField>

<ParamField path="--limit" type="integer" />

<ParamField path="--storage" type="number" default="5.0">
  Amount of storage to use for pricing, in GiB. default=5.0GiB
</ParamField>

<ParamField path="-o" type="string" default="score-">
  Comma-separated list of fields to sort on. postfix field with - to sort desc. ex: -o 'num\_gpus,total\_flops-'.  default='score-' (alias: `--order`)
</ParamField>

## Description

**Query syntax**

```
query      = comparison comparison...
comparison = field op value
field      = <name of a field>
op         = one of: <, <=, ==, !=, >=, >, in, notin
value      = <bool, int, float, string> | 'any' | [value0, value1, ...]
bool       = True | False
```

* Wrap `>` and `<` in quotes on the command line
* For string values (e.g. `gpu_name`), replace spaces with underscores: `RTX_3090` not `RTX 3090`

## Examples

```bash theme={null}
# reliable single RTX 3090, no conflicts with stopped instances
vastai search offers 'reliability > 0.98 num_gpus=1 gpu_name=RTX_3090 rented=False'

# datacenter GPUs with minimum compute capability and TFLOPs
vastai search offers 'compute_cap > 610 total_flops > 5 datacenter=True'

# reliable 4-GPU offers in Taiwan or Sweden
vastai search offers 'reliability>0.99 num_gpus=4 geolocation in [TW,SE]'

# reliable RTX 3090 or 4090 NOT in China or Vietnam
vastai search offers 'reliability>0.99 gpu_name in ["RTX 4090", "RTX 3090"] geolocation notin [CN,VN]'

# nvidia driver 535.86.05 or greater with various constraints
vastai search offers 'disk_space>146 duration>24 gpu_ram>10 cuda_vers>=12.1 direct_port_count>=2 driver_version >= 535.86.05'

# reliable 4+ GPU offers, unverified allowed, sort by num_gpus desc
vastai search offers 'reliability > 0.99  num_gpus>=4 verified=False rented=any' -o 'num_gpus-'

# arm64 cpu architecture only
vastai search offers 'cpu_arch=arm64'
```

## Available Fields

| Field                 | Type   | Description                                                                       |
| --------------------- | ------ | --------------------------------------------------------------------------------- |
| `bw_nvlink`           | float  | bandwidth NVLink                                                                  |
| `compute_cap`         | int    | CUDA compute capability ×100 (e.g. 650 for 6.5, 700 for 7.0)                      |
| `cpu_arch`            | string | host machine cpu architecture (e.g. amd64, arm64)                                 |
| `cpu_cores`           | int    | number of virtual cpus                                                            |
| `cpu_ghz`             | float  | cpu clock speed in GHz                                                            |
| `cpu_cores_effective` | float  | virtual cpus you get                                                              |
| `cpu_ram`             | float  | system RAM in gigabytes                                                           |
| `cuda_vers`           | float  | machine max supported cuda version (based on driver version)                      |
| `datacenter`          | bool   | show only datacenter offers                                                       |
| `direct_port_count`   | int    | open ports on host's router                                                       |
| `disk_bw`             | float  | disk read bandwidth, in MB/s                                                      |
| `disk_space`          | float  | disk storage space, in GB                                                         |
| `dlperf`              | float  | DL-perf score (see FAQ for explanation)                                           |
| `dlperf_usd`          | float  | DL-perf per dollar                                                                |
| `dph`                 | float  | \$/hour rental cost                                                               |
| `driver_version`      | string | machine's nvidia/amd driver version as 3 digit string ex. "535.86.05"             |
| `duration`            | float  | max rental duration in days                                                       |
| `external`            | bool   | show external offers in addition to datacenter offers                             |
| `flops_usd`           | float  | TFLOPs per dollar                                                                 |
| `geolocation`         | string | two letter country code; supports =, !=, in, notin                                |
| `gpu_arch`            | string | host machine gpu architecture (e.g. nvidia, amd)                                  |
| `gpu_max_power`       | float  | GPU power limit (watts)                                                           |
| `gpu_max_temp`        | float  | GPU temp limit (°C)                                                               |
| `gpu_mem_bw`          | float  | GPU memory bandwidth in GB/s                                                      |
| `gpu_name`            | string | GPU model name (no quotes, replace spaces with underscores, ie: RTX\_3090)        |
| `gpu_ram`             | float  | per GPU RAM in GB                                                                 |
| `gpu_total_ram`       | float  | total GPU RAM in GB                                                               |
| `gpu_frac`            | float  | ratio of GPUs in the offer to GPUs in the system                                  |
| `gpu_display_active`  | bool   | True if the GPU has a display attached                                            |
| `has_avx`             | bool   | CPU supports AVX instruction set                                                  |
| `id`                  | int    | instance unique ID                                                                |
| `inet_down`           | float  | internet download speed in Mb/s                                                   |
| `inet_down_cost`      | float  | internet download bandwidth cost in \$/GB                                         |
| `inet_up`             | float  | internet upload speed in Mb/s                                                     |
| `inet_up_cost`        | float  | internet upload bandwidth cost in \$/GB                                           |
| `machine_id`          | int    | machine id of instance                                                            |
| `min_bid`             | float  | current minimum bid price in \$/hr for interruptible                              |
| `num_gpus`            | int    | number of GPUs                                                                    |
| `pci_gen`             | float  | PCIE generation                                                                   |
| `pcie_bw`             | float  | PCIE bandwidth (CPU to GPU)                                                       |
| `reliability`         | float  | machine reliability score (see FAQ for explanation)                               |
| `rentable`            | bool   | is the instance currently rentable                                                |
| `rented`              | bool   | allow/disallow duplicates and potential conflicts with existing stopped instances |
| `storage_cost`        | float  | storage cost in \$/GB/month                                                       |
| `static_ip`           | bool   | is the IP addr static/stable                                                      |
| `total_flops`         | float  | total TFLOPs from all GPUs                                                        |
| `ubuntu_version`      | string | host machine ubuntu OS version                                                    |
| `verified`            | bool   | is the machine verified                                                           |
| `vms_enabled`         | bool   | is the machine a VM instance                                                      |

## Global Options

The following options are available for all commands:

| Option          | Description                                           |
| --------------- | ----------------------------------------------------- |
| `--url URL`     | Server REST API URL                                   |
| `--retry N`     | Retry limit                                           |
| `--raw`         | Output machine-readable JSON                          |
| `--explain`     | Verbose explanation of API calls                      |
| `--api-key KEY` | API key (defaults to `~/.config/vastai/vast_api_key`) |
