Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Spatius Python SDK

Python server SDK for creating Spatius avatar sessions.

Installation

pip install spatius

Install the optional Ogg Opus encoder support when you want the SDK to encode raw PCM before sending:

pip install "spatius[opus]"

Telemetry

The SDK exports anonymous OpenTelemetry metrics and traces by default. Configure the process-wide OTLP base endpoint before using a session, or disable export with an empty string:

from spatius import configure_telemetry, shutdown_telemetry

configure_telemetry("https://telemetry.example.com")
# configure_telemetry("")  # disable metrics and traces

# Useful for short-lived processes that exit immediately after a session.
shutdown_telemetry()

The first audio message for each request carries W3C trace context to the backend. Later chunks omit it. OTel resources include service.name=spatius-python, sdk.platform=python, app_id, and the resolved region. The server SDK exports metrics and traces only; it does not upload telemetry logs.

Warm-up

Session creation performs region scheduling (bootstrap API) and a session-token exchange (console API) before the ingress WebSocket connects. prewarm() moves that work ahead of dispatch — e.g. into a worker's process warm-up hook — so init() reuses the cached results:

from spatius import prewarm

# best-effort, never raises
await prewarm(app_id="your-app-id", api_key="your-api-key")

This resolves and caches the auto region (reused for 5 minutes) and opens throwaway TLS connections to the console and ingress hosts, priming DNS and the process-wide TLS session cache shared by HTTP and WebSocket connections. Pass prefetch_session_token=True to also cache a session token, letting the next init() with matching credentials skip the console API round trip entirely (assumes the backend allows a token to back more than one session).

Documentation

See the full Python SDK guide at docs.spatius.ai/sdk-reference/python-sdk/python-sdk.

License

MIT

Release files for spatius 1.1.0rc2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spatius 1.1.0rc2
File Size Uploaded
spatius-1.1.0rc2.tar.gz 161.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spatius 1.1.0rc2
File Interpreter ABI Platform
spatius-1.1.0rc2-py3-none-any.whl Python 3 none any Details

Total release size: 199.8 kB

Release files / spatius-1.1.0rc2.tar.gz

Download URL spatius-1.1.0rc2.tar.gz
Size 161.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5ab7b888beffa865370c65376579e936146d8045924f2c3dbb2610c0fa853bf2
BLAKE2b-256 checksum
How to use checksums
d0d148720736b2c507281542da7ca4147ae3278e2bb3005ff0a88991c512f348
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Release files / spatius-1.1.0rc2-py3-none-any.whl

Download URL spatius-1.1.0rc2-py3-none-any.whl
Size 38.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ac47a2cca299f8f13e6a7c60caeb140e121e545dfe9ab4d5220b9133b54fbc2
BLAKE2b-256 checksum
How to use checksums
823aceb02275dbede3c27ea6dfc2c7f685ac689552e915518f7d232417a0a77c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page