Skip to main content
The Vast.ai CLI (vastai) is installed via pip install vastai — the same package exposes both the vastai command-line entry point and the Python SDK. Every command supports a shared set of global options (shown under “Global options” in each command’s --help output):
OptionDescription
--url URLServer REST API URL
--retry NRetry limit
--rawOutput machine-readable JSON
--explainVerbose explanation of API calls
--curlPrint the equivalent curl command
--api-key KEYAPI key (defaults to ~/.config/vastai/vast_api_key)
--no-colorDisable colored output
--versionShow CLI version

Command Index

Instances

CommandDescription
vastai show instanceDisplay user’s current instances
vastai show instancesList instances with filtering, sorting, and pagination
vastai create instanceCreate a new instance
vastai create instancesCreate instances from a list of offers
vastai destroy instanceDestroy an instance (irreversible, deletes data)
vastai destroy instancesDestroy a list of instances (irreversible, deletes data)
vastai start instanceStart a stopped instance
vastai start instancesStart a list of instances
vastai stop instanceStop a running instance
vastai stop instancesStop a list of instances
vastai reboot instanceReboot (stop/start) an instance
vastai recycle instanceRecycle (destroy/create) an instance
vastai update instanceUpdate recreate an instance from a new/updated template
vastai label instanceAssign a string label to an instance
vastai prepay instanceDeposit credits into reserved instance
vastai change bidChange the bid price for a spot/interruptible instance
vastai launch instanceLaunch the top instance from the search offers based on the given parameters
vastai executeExecute a (constrained) remote command on a machine
vastai logsGet the logs for an instance
vastai attach sshAttach an ssh key to an instance. This will allow you to connect to the instance with the ssh key
vastai detach sshDetach an ssh key from an instance
vastai ssh-urlssh url helper
vastai scp-urlscp url helper
vastai copyCopy directories between instances and/or local
vastai cloud copyCopy files/folders to and from cloud providers
vastai cancel copyCancel a remote copy in progress, specified by DST id
vastai cancel syncCancel a remote copy in progress, specified by DST id
vastai show connectionsDisplay user’s cloud connections
vastai take snapshotSchedule a snapshot of a running container and push it to your repo in a container registry

Search & Templates

CommandDescription
vastai search offersSearch for instance types using custom query
vastai search benchmarksSearch for benchmark results using custom query
vastai search templatesSearch for template results using custom query
vastai search invoicesSearch for invoices using custom query
vastai search volumesSearch for volume offers using custom query
vastai search network-volumesSearch for network volume offers using custom query
vastai create templateCreate a new template
vastai update templateUpdate an existing template
vastai delete templateDelete a Template

Volumes

CommandDescription
vastai create volumeCreate a new volume
vastai create network-volumeCreate a new network volume
vastai delete volumeDelete a volume
vastai clone volumeClone an existing volume
vastai show volumesShow stats on owned volumes.
vastai list volume[Host] list disk space for rent as a volume on a machine
vastai list volumes[Host] list disk space for rent as a volume on machines
vastai list network-volume[Host] list disk space for rent as a network volume
vastai unlist volume[Host] unlist volume offer
vastai unlist network-volume[Host] Unlists network volume offer

Serverless

CommandDescription
vastai create endpointCreate a new endpoint group
vastai show endpointsDisplay user’s current endpoint groups
vastai update endpointUpdate an existing endpoint group
vastai delete endpointDelete an endpoint group
vastai get endpt-logsFetch logs for a specific serverless endpoint group
vastai create workergroupCreate a new autoscale group
vastai show workergroupsDisplay user’s current workergroups
vastai update workergroupUpdate an existing autoscale group
vastai update workersTrigger a rolling update of all workers in a workergroup, or cancel an in-progress update
vastai delete workergroupDelete a workergroup group
vastai get wrkgrp-logsFetch logs for a specific serverless worker group
vastai show deploymentsDisplay user’s current deployments
vastai show deploymentDisplay a single deployment
vastai delete deploymentDelete a deployment by id, or by name and optional tag

Teams

CommandDescription
vastai create teamCreate a new team
vastai destroy teamDestroy your team
vastai create team-roleAdd a new role to your team
vastai show team-roleShow your team role
vastai show team-rolesShow roles for a team
vastai update team-roleUpdate an existing team role
vastai remove team-roleRemove a role from your team
vastai invite memberInvite a team member
vastai show membersShow your team members
vastai remove memberRemove a team member

Accounts & Keys

CommandDescription
vastai create api-keyCreate a new api-key with restricted permissions. Can be sent to other users and teammates
vastai show api-keysList your api-keys associated with your account
vastai delete api-keyRemove an api-key
vastai set api-keySet api-key (get your api-key from the console/CLI)
vastai create ssh-keyCreate a new ssh-key
vastai show ssh-keysList your ssh keys associated with your account
vastai delete ssh-keyRemove an ssh-key
vastai update ssh-keyUpdate an existing SSH key
vastai show userGet current user data
vastai set userUpdate user data from json file
vastai show subaccountsGet current subaccounts
vastai create subaccountCreate a subaccount
vastai show ipaddrsDisplay user’s history of ip addresses
vastai show audit-logsDisplay account’s history of important actions
vastai show env-varsShow user environment variables
vastai create env-varCreate a new user environment variable
vastai update env-varUpdate an existing user environment variable
vastai delete env-varDelete a user environment variable
vastai transfer creditTransfer credits to another account
vastai show scheduled-jobsDisplay the list of scheduled jobs
vastai delete scheduled-jobDelete a scheduled job
vastai tfa activateActivate a new 2FA method by verifying the code
vastai tfa deleteRemove a 2FA method from your account
vastai tfa loginComplete 2FA login by verifying code
vastai tfa resend-smsResend SMS 2FA code
vastai tfa regen-codesRegenerate backup codes for 2FA
vastai tfa send-smsRequest a 2FA SMS verification code
vastai tfa send-emailRequest a 2FA Email verification code
vastai tfa auth-newAuthorize your account to add a new 2FA method
vastai tfa statusShows the current 2FA status and configured methods
vastai tfa totp-setupGenerate TOTP secret and QR code for Authenticator app setup
vastai tfa updateUpdate a 2FA method’s settings

Billing

CommandDescription
vastai show invoicesGet billing (invoices/charges) history reports with advanced filtering and pagination
vastai show earningsGet machine earning history reports
vastai show depositDisplay reserve deposit info for an instance

Host

CommandDescription
vastai show machine[Host] Show hosted machines
vastai show machines[Host] Show hosted machines
vastai show maints[Host] Show maintenance information for host machines
vastai show network-disks[Host] Show network disks associated with your account.
vastai list machine[Host] list a machine for rent
vastai list machines[Host] list machines for rent
vastai unlist machine[Host] Unlist a listed machine
vastai delete machine[Host] Delete machine if the machine is not being used by clients. host jobs on their own machines are disregarded and machine is force deleted.
vastai cleanup machine[Host] Remove all expired storage instances from the machine, freeing up space
vastai defrag machines[Host] Defragment machines
vastai set min-bid[Host] Set the minimum bid/rental price for a machine
vastai set defjob[Host] Create default jobs for a machine
vastai remove defjob[Host] Delete default jobs
vastai schedule maint[Host] Schedule upcoming maint window
vastai cancel maint[Host] Cancel maint window
vastai add network-disk[Host] Add Network Disk to Physical Cluster.
vastai self-test machine[Host] Perform a self-test on the specified machine
vastai reportsGet the user reports for a given machine

Misc

CommandDescription
vastai benchmarkCompare GPU perf/cost using live marketplace data

Commands

Instances

show instance

Display user’s current instances
Text
usage: vastai show instance ID [options]

positional arguments:
 id                 id of instance to get

options:
 -h, --help         show this help message and exit
 -q, --quiet        only display numeric id

show instances

List instances with filtering, sorting, and pagination
Text
usage: vastai show instances [OPTIONS]

options:
 -h, --help                                       show this help message and exit
 -q, --quiet                                      only print instance IDs, one per line
 -v, --verbose                                    show additional columns (SSH, location, template, etc.)
 -a, --all                                        fetch all pages automatically; useful for scripting
 -s STATUS [STATUS ...], --status STATUS [STATUS ...]
                                                  filter by container status: running loading exited
 --label LABEL [LABEL ...]                        filter by instance label; pass empty string '' for unlabeled
 --gpu-name GPU [GPU ...]                         filter by GPU model name
 --verification VERIF [VERIF ...]                 filter by verification status
 -l LIMIT, --limit LIMIT                          max instances per page (1-25, default 25)
 -t NEXT_TOKEN, --next-token NEXT_TOKEN           resume from a pagination token
 --order-by COL [asc|desc]                        sort by column; repeat for multiple keys
 --cols COLS                                      override displayed columns (available: id,status,label,gpu,disk,volumes,dph,image,age,verified,machine,net,location,template,ssh,msg)

create instance

