VA

vastai-webhooks-events

Implements event polling for Vast.ai instances to track status changes and trigger workflows.

Install

mkdir -p .claude/skills/vastai-webhooks-events && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/8867" && unzip -o skill.zip -d .claude/skills/vastai-webhooks-events && rm skill.zip

Installs to .claude/skills/vastai-webhooks-events

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Build event-driven workflows around Vast.ai instance lifecycle events.
70 charsno explicit “when” trigger
Intermediate

Key capabilities

  • →Poll Vast.ai REST API for instance status transitions
  • →Trigger custom handlers on instance lifecycle events
  • →Implement auto-recovery for preempted GPU instances
  • →Track cost-related status transitions for billing
  • →Monitor instance states like loading, running, and exited

How it works

The poller periodically queries the Vast.ai REST API to compare current instance statuses against previous states. When a transition is detected, it executes registered callback functions.

Inputs & outputs

You give it
Vast.ai API key and polling interval
You get back
Event-driven execution of custom handlers on status changes

When to use vastai-webhooks-events

  • →Monitoring GPU instance lifecycle states
  • →Building auto-recovery for training jobs
  • →Triggering notifications on instance errors
  • →Tracking cost-related status transitions

About this skill

Signed Vast.ai Notification Receiver

Overview

Vast.ai notifications are signed, at-least-once deliveries. Verify the exact raw body before JSON parsing, reject stale timestamps, deduplicate by stable event ID, enqueue durably, and return success only after acceptance.

Prerequisites

  • Full subscription keys such as client:low_credit or client:outbid
  • Public HTTPS endpoint without redirects or private-address resolution
  • Webhook secret store, five-minute replay window, durable queue, and event ledger

Instructions

Step 1: Create a bounded subscription

Discover valid notification types and subscribe only the required full client or host keys. Respect the four-webhook-per-user limit and retain context-specific webhooks when short slugs overlap.

Step 2: Store the one-time secret

Capture the signing secret at create or rotate time because list and update responses do not return it. Test retrieval and rotation ownership.

Step 3: Verify raw delivery

Require POST, read exact body bytes, combine integer X-Vast-Timestamp, a period, and raw body, then compare the HMAC-SHA256 against X-Vast-Signature-256 in constant time.

Step 4: Reject replay and duplicates

Reject missing or malformed headers and timestamps older than 300 seconds. Deduplicate retries using X-Vast-Event-Id or payload event_id.

Step 5: Acknowledge after durable enqueue

Persist the verified event and return 2xx quickly. Process side effects asynchronously and idempotently; the delivery timeout is ten seconds.

Step 6: Test and operate failure paths

Use the provider test delivery, verify rotation, and monitor permanent 3xx/most-4xx failures versus retryable 408, 429, 5xx, timeout, or connection errors.

Authentication

Webhook configuration uses the scoped Vast.ai API key; delivery verification uses the distinct webhook secret. Never log either secret or parse/re-serialize JSON before signature verification.

Tool Discipline

Use Read and Grep to inspect manifests, configuration, provider output, and existing tests before proposing a mutation. Use Write or Edit only for the approved plan, implementation, test, or redacted receipt; do not create, update, destroy, or fund Vast.ai resources without explicit operator approval.

Output

  • Subscription keys, webhook ID, and secret-rotation ownership
  • Signature, replay, deduplication, enqueue, and idempotency tests
  • Delivery health and retry/permanent-failure receipt

Return webhook ID, context keys, test event ID, signature/replay/dedupe results, acknowledgment latency, queue record, and rotation date.

Examples

A client:low_credit delivery is verified from raw bytes, rejected if older than five minutes, deduplicated by event ID, enqueued, and acknowledged with 204 before the worker pages the billing owner.

Error Handling

FailureResponse
Signature or timestamp is invalidReturn a permanent client error and do not enqueue or disclose verification details.
Duplicate event arrivesReturn success after confirming the original durable record; do not repeat side effects.
Queue is unavailableReturn a retryable failure such as 503 rather than acknowledging data loss.
Endpoint redirectsFix the configured final HTTPS URL because redirects are permanent delivery failures.

Resources

When not to use it

  • →Real-time event streaming as Vast.ai requires polling

Prerequisites

Vast.ai CLI authenticatedUnderstanding of instance lifecycle statesPython 3.8+ for event loop implementation

Limitations

  • →Poll interval latency can cause missed status transitions
  • →Auto-recovery loops may occur if failed host IDs are not excluded
  • →API rate limiting may require backoff strategies

How it compares

This approach automates event detection through polling rather than relying on native webhooks which are not provided by the platform.

Compared to similar skills

vastai-webhooks-events side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
vastai-webhooks-events (this skill)02moReviewIntermediate
netalertx-plugin-run-development18moReviewIntermediate
ads-network-killswitch05moNo flagsBeginner
sms-inbox-manager03moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore →

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

Search skills

Search the agent skills registry