Skip to main content

SDKs

Official client libraries for the Slothbox API. They wrap every operation in the API reference with typed parameters and responses, present your sk_ key the way the API expects it, map error responses to a typed hierarchy, retry transient failures safely, verify webhook deliveries, and encode the box lifecycle in ready-made waiters — so your integration code is about boxes, not HTTP.

:::info Service-account keys only The SDKs authenticate with an org service-account sk_ key, which requires the API plan. Personal seat keys and browser sessions are not supported, and requests on unsupported credentials may be rejected. See Authentication for the credential model and the headless guide for minting a key. :::

:::warning Pre-release These pages document the first releases of both SDKs@slothbox/sdk 0.1.0 for TypeScript and slothbox 0.1.0 for Python — which are not yet published to npm and PyPI at the time of writing. The code samples are written against those releases and will run as shown once they ship; until then, npm install @slothbox/sdk and pip install slothbox will not find the packages. :::

Available SDKs

LanguagePackageRepoStatus
TypeScript / JavaScript@slothbox/sdksloth-box/sdk-typescriptPre-release — 0.1.0 publishing to npm soon
Pythonslothboxsloth-box/sdk-pythonPre-release — 0.1.0 publishing to PyPI soon

The TypeScript SDK runs anywhere a WHATWG fetch global exists — Node.js 18+, Cloudflare Workers, Deno, Bun, and modern browsers — with zero runtime dependencies and dual ESM + CJS builds.

The Python SDK supports Python 3.10+ and ships sync and async clients (Slothbox / AsyncSlothbox) with the same surface, built on httpx. The two SDKs are kept at feature parity — same operations, same error codes, same retry policy, same webhook verification — so everything on these pages applies to both, with each page showing both languages.

Generated from the same spec as the reference

Both SDKs' operations and types are generated from the same OpenAPI document that renders the API reference, and methods are named after the spec's operation ids — launchEnvironment in the reference is slothbox.environments.launch(…) in TypeScript and client.environments.launch(…) in Python (Python uses snake_case: rollWebhookSecret becomes webhooks.roll_secret). When you're reading an operation in the reference, the SDK method that calls it has the same name, parameters, and response shape.

Versioning

Both packages are on 0.x pre-GA semver: anything may change between minor versions until 1.0.0. Pin an exact version once the packages are published.

Where to go next

  • Quickstart — install, authenticate, and make your first call.
  • Launch a box and wait — the first real workflow: launch an environment idempotently, wait until it's ready, and wind it down.
  • Errors, retries & rate limits — the typed error hierarchy, the error.code taxonomy, and how to behave under the API's rate limits.
  • Pagination — the cursor-paginated lists and how to iterate them.
  • Webhooks — verify deliveries with the SDK toolkit.
  • Configuration — every constructor and per-request option, in both SDKs.
  • Examples — runnable end-to-end examples with the cost-safety idioms baked in.