Create a new instance
Text
usage: vastai create instance ID [OPTIONS] [--args ...]

positional arguments:
 id                                id of instance type to launch (returned from search offers)

options:
 -h, --help                        show this help message and exit
 --template_hash TEMPLATE_HASH     Create instance from template info
 --user USER                       User to use with docker create. This breaks some images, so only use this if you are certain you need it.
 --disk DISK                       size of local disk partition in GB
 --image IMAGE                     docker container image to launch
 --login LOGIN                     docker login arguments for private repo authentication, surround with '' 
 --label LABEL                     label to set on the instance
 --onstart ONSTART                 filename to use as onstart script
 --onstart-cmd ONSTART_CMD         contents of onstart script as single argument
 --entrypoint ENTRYPOINT           override entrypoint for args launch instance
 --ssh                             Launch as an ssh instance type
 --jupyter                         Launch as a jupyter instance instead of an ssh instance
 --direct                          Use (faster) direct connections for jupyter & ssh
 --jupyter-dir JUPYTER_DIR         For runtype 'jupyter', directory in instance to use to launch jupyter. Defaults to image's working directory
 --jupyter-lab                     For runtype 'jupyter', Launch instance with jupyter lab
 --lang-utf8                       Workaround for images with locale problems: install and generate locales before instance launch, and set locale to C.UTF-8
 --python-utf8                     Workaround for images with locale problems: set python's locale to C.UTF-8
 --env ENV                         env variables and port mapping options, surround with '' 
 --args ...                        list of arguments passed to container ENTRYPOINT. Onstart is recommended for this purpose. (must be last argument)
 --force                           Skip sanity checks when creating from an existing instance
 --cancel-unavail                  Return error if scheduling fails (rather than creating a stopped instance)
 --bid_price BID_PRICE             (OPTIONAL) create an INTERRUPTIBLE instance with per machine bid price in $/hour
 --create-volume VOLUME_ASK_ID     Create a new local volume using an ID returned from the "search volumes" command and link it to the new instance
 --link-volume EXISTING_VOLUME_ID  ID of an existing rented volume to link to the instance during creation. (returned from "show volumes" cmd)
 --volume-size VOLUME_SIZE         Size of the volume to create in GB. Only usable with --create-volume (default 15GB)
 --mount-path MOUNT_PATH           The path to the volume from within the new instance container. e.g. /root/volume
 --volume-label VOLUME_LABEL       (optional) A name to give the new volume. Only usable with --create-volume

create instances

Create instances from a list of offers
Text
usage: vastai create instances [OPTIONS] ID0 ID1 ID2... [--args ...]

positional arguments:
 ids                               ids of instance types to launch (returned from search offers)

options:
 -h, --help                        show this help message and exit
 --template_hash TEMPLATE_HASH     Create instance from template info
 --user USER                       User to use with docker create. This breaks some images, so only use this if you are certain you need it.
 --disk DISK                       size of local disk partition in GB
 --image IMAGE                     docker container image to launch
 --login LOGIN                     docker login arguments for private repo authentication, surround with '' 
 --label LABEL                     label to set on the instance
 --onstart ONSTART                 filename to use as onstart script
 --onstart-cmd ONSTART_CMD         contents of onstart script as single argument
 --entrypoint ENTRYPOINT           override entrypoint for args launch instance
 --ssh                             Launch as an ssh instance type
 --jupyter                         Launch as a jupyter instance instead of an ssh instance
 --direct                          Use (faster) direct connections for jupyter & ssh
 --jupyter-dir JUPYTER_DIR         For runtype 'jupyter', directory in instance to use to launch jupyter. Defaults to image's working directory
 --jupyter-lab                     For runtype 'jupyter', Launch instance with jupyter lab
 --lang-utf8                       Workaround for images with locale problems: install and generate locales before instance launch, and set locale to C.UTF-8
 --python-utf8                     Workaround for images with locale problems: set python's locale to C.UTF-8
 --env ENV                         env variables and port mapping options, surround with '' 
 --args ...                        list of arguments passed to container ENTRYPOINT. Onstart is recommended for this purpose. (must be last argument)
 --force                           Skip sanity checks when creating from an existing instance
 --cancel-unavail                  Return error if scheduling fails (rather than creating a stopped instance)
 --bid_price BID_PRICE             (OPTIONAL) create an INTERRUPTIBLE instance with per machine bid price in $/hour
 --create-volume VOLUME_ASK_ID     Create a new local volume using an ID returned from the "search volumes" command and link it to the new instance
 --link-volume EXISTING_VOLUME_ID  ID of an existing rented volume to link to the instance during creation. (returned from "show volumes" cmd)
 --volume-size VOLUME_SIZE         Size of the volume to create in GB. Only usable with --create-volume (default 15GB)
 --mount-path MOUNT_PATH           The path to the volume from within the new instance container. e.g. /root/volume
 --volume-label VOLUME_LABEL       (optional) A name to give the new volume. Only usable with --create-volume

destroy instance

Destroy an instance (irreversible, deletes data)
Text
usage: vastai destroy instance id [-h] [-y] [--api-key API_KEY] [--raw]

positional arguments:
 id                 id of instance to delete

options:
 -h, --help         show this help message and exit
 -y, --yes          Skip confirmation prompt

destroy instances

Destroy a list of instances (irreversible, deletes data)
Text
usage: vastai destroy instances [--raw] [-y] <id> [<id> ...]

positional arguments:
 ids                ids of instance to destroy

options:
 -h, --help         show this help message and exit
 -y, --yes          Skip confirmation prompt

start instance

Start a stopped instance
Text
usage: vastai start instance ID [OPTIONS]

positional arguments:
 id                 ID of instance to start/restart

options:
 -h, --help         show this help message and exit

start instances

Start a list of instances
Text
usage: vastai start instances [OPTIONS] ID0 ID1 ID2...

positional arguments:
 ids                ids of instance to start

options:
 -h, --help         show this help message and exit

stop instance

Stop a running instance
Text
usage: vastai stop instance ID [OPTIONS]

positional arguments:
 id                 id of instance to stop

options:
 -h, --help         show this help message and exit

stop instances

Stop a list of instances
Text
usage: vastai stop instances [OPTIONS] ID0 ID1 ID2...

positional arguments:
 ids                ids of instance to stop

options:
 -h, --help         show this help message and exit

reboot instance

Reboot (stop/start) an instance
Text
usage: vastai reboot instance ID [OPTIONS]

positional arguments:
 id                                id of instance to reboot

options:
 -h, --help                        show this help message and exit
 --schedule {HOURLY,DAILY,WEEKLY}  try to schedule a command to run hourly, daily, or weekly. Valid values are HOURLY, DAILY, WEEKLY  For ex. --schedule DAILY
 --start_date START_DATE           Start date/time in format 'YYYY-MM-DD HH:MM:SS PM' (UTC). Default is now. (optional)
 --end_date END_DATE               End date/time in format 'YYYY-MM-DD HH:MM:SS PM' (UTC). Default is 7 days from now. (optional)
 --day DAY                         Day of week you want scheduled job to run on (0-6, where 0=Sunday) or "*". Default will be 0. For ex. --day 0
 --hour HOUR                       Hour of day you want scheduled job to run on (0-23) or "*" (UTC). Default will be 0. For ex. --hour 16

recycle instance

Recycle (destroy/create) an instance
Text
usage: vastai recycle instance ID [OPTIONS]

positional arguments:
 id                 id of instance to recycle

options:
 -h, --help         show this help message and exit

update instance

Update recreate an instance from a new/updated template
Text
usage: vastai update instance ID [OPTIONS]

positional arguments:
 id                                   id of instance to update

options:
 -h, --help                           show this help message and exit
 --template_id TEMPLATE_ID            new template ID to associate with the instance
 --template_hash_id TEMPLATE_HASH_ID  new template hash ID to associate with the instance
 --image IMAGE                        new image UUID for the instance
 --args ARGS                          new arguments for the instance
 --env ENV                            new environment variables for the instance
 --onstart ONSTART                    new onstart script for the instance

label instance

Assign a string label to an instance
Text
usage: vastai label instance <id> <label>

positional arguments:
 id                 id of instance to label
 label              label to set

options:
 -h, --help         show this help message and exit

prepay instance

Deposit credits into reserved instance
Text
usage: vastai prepay instance ID AMOUNT

positional arguments:
 id                 id of instance to prepay for
 amount             amount of instance credit prepayment (default discount func of 0.2 for 1 month, 0.3 for 3 months)

options:
 -h, --help         show this help message and exit

change bid

Change the bid price for a spot/interruptible instance
Text
usage: vastai change bid id [--price PRICE]

positional arguments:
 id                                id of instance type to change bid

