VastAI class is the main client for interacting with the Vast.ai platform. It wraps the CLI commands as Python methods with typed signatures.
Installation
Quick Start
Constructor
Your Vast.ai API key. If not provided, reads from
~/.config/vastai/vast_api_key.The Vast.ai API server URL.
Number of retry attempts for failed API requests.
Return raw JSON responses instead of formatted output.
Print verbose explanations of API calls.
Suppress non-essential output.
Print equivalent curl commands for API calls.
If
api_key is not provided, the SDK reads it from ~/.config/vastai/vast_api_key.Getting Help
Use Python’s built-inhelp() to view documentation for any method: