Quick Terminal access to the entire platform
The Vast.ai CLI makes it easy to search GPUs, deploy Docker containers, manage instances, and automate full workflows from your terminal.
Manage
Manage accounts, billing, templates, keys, volumes, instances, and more from one command surface.
Search
Search efficiently with custom queries for GPU model, price, reliability, location, VRAM, and other offer fields.
Deploy
Launch in seconds, automate scaling workflows, and tear resources down when the job is complete.
Install in seconds
Install the CLI, then connect it to your account with an API key.
pip install vastai
vastai set api-key YOUR_API_KEYRequires Python 3.9+. Also available via pipx for isolated command-line installs.
How it works
Step 1
Search the Platform
Filter by GPU model, VRAM, price, reliability, location, and 20+ fields. Sort by performance-per-dollar.
$ vastai search offers 'gpu_name=H100_SXM num_gpus>=4 reliability>0.99' -o 'dph' --limit 5
ID GPU Num VRAM $/hr DLPerf Location
847291 H100_SXM 4 320GB $4.12 98.7 US-East
851003 H100_SXM 4 320GB $4.28 97.2 EU-West
849177 H100_SXM 8 640GB $7.84 99.1 US-WestStep 2
Deploy Your Container
Launch any Docker image on bare-metal GPUs. Pass environment variables, expose ports, mount volumes. SSH access included.
$ vastai create instance 847291 \
--image nvcr.io/nvidia/pytorch:24.01-py3 \
--disk 64 --ssh --direct
{"success": true, "new_contract": 9841205}Step 3
Monitor & Manage
Check status, stream logs, execute commands, and destroy instances when done. Script your entire workflow.
$ vastai show instances
ID GPU Status Image Cost/hr
9841205 4x H100_SXM running nvcr.io/nvidia/pytorch:24.01-py3 $4.12
$ vastai logs 9841205 --tail 5
[14:02:45] Model loaded. 70B params, 4-bit quantized.
[14:02:46] Server ready on :8080
$ vastai destroy instance 9841205Vast.ai CLI features
20+ Filter Fields
GPU model, VRAM, price, reliability, location, bandwidth, compute capability, and more.
Any Docker Image
Public or private registries. PyTorch, TensorFlow, vLLM, custom images — anything.
Spot Pricing
Bid on interruptible instances. RTX 4090 from $0.14/hr.
SSH & Jupyter
Direct SSH access or launch Jupyter notebooks with --jupyter.
File Transfer
vastai copy moves data between instances or to/from local.
Scripting-First
JSON output with --raw. Pipe to jq. Automate everything.
Real-time GPU pricing
GPUs from $0.14/hr (spot) and $0.50/hr (on-demand)
Thousands of GPUs available across 30+ data centers worldwide.
Got questions? We've got answers.
Visit our frequently asked questions for comprehensive answers to questions about the Vast.ai platform.
Deploy your first GPU in 60 seconds
No contracts, no minimums. Get your API key and start building.