options:
 -h, --help                        show this help message and exit
 --price PRICE                     per machine bid price in $/hour
 --schedule {HOURLY,DAILY,WEEKLY}  try to schedule a command to run hourly, daily, or weekly. Valid values are HOURLY, DAILY, WEEKLY  For ex. --schedule DAILY
 --start_date START_DATE           Start date/time in format 'YYYY-MM-DD HH:MM:SS PM' (UTC). Default is now. (optional)
 --end_date END_DATE               End date/time in format 'YYYY-MM-DD HH:MM:SS PM' (UTC). Default is 7 days from now. (optional)
 --day DAY                         Day of week you want scheduled job to run on (0-6, where 0=Sunday) or "*". Default will be 0. For ex. --day 0
 --hour HOUR                       Hour of day you want scheduled job to run on (0-23) or "*" (UTC). Default will be 0. For ex. --hour 16

launch instance

Launch the top instance from the search offers based on the given parameters
Text
usage: vastai launch instance [--help] [--api-key API_KEY] <gpu_name> <num_gpus> <image> [geolocation] [disk_space]

options:
 -h, --help                                       show this help message and exit
 -g {A10,A100_PCIE,A100_SXM4,A100X,A10g,A40,A800_PCIE,B200,GTX_1050,GTX_1050_Ti,GTX_1060,GTX_1070,GTX_1070_Ti,GTX_1080,GTX_1080_Ti,GTX_1650,GTX_1650_S,GTX_1660,GTX_1660_S,GTX_1660_Ti,H100_NVL,H100_PCIE,H100_SXM,H200,H200_NVL,L4,L40,L40S,Q_RTX_4000,Q_RTX_5000,Q_RTX_6000,Q_RTX_8000,Quadro_P2000,Quadro_P4000,RTX_2000Ada,RTX_2060,RTX_2060S,RTX_2070,RTX_2070S,RTX_2080,RTX_2080S,RTX_2080_Ti,RTX_3050,RTX_3060,RTX_3060_laptop,RTX_3060_Ti,RTX_3070,RTX_3070_laptop,RTX_3070_Ti,RTX_3080,RTX_3080_Ti,RTX_3090,RTX_3090_Ti,RTX_4000Ada,RTX_4060,RTX_4060_Ti,RTX_4070,RTX_4070S,RTX_4070S_Ti,RTX_4070_Ti,RTX_4080,RTX_4080S,RTX_4090,RTX_4090D,RTX_4500Ada,RTX_5000Ada,RTX_5060,RTX_5060_Ti,RTX_5070,RTX_5070_Ti,RTX_5080,RTX_5090,RTX_5880Ada,RTX_6000Ada,RTX_A2000,RTX_A4000,RTX_A4500,RTX_A5000,RTX_A6000,RTX_PRO_4000,RTX_PRO_4500,RTX_PRO_5000,RTX_PRO_6000_S,RTX_PRO_6000_WS,RX_6900_XT,Tesla_M40,Tesla_P100,Tesla_P4,Tesla_P40,Tesla_T4,Tesla_V100,Titan_RTX,Titan_V,Titan_Xp}, --gpu-name {A10,A100_PCIE,A100_SXM4,A100X,A10g,A40,A800_PCIE,B200,GTX_1050,GTX_1050_Ti,GTX_1060,GTX_1070,GTX_1070_Ti,GTX_1080,GTX_1080_Ti,GTX_1650,GTX_1650_S,GTX_1660,GTX_1660_S,GTX_1660_Ti,H100_NVL,H100_PCIE,H100_SXM,H200,H200_NVL,L4,L40,L40S,Q_RTX_4000,Q_RTX_5000,Q_RTX_6000,Q_RTX_8000,Quadro_P2000,Quadro_P4000,RTX_2000Ada,RTX_2060,RTX_2060S,RTX_2070,RTX_2070S,RTX_2080,RTX_2080S,RTX_2080_Ti,RTX_3050,RTX_3060,RTX_3060_laptop,RTX_3060_Ti,RTX_3070,RTX_3070_laptop,RTX_3070_Ti,RTX_3080,RTX_3080_Ti,RTX_3090,RTX_3090_Ti,RTX_4000Ada,RTX_4060,RTX_4060_Ti,RTX_4070,RTX_4070S,RTX_4070S_Ti,RTX_4070_Ti,RTX_4080,RTX_4080S,RTX_4090,RTX_4090D,RTX_4500Ada,RTX_5000Ada,RTX_5060,RTX_5060_Ti,RTX_5070,RTX_5070_Ti,RTX_5080,RTX_5090,RTX_5880Ada,RTX_6000Ada,RTX_A2000,RTX_A4000,RTX_A4500,RTX_A5000,RTX_A6000,RTX_PRO_4000,RTX_PRO_4500,RTX_PRO_5000,RTX_PRO_6000_S,RTX_PRO_6000_WS,RX_6900_XT,Tesla_M40,Tesla_P100,Tesla_P4,Tesla_P40,Tesla_T4,Tesla_V100,Titan_RTX,Titan_V,Titan_Xp}
                                                  Name of the GPU model, replace spaces with underscores
 -n {1,2,4,8,12,14}, --num-gpus {1,2,4,8,12,14}   Number of GPUs required
 -r REGION, --region REGION                       Geographical location of the instance
 -i IMAGE, --image IMAGE                          Name of the image to use for instance
 -d DISK, --disk DISK                             Disk space required in GB
 --limit LIMIT
 -o ORDER, --order ORDER                          Comma-separated list of fields to sort on. postfix field with - to sort desc. ex: -o 'num_gpus,total_flops-'.  default='score-'
 --login LOGIN                                    docker login arguments for private repo authentication, surround with '' 
 --label LABEL                                    label to set on the instance
 --onstart ONSTART                                filename to use as onstart script
 --onstart-cmd ONSTART_CMD                        contents of onstart script as single argument
 --entrypoint ENTRYPOINT                          override entrypoint for args launch instance
 --ssh                                            Launch as an ssh instance type
 --jupyter                                        Launch as a jupyter instance instead of an ssh instance
 --direct                                         Use (faster) direct connections for jupyter & ssh
 --jupyter-dir JUPYTER_DIR                        For runtype 'jupyter', directory in instance to use to launch jupyter. Defaults to image's working directory
 --jupyter-lab                                    For runtype 'jupyter', Launch instance with jupyter lab
 --lang-utf8                                      Workaround for images with locale problems: install and generate locales before instance launch, and set locale to C.UTF-8
 --python-utf8                                    Workaround for images with locale problems: set python's locale to C.UTF-8
 --env ENV                                        env variables and port mapping options, surround with '' 
 --args ...                                       list of arguments passed to container ENTRYPOINT. Onstart is recommended for this purpose. (must be last argument)
 --force                                          Skip sanity checks when creating from an existing instance
 --cancel-unavail                                 Return error if scheduling fails (rather than creating a stopped instance)
 --template_hash TEMPLATE_HASH                    template hash which contains all relevant information about an instance. This can be used as a replacement for other parameters describing the instance configuration

execute

Execute a (constrained) remote command on a machine
Text
usage: vastai execute id COMMAND

positional arguments:
 id                                id of instance to execute on
 COMMAND                           bash command surrounded by single quotes

options:
 -h, --help                        show this help message and exit
 --schedule {HOURLY,DAILY,WEEKLY}  try to schedule a command to run hourly, daily, or weekly. Valid values are HOURLY, DAILY, WEEKLY  For ex. --schedule DAILY
 --start_date START_DATE           Start date/time in format 'YYYY-MM-DD HH:MM:SS PM' (UTC). Default is now. (optional)
 --end_date END_DATE               End date/time in format 'YYYY-MM-DD HH:MM:SS PM' (UTC). Default is 7 days from now. (optional)
 --day DAY                         Day of week you want scheduled job to run on (0-6, where 0=Sunday) or "*". Default will be 0. For ex. --day 0
 --hour HOUR                       Hour of day you want scheduled job to run on (0-23) or "*" (UTC). Default will be 0. For ex. --hour 16

logs

Get the logs for an instance
Text
usage: vastai logs INSTANCE_ID [OPTIONS] 

positional arguments:
 INSTANCE_ID        id of instance

options:
 -h, --help         show this help message and exit
 --tail TAIL        Number of lines to show from the end of the logs (default '1000')
 --filter FILTER    Grep filter for log entries
 --daemon-logs      Fetch daemon system logs instead of container logs

attach ssh

Attach an ssh key to an instance. This will allow you to connect to the instance with the ssh key
Text
usage: vastai attach ssh instance_id ssh_key

positional arguments:
 instance_id        id of instance to attach to
 ssh_key            ssh key to attach to instance

options:
 -h, --help         show this help message and exit

detach ssh

Detach an ssh key from an instance
Text
usage: vastai detach instance_id ssh_key_id

positional arguments:
 instance_id        id of the instance
 ssh_key_id         id of the key to detach from the instance

options:
 -h, --help         show this help message and exit

ssh-url

ssh url helper
Text
usage: vastai ssh-url ID

positional arguments:
 id                 id of instance

options:
 -h, --help         show this help message and exit

