Official Python SDK for the Spine API.
Project description
spine-sdk
Official Python SDK for the Spine API.
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
SpineClientandAsyncSpineClient— 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.client.webhooks— verify inbound webhook signatures and parse the event withconstruct_event(payload, sig_header, secret).- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spine_sdk-0.2.0.tar.gz.
File metadata
- Download URL: spine_sdk-0.2.0.tar.gz
- Upload date:
- Size: 30.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f743b39826f0ebb398a92ac88ed7c1244130d4270d0f8405b2074089df9325a
|
|
| MD5 |
c4459fb25587543d3226384e6ebde5d6
|
|
| BLAKE2b-256 |
5696d56b7aca5cd5d3bf148d56b3b008257945fb73110652ec27f45d8066d74f
|
Provenance
The following attestation bundles were made for spine_sdk-0.2.0.tar.gz:
Publisher:
release.yml on Spine-AI/spine-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spine_sdk-0.2.0.tar.gz -
Subject digest:
9f743b39826f0ebb398a92ac88ed7c1244130d4270d0f8405b2074089df9325a - Sigstore transparency entry: 1345848974
- Sigstore integration time:
-
Permalink:
Spine-AI/spine-py@34c236dcbb936ec677a348edb982ea6d250fd41a -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Spine-AI
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@34c236dcbb936ec677a348edb982ea6d250fd41a -
Trigger Event:
push
-
Statement type:
File details
Details for the file spine_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: spine_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 30.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cbf26c473cbf31c670071aa099c88872ec2a3970904b59d7b4c5200eece14de
|
|
| MD5 |
a21ba37b891226ab59a0e3364f415454
|
|
| BLAKE2b-256 |
5e84c51bdd469aeee59592d3d52610e988e961b09c968f6e14f87ca49209ca0a
|
Provenance
The following attestation bundles were made for spine_sdk-0.2.0-py3-none-any.whl:
Publisher:
release.yml on Spine-AI/spine-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spine_sdk-0.2.0-py3-none-any.whl -
Subject digest:
7cbf26c473cbf31c670071aa099c88872ec2a3970904b59d7b4c5200eece14de - Sigstore transparency entry: 1345849056
- Sigstore integration time:
-
Permalink:
Spine-AI/spine-py@34c236dcbb936ec677a348edb982ea6d250fd41a -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Spine-AI
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@34c236dcbb936ec677a348edb982ea6d250fd41a -
Trigger Event:
push
-
Statement type: