castai-sdk-patterns

Featured

Production-ready CAST AI REST API wrapper patterns in TypeScript and Python. Use when building reusable CAST AI clients, implementing retry logic, or wrapping the CAST AI API for team use. Trigger with phrases like "cast ai API patterns", "cast ai client wrapper", "cast ai TypeScript", "cast ai Python client".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# CAST AI SDK Patterns ## Overview CAST AI uses a REST API with `X-API-Key` header authentication. There is no official SDK -- build typed wrappers around `fetch` or `requests`. These patterns cover singleton clients, typed responses, retry with backoff, and multi-cluster management. ## Prerequisites - Completed `castai-install-auth` setup - TypeScript 5+ or Python 3.10+ - Familiarity with async/await patterns ## Instructions ### Step 1: TypeScript API Client ```typescript // src/castai/client.ts interface CastAIConfig { apiKey: string; baseUrl?: string; timeoutMs?: number; } interface CastAICluster { id: string; name: string; status: string; providerType: "eks" | "gke" | "aks"; agentStatus: string; createdAt: string; } interface CastAISavings { monthlySavings: number; savingsPercentage: number; currentMonthlyCost: number; optimizedMonthlyCost: number; } interface CastAINode { name: string; instanceType: string; lifecycle: "on-demand" | "spot"; allocatableCpu: string; allocatableMemory: string; zone: string; } class CastAIClient { private apiKey: string; private baseUrl: string; private timeoutMs: number; constructor(config: CastAIConfig) { this.apiKey = config.apiKey; this.baseUrl = config.baseUrl ?? "https://api.cast.ai"; this.timeoutMs = config.timeoutMs ?? 30000; } private async request<T>(path: string, options?: RequestInit): Promise<T> { const controller = new AbortController(); const tim...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category