scp-url

scp url helper
Text
usage: vastai scp-url ID

positional arguments:
 id                 id

options:
 -h, --help         show this help message and exit

copy

Copy directories between instances and/or local
Text
usage: vastai copy SRC DST

positional arguments:
 src                               Source location for copy operation (supports multiple formats)
 dst                               Target location for copy operation (supports multiple formats)

options:
 -h, --help                        show this help message and exit
 -i IDENTITY, --identity IDENTITY  Location of ssh private key

cloud copy

Copy files/folders to and from cloud providers
Text
usage: vastai cloud copy --src SRC --dst DST --instance INSTANCE_ID --connection CONNECTION_ID --transfer TRANSFER_TYPE

options:
 -h, --help                        show this help message and exit
 --src SRC                         path to source of object to copy
 --dst DST                         path to target of copy operation
 --instance INSTANCE               id of the instance
 --connection CONNECTION           id of cloud connection on your account (get from calling 'vastai show connections')
 --transfer TRANSFER               type of transfer, possible options include Instance To Cloud and Cloud To Instance
 --dry-run                         show what would have been transferred
 --size-only                       skip based on size only, not mod-time or checksum
 --ignore-existing                 skip all files that exist on destination
 --update                          skip files that are newer on the destination
 --delete-excluded                 delete files on dest excluded from transfer
 --schedule {HOURLY,DAILY,WEEKLY}  try to schedule a command to run hourly, daily, or weekly. Valid values are HOURLY, DAILY, WEEKLY  For ex. --schedule DAILY
 --start_date START_DATE           Start date/time in format 'YYYY-MM-DD HH:MM:SS PM' (UTC). Default is now. (optional)
 --end_date END_DATE               End date/time in format 'YYYY-MM-DD HH:MM:SS PM' (UTC). Default is contract's end. (optional)
 --day DAY                         Day of week you want scheduled job to run on (0-6, where 0=Sunday) or "*". Default will be 0. For ex. --day 0
 --hour HOUR                       Hour of day you want scheduled job to run on (0-23) or "*" (UTC). Default will be 0. For ex. --hour 16

cancel copy

Cancel a remote copy in progress, specified by DST id
Text
usage: vastai cancel copy DST

positional arguments:
 dst                instance_id:/path to target of copy operation

options:
 -h, --help         show this help message and exit

cancel sync

Cancel a remote copy in progress, specified by DST id
Text
usage: vastai cancel sync DST

positional arguments:
 dst                instance_id:/path to target of sync operation

options:
 -h, --help         show this help message and exit

show connections

Display user’s cloud connections
Text
usage: vastai show connections [--api-key API_KEY] [--raw]

options:
 -h, --help         show this help message and exit

take snapshot

Schedule a snapshot of a running container and push it to your repo in a container registry
Text
usage: vastai take snapshot INSTANCE_ID --repo REPO --docker_login_user USER --docker_login_pass PASS[--container_registry REGISTRY] [--pause true|false]

positional arguments:
 instance_id                              instance_id of the container instance to snapshot

options:
 -h, --help                               show this help message and exit
 --container_registry CONTAINER_REGISTRY  Container registry to push the snapshot to. Default will be docker.io
 --repo REPO                              repo to push the snapshot to
 --docker_login_user DOCKER_LOGIN_USER    Username for container registry with repo
 --docker_login_pass DOCKER_LOGIN_PASS    Password or token for container registry with repo
 --pause PAUSE                            Pause container's processes being executed by the CPU to take snapshot (true/false). Default will be true

Search & Templates

search offers

Search for instance types using custom query
Text
usage: vastai search offers [--help] [--api-key API_KEY] [--raw] <query>

positional arguments:
 query                    Query to search for. default: 'external=false rentable=true verified=true', pass -n to ignore default

options:
 -h, --help               show this help message and exit
 -t TYPE, --type TYPE     Show 'on-demand', 'reserved', or 'bid'(interruptible) pricing. default: on-demand
 -i, --interruptible      Alias for --type=bid
 -b, --bid                Alias for --type=bid
 -r, --reserved           Alias for --type=reserved
 -d, --on-demand          Alias for --type=on-demand
 -n, --no-default         Disable default query
 --new                    New search exp
 --limit LIMIT
 --storage STORAGE        Amount of storage to use for pricing, in GiB. default=5.0GiB
 -o ORDER, --order ORDER  Comma-separated list of fields to sort on. postfix field with - to sort desc. ex: -o 'num_gpus,total_flops-'.  default='score-'

search benchmarks

Search for benchmark results using custom query
Text
usage: vastai search benchmarks [--help] [--api-key API_KEY] [--raw] <query>

positional arguments:
 query              Search query in simple query syntax (see below)

options:
 -h, --help         show this help message and exit

search templates

Search for template results using custom query
Text
usage: vastai search templates [--help] [--api-key API_KEY] [--raw] <query>

positional arguments:
 query              Search query in simple query syntax (see below)

options:
 -h, --help         show this help message and exit

search invoices

Search for invoices using custom query
Text
usage: vastai search invoices [--help] [--api-key API_KEY] [--raw] <query>

positional arguments:
 query              Search query in simple query syntax (see below)

options:
 -h, --help         show this help message and exit

search volumes

Search for volume offers using custom query
Text
usage: vastai search volumes [--help] [--api-key API_KEY] [--raw] <query>

positional arguments:
 query                    Query to search for. default: 'external=false verified=true disk_space>=1', pass -n to ignore default

options:
 -h, --help               show this help message and exit
 -n, --no-default         Disable default query
 --limit LIMIT
 --storage STORAGE        Amount of storage to use for pricing, in GiB. default=1.0GiB
 -o ORDER, --order ORDER  Comma-separated list of fields to sort on. postfix field with - to sort desc. ex: -o 'disk_space,inet_up-'.  default='score-'

search network-volumes

Search for network volume offers using custom query
Text
usage: vastai search network volumes [--help] [--api-key API_KEY] [--raw] <query>

positional arguments:
 query                    Query to search for. default: 'external=false verified=true disk_space>=1', pass -n to ignore default

options:
 -h, --help               show this help message and exit
 -n, --no-default         Disable default query
 --limit LIMIT
 --storage STORAGE        Amount of storage to use for pricing, in GiB. default=1.0GiB
 -o ORDER, --order ORDER  Comma-separated list of fields to sort on. postfix field with - to sort desc. ex: -o 'disk_space,inet_up-'.  default='score-'

create template

Create a new template
Text
usage: vastai create template

options:
 -h, --help                     show this help message and exit
 --name NAME                    name of the template
 --image IMAGE                  docker container image to launch
 --image_tag IMAGE_TAG          docker image tag
 --href HREF                    link you want to provide
 --repo REPO                    link to repository
 --login LOGIN                  docker login arguments for private repo authentication, surround with ''
 --env ENV                      Contents of the 'Docker options' field
 --ssh                          Launch as an ssh instance type
 --jupyter                      Launch as a jupyter instance instead of an ssh instance
 --direct                       Use (faster) direct connections for jupyter & ssh
 --jupyter-dir JUPYTER_DIR      For runtype 'jupyter', directory in instance to use to launch jupyter
 --jupyter-lab                  For runtype 'jupyter', Launch instance with jupyter lab
 --onstart-cmd ONSTART_CMD      contents of onstart script as single argument
 --search_params SEARCH_PARAMS  search offers filters
 -n, --no-default               Disable default search param query args
 --disk_space DISK_SPACE        disk storage space, in GB
 --readme README                readme string
 --hide-readme                  hide the readme from users
 --desc DESC                    description string
 --public                       make template available to public

update template

Update an existing template
Text
usage: vastai update template HASH_ID

positional arguments:
 HASH_ID                        hash id of the template

options:
 -h, --help                     show this help message and exit
 --name NAME                    name of the template
 --image IMAGE                  docker container image to launch
 --image_tag IMAGE_TAG          docker image tag
 --href HREF                    link you want to provide
 --repo REPO                    link to repository
 --login LOGIN                  docker login arguments for private repo authentication, surround with ''
 --env ENV                      Contents of the 'Docker options' field
 --ssh                          Launch as an ssh instance type
 --jupyter                      Launch as a jupyter instance instead of an ssh instance
 --direct                       Use (faster) direct connections for jupyter & ssh
 --jupyter-dir JUPYTER_DIR      For runtype 'jupyter', directory in instance to use to launch jupyter
 --jupyter-lab                  For runtype 'jupyter', Launch instance with jupyter lab
 --onstart-cmd ONSTART_CMD      contents of onstart script as single argument
 --search_params SEARCH_PARAMS  search offers filters
 -n, --no-default               Disable default search param query args
 --disk_space DISK_SPACE        disk storage space, in GB
 --readme README                readme string
 --hide-readme                  hide the readme from users
 --desc DESC                    description string
 --public                       make template available to public

delete template

