Skip to main content
The official Python SDK for Runcrate. Supports both synchronous and asynchronous usage with full type safety via Pydantic.

Installation

Requires Python 3.9+.

Quick Start

Or use as a context manager:

Configuration

Environments

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

Async Support

Every method available on Runcrate has an async equivalent on AsyncRuncrate.

Model Inference

All inference methods hit api.runcrate.ai.

Chat Completions

Streaming

Image Generation

Model-Specific Parameters

All image methods accept extra keyword arguments that get passed through to the provider. Different models support different parameters:
The image, start_image, mask, and control_image 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 models) 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:
  • e.message — human-readable error description from the API
  • e.status_code — HTTP status code
  • e.code — machine-readable error code (e.g. not_found, rate_limited)
  • e.details — additional details (when available)

Error Hierarchy