Vast.ai Python SDK Guide
A reference skill that teaches Claude to drive Vast.ai GPU instances, volumes, serverless endpoints, and billing through the Python SDK.
Dev & CodingIntermediate★ 212⑂ 89AI score 7/10Last updated: Aug 18, 2026
What it does
- Gives Claude the accurate high-level API surface of the
vastai/vastai_sdkPython package. - Covers the full instance lifecycle with code: searching offers, creating, start/stop/reboot/destroy, labeling, and fetching SSH/SCP connection strings.
- Includes data movement (
copy,cloud_copy), volumes and network volumes, serverless deployments, host machine listing, SSH keys, and team management. - Separates three layers:
VastAI(high level),SyncClient/AsyncClient(typed low level), andServerless(inference endpoints). - Calls out real pitfalls: spot rentals silently fall back to on-demand pricing unless you pass
bid_price, and copying into/rootor/breaks SSH permissions.
Who it's for
- ML engineers and researchers renting GPUs on Vast.ai for training or inference.
- MLOps folks scripting GPU provisioning pipelines.
- Cost-conscious teams mixing interruptible and on-demand instances.
Example uses
- "Find the cheapest 4x RTX 4090 offer with reliability > 0.99 and launch it with the pytorch image" →
search_offersthencreate_instanceon the mindph_total. - "Upload
./datato/workspace/dataon instance 12345, then pull results back" →vast.copy("local:./data/", "C.12345:/workspace/data/")and the reverse. - "Send a Qwen3-8B prompt to my serverless endpoint and print just the completion text" → async
Serverless.request("/v1/completions", ...).
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/vast-ai/vast-cli/HEAD/vastai_sdk/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the vastai_sdk folder from the GitHub repo vast-ai/vast-cli into my ~/.claude/skills/vastai-sdk/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/vast-ai/vast-cli.git /tmp/vast-cli && mkdir -p ~/.claude/skills/vastai-sdk && cp /tmp/vast-cli/vastai_sdk/SKILL.md ~/.claude/skills/vastai-sdk/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and create the skills folder:
mkdir -p ~/.claude/skills - Clone the repository:
git clone https://github.com/vast-ai/vast-cli.git /tmp/vast-cli - Copy the skill file:
mkdir -p ~/.claude/skills/vastai-sdk && cp /tmp/vast-cli/vastai_sdk/SKILL.md ~/.claude/skills/vastai-sdk/ - Install the Python package:
pip install vastai(add serverless support withpip install "vastai[serverless]") - Create an API key at https://console.vast.ai/manage-keys/ and save it to
~/.vast_api_key. - Restart Claude Code and try a prompt like "search Vast.ai for RTX 4090 offers" to confirm the skill loads.
View source on GitHub ↗License: MIT