Skip to main content
Browse the documentation

SDKs

SDKs overview

Six official client libraries for the Snaga API, what they share, and how to install each one.

Why use an SDK

You can call the Snaga API with plain HTTP, and the API section shows how. An SDK saves you the parts that are easy to get subtly wrong: sending an idempotency key on every write, retrying only what is safe to retry, walking cursor pages that can come back empty, reconnecting an event stream without losing events, and turning an error response into something you can switch on.

There are six official SDKs: TypeScript, Python, Rust, Kotlin, Swift and Ada. All six are generated from the platform's OpenAPI description, cover the whole documented API, and are released together under one version number. This page describes release 0.12.0 (18 October 2026), the first to include Python.

What every SDK gives you

  • Typed models. Every body the API description defines is a named type. Where the description defines no shape, you get raw JSON rather than an invented type.
  • Auth from the environment. The key comes from the constructor, or from UARP_API_KEY, then SNAGA_API_KEY. See Client and authentication.
  • Idempotency. Every mutating /api/v1/* call sends an Idempotency-Key. You can pass your own to replay a create on purpose.
  • Retries. Transient failures are retried with backoff; reads always, writes only when they carry an idempotency key. See Errors and retries.
  • Typed errors. RFC 9457 problem documents become a structured error with the status, the stable code, the request id and any field-level validation failures.
  • Streaming and pagination. Server-sent event endpoints return a native stream that reconnects with Last-Event-ID; cursor-paginated lists get a listAll / list_all helper. See Streaming and pagination.
  • Forward-compatible enums. A value the server adds later decodes instead of failing.
  • An escape hatch for calling an endpoint by hand when the generated surface does not fit.

Install

TypeScript / Node

npm install uarp-sdk

The package is ESM only. import works everywhere; require('uarp-sdk') needs Node 22.12+. On older Node, a CommonJS caller uses await import('uarp-sdk').

Python

pip install uarp-sdk

The import name is uarp_sdk. It offers a blocking Client and an asyncio AsyncClient.

Rust

[dependencies]
uarp-sdk = "0.12"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
futures-util = "0.3"   # only if you use streams

TLS is rustls by default; features = ["native-tls"] switches it.

Kotlin / Android

dependencies {
    implementation("ai.snaga:uarp-sdk:0.12.0")
}

The artifact brings OkHttp, kotlinx-serialization-json and kotlinx-coroutines-core with it.

Swift

// Package.swift
dependencies: [
    .package(url: "https://github.com/Snaga-AI/uarp-swift", from: "0.12.0"),
],
targets: [
    .target(name: "App", dependencies: [.product(name: "UARPSDK", package: "uarp-swift")]),
]

Then import UARPSDK.

Ada

# alire.toml
[[depends-on]]
uarp_sdk = "^0.12.0"

Alire has no direct upload: a release reaches the community index through a reviewed pull request, so the index can lag the other five. On 19 October 2026 it listed 0.5.14; until a newer release lands there, install the current one from the release archive on GitHub (https://github.com/Snaga-AI/uarp-sdks/releases).

Requirements

LanguagePackageRequirements
TypeScriptuarp-sdk (npm)Node 18+, or any runtime with a global fetch
Pythonuarp-sdk (PyPI)Python 3.10+, httpx
Rustuarp-sdk (crates.io)Rust 1.89+, Tokio
Kotlinai.snaga:uarp-sdk (Maven)Kotlin 2.2+, JVM 11+, Android API 21+
SwiftUARPSDK from Snaga-AI/uarp-swiftSwift 5.9+, macOS 12+, iOS 15+, tvOS 15+, watchOS 8+, visionOS 1+
Adauarp_sdk (Alire)GNAT (Ada 2022), GNATCOLL, libcurl

Known limits

  • Kotlin: the library is built with Kotlin 2.2. A project on a Kotlin 2.0 compiler fails with "Module was compiled with an incompatible version of Kotlin". On Android, pass the key explicitly instead of reading the environment.
  • Swift on Linux: request/response calls work, but event-stream endpoints throw UARPError.stream, because swift-corelibs-foundation has no way to read a response as it arrives.
  • Unions: the three oneOf bodies in the API description are raw JSON in every SDK except TypeScript, which renders them as union types.
  • Timestamps are ISO-8601 strings in every SDK, not native date types.

Keep keys off the client side

An API key in front-end code is readable by every visitor. Keep the key on a server you control and let your web page talk to that server; the server uses the SDK.

Source and issues