Delete a Template
Text
usage: vastai delete template [--template-id <id> | --hash-id <hash_id>]

options:
 -h, --help                 show this help message and exit
 --template-id TEMPLATE_ID  Template ID of Template to Delete
 --hash-id HASH_ID          Hash ID of Template to Delete

Volumes

create volume

Create a new volume
Text
usage: vastai create volume ID [options]

positional arguments:
 id                    id of volume offer

options:
 -h, --help            show this help message and exit
 -s SIZE, --size SIZE  size in GB of volume. Default 15 GB.
 -n NAME, --name NAME  Optional name of volume.

create network-volume

Create a new network volume
Text
usage: vastai create network volume ID [options]

positional arguments:
 id                    id of network volume offer

options:
 -h, --help            show this help message and exit
 -s SIZE, --size SIZE  size in GB of network volume. Default 15 GB.
 -n NAME, --name NAME  Optional name of network volume.

delete volume

Delete a volume
Text
usage: vastai delete volume ID

positional arguments:
 id                 id of volume contract

options:
 -h, --help         show this help message and exit

clone volume

Clone an existing volume
Text
usage: vastai clone volume <source_id> <dest_id> [options]

positional arguments:
 source                     id of volume contract being cloned
 dest                       id of volume offer volume is being copied to

options:
 -h, --help                 show this help message and exit
 -s SIZE, --size SIZE       Size of new volume contract, in GB. Must be greater than or equal to the source volume, and less than or equal to the destination offer.
 -d, --disable_compression  Do not compress volume data before copying.

show volumes

Show stats on owned volumes.
Text
usage: vastai show volumes [OPTIONS]

options:
 -h, --help            show this help message and exit
 -t TYPE, --type TYPE  volume type to display. Default to all. Possible values are "local", "all", "network"

list volume

[Host] list disk space for rent as a volume on a machine
Text
usage: vastai list volume ID [options]

positional arguments:
 id                                      id of machine to list

options:
 -h, --help                              show this help message and exit
 -p PRICE_DISK, --price_disk PRICE_DISK  storage price in $/GB/month, default: $0.10/GB/month
 -e END_DATE, --end_date END_DATE        contract offer expiration - the available until date (optional, in unix float timestamp or MM/DD/YYYY format), default 3 months
 -s SIZE, --size SIZE                    size of disk space allocated to offer in GB, default 15 GB

list volumes

[Host] list disk space for rent as a volume on machines
Text
usage: vastai list volume IDs [options]

positional arguments:
 ids                                     id of machines list

options:
 -h, --help                              show this help message and exit
 -p PRICE_DISK, --price_disk PRICE_DISK  storage price in $/GB/month, default: $0.10/GB/month
 -e END_DATE, --end_date END_DATE        contract offer expiration - the available until date (optional, in unix float timestamp or MM/DD/YYYY format), default 3 months
 -s SIZE, --size SIZE                    size of disk space allocated to offer in GB, default 15 GB

list network-volume

[Host] list disk space for rent as a network volume
Text
usage: vastai list network volume DISK_ID [options]

positional arguments:
 disk_id                                 id of network disk to list

options:
 -h, --help                              show this help message and exit
 -p PRICE_DISK, --price_disk PRICE_DISK  storage price in $/GB/month, default: $0.15/GB/month
 -e END_DATE, --end_date END_DATE        contract offer expiration - the available until date (optional, in unix float timestamp or MM/DD/YYYY format), default 1 month
 -s SIZE, --size SIZE                    size of disk space allocated to offer in GB, default 15 GB

unlist volume

[Host] unlist volume offer
Text
usage: vastai unlist volume ID

positional arguments:
 id                 volume ID you want to unlist

options:
 -h, --help         show this help message and exit

unlist network-volume

[Host] Unlists network volume offer
Text
usage: vastai unlist network volume OFFER_ID

positional arguments:
 id                 id of network volume offer to unlist

options:
 -h, --help         show this help message and exit

Serverless

create endpoint

Create a new endpoint group
Text
usage: vastai create endpoint [OPTIONS]

options:
 -h, --help                               show this help message and exit
 --min_load MIN_LOAD                      minimum floor load in perf units/s  (token/s for LLms)
 --min_cold_load MIN_COLD_LOAD            minimum floor load in perf units/s (token/s for LLms), but allow handling with cold workers
 --target_util TARGET_UTIL                target capacity utilization (fraction, max 1.0, default 0.9)
 --cold_mult COLD_MULT                    cold/stopped instance capacity target as multiple of hot capacity target (default 2.5)
 --cold_workers COLD_WORKERS              min number of workers to keep 'cold' when you have no load (default 5)
 --max_workers MAX_WORKERS                max number of workers your endpoint group can have (default 20)
 --endpoint_name ENDPOINT_NAME            deployment endpoint name (allows multiple autoscale groups to share same deployment endpoint)
 --max_queue_time MAX_QUEUE_TIME          maximum seconds requests may be queued on each worker (default 30.0)
 --target_queue_time TARGET_QUEUE_TIME    target seconds for the queue to be cleared (default 10.0)
 --inactivity_timeout INACTIVITY_TIMEOUT  seconds of no traffic before the endpoint can scale to zero active workers

show endpoints

Display user’s current endpoint groups
Text
usage: vastai show endpoints [--api-key API_KEY]

options:
 -h, --help         show this help message and exit

update endpoint

Update an existing endpoint group
Text
usage: vastai update endpoint ID [OPTIONS]

positional arguments:
 id                                       id of endpoint group to update

options:
 -h, --help                               show this help message and exit
 --min_load MIN_LOAD                      minimum floor load in perf units/s  (token/s for LLms)
 --min_cold_load MIN_COLD_LOAD            minimum floor load in perf units/s  (token/s for LLms), but allow handling with cold workers
 --endpoint_state ENDPOINT_STATE          active, suspended, or stopped
 --target_util TARGET_UTIL                target capacity utilization (fraction, max 1.0, default 0.9)
 --cold_mult COLD_MULT                    cold/stopped instance capacity target as multiple of hot capacity target (default 2.5)
 --cold_workers COLD_WORKERS              min number of workers to keep 'cold' when you have no load (default 5)
 --max_workers MAX_WORKERS                max number of workers your endpoint group can have (default 20)
 --endpoint_name ENDPOINT_NAME            deployment endpoint name (allows multiple workergroups to share same deployment endpoint)
 --max_queue_time MAX_QUEUE_TIME          maximum seconds requests may be queued on each worker (default 30.0)
 --target_queue_time TARGET_QUEUE_TIME    target seconds for the queue to be cleared (default 10.0)
 --inactivity_timeout INACTIVITY_TIMEOUT  seconds of no traffic before the endpoint can scale to zero active workers

delete endpoint

Delete an endpoint group
Text
usage: vastai delete endpoint ID 

positional arguments:
 id                 id of endpoint group to delete

options:
 -h, --help         show this help message and exit

get endpt-logs

Fetch logs for a specific serverless endpoint group
Text
usage: vastai get endpt-logs ID [--api-key API_KEY]

positional arguments:
 id                 id of endpoint group to fetch logs from

options:
 -h, --help         show this help message and exit
 --level LEVEL      log detail level (0 to 3)
 --tail TAIL

create workergroup

Create a new autoscale group
Text
usage: vastai create workergroup [OPTIONS]

