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.zipInstalls 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.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
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_creditorclient: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
| Failure | Response |
|---|---|
| Signature or timestamp is invalid | Return a permanent client error and do not enqueue or disclose verification details. |
| Duplicate event arrives | Return success after confirming the original durable record; do not repeat side effects. |
| Queue is unavailable | Return a retryable failure such as 503 rather than acknowledging data loss. |
| Endpoint redirects | Fix 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
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| vastai-webhooks-events (this skill) | 0 | 2mo | Review | Intermediate |
| netalertx-plugin-run-development | 1 | 8mo | Review | Intermediate |
| ads-network-killswitch | 0 | 5mo | No flags | Beginner |
| sms-inbox-manager | 0 | 3mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by jeremylongshore
View all by jeremylongshore →You might also like
netalertx-plugin-run-development
netalertx
Create and run NetAlertX plugins. Use this when asked to create plugin, run plugin, test plugin, plugin development, or execute plugin script.
ads-network-killswitch
engremran07
Network killswitch: per-network enable/disable. Use when: disabling problematic networks, emergency ad shutoff, toggling networks without deletion.
sms-inbox-manager
Little-King2022
Maintain a self-hosted realtime SMS inbox service. Use when inspecting received SMS messages, managing the web UI, debugging SMS forwarding, restarting or enabling the service, adjusting authentication, updating nginx routing, or locating data/log files.
ha-config-fetch
calexandre
>-
amc-run-sample-calibration
NVIDIA
Run end-to-end calibration on the shipped sample dataset (sdg_08_2_sample_data_010926.zip) against a running AMC microservice. Use when user says 'test sample dataset', 'run sample calibration', 'verify AMC install', or 'launch and test'.
telegram-bot-builder
davila7
Expert in building Telegram bots that solve real problems - from simple automation to complex AI-powered bots. Covers bot architecture, the Telegram Bot API, user experience, monetization strategies, and scaling bots to thousands of users. Use when: telegram bot, bot api, telegram automation, chat bot telegram, tg bot.