SDKs
Three first-party SDKs cover the ScaiGrid API surface with identical ergonomics — pick the one that matches your stack.
| Language | Package | Install |
|---|---|---|
| Python | scailabs-scaigrid |
pip install scailabs-scaigrid |
| TypeScript / JavaScript | @scailabs/scaigrid |
npm install @scailabs/scaigrid |
| .NET | ScaiLabs.ScaiGrid |
dotnet add package ScaiLabs.ScaiGrid |
All three are MIT-licensed and follow the same conceptual shape:
- Single top-level client —
ScaiGrid(Python / TS) orScaiGridClient(.NET) — constructed with one of three auth modes: static API key (sgk_...), bearer JWT, or OAuthclient_credentialsagainst ScaiKey. - Resources mirror the
/v1/surface:client.models,client.inference,client.modules, plus first-class module sub-clients (client.scaibot,client.scaispeak,client.scaidial) for the most common module routes. A genericclient.modules.proxy(...)covers everything else. - First-class streaming for chat completions — language-idiomatic
(Python
Iterator/AsyncIterator, TSAsyncIterable, .NETIAsyncEnumerable<ChatChunk>). - Typed errors that mirror the server's
ScaiGridError.codetaxonomy 1-to-1, so a code in a server log maps directly to an SDK exception class. - Retries with backoff on
429and idempotent5xx, honouringRetry-After.
The SDK is the recommended path for any new integration. The raw
/v1/ REST surface stays stable and documented under
Reference, but the SDK is what we test, ship
breaking-change-free, and dogfood ourselves.
Source + license#
All three SDKs are open-source under MIT. Builds for the current
release are available on /downloads,
grouped under ScaiGrid. Each artifact includes its SHA-256 checksum
on the download card for verification.
Authentication, briefly#
1 2 3 | |
1 2 3 | |
1 2 | |
For agent-driven workloads, the client_credentials factory takes a
ScaiKey client ID / secret and handles token caching + refresh
automatically. See the per-language pages for details.
OpenAI compatibility — when to use the OpenAI SDK instead#
If your code already targets the OpenAI Python or Node SDK and you only
need chat completions or embeddings, you don't need this SDK — point
the OpenAI client at https://scaigrid.scailabs.ai/oai/v1/:
1 2 | |
The native /v1/inference/* surface (and this SDK) adds tenant-aware
accounting metadata, native streaming chunk shape, and multi-modality
dispatch that the OAI-compat layer can't expose.
Versioning policy#
SDK version tracks the server's API minor: scailabs-scaigrid 1.5.x
works against API v1.5.*. Patch bumps are SDK-only. Breaking
server changes always bump both. See the per-language page for the
specific compatibility matrix.
See also#
- Authentication — how to obtain an API key.
- Inference reference — the underlying REST surface the SDK wraps.
- Error codes reference — the
full
codetaxonomy the SDKs surface as typed exceptions.