options:
 -h, --help                     show this help message and exit
 --template_hash TEMPLATE_HASH  template hash (required, but **Note**: if you use this field, you can skip search_params, as they are automatically inferred from the template)
 --template_id TEMPLATE_ID      template id (optional)
 -n, --no-default               Disable default search param query args
 --launch_args LAUNCH_ARGS      launch args  string for create instance  ex: "--onstart onstart_wget.sh  --env '-e ONSTART_PATH=https://s3.amazonaws.com/vast.ai/onstart_OOBA.sh' --image atinoda/text-generation-webui:default-nightly --disk 64"
 --endpoint_name ENDPOINT_NAME  deployment endpoint name (allows multiple workergroups to share same deployment endpoint)
 --endpoint_id ENDPOINT_ID      deployment endpoint id (allows multiple workergroups to share same deployment endpoint)
 --test_workers TEST_WORKERS    number of workers to create to get an performance estimate for while initializing workergroup (default 3)
 --gpu_ram GPU_RAM              estimated GPU RAM req  (independent of search string)
 --search_params SEARCH_PARAMS  search param string for search offers    ex: "gpu_ram>=23 num_gpus=2 gpu_name=RTX_4090 inet_down>200 direct_port_count>2 disk_space>=64"
 --min_load MIN_LOAD            [NOTE: this field isn't currently used at the workergroup level] minimum floor load in perf units/s  (token/s for LLms)
 --target_util TARGET_UTIL      [NOTE: this field isn't currently used at the workergroup level] target capacity utilization (fraction, max 1.0, default 0.9)
 --cold_mult COLD_MULT          [NOTE: this field isn't currently used at the workergroup level]cold/stopped instance capacity target as multiple of hot capacity target (default 2.0)
 --cold_workers COLD_WORKERS    min number of workers to keep 'cold' for this workergroup

show workergroups

Display user’s current workergroups
Text
usage: vastai show workergroups [--api-key API_KEY]

options:
 -h, --help         show this help message and exit

update workergroup

Update an existing autoscale group
Text
usage: vastai update workergroup WORKERGROUP_ID --endpoint_id ENDPOINT_ID [options]

positional arguments:
 id                             id of autoscale group to update

options:
 -h, --help                     show this help message and exit
 --min_load MIN_LOAD            minimum floor load in perf units/s  (token/s for LLms)
 --target_util TARGET_UTIL      target capacity utilization (fraction, max 1.0, default 0.9)
 --cold_mult COLD_MULT          cold/stopped instance capacity target as multiple of hot capacity target (default 2.5)
 --cold_workers COLD_WORKERS    min number of workers to keep 'cold' for this workergroup
 --test_workers TEST_WORKERS    number of workers to create to get an performance estimate for while initializing workergroup (default 3)
 --gpu_ram GPU_RAM              estimated GPU RAM req  (independent of search string)
 --template_hash TEMPLATE_HASH  template hash (**Note**: if you use this field, you can skip search_params, as they are automatically inferred from the template)
 --template_id TEMPLATE_ID      template id
 --search_params SEARCH_PARAMS  search param string for search offers    ex: "gpu_ram>=23 num_gpus=2 gpu_name=RTX_4090 inet_down>200 direct_port_count>2 disk_space>=64"
 -n, --no-default               Disable default search param query args
 --launch_args LAUNCH_ARGS      launch args  string for create instance  ex: "--onstart onstart_wget.sh  --env '-e ONSTART_PATH=https://s3.amazonaws.com/public.vast.ai/onstart_OOBA.sh' --image atinoda/text-generation-webui:default-nightly --disk 64"
 --endpoint_name ENDPOINT_NAME  deployment endpoint name (allows multiple workergroups to share same deployment endpoint)
 --endpoint_id ENDPOINT_ID      deployment endpoint id (allows multiple workergroups to share same deployment endpoint)

update workers

Trigger a rolling update of all workers in a workergroup, or cancel an in-progress update
Text
usage: vastai update workers WORKERGROUP_ID [--cancel]

positional arguments:
 id                 id of workergroup to update workers for

options:
 -h, --help         show this help message and exit
 --cancel           cancel an in-progress update for the workergroup

delete workergroup

Delete a workergroup group
Text
usage: vastai delete workergroup ID 

positional arguments:
 id                 id of group to delete

options:
 -h, --help         show this help message and exit

get wrkgrp-logs

Fetch logs for a specific serverless worker group
Text
usage: vastai get wrkgrp-logs ID [--api-key API_KEY]

positional arguments:
 id                 id of workergroup to fetch logs from

options:
 -h, --help         show this help message and exit
 --level LEVEL      log detail level (0 to 3)
 --tail TAIL

show deployments

Display user’s current deployments
Text
usage: vastai show deployments [OPTIONS]

options:
 -h, --help         show this help message and exit
 -q, --quiet        only display numeric ids

show deployment

Display a single deployment
Text
usage: vastai show deployment ID [OPTIONS]

positional arguments:
 id                 id of deployment to show info for

options:
 -h, --help         show this help message and exit
 -q, --quiet        only display numeric id

delete deployment

Delete a deployment by id, or by name and optional tag
Text
usage: vastai delete deployment [ID | --name NAME [--tag TAG]]

positional arguments:
 id                 id of deployment to delete

options:
 -h, --help         show this help message and exit
 --name NAME        name of deployment to delete (deletes all tags unless --tag is specified)
 --tag TAG          tag to filter by when deleting by name

Teams

create team

Create a new team
Text
usage: vastai create-team --team-name TEAM_NAME [--transfer-credit AMOUNT]

options:
 -h, --help                         show this help message and exit
 --team-name TEAM_NAME              name of the team
 --transfer-credit TRANSFER_CREDIT  amount of personal credit to transfer to the new team

destroy team

Destroy your team
Text
usage: vastai destroy team

options:
 -h, --help         show this help message and exit

create team-role

Add a new role to your team
Text
usage: vastai create team-role --name NAME --permissions PERMISSIONS

options:
 -h, --help                 show this help message and exit
 --name NAME                name of the role
 --permissions PERMISSIONS  file path for json encoded permissions, look in the docs for more information

show team-role

Show your team role
Text
usage: vastai show team-role NAME

positional arguments:
 NAME               name of the role

options:
 -h, --help         show this help message and exit

show team-roles

Show roles for a team
Text
usage: vastai show team-roles

options:
 -h, --help         show this help message and exit

update team-role

Update an existing team role
Text
usage: vastai update team-role ID --name NAME --permissions PERMISSIONS

positional arguments:
 id                         id of the role

options:
 -h, --help                 show this help message and exit
 --name NAME                name of the role
 --permissions PERMISSIONS  file path for json encoded permissions, look in the docs for more information

remove team-role

Remove a role from your team
Text
usage: vastai remove team-role NAME

positional arguments:
 NAME               name of the role

options:
 -h, --help         show this help message and exit

invite member

Invite a team member
Text
usage: vastai invite member --email EMAIL --role ROLE

options:
 -h, --help         show this help message and exit
 --email EMAIL      email of user to be invited
 --role ROLE        role of user to be invited

show members

Show your team members
Text
usage: vastai show members

options:
 -h, --help         show this help message and exit

remove member

Remove a team member
Text
usage: vastai remove member ID

positional arguments:
 id                 id of user to remove

options:
 -h, --help         show this help message and exit

Accounts & Keys

create api-key

Create a new api-key with restricted permissions. Can be sent to other users and teammates
Text
usage: vastai create api-key --name NAME --permission_file PERMISSIONS

options:
 -h, --help                         show this help message and exit
 --name NAME                        name of the api-key
 --permission_file PERMISSION_FILE  file path for json encoded permissions, see https://vast.ai/docs/cli/roles-and-permissions for more information
 --key_params KEY_PARAMS            optional wildcard key params for advanced keys

show api-keys

List your api-keys associated with your account
Text
usage: vastai show api-keys

options:
 -h, --help         show this help message and exit

delete api-key

Remove an api-key
Text
usage: vastai delete api-key ID

positional arguments:
 id                 id of apikey to remove

options:
 -h, --help         show this help message and exit

set api-key

Set api-key (get your api-key from the console/CLI)
Text
usage: vastai set api-key APIKEY

positional arguments:
 new_api_key        Api key to set as currently logged in user

options:
 -h, --help         show this help message and exit

create ssh-key

Create a new ssh-key
Text
usage: vastai create ssh-key [ssh_public_key] [-y]

positional arguments:
 ssh_key            add your existing ssh public key to your account (from the .pub file). If no public key is provided, a new key pair will be generated.

options:
 -h, --help         show this help message and exit
 -y, --yes          automatically answer yes to prompts

show ssh-keys

List your ssh keys associated with your account
Text
usage: vastai show ssh-keys

options:
 -h, --help         show this help message and exit

delete ssh-key

Remove an ssh-key
Text
usage: vastai delete ssh-key ID

positional arguments:
 id                 id ssh key to delete

options:
 -h, --help         show this help message and exit

update ssh-key

Update an existing SSH key
Text
usage: vastai update ssh-key ID SSH_KEY

positional arguments:
 id                 id of the ssh key to update
 ssh_key            new public key value

options:
 -h, --help         show this help message and exit

show user

Get current user data
Text
usage: vastai show user [OPTIONS]

options:
 -h, --help         show this help message and exit
 -q, --quiet        display information about user

set user

Update user data from json file
Text
usage: vastai set user --file FILE

options:
 -h, --help         show this help message and exit
 --file FILE        file path for params in json format

show subaccounts

Get current subaccounts
Text
usage: vastai show subaccounts [OPTIONS]

options:
 -h, --help         show this help message and exit
 -q, --quiet        display subaccounts from current user

create subaccount

Create a subaccount
Text
usage: vastai create subaccount --email EMAIL --username USERNAME --password PASSWORD --type TYPE

options:
 -h, --help           show this help message and exit
 --email EMAIL        email address to use for login
 --username USERNAME  username to use for login
 --password PASSWORD  password to use for login
 --type TYPE          host/client

show ipaddrs

Display user’s history of ip addresses
Text
usage: vastai show ipaddrs [--api-key API_KEY] [--raw]

options:
 -h, --help         show this help message and exit

show audit-logs

Display account’s history of important actions
Text
usage: vastai show audit-logs [--api-key API_KEY] [--raw]

options:
 -h, --help         show this help message and exit

show env-vars

Show user environment variables
Text
usage: vastai show env-vars [-s]

options:
 -h, --help         show this help message and exit
 -s, --show-values  Show the values of environment variables

create env-var

Create a new user environment variable
Text
usage: vastai create env-var <name> <value>

positional arguments:
 name               Environment variable name
 value              Environment variable value

options:
 -h, --help         show this help message and exit

update env-var

Update an existing user environment variable
Text
usage: vastai update env-var <name> <value>

positional arguments:
 name               Environment variable name to update
 value              New environment variable value

options:
 -h, --help         show this help message and exit

delete env-var

Delete a user environment variable
Text
usage: vastai delete env-var <name>

positional arguments:
 name               Environment variable name to delete

options:
 -h, --help         show this help message and exit

transfer credit

Transfer credits to another account
Text
usage: vastai transfer credit RECIPIENT AMOUNT

positional arguments:
 recipient          email (or id) of recipient account
 amount             $dollars of credit to transfer 

options:
 -h, --help         show this help message and exit
 --skip             skip confirmation

show scheduled-jobs

Display the list of scheduled jobs
Text
usage: vastai show scheduled-jobs [--api-key API_KEY] [--raw]

options:
 -h, --help         show this help message and exit

delete scheduled-job

Delete a scheduled job
Text
usage: vastai delete scheduled-job ID

positional arguments:
 id                 id of scheduled job to remove

options:
 -h, --help         show this help message and exit

tfa activate

Activate a new 2FA method by verifying the code
Text
usage: vastai tfa activate CODE --secret SECRET [--method-type METHOD_TYPE] [--phone-number PHONE_NUMBER] [--label LABEL]

positional arguments:
 code                                     6-digit verification code from SMS or Authenticator app

options:
 -h, --help                               show this help message and exit
 -t {sms,totp}, --method-type {sms,totp}  New 2FA Method type to activate
 --secret SECRET                          Secret token from setup process (required)
 --phone-number PHONE_NUMBER              Phone number for SMS method (E.164 format)
 -l LABEL, --label LABEL                  Label for the new 2FA method

tfa delete

Remove a 2FA method from your account
Text
usage: vastai tfa delete [--id-to-delete ID] [--code CODE] [--method-type METHOD_TYPE] [--secret SECRET] [--backup-code BACKUP_CODE] [--method-id ID]

options:
 -h, --help                                       show this help message and exit
 -id ID_TO_DELETE, --id-to-delete ID_TO_DELETE    ID of the 2FA method to delete (see `vastai tfa status`)
 -c CODE, --code CODE                             2FA code from your Authenticator app, SMS, or Email to authorize deletion
 -t {email,sms,totp}, --method-type {email,sms,totp}
                                                  2FA Method type. Only use when you only have one method of this type
 -s SECRET, --secret SECRET                       Secret token (required for SMS or Email 2FA)
 -bc BACKUP_CODE, --backup-code BACKUP_CODE       One-time backup code (alternative to regular 2FA code)
 --method-id METHOD_ID                            2FA Method ID to use if you have more than one of the same type ('id' from `tfa status`)

tfa login

Complete 2FA login by verifying code
Text
usage: vastai tfa login [--code CODE] [--method-type METHOD_TYPE] [--secret SECRET] [--backup-code BACKUP_CODE]

options:
 -h, --help                                       show this help message and exit
 -c CODE, --code CODE                             2FA code from Authenticator app, SMS, or Email
 -t {email,sms,totp}, --method-type {email,sms,totp}
                                                  2FA Method type. Only use when you only have one method of this type
 -s SECRET, --secret SECRET                       Secret token from previous login step (required for SMS or Email 2FA)
 -bc BACKUP_CODE, --backup-code BACKUP_CODE       One-time backup code (alternative to regular 2FA code)
 -id METHOD_ID, --method-id METHOD_ID             2FA Method ID if you have more than one of the same type ('id' from `tfa status`)

tfa resend-sms

Resend SMS 2FA code
Text
usage: vastai tfa resend-sms --secret SECRET [--phone-number PHONE_NUMBER]

options:
 -h, --help                                    show this help message and exit
 -p PHONE_NUMBER, --phone-number PHONE_NUMBER  Phone number to receive SMS code (E.164 format, e.g., +1234567890)
 -s SECRET, --secret SECRET                    Secret token from the original 2FA login attempt

tfa regen-codes

Regenerate backup codes for 2FA
Text
usage: vastai tfa regen-codes [--code CODE] [--method-type METHOD_TYPE] [--secret SECRET] [--backup-code BACKUP_CODE] [--method-id ID]

options:
 -h, --help                                       show this help message and exit
 -c CODE, --code CODE                             2FA code from Authenticator app, SMS, or Email
 -t {email,sms,totp}, --method-type {email,sms,totp}
                                                  2FA Method type. Only use when you only have one method of this type
 -s SECRET, --secret SECRET                       Secret token from previous login step (required for SMS or Email 2FA)
 -bc BACKUP_CODE, --backup-code BACKUP_CODE       One-time backup code (alternative to regular 2FA code)
 -id METHOD_ID, --method-id METHOD_ID             2FA Method ID if you have more than one of the same type ('id' from `tfa status`)

tfa send-sms

Request a 2FA SMS verification code
Text
usage: vastai tfa send-sms [--phone-number PHONE_NUMBER]

options:
 -h, --help                                    show this help message and exit
 -p PHONE_NUMBER, --phone-number PHONE_NUMBER  Phone number to receive SMS code (E.164 format, e.g., +1234567890)

tfa send-email

Request a 2FA Email verification code
Text
usage: vastai tfa send-email

options:
 -h, --help         show this help message and exit

tfa auth-new

Authorize your account to add a new 2FA method
Text
usage: vastai tfa auth-new {[--method-type METHOD_TYPE | --method-id ID | --backup-code BACKUP_CODE] | [--secret SECRET --code CODE]}

options:
 -h, --help                                       show this help message and exit
 -c CODE, --code CODE                             2FA code from Authenticator app, SMS, or Email
 -s SECRET, --secret SECRET                       Secret token from previous auth step
 -t {email,sms,totp}, --method-type {email,sms,totp}
                                                  2FA Method type. Only use when you only have one method of this type
 -bc BACKUP_CODE, --backup-code BACKUP_CODE       One-time backup code (alternative to regular 2FA code)
 -id METHOD_ID, --method-id METHOD_ID             2FA Method ID if you have more than one of the same type ('id' from `tfa status`)

tfa status

Shows the current 2FA status and configured methods
Text
usage: vastai tfa status [-h] [--url URL] [--retry RETRY] [--explain] [--raw] [--full] [--curl] [--api-key API_KEY] [--version]
                         [--no-color]

options:
 -h, --help         show this help message and exit

tfa totp-setup

Generate TOTP secret and QR code for Authenticator app setup
Text
usage: vastai tfa totp-setup

options:
 -h, --help         show this help message and exit

tfa update

Update a 2FA method’s settings
Text
usage: vastai tfa update METHOD_ID [--label LABEL] [--set-primary]

positional arguments:
 METHOD_ID                                  ID of the 2FA method to update (see `vastai tfa status`)

options:
 -h, --help                                 show this help message and exit
 -l LABEL, --label LABEL                    New label/name for this 2FA method
 -p SET_PRIMARY, --set-primary SET_PRIMARY  Set this method as the primary/default 2FA method

Billing

show invoices

Get billing (invoices/charges) history reports with advanced filtering and pagination
Text
usage: vastai show invoices [OPTIONS]

options:
 -h, --help                                       show this help message and exit
 -i, --invoices                                   Show invoices instead of charges
 -it type [type ...], --invoice-type type [type ...]
                                                  Filter which types of invoices to show: {transfers, stripe, bitpay, coinbase, crypto.com, reserved, payout_paypal, payout_wise}
 -c, --charges                                    Show charges instead of invoices
 -ct type [type ...], --charge-type type [type ...]
                                                  Filter which types of charges to show: {i|instance, v|volume, s|serverless}
 -s START_DATE, --start-date START_DATE           Start date (YYYY-MM-DD or timestamp)
 -e END_DATE, --end-date END_DATE                 End date (YYYY-MM-DD or timestamp)
 -l LIMIT, --limit LIMIT                          Number of results per page (default: 20, max: 100)
 -t NEXT_TOKEN, --next-token NEXT_TOKEN           Pagination token for next page
 -f {table,tree}, --format {table,tree}           Output format for charges (default: table)
 -v, --verbose                                    Include full Instance Charge details and Invoice Metadata (tree view only)
 --latest-first                                   Sort by latest first

show earnings

Get machine earning history reports
Text
usage: vastai show earnings [OPTIONS]

options:
 -h, --help                              show this help message and exit
 -q, --quiet                             only display numeric ids
 -s START_DATE, --start_date START_DATE  start date and time for report. Many formats accepted
 -e END_DATE, --end_date END_DATE        end date and time for report. Many formats accepted 
 -m MACHINE_ID, --machine_id MACHINE_ID  Machine id (optional)

show deposit

Display reserve deposit info for an instance
Text
usage: vastai show deposit ID [options]

positional arguments:
 id                 id of instance to get info for

options:
 -h, --help         show this help message and exit

Host

show machine

[Host] Show hosted machines
Text
usage: vastai show machine ID [OPTIONS]

positional arguments:
 Machine            id of machine to display

options:
 -h, --help         show this help message and exit
 -q, --quiet        only display numeric ids

show machines

[Host] Show hosted machines
Text
usage: vastai show machines [OPTIONS]

options:
 -h, --help         show this help message and exit
 -q, --quiet        only display numeric ids

show maints

[Host] Show maintenance information for host machines
Text
usage: 
vastai show maints -ids 'machine_id_1' [OPTIONS]
vastai show maints -ids 'machine_id_1, machine_id_2' [OPTIONS]

options:
 -h, --help         show this help message and exit
 -ids IDS           comma separated string of machine_ids for which to get maintenance information
 -q, --quiet        only display numeric ids of the machines in maintenance

show network-disks

[Host] Show network disks associated with your account.
Text
usage: vastai show network-disks

options:
 -h, --help         show this help message and exit

list machine

[Host] list a machine for rent
Text
usage: vastai list machine ID [options]

positional arguments:
 id                                               id of machine to list

options:
 -h, --help                                       show this help message and exit
 -g PRICE_GPU, --price_gpu PRICE_GPU              per gpu rental price in $/hour  (price for active instances)
 -s PRICE_DISK, --price_disk PRICE_DISK           storage price in $/GB/month (price for inactive instances), default: $0.10/GB/month
 -u PRICE_INETU, --price_inetu PRICE_INETU        price for internet upload bandwidth in $/GB
 -d PRICE_INETD, --price_inetd PRICE_INETD        price for internet download bandwidth in $/GB
 -b PRICE_MIN_BID, --price_min_bid PRICE_MIN_BID  per gpu minimum bid price floor in $/hour
 -r DISCOUNT_RATE, --discount_rate DISCOUNT_RATE  Max long term prepay discount rate fraction, default: 0.4 
 -m MIN_CHUNK, --min_chunk MIN_CHUNK              minimum amount of gpus
 -e END_DATE, --end_date END_DATE                 contract offer expiration - the available until date (optional, in unix float timestamp or MM/DD/YYYY format)
 -l DURATION, --duration DURATION                 Updates end_date daily to be duration from current date. Cannot be combined with end_date. Format is: `n days`, `n weeks`, `n months`, `n years`, or total intended duration in seconds.
 -v VOL_SIZE, --vol_size VOL_SIZE                 Size for volume contract offer. Defaults to half of available disk. Set 0 to not create a volume contract offer.
 -z VOL_PRICE, --vol_price VOL_PRICE              Price for disk on volume contract offer. Defaults to price_disk. Invalid if vol_size is 0.

list machines

[Host] list machines for rent
Text
usage: vastai list machines IDs [options]

positional arguments:
 ids                                              ids of machines to list

options:
 -h, --help                                       show this help message and exit
 -g PRICE_GPU, --price_gpu PRICE_GPU              per gpu on-demand rental price in $/hour (base price for active instances)
 -s PRICE_DISK, --price_disk PRICE_DISK           storage price in $/GB/month (price for inactive instances), default: $0.10/GB/month
 -u PRICE_INETU, --price_inetu PRICE_INETU        price for internet upload bandwidth in $/GB
 -d PRICE_INETD, --price_inetd PRICE_INETD        price for internet download bandwidth in $/GB
 -b PRICE_MIN_BID, --price_min_bid PRICE_MIN_BID  per gpu minimum bid price floor in $/hour
 -r DISCOUNT_RATE, --discount_rate DISCOUNT_RATE  Max long term prepay discount rate fraction, default: 0.4 
 -m MIN_CHUNK, --min_chunk MIN_CHUNK              minimum amount of gpus
 -e END_DATE, --end_date END_DATE                 contract offer expiration - the available until date (optional, in unix float timestamp or MM/DD/YYYY format)
 -l DURATION, --duration DURATION                 Updates end_date daily to be duration from current date. Cannot be combined with end_date. Format is: `n days`, `n weeks`, `n months`, `n years`, or total intended duration in seconds.
 -v VOL_SIZE, --vol_size VOL_SIZE                 Size for volume contract offer. Defaults to half of available disk. Set 0 to not create a volume contract offer.
 -z VOL_PRICE, --vol_price VOL_PRICE              Price for disk on volume contract offer. Defaults to price_disk. Invalid if vol_size is 0.

unlist machine

[Host] Unlist a listed machine
Text
usage: vastai unlist machine <id>

positional arguments:
 id                 id of machine to unlist

options:
 -h, --help         show this help message and exit

delete machine

[Host] Delete machine if the machine is not being used by clients. host jobs on their own machines are disregarded and machine is force deleted.
Text
usage: vastai delete machine <id>

positional arguments:
 id                 id of machine to delete

options:
 -h, --help         show this help message and exit

cleanup machine

[Host] Remove all expired storage instances from the machine, freeing up space
Text
usage: vastai cleanup machine ID [options]

positional arguments:
 id                 id of machine to cleanup

options:
 -h, --help         show this help message and exit

defrag machines

[Host] Defragment machines
Text
usage: vastai defragment machines IDs 

positional arguments:
 IDs                ids of machines

options:
 -h, --help         show this help message and exit

set min-bid

[Host] Set the minimum bid/rental price for a machine
Text
usage: vastai set min_bid id [--price PRICE]

positional arguments:
 id                 id of machine to set min bid price for

options:
 -h, --help         show this help message and exit
 --price PRICE      per gpu min bid price in $/hour

set defjob

[Host] Create default jobs for a machine
Text
usage: vastai set defjob id [--api-key API_KEY] [--price_gpu PRICE_GPU] [--price_inetu PRICE_INETU] [--price_inetd PRICE_INETD] [--image IMAGE] [--args ...]

positional arguments:
 id                         id of machine to launch default instance on

options:
 -h, --help                 show this help message and exit
 --price_gpu PRICE_GPU      per gpu rental price in $/hour
 --price_inetu PRICE_INETU  price for internet upload bandwidth in $/GB
 --price_inetd PRICE_INETD  price for internet download bandwidth in $/GB
 --image IMAGE              docker container image to launch
 --args ...                 list of arguments passed to container launch

remove defjob

[Host] Delete default jobs
Text
usage: vastai remove defjob id

positional arguments:
 id                 id of machine to remove default instance from

options:
 -h, --help         show this help message and exit

schedule maint

[Host] Schedule upcoming maint window
Text
usage: vastai schedule maintenance id [--sdate START_DATE --duration DURATION --maintenance_category MAINTENANCE_CATEGORY]

positional arguments:
 id                                           id of machine to schedule maintenance for

options:
 -h, --help                                   show this help message and exit
 --sdate SDATE                                maintenance start date in unix epoch time (UTC seconds)
 --duration DURATION                          maintenance duration in hours
 --maintenance_category MAINTENANCE_CATEGORY  (optional) can be one of [power, internet, disk, gpu, software, other]

cancel maint

[Host] Cancel maint window
Text
usage: vastai cancel maint id

positional arguments:
 id                 id of machine to cancel maintenance(s) for

options:
 -h, --help         show this help message and exit

add network-disk

[Host] Add Network Disk to Physical Cluster.
Text
usage: vastai add network-disk MACHINES MOUNT_PATH [options]

positional arguments:
 machines                           ids of machines to add disk to, that is networked to be on the same LAN as machine
 mount_point                        mount path of disk to add

options:
 -h, --help                         show this help message and exit
 -d [DISK_ID], --disk_id [DISK_ID]  id of network disk to attach to machines in the cluster

self-test machine

[Host] Perform a self-test on the specified machine
Text
usage: vastai self-test machine <machine_id> [--debugging] [--ignore-requirements]

positional arguments:
 machine_id             Machine ID

options:
 -h, --help             show this help message and exit
 --debugging            Enable debugging output
 --ignore-requirements  Ignore the minimum system requirements and run the self test regardless

reports

Get the user reports for a given machine
Text
usage: vastai reports ID

positional arguments:
 id                 machine id

options:
 -h, --help         show this help message and exit

Misc

benchmark

Compare GPU perf/cost using live marketplace data
Text
usage: vastai benchmark [--gpus 3090,4090,...] [--num-gpus N] [--json]

options:
 -h, --help                 show this help message and exit
 --gpus GPUS                Comma-separated GPU names. default: RTX 3090,RTX 4090,RTX 5090,RTX A4000,RTX A5000,H100 SXM,H100 NVL,H200
 --num-gpus NUM_GPUS        Bucket to benchmark (e.g. 1, 2, 4, 8). default: 1
 --min-samples MIN_SAMPLES  Minimum offers per GPU before reporting without a warning. default: 3
 --json                     Emit JSON instead of a text table.