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.0rc1

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.0rc1
File Size Uploaded
spatius-1.1.0rc1.tar.gz 159.3 kB Details

Built distribution (wheel)

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

Total release size: 196.9 kB

Release files / spatius-1.1.0rc1.tar.gz

Download URL spatius-1.1.0rc1.tar.gz
Size 159.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bd15ef9b67fe3896fd4ba19d3f8c04eee815f8a69aa4fa0d6e95bfef32069b1f
BLAKE2b-256 checksum
How to use checksums
73045b82f547e130adec7188a235315804d2933e05c148c94473f013a58e52f7
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 25, 2026.

Transparency log

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

Download URL spatius-1.1.0rc1-py3-none-any.whl
Size 37.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a0ed80bc02563d25e1e614ffb85979833e6266a1e1c7d98803bc06ac220aaff
BLAKE2b-256 checksum
How to use checksums
19a8526a843730d7763adef1bb4f2c789d8f1e13a0385beefb8148c108aa4e79
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 25, 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