Claude-code-plugins-plus castai-hello-world

install
source · Clone the upstream repo
git clone https://github.com/jeremylongshore/claude-code-plugins-plus-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/jeremylongshore/claude-code-plugins-plus-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/plugins/saas-packs/castai-pack/skills/castai-hello-world" ~/.claude/skills/jeremylongshore-claude-code-plugins-plus-castai-hello-world && rm -rf "$T"
manifest: plugins/saas-packs/castai-pack/skills/castai-hello-world/SKILL.md
source content

CAST AI Hello World

Overview

First API calls against the CAST AI REST API: list connected clusters, retrieve the savings report, and inspect node inventory. All examples use

curl
with the
X-API-Key
header -- no SDK required.

Prerequisites

  • Completed
    castai-install-auth
    setup
  • CASTAI_API_KEY
    environment variable set
  • At least one cluster connected to CAST AI

Instructions

Step 1: List Connected Clusters

curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
  https://api.cast.ai/v1/kubernetes/external-clusters \
  | jq '.items[] | {id, name, status, providerType}'

Expected output:

{
  "id": "abc123-def456",
  "name": "production-eks",
  "status": "ready",
  "providerType": "eks"
}

Step 2: Get Cluster Savings Report

export CASTAI_CLUSTER_ID="your-cluster-id"

# Current month savings
curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
  "https://api.cast.ai/v1/kubernetes/clusters/${CASTAI_CLUSTER_ID}/savings" \
  | jq '{
    monthlySavings: .monthlySavings,
    savingsPercentage: .savingsPercentage,
    currentCost: .currentMonthlyCost,
    optimizedCost: .optimizedMonthlyCost
  }'

Step 3: List Cluster Nodes

curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
  "https://api.cast.ai/v1/kubernetes/external-clusters/${CASTAI_CLUSTER_ID}/nodes" \
  | jq '.items[] | {
    name: .name,
    instanceType: .instanceType,
    lifecycle: .lifecycle,
    cpu: .allocatableCpu,
    memory: .allocatableMemory,
    zone: .zone
  }'

Step 4: Check Autoscaler Policies

curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
  "https://api.cast.ai/v1/kubernetes/clusters/${CASTAI_CLUSTER_ID}/policies" \
  | jq '{
    enabled: .enabled,
    unschedulablePods: .unschedulablePods.enabled,
    nodeDownscaler: .nodeDownscaler.enabled,
    spotInstances: .spotInstances.enabled
  }'

Output

  • List of connected clusters with IDs and status
  • Monthly savings report with before/after cost
  • Node inventory with instance types and lifecycle (spot vs on-demand)
  • Autoscaler policy status

Error Handling

ErrorCauseSolution
401 Unauthorized
Bad API keyRegenerate at console.cast.ai
404 Not Found
Wrong cluster IDList clusters first to get correct ID
Empty
items
array
No clusters connectedRun
castai-install-auth
to onboard
agentStatus: offline
Agent not runningCheck
kubectl get pods -n castai-agent

Resources

Next Steps

Proceed to

castai-local-dev-loop
to set up a development workflow.