vastai-sdk

vastai-sdk is a skill for Claude Code from vast-ai/vast-cli. It costs 26 tokens per session (1,996 once invoked), scanned A, original, MIT.

A Python library for managing Vast.ai GPU computers and related services from code. Vast.ai is a cloud marketplace for renting computers with graphics processors.

In plain words
What is it for?
Use it to list or inspect instances, search GPU offers, create and manage rented machines, and work with Vast.ai volumes, serverless endpoints, SSH keys, and billing through Python.
Why use it?
It lets Python programs automate GPU-instance and service management instead of requiring manual terminal commands. It also provides a programmatic way to authenticate, search offers, and work with instances.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to list or inspect instances, search GPU offers, create and manage rented machines, and work with Vast.ai volumes, serverless endpoints, SSH keys, and billing through Python.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vast-ai/vast-cli/vastai_sdk
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add vast-ai/vast-cli --skill vastai_sdk
Clone the repo
git clone --depth 1 https://github.com/vast-ai/vast-cli

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for vastai-sdk

README.md
[![agentmods](https://agentmods.dev/badge/skills/vast-ai/vast-cli/vastai_sdk.svg)](https://agentmods.dev/skills/vast-ai/vast-cli/vastai_sdk)
Your own site
<a href="https://agentmods.dev/skills/vast-ai/vast-cli/vastai_sdk"><img src="https://agentmods.dev/badge/skills/vast-ai/vast-cli/vastai_sdk.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,996 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Rogue Agent · line 186
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00026 $0.01996
Opus 5 $0.00013 $0.00998
Sonnet 5 $0.00005 $0.00399
Haiku 4.5 $0.00003 $0.00200

Measured 9d ago against content hash 40d5d51eacba, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

vastai-sdk scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (__init__.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

vastai_sdk/SKILL.md · 272 lines

How it starts

The opening of the file, as written. The whole thing — 272 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Vast.ai Python SDK (vastai / vastai_sdk)

The vastai package provides a Python SDK for managing GPU instances, volumes, serverless endpoints, and billing on Vast.ai. The vastai_sdk package is a backward-compatibility shim that re-exports vastai.

Installation

pip install vastai

For serverless and async support:

pip install "vastai[serverless]"

Authentication

The SDK reads the API key from ~/.vast_api_key by default. You can also pass it explicitly:

from vastai import VastAI
vast = VastAI()                        # reads ~/.vast_api_key
vast = VastAI(api_key="YOUR_API_KEY")  # explicit key

Get your API key from https://console.vast.ai/manage-keys/

Backward Compatibility

The old vastai_sdk import still works:

from vastai_sdk import VastAI  # equivalent to: from vastai import VastAI

VastAI Class (High-Level SDK)

from vastai import VastAI
vast = VastAI(api_key=None, server_url=None, retry=3, raw=False, quiet=False)

Instance Management

# List all your instances
instances = vast.show_instances()

# Get a single instance
instance = vast.show_instance(id=12345)

# Search GPU offers
offers = vast.search_offers(query='gpu_name=RTX_4090 num_gpus>=4 reliability>0.99')

# Create an instance from an offer
result = vast.create_instance(id=<offer_id>, image="pytorch/pytorch:latest", disk=50)

# ...as a jupyter instance on a direct connection
result = vast.create_instance(id=<offer_id>, image="pytorch/pytorch:latest", disk=50,
                              jupyter=True, direct=True, jupyter_lab=True)

# Lifecycle
vast.start_instance(id=12345)
vast.stop_instance(id=12345)
vast.reboot_instance(id=12345)
vast.destroy_instance(id=12345)

# Label an instance
vast.label_instance(id=12345, label="my-training-run")

# Get SSH connection string
ssh_url = vast.ssh_url(id=12345)   # returns "ssh -p PORT user@host"
scp_url = vast.scp_url(id=12345)   # returns scp-compatible URL

Read the full file on GitHub · 272 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 272 lines · 26 tokens per session scan A 40d5d51eacba

Subscribe to this mod's changes

vastai-sdk is a skill published in the GitHub repository vast-ai/vast-cli (219 stars, last pushed 4d ago), licensed MIT. It adds 26 tokens to every session and 1,996 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

kelly-devops

Product-fleet ops desk (Busabase App-in-Skill) for uptime/service health, SSL certificate expiry, domain renewal, API key rotation, cloud spend anomalies, and a review queue of agent-proposed action cards. Use when the user invokes $kelly-devops or /kelly-devops, or asks about uptime, service health checks, SSL…

mr-kelly/skills · 129 tokens

gdpr-compliance-checker

Autonomous GDPR compliance auditor that scans a codebase to identify PII collection, storage, and sharing, then produces an article-by-article gap analysis, a pre-filled Data Processing Agreement (DPA), and a ROPA (Record of Processing Activities) starter kit — all exported as downloadable files (.docx recommended).…

goSprinto/compliance-skills · 182 tokens

pii-detector

Proactive PII add-on — augments the main response with PII guidance. Auto-trigger on any form, schema, migration, model, API route, GraphQL resolver, auth flow, or data design discussion. Also fires on: middleware, webhooks, workers, seed/fixture/factory files, delete/export/purge/anonymize functions, cron jobs, HTTP…

goSprinto/compliance-skills · 209 tokens

huawei-cloud-account-onboarding

A read-only helper for checking whether a Huawei Cloud account has completed real-name verification and guiding the user through phone-based face verification.

ontology-of-everything/SemanticSkills · 139 tokens

create-azure-agent

Deploys a skill as an Azure AI Foundry hosted agent. NOT for Docker runtime skills (use create-docker-skill) and NOT for MCP server integrations (use create-mcp-integration).

richfrem/agent-plugins-skills · 48 tokens

deploy-workflow

Safe deployment workflow for Drupal 10/11 sites: pre-flight checks, backup, the correct update sequence (composer install, database updates, config import, cache rebuild), verification, and rollback plan. Use when deploying to any environment, releasing to production, or when the user asks to "push changes live"…

siva01c/claude-plugins · 92 tokens