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

# vastai search benchmarks

Search for benchmark results using custom query

## Usage

```bash theme={null}
vastai search benchmarks [--help] [--api-key API_KEY] [--raw] [--limit N] [--next-token TOKEN] <query>
```

## Arguments

<ParamField path="query" type="string" required>
  Search query in simple query syntax (see below)
</ParamField>

## Options

<ParamField path="--all" type="boolean">
  force fetching every page, even with --limit/--next-token (fetching everything is already the default otherwise)
</ParamField>

<ParamField path="--limit" type="integer">
  max results per page; passing this switches to single-page mode instead of fetching everything
</ParamField>

<ParamField path="--next-token" type="string">
  resume from a pagination token (implies single-page mode)
</ParamField>

## Description

By default this fetches every page and prints one combined result. Passing
\--limit or --next-token switches to single-page mode, which prints a page
and asks whether to fetch the next one (add --all to still fetch every page
in that mode). The prompt is skipped when output is piped or --raw is used;
those print the next page token so you can resume with --next-token.

\--raw prints a flat list when fetching every page, and the full response
(benchmarks plus next\_token) in single-page mode.

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

note: to pass '>' and '\<' on the command line, make sure to use quotes
note: to encode a string query value (ie for gpu\_name), replace any spaces ' ' with underscore '\_'

## Examples

```bash theme={null}
# search for benchmarks with value > 100 on RTX 4090s for 2 specific machines
    vastai search benchmarks 'value > 100.0  gpu_name=RTX_4090  machine_id in [302,402]'

    # a page at a time, prompting between pages
    vastai search benchmarks 'gpu_name=RTX_5090' --limit 50

Available fields:

      Name                  Type       Description

    contract_id             int        ID of instance/contract reporting benchmark
    dph_base                float      gpu $/hr at the time of the benchmark
    gpu_name                string     GPU model benchmarked (e.g. RTX_4090)
    id                      int        benchmark unique ID
    image                   string     image used for benchmark
    last_update             float      date of benchmark
    launch_args             string     launch args of the benchmarked worker
    machine_id              int        id of machine benchmarked
    num_gpus                int        number of gpus used in benchmark
    template_hash           string     hash of the template benchmarked (formerly 'name')
    template_id             int        id of the template benchmarked
    type                    string     benchmark type
    value                   float      benchmark result (formerly 'score')
```

## 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`) |
