Skip to main content
The official TypeScript/JavaScript SDK for Runcrate. Zero runtime dependencies, native fetch, full type safety.

Installation

Requires Node.js 18+.

Quick Start

You can also set the RUNCRATE_API_KEY environment variable instead of passing apiKey.

Configuration

Environments

API keys are workspace-scoped. By default, requests target the workspace’s default environment (usually main). Pass environment at client construction to target a different one:
Environment-scoped: instances, crates, storage volumes. Workspace-wide: SSH keys, billing, API keys, templates.

Model Inference

All inference methods hit api.runcrate.ai.

Chat Completions

Streaming

Image Generation

Model-Specific Parameters

All inference methods accept extra parameters that get passed through to the provider. Different models support different parameters:
The image, startImage, mask, and controlImage fields accept three formats:
  • File path"./photo.png" (auto-detected, read and base64-encoded)
  • URL"https://..." (passed through as-is)
  • Base64 string — raw base64 data (passed through as-is)

Video Generation

Or manage the lifecycle manually:
Extra parameters (e.g., seed, negative_prompt, image for image-to-video) are passed through:

Text-to-Speech

Extra parameters like speed or language are passed through:

Transcription


Infrastructure Management

GPU Instances

SSH Keys

Storage

Storage volumes are environment-scoped. Your workspace’s storage provider (AWS S3, Wasabi, or Backblaze B2) must be configured in the dashboard first — the SDK picks it up automatically.
Billing: $0.03/GB/month, charged weekly in advance. Deletion refunds the unused portion of the current billing week.

Billing

Templates


Error Handling

All API errors include the actual error message from the server — never a generic fallback.
Every error exposes:
  • err.message — human-readable error description from the API
  • err.statusCode — HTTP status code
  • err.code — machine-readable error code (e.g. not_found, rate_limited)
  • err.details — additional details (when available)

Error Hierarchy