Skip to main content

Official Python SDK for the Spine API.

Project description

spine-sdk

Official Python SDK for the Spine API.

PyPI version Python versions License: MIT

Create async canvas runs, poll them to completion, and introspect the resulting canvas graph and task tree — with full type hints, sync and async clients, and a built-in polling helper.

Installation

pip install spine-sdk

The package installs as spine, so you import it as:

from spine import SpineClient

Python 3.9+ is required.

Quickstart

from spine import SpineClient, Template

with SpineClient(api_key="sk_spine_...") as client:
    handle = client.runs.create(
        prompt="Research the Q4 2025 AI chip market and write a memo",
        template=Template.DEEP_RESEARCH,
    )
    result = handle.wait(timeout=600)
    print(result.final_output)
    for artifact in result.artifacts:
        print(artifact.name, artifact.download_url)

The same code in async:

import asyncio
from spine import AsyncSpineClient

async def main() -> None:
    async with AsyncSpineClient() as client:  # reads SPINE_API_KEY from env
        handle = await client.runs.create(prompt="Hello")
        result = await handle.wait()
        print(result.final_output)

asyncio.run(main())

What's in the SDK

  • SpineClient and AsyncSpineClient — fully typed, context-managed HTTP clients.
  • client.runs — create runs, poll them, wait for completion with exponential backoff, or stream progress snapshots.
  • client.canvas — inspect the canvas block DAG and task tree for any run.
  • Typed Pydantic models for every request and response.
  • Typed exceptions (AuthenticationError, NotFoundError, BadRequestError, ServerError, SpineTimeoutError) so you can branch on the exact failure.
  • Automatic retry on transient 5xx and 429 responses (honours Retry-After).

Documentation

Full reference and guides: https://docs.getspine.ai/api-reference/sdks/python

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spine_sdk-0.1.0.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spine_sdk-0.1.0-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

Details for the file spine_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: spine_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for spine_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9b067253d7f0429d392f1984e54c7cc1a9286b8ed8e4aee6e80eb3f3308c08e9
MD5 0b5d561966b90275ba07ae9177b9077f
BLAKE2b-256 d6b755add0a7a949c252f3db88a44f8c020f9008744a705646e2e9809fcbcf51

See more details on using hashes here.

Provenance

The following attestation bundles were made for spine_sdk-0.1.0.tar.gz:

Publisher: release.yml on Spine-AI/spine-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spine_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: spine_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for spine_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2988b9f9a040e6e4b1d91d00724d566e4dc90aa19ab38c44866fb5e29ab9754a
MD5 77c396a667c144ea1f7be465f9a8b851
BLAKE2b-256 ec0ff355c580bdb3b16e555e5394e8ffc773a77209182de9c00bb0851e1bdb0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for spine_sdk-0.1.0-py3-none-any.whl:

Publisher: release.yml on Spine-AI/spine-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page