Skip to main content

OrbitSpace Python SDK

Python 3.11+ application backend SDK with synchronous and asynchronous clients, 330 typed REST operations, OAuth, explicit Task interaction, SSE recovery and verified downloads. Package: orbitspace-sdk; import namespace: orbitspace. Requires Python 3.11 or later.

Documentation / 开发文档 English 中文
Developer Center / 开发者中心 Open 打开
Python SDK handbook / Python 手册 Integration guide 接入指南
API reference / API 参考 Public REST API 公开 REST API
Authentication / 认证 API Tokens & OAuth API Token 与 OAuth

Install a published release

Install version 0.1.0 after it is available on PyPI:

python -m pip install orbitspace-sdk==0.1.0

During initial publication or when working with an unreleased checkout, use the source installation below. A version declared in the source tree alone does not prove that its PyPI release has completed.

Build from source

The SDK-only public distribution repository is orbitspace-python-sdk. Install from the public repository using Python 3.11+ and a dedicated virtual environment:

git clone https://github.com/orbitmesh-official/orbitspace-python-sdk.git
cd orbitspace-python-sdk
python -m venv .venv
. .venv/bin/activate
python -m pip install .

Consumers import orbitspace. They do not need a generator, protobuf, Buf or an application framework. Tagged releases are published through GitHub OIDC Trusted Publishing; consumers do not need PyPI publishing credentials.

Sync and async clients

from orbitspace import OrbitSpaceClient, models

with OrbitSpaceClient(token=api_token_from_secret_store, tenant_id=tenant_id) as client:
    task = client.tasks.create(models.CreateTaskRequest(
        workspace_id=workspace_id,
        workspace_agent_binding_id=binding_id,
        input="Summarize the supplied document.",
        idempotency_key=durable_business_job_key,
    ))
    result = client.tasks.wait(task.id, timeout=600)
    # Inspect result.state: waiting_input, waiting_approval and paused are not success.

Use async with AsyncOrbitSpaceClient(...) and await client.tasks.create(...) for asyncio applications. Async streams use async for; sync streams are ordinary iterators. Close streams explicitly when stopping early, and close the client. The sync facade uses a dedicated I/O loop for the same bounded async transport; closing a local client/stream never cancels the remote Task. Each client owns its dedicated token provider; do not share one across clients/event loops. See the runnable backend example.

OAuth and explicit writes

Use ClientCredentials(token_url, client_id, client_secret=secret, scope=scope) as token_provider, instead of token. Supply the issuer's actual HTTPS token URL. client_secret_basic, client_secret_post and private_key_jwt are supported; for the latter, provide an assertion(audience) signer. Secrets never belong in source code, public browser bundles or model-provider configuration.

Issuance is single-flight per provider; cancelling one waiter leaves others running. Expiring tokens renew early; responses without expiry are not cached long-term. invalidate() discards cached credentials and prevents stale in-flight issuance from restoring the old cache. Dedicated providers close with the client.

tasks.input_requests, get_input and reply_input use the existing input request. Replies require a persistent idempotency key and the exact decimal expected_state_version. Read a fresh Task before resume, pause, retry or cancel. SDKs never automatically answer, approve or resume. Writes are never automatically replayed. Scopes do not replace tenant/project authorization.

Streams, deadlines and errors

tasks, invocations and goals expose watch, observe and wait. A finite timeout is required. observe reads authoritative snapshots after events, with a minimum interval, and performs no idle polling. wait returns when an intervention or terminal state is reached. Local cancellation stops local I/O.

Use StreamOptions(after=cursor, committed_cursor=load_committed_cursor) for recovery. Commit effects and cursor atomically in business storage; observation alone is not acknowledgement. Reconnect reads the committed supplier, not the last observed event. Without a supplier it reuses the initial cursor: tolerate duplicates. Incomplete EOF frames are discarded; UTF-8 and frame limits are checked. History gaps remain explicit errors, never a silent jump to live data.

API requests have a total deadline (30 seconds by default), including body reads. Only GET/HEAD transient failures have bounded retries. Redirects, cookies, implicit environment authentication and cross-origin token forwarding are blocked. ApiError exposes status, code, request_id; default exception messages omit response bodies, credentials and signed URLs.

Verified artifact downloads

result = client.artifacts.download_file(
    artifact_id, destination, max_bytes=32 << 20, timeout=120,
)

Downloads use a separate credential-free client, check receipt expiry, exact size, byte limits and SHA-256, then atomically replace the destination. Failures remove private staging files and preserve the previous file. The default destination is the API artifact-download prefix; S3/CDN origins need explicit Destination(origin, path_prefix) entries. Redirects are not followed.

Full typed API

from orbitspace.generated.api.task_service import task_service_get_task
resource = task_service_get_task.sync(client=client.api, id=task_id)
# Async: await task_service_get_task.asyncio(client=client.api, id=task_id)

Generated operations use the same credential boundary. orbitspace.models exports typed wire models. UNSET, explicit null, empty lists, unknown string enums and large decimal version strings remain distinct. The public contract is embedded in the wheel. Raw operation modules expose the complete admitted application API, including Skill/Registry resources; Worker/Host administration and secret leasing are excluded.

This SDK does not install Runtimes, perform interactive OIDC/PKCE login or implement an application business ledger. Use an established login client and the separate Runtime/domain-tool contracts for those integrations.

Development

Use the pinned development requirements and run scripts/qualify.sh. Generation uses openapi-python-client 0.28.3 against a separate open-enum adapter; canonical OpenAPI 3.1 is unchanged. Both sync/async generated operations and typed sync facades are reproduced during qualification. SDK source and wheel/sdist release versions are independent of API, Runtime and website versions.

Apache-2.0. See LICENSE.

Metadata

Release files for orbitspace-sdk 0.1.0

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

Source distribution (sdist)

Source distribution for orbitspace-sdk 0.1.0
File Size Uploaded Provenance Actions
orbitspace_sdk-0.1.0.tar.gz 405.5 kB With provenance Details for orbitspace_sdk-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for orbitspace-sdk 0.1.0
File Interpreter ABI Platform Actions
orbitspace_sdk-0.1.0-py3-none-any.whl Python 3 none any Details for orbitspace_sdk-0.1.0-py3-none-any.whl

Total release size: 1.5 MB

Release files / orbitspace_sdk-0.1.0.tar.gz

Download URL orbitspace_sdk-0.1.0.tar.gz
Size 405.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c1d513d5356185a0991161dd86687f2b4427c754d6ff8ab55af26ba91587e1b7
BLAKE2b-256 checksum
How to use checksums
35acbac32bfbf29f7798f8c8caf4303ccf30fb3984f894775e943929fd2a77e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 29, 2026.

Transparency log

Release files / orbitspace_sdk-0.1.0-py3-none-any.whl

Download URL orbitspace_sdk-0.1.0-py3-none-any.whl
Size 1.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a248de19357a9893d29ff92f669096ce017b0ea6be3418fa738dc979b1de3570
BLAKE2b-256 checksum
How to use checksums
aab728a264a94f04088c6b3bca0bdf2f7b3326902be67259ef8f6cc7321b6fcc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 29, 2026.

Transparency log

Security for orbitspace-sdk 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for orbitspace_sdk-0.1.0.tar.gz

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 Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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