Vast.ai Python SDK & CLI
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Provides both the CLI and SDK for managing Vast.ai GPU cloud resources, plus a serverless client for endpoint inference.
Install
**Linux, macOS, or WSL** — install the CLI with no Python required:
Update anytime with vastai update.
**Windows, or using the Python SDK** — install from PyPI instead:
Quickstart
1. Get your API key from https://cloud.vast.ai/manage-keys/
2. Set your API key:
3. Test a search:
You should see a short list of available GPU offers.
CLI Usage
The vastai command provides full access to the Vast.ai platform from your terminal:
Run vastai --help for a full list of commands. You can also use --help on any subcommand:
SDK Usage
Use help(vast.search_offers) to view documentation for any method.
Using the Serverless Client
1. Create the client
2. Get an endpoint
3. Make a request
4. Read the response
Find more examples in the examples/ directory.
AI Agents
Vast.ai has a skill for AI coding agents (Claude Code, Cursor, Windsurf, Codex, etc.):
This installs the Vast.ai skill so your agent can search offers, create instances, and manage GPU workflows directly. See CLI SKILL.md or SDK SKILL.md for the full reference.
Contributing
This repository is open source. If you find a bug, please open an issue. PRs are welcome.