SDK
Runcrate in your app. TypeScript or Python.
Ask Claude Code or Codex to add Runcrate to your app. It installs the SDK and writes the calls: models and GPUs from $0.20/hr, on one key.
@runcrate/sdk on npm, runcrate-sdk on PyPI.
How it works
You ask. Your agent adds it. With one install and one key.
- 01
Ask for the feature.
Tell Claude Code or Codex what your app or job should do: answer with a model, make an image, start a GPU for a training run.
- 02
It installs the SDK.
npm install @runcrate/sdkorpip install runcrate-sdk. Your key goes inRUNCRATE_API_KEY, which both SDKs and the CLI read. - 03
It writes the calls and runs them.
You review the change like any other. The code stays in your repo and runs on your own servers.
npm install @runcrate/sdkimport Runcrate from "@runcrate/sdk"; const rc = new Runcrate(); // reads RUNCRATE_API_KEY const reply = await rc.models.chatCompletion({ model: "deepseek-ai/DeepSeek-V3", messages: [{ role: "user", content: "In two sentences: why do GPUs train neural networks faster than CPUs?" }],}); console.log(reply.choices[0].message.content);GPUs train neural networks faster than CPUs because they are optimized for parallel processing, handling thousands of computations simultaneously, whereas CPUs are designed for sequential tasks and fewer cores. Additionally, GPUs have specialized architectures with thousands of smaller, efficient cores tailored for matrix and vector operations, which are fundamental to neural network training.
What it covers
Models and GPUs. In both languages.
rc.models
Chat, images, video, speech and transcription, on every model in the catalog.
9 methods
rc.chat.completions
The same chat call in the OpenAI SDK's shape, for code that already speaks it.
1 method
rc.instances
See every GPU on offer with its price, launch one, check its status, terminate it.
6 methods
rc.storage
Volumes that outlive an instance: create, resize and delete them, and list regions.
6 methods
rc.templates
The crates an instance can boot, with what each has installed.
1 method
rc.sshKeys
Public keys an instance accepts, for tools that connect over SSH.
3 methods
rc.environments
Keep staging apart from production inside one workspace.
5 methods
rc.billing
Your balance, every transaction and what you spent, as numbers.
3 methods
Python has the same namespaces in snake case: client.models.chat_completion, client.instances.get_status.
Why the SDK
Less for your agent to get wrong. Than calling the API by hand.
retries
GPU, storage and billing calls retry a 429, 500, 502, 503 or 504 with backoff, as do TypeScript model calls that are not streamed. A bad request fails at once.
up to 3 times
RateLimitError
Every error the API returns is a class with its status code and message, so code catches the one it handles.
9 classes, by status
stream: true
A streamed chat is an async iterator in TypeScript and an iterator in Python. No events to parse by hand.
for await … of stream
types
Full TypeScript types, Pydantic models in Python. TypeScript hands responses back in camelCase.
reply.choices[0].message
Change only what you need.
Every option has a default. Python takes the same ones in snake case: max_retries, api_key.
- Your key
apiKey - Default: from env
- Read from
RUNCRATE_API_KEYwhen you leave it out, so it never lands in your code. - One environment at a time
environment - Default: default
- A client pointed at staging only sees staging's instances and volumes. Keys, billing and templates stay workspace-wide.
- A time limit on each call
timeout - Default: 30
- In seconds. Images, video and speech set their own 120.
- How often to retry
maxRetries - Default: 3
- Retries a 429, 500, 502, 503 or 504 only. 0 turns them off. Python model calls and streamed chats never retry.
Examples
Ask once. Your agent writes the code.
Claude Code or Codex installs the SDK, writes the call and runs it. The code it writes is the docs' own.
Pricing
Same prices. Whatever sends the call.
A call costs the same from the SDK, your agent, the CLI or plain HTTP. One balance pays for all of it.
Models bill for what they produce: tokens, images or seconds, at the price shown. GPUs bill for the time they run.
Model or GPU
As billed
DeepSeek V3
DeepSeek AI
$0.269 in, per 1M tokens
$0.748 out
Qwen3 32B
Alibaba Cloud
$0.084 in, per 1M tokens
$0.294 out
GPT-OSS 20B
OpenAI
$0.0315 in, per 1M tokens
$0.147 out
H100 SXM
GPU, 80GB, cheapest offer
$3.25/hr
A100 80GB
GPU, 80GB, cheapest offer
$1.76/hr
RTX 4090
GPU, 24GB, cheapest offer
$0.52/hr
FAQ