spine-sdk) is a typed, documented client for the
Spine API. It wraps all five public endpoints,
handles polling with exponential backoff, and exposes both a sync and an
async client.
Install
py.typed), so mypy and Pyright pick them up out of the box.
First request
SPINE_API_KEY environment variable so keys stay out of your
source code:
What’s in the box
SpineClient + AsyncSpineClient
Sync and async clients built on
httpx. Use whichever matches your
stack.Typed models
Pydantic v2 models for every request and response — IDE
autocompletion and mypy coverage out of the box.
Polling helper
handle.wait() polls with exponential backoff;
handle.stream_progress() yields progress snapshots for UIs.Typed exceptions
AuthenticationError, NotFoundError, BadRequestError,
RateLimitError, ServerError, SpineTimeoutError — branch on the
exact failure.Next steps
Quickstart
Full end-to-end example with uploads, polling, and artifact download.
Runs and polling
All the options on
runs.create, wait, and stream_progress.Canvas introspection
Walk the block graph and task tree produced by a run.
Errors and retries
Exception hierarchy and how to tune the built-in retry policy.