Vast.ai Python SDK Guide
A reference skill that teaches Claude the correct Python API for searching, renting, and managing GPUs on Vast.ai.
Dev & CodingIntermediate★ 223⑂ 95AI score 7/10Last updated: Oct 2, 2026
What it does
- Gives Claude the exact
vastaipackage usage: API-key auth, offer search, instance create/start/stop/reboot/destroy, labeling, and SSH/SCP connection strings. - Covers the high-level
VastAIclass plus the typedSyncClient, theAsyncClientcontext-manager pattern, and theServerlessinference client. - Documents
copy()/cloud_copy()URL syntax for moving data between local disk, instances, volumes, and cloud buckets, with the warning never to target/root. - Captures billing gotchas such as always passing
bid_priceafter atype='bid'search, and that outbid spot instances stop (and keep billing storage) rather than being destroyed.
Who it's for
- ML engineers and researchers renting GPUs on Vast.ai for training or inference.
- Anyone scripting GPU provisioning/teardown to keep cloud costs down.
- Developers wiring up Vast.ai serverless LLM endpoints.
Example uses
- "Find the cheapest 4x RTX 4090 offer above 0.99 reliability and launch a PyTorch instance" → generates
search_offers+min()+create_instancecode. - "Pull results back to my laptop and destroy the box when training finishes" →
copy("C.12345:/workspace/results/", "local:./out/")thendestroy_instance. - "Async call a Qwen3-8B serverless endpoint for completions" → produces the
Serverlessasync pattern.
· · · 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.
- Create the skill folder:
mkdir -p ~/.claude/skills/vastai-sdk - Clone the repo:
git clone https://github.com/vast-ai/vast-cli.git /tmp/vast-cli - Copy the skill file:
cp /tmp/vast-cli/vastai_sdk/SKILL.md ~/.claude/skills/vastai-sdk/ - Install the library:
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 ask something like "write a script to rent an RTX 4090 on Vast.ai" to trigger the skill.
View source on GitHub ↗License: MIT