Clients
SpineClient(...) — sync
with SpineClient() as client:) so the
underlying HTTP pool closes cleanly.
AsyncSpineClient(...) — async
Identical signature; http_client accepts an httpx.AsyncClient. Use
as async with AsyncSpineClient() as client:.
Runs
| Method | Returns | Description |
|---|---|---|
client.runs.create(prompt, *, template, blocks, agent_instructions, webhook_url, files) | RunHandle | Create a new run and return a polling handle. |
client.runs.get(run_id) | GetRunResponse | One-shot status fetch. |
RunHandle
| Method | Returns | Description |
|---|---|---|
handle.refresh() | GetRunResponse | Fetch the current state. |
handle.wait(*, timeout, poll_interval, max_poll_interval) | RunResult | Poll until terminal; raise on timeout or failure. |
handle.stream_progress(*, poll_interval) | Iterator[RunProgress] | Yield snapshots until terminal. |
| Attribute | Type |
|---|---|
handle.run_id | str |
handle.canvas_id | str | None |
handle.create_response | CreateRunResponse |
Canvas
| Method | Returns |
|---|---|
client.canvas.get_dag(canvas_id) | CanvasDAG |
client.canvas.get_tasks(canvas_id) | TaskTree |
client.canvas.get_task(canvas_id, task_id) | TaskNode |
Enums
Template
AUTO, DEEP_RESEARCH, REPORT, SLIDES, MEMO, EXCEL, APP,
LANDING_PAGE. See Templates.
BlockType
17 members covering every block type the platform produces. See
Block types.
RunStatus
RUNNING, COMPLETED, PARTIAL, FAILED. status.is_terminal is
True for anything except RUNNING.
Models
All models are Pydantic v2 and are re-exported from the top-levelspine package:
extra="ignore", so new fields added to the backend
don’t break old SDK releases.
Exceptions
Retry policy
SpineClient(retry_policy=...).