# Authentication
Source: https://docs.getspine.ai/api-reference/authentication
API key setup, rotation, and security.
All Spine API endpoints authenticate via the `X-API-KEY` header.
```
X-API-KEY: sk_spine_...
```
## Create an API key
1. Go to [API keys](https://platform.getspine.ai/keys) in the developer portal.
2. Click **Create Key** and give it an optional name.
3. Copy the key immediately — it is only shown once.
4. Use the key in the `X-API-KEY` header for all Spine API requests.
Keys can be rotated or revoked from the same page.
## Security best practices
* Never expose API keys in client-side code or commit them to version control.
* Store keys in environment variables or a secrets manager.
* Rotate keys periodically and whenever a team member with access leaves.
* Revoke keys immediately if a leak is suspected.
* Use a separate key per application or service so you can rotate scope-by-scope.
# Get a single task
Source: https://docs.getspine.ai/api-reference/canvas/get-a-single-task
/openapi.yaml get /v1/canvas/{canvas_id}/tasks/{task_id}
Returns a single task with its children.
# Get canvas DAG
Source: https://docs.getspine.ai/api-reference/canvas/get-canvas-dag
/openapi.yaml get /v1/canvas/{canvas_id}/dag
Returns the canvas block graph — nodes and edges.
# Get task tree
Source: https://docs.getspine.ai/api-reference/canvas/get-task-tree
/openapi.yaml get /v1/canvas/{canvas_id}/tasks
Returns the full task hierarchy for a canvas:
parent-task → persona-task → tool-call-task.
# Agent instructions
Source: https://docs.getspine.ai/api-reference/concepts/agent-instructions
Shape agent tone, rigor, scope, and citations across every layer of a run.
The `agent_instructions` field on [`POST /v1/run`](/api-reference/endpoints/create-run) is a natural-language directive that gets incorporated into system prompts at every agent layer — orchestrator, strategist, persona agents, and block operators. Use it to shape tone, depth, scope, and citation requirements without having to pre-configure block types.
## Examples
| Instruction | Effect |
| -------------------------------------------------- | ----------------------------------------------------- |
| `"Be thorough, verify all claims with 2+ sources"` | More personas spun up, verification steps inserted |
| `"Prioritize speed, minimal verification"` | Single persona, cross-checks skipped |
| `"Write for a C-suite executive audience"` | Executive tone across all outputs |
| `"Focus on European markets only"` | Research scoped geographically |
| `"Include source citations for every claim"` | Citation requirements injected into per-block prompts |
## Usage
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
curl -X POST https://api.getspine.ai/v1/run \
-H "X-API-KEY: sk_spine_..." \
-F "prompt=Analyze the competitive landscape for AI coding tools" \
-F "template=deep_research" \
-F "agent_instructions=Be thorough, verify all claims with 2+ sources. Write for a technical audience."
```
Agent instructions are additive to templates and custom `blocks` — you can combine all three in a single request.
# Block types
Source: https://docs.getspine.ai/api-reference/concepts/block-types
The 17 block types agents can create, and how they map to the visual app.
A block is a single node in the canvas DAG. The `blocks` field on [`POST /v1/run`](/api-reference/endpoints/create-run) accepts a JSON array of block-type strings that constrains what the agents are allowed to create — overriding whatever [template](/api-reference/concepts/templates) you passed.
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
curl -X POST https://api.getspine.ai/v1/run \
-H "X-API-KEY: sk_spine_..." \
-F "prompt=Create a Q1 performance report with charts" \
-F 'blocks=["document-block", "table-block", "image-block", "web-block"]'
```
## Valid block types
Each API block type maps 1:1 to a block in the visual app. Follow the link to see what the block produces, its inputs, and example use cases.
| Block type | Creates | App docs |
| --------------------- | ----------------------------- | ------------------------------------------------------------ |
| `prompt-block` | AI prompt / analysis | [Prompt Block](/app/blocks/prompt-block) |
| `list-block` | Expandable list | [List Block](/app/blocks/list-block) |
| `memo-block` | Memo document (.docx) | [Memo Block](/app/blocks/memo-block) |
| `document-block` | Report document (.docx) | [Document Block](/app/blocks/document-block) |
| `excel-block` | Spreadsheet (.xlsx) | [Excel Block](/app/blocks/excel-block) |
| `deep-research-block` | Deep research report | [Deep Research Block](/app/blocks/deep-research-block) |
| `image-block` | AI-generated image (.png) | [Image Generation Block](/app/blocks/image-generation-block) |
| `presentation-block` | Slide deck (.pptx) | [Slides Block](/app/blocks/slides-block) |
| `app-block` | Web application (.html) | [App Block](/app/blocks/app-block) |
| `table-block` | Structured data table | [Table Block](/app/blocks/table-block) |
| `prototype-block` | Interactive prototype (.html) | [App Block](/app/blocks/app-block) |
| `landing-page-block` | Landing page (.html) | [App Block](/app/blocks/app-block) |
| `text-block` | Static markdown / text note | [Notes Block](/app/blocks/notes-block) |
| `web-block` | Web URL reference | [Web Page](/app/blocks/web-page) |
| `yt-block` | YouTube video reference | [YouTube Block](/app/blocks/youtube-block) |
| `web-research-block` | Browser navigation / scraping | [BrowserUse Block](/app/blocks/browseruse-block) |
| `file-block` | File upload reference | [File Upload](/app/blocks/file-upload) |
## When to use `blocks` vs `template`
* **Use a template** when you want an opinionated output — the template was tuned for that shape.
* **Use `blocks`** when you need to add or remove a specific block type, e.g. forcing a `table-block` into a research run, or excluding `image-block` for cost reasons.
See [Templates](/api-reference/concepts/templates) for the full template matrix.
# Canvases and runs
Source: https://docs.getspine.ai/api-reference/concepts/canvases-and-runs
How runs, canvases, blocks, and tasks fit together.
The Spine API has four core concepts. Understanding how they relate makes the rest of the reference make sense.
## Run
A **run** is a single invocation of the API. You create one with [`POST /v1/run`](/api-reference/endpoints/create-run). A run moves through `running` → `completed` (or `partial` / `failed`) and eventually produces a synthesized `final_output` and zero or more downloadable `artifacts`.
A run has a 1:1 relationship with a canvas: each run generates exactly one new canvas.
## Canvas
A **canvas** is the workspace that blocks and connections live on. In the visual [Spine app](/app/canvas) it's an infinite pannable surface; through the API it's a directed acyclic graph exposed via [`GET /v1/canvas/{canvas_id}/dag`](/api-reference/endpoints/get-canvas-dag).
Agents build the canvas for you: they decompose your prompt into subtasks, pick the right block types, and wire them together so outputs from one block feed into the next.
## Block
A **block** is a single computational node — one AI prompt, one document generation, one web fetch, one image. Blocks are the units of work on the canvas. Each block has a `type` (one of 17 — see [Block types](/api-reference/concepts/block-types)), a `status`, a `content` field with its output, and optional `url` / `sources` references.
You can constrain which block types agents are allowed to create in three ways, in order of precedence:
1. Pass an explicit `blocks` array on the run request.
2. Pass a `template` (a curated block preset — see [Templates](/api-reference/concepts/templates)).
3. Let it default to `auto`, which allows all 17 types.
## Task
A **task** is execution metadata, not canvas content. Tasks form a three-level hierarchy that mirrors how agents decompose work internally:
* **Parent-task** — a high-level goal (e.g., "Produce the Q1 performance report").
* **Persona-task** — a sub-task assigned to a specialized persona agent (e.g., "Finance analyst: draft the executive summary").
* **Tool-call-task** — an atomic tool invocation (e.g., "Call the Excel generator").
Fetch the full tree with [`GET /v1/canvas/{canvas_id}/tasks`](/api-reference/endpoints/get-canvas-tasks) or a single task with [`GET /v1/canvas/{canvas_id}/tasks/{task_id}`](/api-reference/endpoints/get-task). Tasks are most useful for debugging, building observability UIs, or displaying agent progress to end users.
## How they connect
```
Run (POST /v1/run)
└── Canvas (1:1 with run)
├── Blocks (DAG nodes, exposed via /dag)
└── Tasks (execution tree, exposed via /tasks)
```
A typical integration looks like: create a run, poll until terminal, display `final_output` and link the `artifacts`. If you want richer UX — e.g. a live agent-progress view — also pull the task tree while the run is in flight.
# File uploads
Source: https://docs.getspine.ai/api-reference/concepts/file-uploads
Attach documents and images to a run as agent context.
Attach files to a run request using the `files` field on [`POST /v1/run`](/api-reference/endpoints/create-run). Files ride along as `multipart/form-data` and become blocks on the resulting canvas.
## Supported file types
**Images** (create an `image-block`): PNG, JPEG, GIF, WEBP, SVG.
**Documents** (create a `file-block`, indexed for agent access): PDF, DOCX, XLSX, CSV, TXT, MD, YAML, JSON, ZIP.
## Example
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
curl -X POST https://api.getspine.ai/v1/run \
-H "X-API-KEY: sk_spine_..." \
-F "prompt=Summarize this sales data and create a chart" \
-F "template=report" \
-F "files=@sales-data.csv;type=text/csv" \
-F "files=@revenue-chart.png;type=image/png"
```
## Notes
* Multiple files can be attached in a single request — just repeat `-F "files=@..."`.
* Image files show up as image-blocks on the canvas and are available to downstream agents by visual reference.
* Document files are indexed at ingest time so every agent in the run can query them.
* Maximum file size and total attachment limits apply per plan — see [Pricing](/app/team/pricing).
# Polling and status
Source: https://docs.getspine.ai/api-reference/concepts/polling-and-status
How to poll a run and interpret the response at each state.
Prefer webhooks for app integrations. Instead of polling on a timer, you can register a webhook URL to receive a signed callback the moment a run completes. See [Webhooks](/api-reference/concepts/webhooks).
Runs are asynchronous. [`POST /v1/run`](/api-reference/endpoints/create-run) returns a `run_id` immediately; you poll [`GET /v1/run/{run_id}`](/api-reference/endpoints/get-run) until the run reaches a terminal status.
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
curl https://api.getspine.ai/v1/run/ \
-H "X-API-KEY: sk_spine_..."
```
Runs average 10–20 minutes; complex research can take up to 2 hours. Poll every 15–30 seconds, or use a backoff (start at 15 s, grow to 60 s) to reduce traffic on longer runs.
## Run statuses
| Status | Meaning | Terminal? |
| ----------- | ------------------------------------------- | --------- |
| `running` | Agents still executing | No |
| `completed` | All agents finished, results available | Yes |
| `partial` | Some blocks failed but usable results exist | Yes |
| `failed` | Run failed — see `errors` array | Yes |
## Response shapes
### While running
```json theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
{
"success": true,
"data": {
"run_id": "uuid",
"status": "running",
"canvas_id": "uuid",
"progress": {
"tasks_completed": 3,
"tasks_total": 8,
"elapsed_ms": 480000
}
}
}
```
### Completed
```json theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
{
"success": true,
"data": {
"run_id": "uuid",
"status": "completed",
"canvas_id": "uuid",
"duration_ms": 927300,
"result": {
"final_output": "synthesized answer or agent summary",
"artifacts": [
{
"id": "node-uuid",
"type": "docx",
"name": "Q1_Report.docx",
"download_url": "https://...",
"size_bytes": 245000
}
]
},
"metadata": {
"template_used": "report",
"models_used": ["anthropic/claude-sonnet-4-6"],
"credits_consumed": 45
}
}
}
```
### Failed
```json theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
{
"success": true,
"data": {
"run_id": "uuid",
"status": "failed",
"errors": [{ "error": "Agent execution failed" }]
}
}
```
## Canvas introspection
Spine runs are fully auditable. Once a run has a `canvas_id`, you can see exactly what the agents did — both programmatically and visually.
### Inspect via the API
* [`GET /v1/canvas/{canvas_id}/dag`](/api-reference/endpoints/get-canvas-dag) — the block graph (nodes + edges). Shows which blocks the agents created and how they're connected.
* [`GET /v1/canvas/{canvas_id}/tasks`](/api-reference/endpoints/get-canvas-tasks) — the full task hierarchy (parent-task → persona-task → tool-call-task). Reveals how the prompt was decomposed, which personas ran, and every tool call they made.
* [`GET /v1/canvas/{canvas_id}/tasks/{task_id}`](/api-reference/endpoints/get-task) — a single task with its children. Drill into one step of the agent's reasoning.
Every block includes its full `content` output and `sources`, so you can verify every intermediate artifact — not just the final deliverable.
### Open the run in a canvas
Each `canvas_id` also has a visual counterpart at `https://app.getspine.ai/canvas/{canvas_id}` — open it to see the block DAG rendered, click into any block to inspect its output, and watch the agent tree as a graph rather than JSON. Same data, two surfaces: use whichever fits your workflow.
# Templates
Source: https://docs.getspine.ai/api-reference/concepts/templates
Preset block configurations for common workflows.
Templates are named presets that control which block types agents are allowed to create. Pass a `template` field in [`POST /v1/run`](/api-reference/endpoints/create-run).
| Template | Block types | Typical output |
| --------------- | ------------------------------------------------------ | -------------------- |
| `auto` | All 17 block types | Depends on prompt |
| `deep_research` | prompt, table, web, web-research, file, yt, memo, text | Research memo |
| `report` | prompt, table, web, yt, document, text | Report (.docx) |
| `slides` | prompt, table, web, yt, presentation, text | Slide deck (.pptx) |
| `memo` | prompt, web, yt, memo, text | Memo (.docx) |
| `excel` | prompt, table, web, yt, excel, text | Spreadsheet (.xlsx) |
| `app` | prompt, app, text | Web app (.html) |
| `landing_page` | prompt, web, image, yt, landing-page, text | Landing page (.html) |
## Example
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
curl -X POST https://api.getspine.ai/v1/run \
-H "X-API-KEY: sk_spine_..." \
-F "prompt=Create a quarterly sales report" \
-F "template=report"
```
## Precedence
When both `blocks` and `template` are provided, `blocks` wins:
```
blocks (if provided) > template > "auto" default
```
See [Block types](/api-reference/concepts/block-types) for the full block-type reference and when to use `blocks` instead of a template.
# Webhooks
Source: https://docs.getspine.ai/api-reference/concepts/webhooks
Receive signed HTTP callbacks when a run starts, completes, or fails.
Webhooks let your app react to [run](/api-reference/concepts/canvases-and-runs) lifecycle events without polling. When an event fires, Spine POSTs a signed JSON envelope to a URL you configured, and you verify it with a shared secret.
Pair webhooks with [polling](/api-reference/concepts/polling-and-status) if you want both — the delivery tells you when a run is ready, and `GET /v1/run/{run_id}` gives you the full shape on demand.
Webhook endpoints are configured per workspace in the Spine developer portal. A single endpoint can subscribe to one or more event types, or to `*` for everything.
## Event types
| Event | Fires when |
| --------------- | ---------------------------------------------------------------------------------------- |
| `run.started` | Immediately after [`POST /v1/run`](/api-reference/endpoints/create-run) creates the run. |
| `run.completed` | The run reaches terminal status `completed`. Includes `final_output` and artifacts. |
| `run.failed` | The run reaches terminal status `failed`. Includes the error message. |
| `webhook.ping` | Fired by **Send test event** in the portal — use it to exercise your verifier. |
## Event envelope
Every delivery has the same top-level shape.
```json theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
{
"id": "evt_78ffe7c625d94d2192b2f5a8d63933a6",
"type": "run.completed",
"created": 1745251200,
"livemode": true,
"api_version": "2026-04-01",
"data": {
"object": {
"run_id": "06bb6cee-7982-48af-acd4-05d21ce39ed5",
"canvas_id": "3c86545a-2e06-4c29-aac5-557f897c8ada",
"status": "completed",
"duration_ms": 10736,
"artifacts": [],
"final_output": "2 + 2 equals 4."
}
}
}
```
| Field | Type | Notes |
| ------------- | ------ | ---------------------------------------------------------------------------------------------------- |
| `id` | string | `evt_`. Unique per delivery — use for idempotency. |
| `type` | string | One of the event types above. |
| `created` | int | Unix seconds when the event was generated. |
| `livemode` | bool | `true` in production, `false` in development / staging. |
| `api_version` | string | Envelope schema version. Bumped on breaking changes. |
| `data.object` | object | The payload. For `run.*` events, mirrors [`GET /v1/run/{run_id}`](/api-reference/endpoints/get-run). |
## Request headers
```
Content-Type: application/json
User-Agent: Spine-Webhooks/1.0
Spine-Signature: t=1745251200,v1=5fe3f78dbf86c53084d1bd1222005d3c064567937e5ceafb904e30551fdb89ad
Spine-Event-Id: 37070895-029a-4802-a5da-4052e7964cc3
Spine-Event-Type: run.completed
```
`Spine-Signature` is `t={unix_ts},v1={hex}` — timestamp and HMAC-SHA256 over `{t}.{raw_body}`. `Spine-Event-Id` equals `event.id` in the body; persist it to dedupe. `Spine-Event-Type` is redundant with `event.type` but handy for routing before JSON parse.
## Verify the signature
Always verify the signature before processing a delivery. Anyone who learns your webhook URL can send unsigned POSTs; the signature proves the body came from Spine.
Given the `whsec_...` secret you stored when you created the endpoint, the raw request body, and the `Spine-Signature` header, verification is five steps:
1. **Parse the header.** Split on `,` to extract `t` (unix seconds) and every `v1=` value.
2. **Check freshness.** Reject if `abs(now - t) > 300` — blocks replayed deliveries.
3. **Rebuild the signed payload.** Literally `{t}.{raw_body}`: the header's `t` value, a single `.`, then the **raw request body bytes**. Not the parsed JSON — frameworks may reorder keys and invalidate the signature.
4. **Recompute the HMAC.** `HMAC-SHA256(secret, signed_payload)` as a lowercase hex digest.
5. **Constant-time compare** against any `v1` value from the header. Use `hmac.compare_digest` (Python) or `crypto.timingSafeEqual` (Node) — never `==`.
```python Python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
import hmac, hashlib, time
TOLERANCE_SECONDS = 300
def verify_spine_webhook(secret: str, raw_body: bytes, header: str) -> bool:
pairs = [kv.split("=", 1) for kv in header.split(",") if "=" in kv]
t = next((v for k, v in pairs if k == "t"), None)
v1s = [v for k, v in pairs if k == "v1"]
if not t or not v1s:
return False
if abs(int(time.time()) - int(t)) > TOLERANCE_SECONDS:
return False
expected = hmac.new(
secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256
).hexdigest()
return any(hmac.compare_digest(expected, v) for v in v1s)
```
```typescript TypeScript theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
import crypto from "node:crypto";
const TOLERANCE_SECONDS = 300;
export function verifySpineWebhook(
secret: string,
rawBody: Buffer | string,
header: string,
): boolean {
const pairs = header.split(",").map((s) => s.trim().split("="));
const t = pairs.find(([k]) => k === "t")?.[1];
const v1s = pairs.filter(([k]) => k === "v1").map(([, v]) => v);
if (!t || v1s.length === 0) return false;
if (Math.abs(Math.floor(Date.now() / 1000) - parseInt(t, 10)) > TOLERANCE_SECONDS) {
return false;
}
const body = typeof rawBody === "string" ? Buffer.from(rawBody, "utf8") : rawBody;
const signed = Buffer.concat([Buffer.from(`${t}.`), body]);
const expected = crypto.createHmac("sha256", secret).update(signed).digest("hex");
const e = Buffer.from(expected);
return v1s.some((s) => {
const b = Buffer.from(s);
return b.length === e.length && crypto.timingSafeEqual(e, b);
});
}
```
Express parses JSON by default and discards the raw bytes needed for verification — capture them first.
```typescript theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
app.post(
"/webhooks/spine",
express.raw({ type: "application/json" }),
(req, res) => {
if (!verifySpineWebhook(SECRET, req.body, req.header("Spine-Signature") ?? "")) {
return res.status(400).json({ error: "invalid signature" });
}
const event = JSON.parse(req.body.toString("utf8"));
// dedupe on event.id, then handle event.type
res.status(200).json({ ok: true });
},
);
```
## Test your setup
Before wiring real events to your verifier, send a ping and confirm it parses cleanly.
1. In the Spine developer portal, open your webhook endpoint and click **Send test event**. This fires a `webhook.ping` delivery through the real pipeline — signed, headered, same shape as production events.
2. Confirm your endpoint returned `2xx` in the portal's delivery log. A non-2xx means your verifier rejected a legitimate Spine signature; inspect the delivery's response body for your error message.
3. Click **Resend** on the delivery to re-fire it as you iterate.
The ping envelope is intentionally minimal so you can assert on it:
```json theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
{
"id": "evt_...",
"type": "webhook.ping",
"created": 1745251200,
"livemode": false,
"api_version": "2026-04-01",
"data": { "object": { "ok": true } }
}
```
Common causes of a failed verifier:
* **Body was re-parsed before hashing.** Hash the bytes you received, not the re-serialized JSON. Express needs `express.raw()`; FastAPI needs `await request.body()` on the `Request` object.
* **Wrong secret.** After rotation, the previous secret stops signing immediately — update the value in your app before the next delivery.
* **Clock skew.** If your server drifts more than 5 minutes from Spine's clock, every delivery will fail the freshness check. Run NTP.
* **Non-constant-time compare.** Fine functionally, but leaks timing information to attackers. Use the platform primitive.
## Responding
Return any `2xx` status within **10 seconds** to mark the delivery as succeeded. Anything else — non-2xx, timeout, network error — is recorded as `failed` in the delivery log. Do heavy work asynchronously: acknowledge fast, process later.
## Idempotency
Two situations can look like duplicates:
* **Resend.** Clicking **Resend** in the portal clones a past delivery and fires a fresh one with a **new** `Spine-Event-Id`.
* **Repeat trigger.** If a run transitions through a terminal state more than once (rare), each transition issues a new delivery with a new `Spine-Event-Id`.
Either way: persist the `Spine-Event-Id` alongside the downstream effect, and skip if you've seen it.
## Secret management
The full `whsec_...` secret is shown exactly once when you create or rotate an endpoint. Store it in a secret manager or your `.env` — after the reveal, the portal shows only a masked form like `whsec_••••abcd`.
Rotating invalidates the old secret immediately. If multiple consumers share a secret, update your verifiers before rotating.
## Notes
* Deliveries are single-attempt in v1. Transient failures are recorded and can be re-fired with **Resend** in the portal. Automatic retries with exponential backoff are planned.
* Use `*` in the events list to subscribe an endpoint to every event type, including ones added later.
* HTTPS is enforced in production.
# Create a run
Source: https://docs.getspine.ai/api-reference/endpoints/create-run
POST /v1/run
Submit a prompt to trigger an async canvas run. Agents orchestrate a
DAG of blocks to satisfy the prompt; poll `GET /v1/run/{run_id}`
until status becomes `completed`, `partial`, or `failed`.
Async runs need an API key and typically take 10–20 minutes (up to 2 hours
for complex research). Get \$5 of free credits on signup — no subscription,
\$1 = 1,000 credits. The developer playground handles auth, polling, and
artifact downloads for you.
For push notifications on run completion, configure a webhook endpoint in the [developer portal](https://portal.getspine.ai/webhooks) instead of using the per-run `webhook_url` field. See [Webhooks](/api-reference/concepts/webhooks) for the event schema and signature verification.
# Get canvas DAG
Source: https://docs.getspine.ai/api-reference/endpoints/get-canvas-dag
GET /v1/canvas/{canvas_id}/dag
Returns the canvas block graph — nodes and edges.
Async runs need an API key and typically take 10–20 minutes (up to 2 hours
for complex research). Get \$5 of free credits on signup — no subscription,
\$1 = 1,000 credits. The developer playground handles auth, polling, and
artifact downloads for you.
# Get task tree
Source: https://docs.getspine.ai/api-reference/endpoints/get-canvas-tasks
GET /v1/canvas/{canvas_id}/tasks
Returns the full task hierarchy for a canvas:
parent-task → persona-task → tool-call-task.
Async runs need an API key and typically take 10–20 minutes (up to 2 hours
for complex research). Get \$5 of free credits on signup — no subscription,
\$1 = 1,000 credits. The developer playground handles auth, polling, and
artifact downloads for you.
# Get a run
Source: https://docs.getspine.ai/api-reference/endpoints/get-run
GET /v1/run/{run_id}
Poll the current status of a run. Returns progress while `running` and
the full result (final output + downloadable artifacts + metadata)
once `completed`.
Async runs need an API key and typically take 10–20 minutes (up to 2 hours
for complex research). Get \$5 of free credits on signup — no subscription,
\$1 = 1,000 credits. The developer playground handles auth, polling, and
artifact downloads for you.
# Get a single task
Source: https://docs.getspine.ai/api-reference/endpoints/get-task
GET /v1/canvas/{canvas_id}/tasks/{task_id}
Returns a single task with its children.
Async runs need an API key and typically take 10–20 minutes (up to 2 hours
for complex research). Get \$5 of free credits on signup — no subscription,
\$1 = 1,000 credits. The developer playground handles auth, polling, and
artifact downloads for you.
# Errors
Source: https://docs.getspine.ai/api-reference/errors
HTTP status codes and error response shapes.
All errors return a standard JSON envelope with an appropriate HTTP status code:
```json theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
{
"success": false,
"error": "Human-readable error message"
}
```
## HTTP status codes
| Code | Meaning | Common causes |
| ----- | -------------- | --------------------------------------------------------------------------------------------------------- |
| `400` | Bad Request | Invalid `template`, invalid `blocks` (bad JSON, unknown block types, empty array), malformed UUID in path |
| `401` | Unauthorized | Missing `X-API-KEY` header, invalid or revoked API key |
| `404` | Not Found | Run, canvas, or task does not exist or belongs to another account |
| `500` | Internal Error | Unexpected server error — details are logged server-side and not exposed to callers |
## Example error responses
### Invalid template (400)
```json theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
{
"success": false,
"error": "Invalid template: foo. Valid templates: app, auto, deep_research, excel, landing_page, memo, report, slides"
}
```
### Invalid block types (400)
```json theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
{
"success": false,
"error": "Invalid block types: my-block. Valid block types: app-block, deep-research-block, ..."
}
```
### Missing API key (401)
```json theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
{
"success": false,
"error": "X-API-KEY header required"
}
```
### Run not found (404)
```json theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
{
"success": false,
"error": "Run not found: 550e8400-e29b-41d4-a716-446655440000"
}
```
### Invalid UUID (400)
```json theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
{
"success": false,
"error": "Invalid run_id: must be a valid UUID"
}
```
### Internal error (500)
```json theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
{
"success": false,
"error": "An internal error occurred while creating the run"
}
```
# For agents
Source: https://docs.getspine.ai/api-reference/for-agents
Spine docs are built for LLM consumption. Raw markdown, llms.txt, OpenAPI spec, and per-agent skill files.
Spine docs are designed to be parsed and consumed by AI agents. Every surface listed here is auto-generated by Mintlify and stays in sync with the rest of this site.
## Machine-readable surfaces
Compact index of every page with one-line descriptions. Drop this URL into
any agent that supports the `llms.txt` convention.
Full text of every page in a single document. Use when you want the agent
to have the complete docs in context.
The Spine API spec — suitable for codegen tools, schema validators, or
any agent that consumes OpenAPI directly.
Add `.md` to any page URL (e.g. `/api-reference/quickstart.md`) for raw
markdown. Or request the HTML URL with `Accept: text/markdown`.
## Discovery headers
Every HTML response includes:
```
Link: ; rel="alternate"; type="text/plain"; title="llms.txt"
X-Llms-Txt: https://docs.getspine.ai/llms.txt
```
Agents can discover the docs index from any page's response headers — no out-of-band configuration needed.
## Drop Spine into your agent
Install the matching skill or config for your agent:
Installable skill file for `~/.claude/skills/`.
Tool config for OpenClaw's local agent runtime.
`.cursorrules` file for Cursor projects.
System prompt snippet for OpenAI Codex CLI.
Proxy + fetch patterns for browser-based builders.
# Claude Code
Source: https://docs.getspine.ai/api-reference/integrations/claude-code
Install a Claude Code skill that delegates research and deliverable generation to Spine.
Drop a single skill file into Claude Code and it learns when and how to call the Spine API — no prompt engineering on your part.
## Install
Claude Code 2.1+ loads skills from installed plugins. Loose files at
`~/.claude/skills/*.md` are no longer auto-scanned — you must install the skill
as a plugin, or inject it into individual sessions with
`--append-system-prompt-file`.
Install the `spine` plugin from the Spine marketplace:
```shell theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
/plugin marketplace add Spine-AI/claude-plugins
/plugin install spine@spine-marketplace
```
The plugin exposes the skill `spine:research`, which Claude Code
auto-discovers at session start and invokes on research/deliverable prompts.
If you can't install plugins (sandbox, policy, etc.), download the skill
file and inject it into a single session:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
curl -o ~/.claude/skills/spine.skill.md \
https://docs.getspine.ai/static/agent-files/spine.skill.md
claude -p "Your research task" \
--append-system-prompt-file ~/.claude/skills/spine.skill.md
```
Clone the plugin repo and point Claude Code at it directly:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
git clone https://github.com/Spine-AI/claude-plugins
claude --plugin-dir ./claude-plugins/plugins/spine
```
`spine.skill.md` — used by the per-invocation fallback tab above
## Set your API key
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
export SPINE_API_KEY="sk_spine_..."
```
Create a key at [platform.getspine.ai/keys](https://platform.getspine.ai/keys) if you don't have one.
## What it does
Once installed, Claude Code will automatically delegate to Spine when you ask for tasks like:
* "Produce a competitive analysis of AI coding tools"
* "Create a Q1 sales report from this CSV"
* "Build a slide deck on European market expansion"
Claude calls `POST /v1/run`, polls until complete, and presents the synthesized output plus download links for any generated artifacts.
## Example session
```
You: Produce a competitive analysis of the top 5 AI research APIs
Claude: I'll delegate this to the Spine API using the deep_research template.
[Creates run → polls → completed in 13m 04s]
Here's the analysis:
- final_output: [competitive analysis text...]
- Artifacts:
- Competitive_Analysis.docx (download: https://...)
- Market_Data.xlsx (download: https://...)
- Credits consumed: 32
```
## How the skill works
The skill file teaches Claude Code:
1. **When** to use Spine (multi-source research, deliverable generation — not simple lookups)
2. **How** to authenticate (`SPINE_API_KEY` env var)
3. **The two-step pattern** — `POST /v1/run` → poll `GET /v1/run/{run_id}`
4. **How to pick a template** based on the deliverable type
5. **How to present results** — show `final_output` + artifact download links
# Codex CLI
Source: https://docs.getspine.ai/api-reference/integrations/codex-cli
Use OpenAI Codex CLI with the Spine API for research and deliverables.
[Codex CLI](https://github.com/openai/codex) is OpenAI's terminal-based coding agent. Give it a system prompt that includes Spine's API pattern and it will delegate research-heavy tasks to Spine.
## Install
Download the system-prompt snippet:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
curl -o spine-codex-prompt.md \
https://docs.getspine.ai/static/agent-files/spine.codex.md
```
`spine.codex.md` — append to your Codex system prompt or project instructions
Then append it to your Codex system instructions, or paste it into your project's `AGENTS.md`.
## Set your API key
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
export SPINE_API_KEY="sk_spine_..."
```
Create a key at [platform.getspine.ai/keys](https://platform.getspine.ai/keys).
## What it does
The system prompt teaches Codex:
1. **When** to call Spine — multi-source research, deliverable generation, competitive analyses
2. **The two-step pattern** — `POST /v1/run` → poll `GET /v1/run/{run_id}`
3. **How to pick a template** based on the deliverable type
4. **How to present results** — `final_output` text + artifact download links
## Non-interactive / CI usage
Three one-time setup steps are required for unattended Codex invocation:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
# 1. Register your OpenAI API key with Codex. The OPENAI_API_KEY env var
# alone is not sufficient — Codex stores auth in its own keychain.
printenv OPENAI_API_KEY | codex login --with-api-key
# 2. Export your Spine key in the same shell Codex will run in.
export SPINE_API_KEY=sk_spine_...
# 3. (Optional) confirm Codex auth status:
codex login status
```
Then invoke:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
codex exec \
--json --skip-git-repo-check \
--dangerously-bypass-approvals-and-sandbox \
"Produce a deep-research memo on using Spine" \
< /dev/null
```
* `--skip-git-repo-check` is required when running outside a git repo; without it Codex refuses with `Not inside a trusted directory`.
* `--full-auto` is tempting for automation but its sandbox blocks network — Codex cannot reach `api.getspine.ai` under that preset. Use `--dangerously-bypass-approvals-and-sandbox` or a custom sandbox policy that allows outbound HTTPS.
* `< /dev/null` closes stdin; without it `codex exec` blocks waiting for additional input even when the prompt is passed as an argument.
## Example
```
You: Create a market analysis of European fintech APIs and output as a slide deck
Codex: I'll use the Spine API with template=slides.
curl -X POST https://api.getspine.ai/v1/run \
-H "X-API-KEY: $SPINE_API_KEY" \
-F "prompt=Market analysis of European fintech APIs" \
-F "template=slides"
[polling... completed in 14m 32s]
Results:
- European_Fintech_APIs.pptx → https://...
- Credits consumed: 41
```
For long-running production workflows, register a webhook instead of polling — see [Webhooks](/api-reference/concepts/webhooks). Poll loops inside `codex exec` can exceed the turn budget for runs longer than 5–10 minutes.
# Cursor
Source: https://docs.getspine.ai/api-reference/integrations/cursor
Add a .cursorrules file so Cursor agents call the Spine API for research and deliverables.
Drop a `.cursorrules` file into your project root and Cursor will know to delegate research and deliverable-generation tasks to the Spine API.
## Install
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
curl -o .cursorrules \
https://docs.getspine.ai/static/agent-files/.cursorrules
```
`.cursorrules` — drop into your project root
## Set your API key
Add to your shell profile or Cursor's environment:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
export SPINE_API_KEY="sk_spine_..."
```
Create a key at [platform.getspine.ai/keys](https://platform.getspine.ai/keys).
## What it does
The `.cursorrules` file teaches Cursor's agent:
1. When to use Spine — research, reports, decks, spreadsheets, competitive analyses
2. The API pattern — `POST /v1/run` → poll `GET /v1/run/{run_id}`
3. Available templates and which to pick for each output type
4. How to surface results — `final_output` + artifact download URLs
## Example
```
You: Compile a competitive analysis of the top 5 AI coding assistants
Cursor: I'll delegate this to Spine using the deep_research template.
[Calling POST /v1/run...]
[Polling... completed in 11m 18s]
Here are the results:
- Competitive analysis (full text below)
- Download: Competitive_Analysis.docx → https://...
- Credits used: 26
```
## Combining with other rules
If you already have a `.cursorrules`, append the Spine rules at the end:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
curl -s https://docs.getspine.ai/static/agent-files/.cursorrules >> .cursorrules
```
# OpenClaw
Source: https://docs.getspine.ai/api-reference/integrations/openclaw
Configure OpenClaw to call the Spine API for research and deliverable generation.
[OpenClaw](https://github.com/openclaw/openclaw) is an open-source local AI agent that connects to any LLM. Add a Spine tool config and OpenClaw will delegate research-heavy tasks to Spine automatically.
## Install
Install OpenClaw if you don't have it:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
npm i -g openclaw
```
Drop a `SKILL.md` for Spine into OpenClaw's user skills directory:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
mkdir -p ~/.openclaw/skills/spine
curl -o ~/.openclaw/skills/spine/SKILL.md \
https://docs.getspine.ai/static/agent-files/spine.openclaw.md
```
Verify OpenClaw discovered it:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
openclaw skills list | grep spine # should show "✓ ready 🌲 spine"
openclaw skills info spine # full skill metadata + path
```
`spine.openclaw.md` — drop into `~/.openclaw/skills/spine/`
OpenClaw uses **`skills/`**, not `tools/`. The file must be named exactly
`SKILL.md` inside a per-skill directory (`~/.openclaw/skills/spine/SKILL.md`).
OpenClaw also accepts skills under `~/.openclaw/workspace/skills//SKILL.md`
if you want a workspace-scoped install.
## Set your API key
Add `SPINE_API_KEY` to your environment or to OpenClaw's `.env` file:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
export SPINE_API_KEY="sk_spine_..."
```
Create a key at [platform.getspine.ai/keys](https://platform.getspine.ai/keys).
## What it does
The skill teaches the OpenClaw agent:
1. **When** to delegate — multi-source research, competitive landscapes, reports, slide decks, spreadsheets, web apps
2. **The two-step pattern** — `POST /v1/run` → poll `GET /v1/run/{run_id}` every 15–30s (runs average 10–20 min, up to 2 hr)
3. **How to pick a template** — `deep_research`, `report`, `slides`, `memo`, `excel`, `app`, `landing_page`, or `auto`
4. **How to present results** — `final_output` text + artifact download links
## Headless invocation
For unattended use (CI, scheduled runs, scripts):
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
openclaw agent --local --agent main --json \
-m "Produce a competitive landscape on using your Spine skill"
```
* `--local` runs the embedded agent (no gateway required; needs a model-provider key such as `OPENAI_API_KEY` or `ANTHROPIC_API_KEY` in the shell).
* `--agent main` (or `--session-id …`, or `--to `) is required — otherwise `openclaw agent` exits with `Pass --to , --session-id, or --agent to choose a session`.
* OpenClaw loads skills lazily. If your prompt doesn't clearly match the skill's description, the agent may solve the task with its default tools instead. For deterministic routing, mention the capability by name ("using your Spine skill") or prompt the agent to check its available skills first.
## Example
```
You: Research the top 5 competitors in the AI search API space
OpenClaw: Using my 🌲 spine skill with template=deep_research.
[polling... 3/8 tasks complete... 7/8... done in 15m 42s]
Result:
Competitive landscape analysis (final_output attached)
Artifacts:
- AI_Search_API_Analysis.docx → https://...
Credits: 28
```
For long-running production workflows, register a webhook instead of polling — see [Webhooks](/api-reference/concepts/webhooks). Polling loops inside the agent can exhaust turn budgets on runs longer than 5–10 minutes.
## Templates
Pass the template that best fits the output:
| Template | Output |
| --------------- | -------------------- |
| `auto` | Agent picks |
| `deep_research` | Research memo |
| `report` | Report (.docx) |
| `slides` | Slide deck (.pptx) |
| `memo` | Memo (.docx) |
| `excel` | Spreadsheet (.xlsx) |
| `app` | Web app (.html) |
| `landing_page` | Landing page (.html) |
# Bolt, Replit, Lovable
Source: https://docs.getspine.ai/api-reference/integrations/web-builders
Call the Spine API from browser-based app builders.
Bolt.new, Replit Agent, and Lovable all run in the browser. Since the Spine API authenticates via an `X-API-KEY` header, you need a thin server-side proxy to keep the key off the client. The calling pattern is the same across all three.
`spine-proxy.ts` — a minimal Next.js / Edge-compatible proxy
## Architecture
```
Browser (Bolt / Replit / Lovable)
│ POST /api/spine/run { prompt, template }
▼
Your proxy (serverless / edge function)
│ POST https://api.getspine.ai/v1/run
│ X-API-KEY: sk_spine_...
▼
Spine API
```
## Set your API key
Add `SPINE_API_KEY` to your project's environment / secrets:
| Tool | Where |
| -------- | ---------------------------------------- |
| Bolt.new | Project settings → Environment variables |
| Replit | Secrets tab (lock icon in sidebar) |
| Lovable | Project settings → Secrets |
Create a key at [platform.getspine.ai/keys](https://platform.getspine.ai/keys).
## Proxy setup
### Bolt.new / Next.js
Create `app/api/spine/run/route.ts`:
```typescript theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
const SPINE_API_KEY = process.env.SPINE_API_KEY!;
export async function POST(req: Request) {
const { prompt, template } = await req.json();
const form = new FormData();
form.set("prompt", prompt);
if (template) form.set("template", template);
const res = await fetch("https://api.getspine.ai/v1/run", {
method: "POST",
headers: { "X-API-KEY": SPINE_API_KEY },
body: form,
});
return new Response(await res.text(), {
status: res.status,
headers: { "Content-Type": "application/json" },
});
}
```
### Replit
Create a simple Express endpoint or use Replit's built-in HTTP handler:
```javascript theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
app.post("/api/spine/run", async (req, res) => {
const form = new FormData();
form.set("prompt", req.body.prompt);
if (req.body.template) form.set("template", req.body.template);
const r = await fetch("https://api.getspine.ai/v1/run", {
method: "POST",
headers: { "X-API-KEY": process.env.SPINE_API_KEY },
body: form,
});
res.status(r.status).json(await r.json());
});
```
### Lovable
Lovable uses Supabase Edge Functions. Create `supabase/functions/spine-run/index.ts`:
```typescript theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
Deno.serve(async (req) => {
const { prompt, template } = await req.json();
const form = new FormData();
form.set("prompt", prompt);
if (template) form.set("template", template);
const res = await fetch("https://api.getspine.ai/v1/run", {
method: "POST",
headers: { "X-API-KEY": Deno.env.get("SPINE_API_KEY")! },
body: form,
});
return new Response(await res.text(), {
status: res.status,
headers: { "Content-Type": "application/json" },
});
});
```
## Browser-side calling pattern
Once your proxy is deployed, the browser code is the same regardless of tool:
```javascript theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
// Create a run
const { data } = await fetch("/api/spine/run", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
prompt: "Create a competitive analysis of AI search APIs",
template: "deep_research",
}),
}).then((r) => r.json());
// Poll until complete
let run;
do {
await new Promise((r) => setTimeout(r, 30000));
run = await fetch(`/api/spine/run/${data.run_id}`).then((r) => r.json());
} while (run.data.status === "running");
// Use the results
console.log(run.data.result.final_output);
run.data.result.artifacts.forEach((a) => {
console.log(`${a.name}: ${a.download_url}`);
});
```
# Spine API
Source: https://docs.getspine.ai/api-reference/overview
The highest-quality research API. #1 on GAIA Level 3 — agent-grade research delivered as polished artifacts via a single API call.
# The highest-quality research, delivered
Spine produces research that beats Perplexity, You.com, Claude, and Manus AI on hard, multi-hop tasks — [#1 on GAIA Level 3 and Google Deep Research](https://www.getspine.ai/blog/spine-swarm-hits-1-on-gaia-level-3-and-google-deep). One API call runs a multi-agent swarm and returns verified findings as ready-to-ship `.docx`, `.xlsx`, `.pptx`, `.html`, and `.png` artifacts.
Every run is **fully auditable**: inspect the agent DAG, the task tree, and every intermediary block via the API — or open the same run in a visual canvas to see exactly what each agent did, step by step.
\#1 on GAIA Level 3. Every claim verified with citations.
Inspect the agent DAG and every intermediate block — via API or a visual canvas.
One `POST`, a multi-agent DAG runs for 10–20 min (up to 2 hr).
Skills and configs for Claude Code, Cursor, Codex, OpenClaw, and web builders.
Get **\$5 of free credits** when you sign up — enough to run several research
jobs end-to-end. No subscription, simple pay-as-you-go pricing: **\$1 = 1,000
credits**. Add a card when you're ready for more.
## Hello world
```bash curl theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
curl -X POST https://api.getspine.ai/v1/run \
-H "X-API-KEY: sk_spine_..." \
-F "prompt=Summarize this sales data" \
-F "template=memo" \
-F "files=@sales-data.csv;type=text/csv"
```
```python Python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
import requests
r = requests.post(
"https://api.getspine.ai/v1/run",
headers={"X-API-KEY": "sk_spine_..."},
data={"prompt": "Summarize this sales data", "template": "memo"},
files={"files": ("sales-data.csv", open("sales-data.csv", "rb"), "text/csv")},
)
run_id = r.json()["data"]["run_id"]
print(run_id)
```
```javascript Node theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
import fs from "node:fs";
const form = new FormData();
form.set("prompt", "Summarize this sales data");
form.set("template", "memo");
form.append(
"files",
new Blob([fs.readFileSync("sales-data.csv")]),
"sales-data.csv",
);
const res = await fetch("https://api.getspine.ai/v1/run", {
method: "POST",
headers: { "X-API-KEY": "sk_spine_..." },
body: form,
});
const { data } = await res.json();
console.log(data.run_id);
```
You'll get back a `run_id`. **For apps, webhooks are the preferred approach** — register a URL in the developer portal and Spine will POST results to you when the run finishes. See [Webhooks](/api-reference/concepts/webhooks). Polling remains available if you prefer: poll [`GET /v1/run/{run_id}`](/api-reference/endpoints/get-run) every 15–30 seconds until `status` becomes `completed` — then read `result.final_output` and download everything in `result.artifacts`.
## Start here
Your first request end-to-end.
API keys, rotation, best practices.
Pre-built block configurations for common workflows.
## Concepts
How runs, canvases, blocks, and tasks fit together.
Every block type agents can create, with links to the visual app docs.
Shape tone, rigor, audience, scope across all agent layers.
Attach documents and images as agent context.
## Endpoints
Five endpoints. All return `{ success, data }` JSON envelopes; errors return `{ success: false, error }` with an HTTP status — see [Errors](/api-reference/errors).
| Method | Path | Purpose |
| ------ | ----------------------------------------------------------------------------- | ----------------------------------- |
| `POST` | [`/v1/run`](/api-reference/endpoints/create-run) | Create an async canvas run |
| `GET` | [`/v1/run/{run_id}`](/api-reference/endpoints/get-run) | Poll a run for progress and results |
| `GET` | [`/v1/canvas/{canvas_id}/dag`](/api-reference/endpoints/get-canvas-dag) | Fetch the canvas block graph |
| `GET` | [`/v1/canvas/{canvas_id}/tasks`](/api-reference/endpoints/get-canvas-tasks) | Fetch the task hierarchy |
| `GET` | [`/v1/canvas/{canvas_id}/tasks/{task_id}`](/api-reference/endpoints/get-task) | Fetch a single task |
## Want the visual app instead?
Spine Canvas is our hands-on product — a visual multi-agent workspace with its own subscription plans (separate from API credits).
Using Spine Canvas in the browser — blocks, canvases, integrations, agents.
Subscription plans and team billing for the visual app.
# Quickstart
Source: https://docs.getspine.ai/api-reference/quickstart
Make your first Spine API request end-to-end — submit a prompt, poll, and read the result.
The Spine API lets you run canvas-based research and agent workflows programmatically. Submit a prompt, pick a template (or custom blocks), and poll for the synthesized result plus downloadable artifacts.
## 1. Get an API key
Sign up at the [developer portal](https://platform.getspine.ai/keys) — you get **\$5 of free credits** immediately (no card required) to try the API end-to-end. Pricing is simple pay-as-you-go: **\$1 = 1,000 credits**, no subscription.
Create a key from the keys page. Keys look like:
```
sk_spine_...
```
Keys are shown only once at creation — store them somewhere safe. See [Authentication](/api-reference/authentication) for rotation and revocation.
## 2. Make your first request
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
curl -X POST https://api.getspine.ai/v1/run \
-H "X-API-KEY: sk_spine_..." \
-F "prompt=What is the current state of AI regulation in the EU?"
```
Try it interactively on the [Create a run](/api-reference/endpoints/create-run) page.
## 3. Poll for results
The API returns a `run_id` immediately. Poll the status endpoint until the run completes:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
curl https://api.getspine.ai/v1/run/ \
-H "X-API-KEY: sk_spine_..."
```
Runs average 10–20 minutes; complex research can take up to 2 hours. Poll every 15–30 seconds.
## 4. Read the result
When `status` becomes `completed`, the response includes:
* `result.final_output` — the synthesized answer
* `result.artifacts` — downloadable files (docx, xlsx, pptx, html, png, …)
* `metadata.credits_consumed` — credits used for this run
## Next steps
Manage, rotate, and secure your API keys.
How runs, canvases, and blocks fit together.
Preset block configurations for common workflows.
Full endpoint reference with try-it panels.
# Create a canvas run
Source: https://docs.getspine.ai/api-reference/runs/create-a-canvas-run
/openapi.yaml post /v1/run
Submit a prompt to trigger an async canvas run. Agents orchestrate a
DAG of blocks to satisfy the prompt; poll `GET /v1/run/{run_id}`
until status becomes `completed`, `partial`, or `failed`.
# Get run status and results
Source: https://docs.getspine.ai/api-reference/runs/get-run-status-and-results
/openapi.yaml get /v1/run/{run_id}
Poll the current status of a run. Returns progress while `running` and
the full result (final output + downloadable artifacts + metadata)
once `completed`.
# SDKs
Source: https://docs.getspine.ai/api-reference/sdks
Official client libraries for the Spine API.
## Official SDKs
`pip install spine-sdk` — sync + async clients, typed Pydantic
models, a polling helper with exponential backoff, and typed
exceptions for every HTTP error.
`npm install spine-sdk` — typed client with discriminated run
states, an auto-polling helper, and typed errors for every HTTP
failure. Runs on Node, browsers, Deno, Bun, and Cloudflare Workers.
## Direct HTTP
The Spine API is plain HTTP — any language with a multipart-capable
client works. Every endpoint page under
[Endpoints](/api-reference/endpoints/create-run) has copy-pasteable
`curl`, Python (`requests`), and Node (`fetch`) snippets.
## Community libraries
Built a client library for Spine? Email
[support@getspine.ai](mailto:support@getspine.ai) and we'll list it
here.
# Agent Architecture
Source: https://docs.getspine.ai/app/advanced/agent-architecture
How Spine Swarm's four-tier agent system works
## Overview
Spine Swarm uses a four-tier agent architecture. Each tier has a specific role, and the tiers work together to handle complex projects that no single agent could manage alone.
## L1: The Orchestrator
L1 is the user-facing agent. It operates in the chat panel and is the only tier the user talks to directly. L1's job is to understand what the user wants, plan the approach with the user, collect initial context, and dispatch work to L2. L1 is also responsible for presenting finished results back to the user and handling follow-up requests.
L1 does not operate on the canvas. It does not create blocks or make connections. It plans and dispatches.
Because L1 is not coupled to the canvas execution, it can dispatch multiple independent tasks to separate L2 agents that run in parallel. L1 also maintains a persistent understanding of the full project scope, which means follow-up requests ("Now do the same analysis for Europe") do not require re-explaining the project.
## L2: The Strategist
L2 receives a task from L1 and decomposes it into a structured execution plan. L2 identifies what subtasks are required, what the dependencies between them are, which can run in parallel and which are sequential, what kinds of blocks each subtask will need, what models to use for each block, and what the expected outputs are.
L2 agents can read the canvas, search across blocks and canvases, do web searches directly, ask the user for clarification via L1, and use connector tools (integrations) to access external services. L2 does not create blocks directly — it delegates to L2.5 persona agents. When the L2.5 agents complete, L2 reads their outputs and synthesizes the final response.
## L2.5: Persona Agents
L2.5 agents are specialized persona agents, each assigned a specific persona and goal by the L2 that created them. A persona agent might be a researcher, a competitive analyst, a financial modeler, a writer, a reviewer. Each one operates on the canvas using blocks (L3 primitives) to do its work.
Independent L2.5 agents run in parallel. Dependent ones wait on the outputs they need before starting. L2.5 agents also validate each other's work — reviewer personas check outputs before they are passed downstream, catching reasoning errors before they compound across a long execution chain.
Like L2, persona agents can search the canvas, read block content, do web searches directly, ask the user for clarification, and use connector tools. The key difference is that L2.5 agents also delegate block creation to L3 sub-agents. A persona agent might do a web search to find relevant URLs, then spin up an L3 agent to create a BrowserUse block for each URL, run them in parallel, read the results, and use those as input for the next step.
## L3: The Block Operators
L3 is the lowest tier. L3 agents handle individual block operations: creating a block, running it, reading its output, editing it, connecting it to other blocks. Each L3 call does one thing.
L3 agents are orchestrated by L2.5 persona agents. Specific L3 capabilities include:
* Creating blocks of any type with full configuration
* Running blocks and waiting for output
* Reading block output
* Editing existing blocks to refine or fix content
* Resolving model names to exact IDs and looking up which models are available for a given block type
* Reading canvas context and specific block content
* Bulk expanding list items into individual blocks (take a list of 10 topics and automatically create a research block for each one)
L3 creates one block per call, but L2.5 can dispatch many L3 sub-agents in parallel.
## How the Tiers Work Together
A typical flow: the user describes a project to L1. L1 clarifies scope and dispatches it as a task. L2 decomposes the task into subtasks (research, analysis, synthesis, deliverable creation). L2.5 persona agents pick up each subtask and operate on the canvas via L3 actions. Independent personas run simultaneously. Downstream personas wait for upstream context. The canvas persists everything, so any agent at any tier can read any artifact that has been produced. L2 synthesizes the final output. L1 presents it to the user and handles follow-up.
## Model Selection
Rather than relying on a single model, Spine dynamically selects the best model (or ensemble of models) from a pool of 300+ for each task. Agents pick the best model for each block and sometimes run the same block with multiple models to compare and synthesize outputs. The user does not configure any of this.
This matters because no single model is best at everything. Some are better at reasoning, some at web search synthesis, some at creative writing, some at structured data extraction. Spine routes to the right tool for each step and ensembles multiple models to override any single model's biases or blind spots.
## Key Infrastructure
* **Dependency graph execution** — Under the hood there is a full dependency graph (DAG) that determines execution order, parallelism, and concurrency automatically. Agents do not need to manage this — they just operate on blocks
* **Context propagation** — Handles the wide variance in context sizes and formats across different block types. A web page block can feed into a prompt block can feed into a table block can feed into a slides block
* **Structured handoffs** — Agents leave explicit, structured summaries designed to be consumed efficiently by the next agent. This is a protocol for maintaining context fidelity across long chains of agent work
* **BrowserUse at scale** — Multiple browser sessions running in parallel, interacting with the real web (including web archives), feeding information back into the canvas
* **Folder synthesis (map-reduce)** — Run a prompt against every file in a folder and aggregate the results. Scales to large document collections in a way that dumping everything into a single context window does not
# Context Management
Source: https://docs.getspine.ai/app/advanced/context-management
Control how Spine handles context and memory to improve understanding, recall, and performance
## Overview
[Context Management](/app/advanced/context-management) lets you configure how Spine's AI models handle [context](/app/basics/context-passing) and memory across your workspace. From the **Settings → Context Management** panel,
you can enable features like *Maximum Context Mode* (enabled by default) and *Memory* to add persistent context across all blocks.
## Key Features
### **Maximum Context Mode**
Enable Spine to use each model’s full context window for deeper understanding and more accurate results — ideal for large canvases and research-heavy workflows.
* **Larger context window** – Models process more data across [connected blocks](/app/basics/context-passing).
* **Better comprehension** – Handles complex chains of reasoning or long documents with more precision.
* **Slightly slower responses** – Due to increased context size, but with improved output quality.
* **Best for** – Analysis, research, and long-form reasoning tasks.
### **Memory**
Add persistent context that gets used across all block processing and initial natural language input to canvas creation. Memory provides important user context for more coherent and contextually aware responses.
* **Canvas-wide recall** – The memory text is used as implicit [context](/app/basics/context-passing) for every [block](/app/general-block-features).
* **Smarter personalization** – AI better understands your preferences and workflows.
* **Optional toggle** – Turn memory on or off at any time.
* **Editable memory** – Click “View/Edit Canvas Memory” to review or adjust stored context.
## How to Use
1. **Open Settings** – Click the ⚙️ **Settings** icon on the left sidebar.
2. **Select “Context Management”** – Opens the context configuration panel.
3. **Enable Maximum Context Mode** – Toggle on to let AI models use their full context window.
4. **Enable Memory** – Toggle on to persist user and canvas context across all processing.
5. **View/Edit Memory** – Click “View/Edit Canvas Memory” to update what the AI remembers.
# Bulk Variant Generation
Source: https://docs.getspine.ai/app/advanced/cross-model-variations
Generate outputs from multiple AI models or the same model in parallel to quickly iterate.
## Overview
Bulk Variant Generation lets you instantly generate results from multiple AI models or the same model at one time. With just a couple of clicks, you can take any prompt, chat, or
image and generate multiple versions. It’s one of the fastest ways to explore creativity, quality, or get to a desired output quickly across Spine’s 300+ supported models.
## How to Use
1. **Select a Block** – Choose a [Prompt](/app/blocks/prompt-block), [Image](/app/blocks/image-generation-block), or [Chat Block](/app/blocks/chat-block) you want to explore variations for. Be sure to run it once, otherwise the variation button will be greyed out.
2. **Click “Variations” Icon** – Select whether to vary by same model or vary by different models. If choosing to vary by different models, choose what models to vary with.
3. **Run Variations** – Hit "Generate Alternatives" which will run.
# Duplicate and Re-run Branch
Source: https://docs.getspine.ai/app/advanced/duplicate-rerun-branch
Duplicate blocks and re-run with different models, prompts, or parameters
## Overview
Select any subset of blocks and duplicate the entire branch. Re-run the duplicate with different models, prompts, or parameters. Good for A/B testing approaches, exploring alternatives, and iterating without destroying previous work.
When updating a block, you can either update locally (only the local block changes) or duplicate and re-run the entire branch. The duplicate option preserves the state of the old block, creates a new block with the same context as the original, runs your new changes, and trickles them down the entire branch. This creates a dynamic, iterative workflow where improvements cascade through your entire thinking process.
This feature is not yet supported for Chat blocks, but it is on our planned features list.
## What's Next?
Want to see what other features we're working on? Check out our full [roadmap](https://app.getspine.ai/roadmap) to see what's coming next and vote on features you'd like to see prioritized.
Have questions or want to connect with the community? Join our [Discord](https://discord.gg/qdkYmxph) to get help, share feedback, and discuss Spine with other users.
# Integrations
Source: https://docs.getspine.ai/app/advanced/integrations
Connect your favorite tools to bring external data directly into your Spine canvas
## Overview
[Integrations](/app/advanced/integrations) connect Spine to the tools you already use — like Google Drive, Notion, Slack, and Airtable — so you can import live data, documents, and tasks directly into your [canvas](/app/canvas). Once connected, you can pull information from these apps into any [block](/app/general-block-features), creating seamless AI workflows powered by real [context](/app/basics/context-passing).
## How to Use
1. **Open Integrations** – On the left sidebar, click **Integrations**.
2. **Choose an App** – Select from the list (e.g. Google Drive, Notion, Slack, Airtable, Linear, Jira).
3. **Connect Your Account** – Follow the secure login flow to authorize access.
4. **Import Data** – Once connected, click "Import" within a [block](/app/general-block-features) or the [canvas](/app/canvas) to pull in data from that app.
5. **Use as Context** – The imported item will appear as a new block (e.g. a [File](/app/blocks/file-upload), [Note](/app/blocks/notes-block), or [List Block](/app/blocks/list-block)) that you can connect to AI actions.
# MCP Integration
Source: https://docs.getspine.ai/app/advanced/mcp
Reference your Spine canvases in other apps using Model Context Protocol (MCP)
## Overview
Model Context Protocol (MCP) allows you to reference your Spine [canvas](/app/canvas) directly in other applications like Cursor, Lovable, Replit, ChatGPT, and Claude Code. Once configured, simply paste your canvas URL into any of these tools, and they can access all your canvas content, [blocks](/app/general-block-features), and context.
## How It Works
MCP enables Spine to share canvas data with MCP-compatible applications. Once you've configured the MCP server in your tool, you can paste any Spine canvas URL to give that tool access to all the [blocks](/app/general-block-features), connections, and context on that canvas.
## Setting Up MCP
Setup instructions vary by platform. Follow the guide for your specific application below.
> **Enterprise / Custom Deployments:** If you're on an enterprise plan with a custom deployment, the MCP URL may differ from the standard URL shown in these instructions. Please reach out to our support team at [support@getspine.ai](mailto:support@getspine.ai) to get the correct MCP URL for your deployment.
### Enterprise / Custom Deployments
If your organization has an enterprise plan with a custom deployment (such as a dedicated instance), you'll need to use a different MCP URL than the standard `https://mcp.getspine.ai/mcp` shown in these instructions.
**To get your custom MCP URL:**
1. Contact our support team at [support@getspine.ai](mailto:support@getspine.ai)
2. Provide your organization name or account details
3. Our team will provide you with the correct MCP URL for your deployment
4. Use this custom URL in place of the standard URL in all the platform-specific setup instructions below
Once you have your custom MCP URL, follow the same setup instructions for your platform, but replace `https://mcp.getspine.ai/mcp` with your organization's custom MCP URL.
### Cursor
1. **Locate or Create MCP Configuration File**:
* **macOS/Linux**: `~/.cursor/mcp.json`
* **Windows**: `%USERPROFILE%\.cursor\mcp.json`
* If the file doesn't exist, create it.
2. **Edit the Configuration File**:
* Open `mcp.json` in a text editor
* Add the following configuration:
```json theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
{
"mcpServers": {
"spine-ai": {
"url": "https://mcp.getspine.ai/mcp"
}
}
}
```
* Save the file
3. **Alternative: Use Cursor Settings**:
* Open Cursor Settings (`Cmd+,` / `Ctrl+,`)
* Navigate to **Settings → MCP** (or **Features → MCP**)
* Click "Add new global MCP server"
* Enter the configuration above
4. **Restart Cursor** – Fully quit and restart Cursor to apply the changes
### Lovable
1. **Open Lovable Settings** – Navigate to **Settings → MCP Servers** (or **Settings → Integrations → MCP**)
2. **Add Spine Server** – Scroll down to "Your MCP Servers" section
3. **Set Up Spine** – Click "Set up" or "Add MCP Server"
4. **Enter Configuration**:
* Server Name: `spine-ai`
* Server URL: `https://mcp.getspine.ai/mcp`
5. **Save and Verify** – Click "Save" or "Connect" and verify "Spine" appears in your connected services
### Replit
Replit uses install links with base64-encoded configuration to add MCP servers.
1. **Generate Install Link** (if available):
* Visit [Replit's MCP install links documentation](https://docs.replit.com/replitai/mcp/install-links) to generate a custom install link
* The install link format uses base64-encoded JSON with:
```json theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
{
"displayName": "Spine AI",
"baseUrl": "https://mcp.getspine.ai/mcp"
}
```
2. **Use Install Link**:
* Click the generated install link or share it with users
* This will automatically configure the MCP server in Replit
3. **Manual Configuration** (Alternative):
* Open your Replit project
* Navigate to **Settings → Integrations** or look for MCP settings
* Add a new MCP server with:
* Display Name: `Spine AI`
* Base URL: `https://mcp.getspine.ai/mcp`
* Save the configuration
### ChatGPT
1. **Enable Developer Mode**:
* Click your profile icon → **Settings & Beta**
* Navigate to **Settings → Apps → Advanced**
* Toggle on **Developer mode**
2. **Create a Custom Connector**:
* Navigate to a new chat and click the + icon.
* Click "More" and then "Add sources"
* Click "Add" then "Connect More". Then, in advanced settings, click "Create App".
* Fill in the details:
* **Connector Name**: `Spine AI`
* **Description**: `Access your Spine canvases and send them to ChatGPT`
* **Connector URL**: `https://mcp.getspine.ai/mcp`
* Click **Create**. It will prompt you to authenticate. Follow the steps then you'll be back in ChatGPT.
3. **Enable in Chat**:
* Open a new chat in ChatGPT
* Click the **+** button near the message composer
* Select **Developer mode** and toggle on your **Spine AI** connector
4. **Verify** – Test by pasting a Spine canvas URL into your ChatGPT conversation
### Claude Code
Claude Code uses the `claude mcp add` command to configure MCP servers via the command line.
1. **Add the Spine MCP Server**:
* Open your terminal
* Run the following command:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
claude mcp add --transport http spine-ai https://mcp.getspine.ai/mcp
```
* This configures the Spine MCP server with the name `spine-ai`
2. **Alternative: Manual Configuration File**:
* You can also manually edit your MCP configuration file
* **Project scope** (shared with team): Create or edit `.mcp.json` in your project root
* **User scope** (personal): Edit the user-level MCP configuration file
* Add the following configuration:
```json theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
{
"mcpServers": {
"spine-ai": {
"type": "http",
"url": "https://mcp.getspine.ai/mcp"
}
}
}
```
3. **Verify Configuration**:
* List your configured MCP servers:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
claude mcp list
```
* You should see `spine-ai` in the list
* Get details about the server:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
claude mcp get spine-ai
```
4. **Use in Claude Code**:
* Start a new conversation in Claude Code
* Paste your Spine canvas URL directly into the chat
* Claude Code will automatically use the MCP server to access your canvas content
**Configuration Scopes:**
* `--scope local` (default): Available only to you in the current project
* `--scope project`: Shared with everyone in the project via `.mcp.json` file
* `--scope user`: Available to you across all projects
## How to Use
Once MCP is configured in your application:
1. **Get Your Canvas URL** – In Spine, open the [canvas](/app/canvas) you want to reference and copy its URL from your browser's address bar
2. **Paste the URL** – Simply paste the canvas URL into your tool (Cursor, Lovable, Replit, ChatGPT, or Claude Code)
3. **Access Canvas Content** – The tool can now reference and use all the content from that canvas, including:
* **All blocks** – Every [block](/app/general-block-features) on your canvas
* **Block content** – Text, outputs, and data from each block
* **Connections** – All [context passing](/app/basics/context-passing) relationships between blocks
* **Block metadata** – Block types, models used, and configuration settings
* **Canvas structure** – The overall organization and layout information
The tool will have access to your canvas content and can use it as context in conversations or development workflows.
## Troubleshooting
**Connection Issues:**
* Verify the URL is correct: `https://mcp.getspine.ai/mcp`
* Ensure the receiving application supports MCP
* Check your internet connection
* Make sure the JSON configuration is properly formatted
**Server Not Connecting:**
* Verify the MCP server configuration matches the exact format shown above
* Check that MCP is enabled in your application settings
* Some applications may require a restart after configuration
**Canvas Not Accessible:**
* Verify you have permission to access the canvas in Spine
* Check that the canvas isn't archived or deleted
* Ensure the canvas URL is correct and complete
* Make sure you're logged into Spine in your browser
* Verify the MCP server is properly configured and the connection is active
# Model Management
Source: https://docs.getspine.ai/app/advanced/model-management
Customize, prioritize, and organize the 300+ AI models available inside Spine
## Overview
[Model Management](/app/advanced/model-management) gives you full control over how Spine's 300+ AI models appear and behave across your workspace. From the Settings panel, you can organize, enable, or disable models based on your workflow preferences — ensuring the best models are always front and center when you're creating or switching within [blocks](/app/general-block-features).
## How to Use
1. **Open Settings** – Click the ⚙️ **Settings** icon on the left sidebar.
2. **Select “Model Selection”** – This opens the list of all supported models.
3. **Toggle Models** – Enable or disable models you want to appear in your workspace.
4. **Organize Preferences** – Drag models up or down to set priority — higher models appear first in dropdown menus.
5. **Save Automatically** – Changes are applied instantly across your account.
# Scheduled Runs
Source: https://docs.getspine.ai/app/advanced/scheduled-runs
Automate recurring agent workflows on a daily, weekly, or custom cadence
## Overview
You can schedule agent swarms to run at a specific cadence — daily, weekly, or custom schedules. This means recurring tasks do not require manual re-triggering. The agent swarm runs on schedule, produces updated deliverables on the canvas, and you come back to fresh results without having to prompt anything.
Scheduled runs turn Spine from a one-shot project tool into a continuous intelligence platform.
## Use Cases
* **Daily competitive monitoring** — Track competitor pricing, news, and product changes automatically
* **Weekly market digests** — Synthesize the latest developments in a sector every week
* **Automated pipeline tracking** — Refresh a clinical trial tracker or deal pipeline on a recurring basis
* **Recurring SEO audits** — Run full SEO analysis on a schedule to track changes over time
* **Regular financial data pulls** — Pull and analyze financial data on a set cadence
* **Any repeating workflow** — Any workflow where the same research or analysis needs to happen on a repeating basis
## How It Works
1. **Build your workflow** — Create a canvas with the blocks and agent tasks you want to run
2. **Set a schedule** — Choose daily, weekly, or a custom cadence
3. **Agents run automatically** — At the scheduled time, the agent swarm executes the full workflow
4. **Review fresh results** — Come back to updated deliverables on your canvas without prompting anything
## Best Practices
* **Use Inputs blocks for parameters** — Set up date ranges, keywords, accounts, or other variables as Inputs so one scheduled workflow works across many runs
* **Connect to Integrations** — Combine scheduled runs with [Integrations](/app/advanced/integrations) to automatically push results into Slack, Google Drive, Notion, or other tools your team uses
* **Start with a manual run** — Run the workflow manually first to verify it produces the output you want before scheduling it
* **Layer deliverables** — A single scheduled run can produce research, tables, documents, and slide decks — all refreshed automatically
# @ Mentions
Source: https://docs.getspine.ai/app/basics/at-mentions
Reference blocks by name without drawing connection lines
## Overview
Reference other blocks by name within any block using @ mentions, no explicit connections needed. Type @ followed by a block or frame name to create a reference, making it easy to link ideas across your workspace without cluttering your canvas with connection lines.
This allows targeted context pulling without requiring a direct connection on the canvas. Perfect for creating cross-references, building on previous work, or maintaining relationships between distant blocks.
## How to Use
1. **Type @ in any block**: Start typing @ followed by the name of a block or frame on your canvas
2. **Select from the dropdown**: Choose the block or frame you want to reference from the autocomplete suggestions
3. **Reference without connections**: The referenced block's content is automatically included in your prompt without needing to draw connection lines
4. **Use across your workspace**: Reference blocks from anywhere on your canvas, even if they're far apart
## Use Cases
* **Cross-references**: Link related ideas without visual clutter
* **Build on previous work**: Reference earlier blocks in new prompts
* **Maintain relationships**: Keep connections between distant blocks without drawing lines
# Collapse Blocks
Source: https://docs.getspine.ai/app/basics/collapse-block
Manage visual complexity on large canvases
## Overview
Collapse blocks allow you to organize your canvas by grouping multiple blocks together into a collapsible view. This feature helps keep your canvas clean and organized, especially when working with many blocks or complex workflows.
Collapsed blocks still participate in context passing and execution, they are not disabled, just visually condensed.
## How It Works
When you collapse blocks, you combine multiple blocks into a single collapsible container. The collapsed view shows a condensed representation of the grouped blocks, making it easier to navigate and manage large canvases.
## Creating a Collapsed Block
1. **Select Blocks**: Highlight or select the blocks you want to collapse
2. **Collapse**: Use the collapse action to group the selected blocks together
3. **Organized View**: The blocks are now contained within a collapsed block view
## Expanding a Collapsed Block
To view or edit the contents of a collapsed block:
1. **Click Expand**: Click the "Expand" button on the collapsed block
2. **View Contents**: The collapsed block expands to show all the blocks it contains
3. **Edit or Reorganize**: You can now edit, move, or modify the blocks within the expanded view
## Use Cases
* **Organizing large canvases**: Group related blocks together to reduce visual clutter
* **Creating workflow sections**: Collapse different phases or sections of your work
* **Temporarily hiding content**: Focus on specific parts of your canvas while keeping other blocks accessible
* **Better navigation**: Quickly scan your canvas with collapsed groups and expand only what you need
# Context Passing
Source: https://docs.getspine.ai/app/basics/context-passing
How information flows between connected blocks
## Overview
Context Passing is Spine's core infrastructure that allows blocks to automatically share information with each other. When blocks get connected, Spine figures out the best way to pass context by preserving maximum relevant context and translating between block types seamlessly.
Under the hood there is a full dependency graph that determines execution order, parallelism, and concurrency across connected blocks. Context propagation handles long branches of connected blocks and the wide variance in context sizes across different block types. At scale, this infrastructure is what keeps the workload coherent and consistent across hundreds of simultaneous operations.
## How Context Flows
When blocks are connected (via drag-and-drop lines), they automatically share context. Any action you take with a block will be grounded in the connected context. You can connect any block to any other block, and that connection guarantees the passing of context regardless of block type.
Within the current block, you can also pass context explicitly in specific variables. This is useful when you want to tell the block exactly what to do with the connected content. For example:
"Update the image \[image\_block\_name] with the new design guidelines \[design\_guidelines]"
## Creating Connections
* **Hover over a block** — Connection points appear on block edges
* **Click and drag** — From one block's connection point to another
## Connected Block Cost
Connected blocks have a cost multiplier: for every 3 connected blocks, cost increases by 1x block price. This reflects the additional context processing required.
## Best Practices
* **Connect related blocks** — Link blocks that should inform each other
* **Avoid over-connection** — Too many connections can create noise
* **Use strategic context** — Connect blocks where information flow adds value
* **Review context flow** — Ensure connections are helping, not hindering
## Video Overview
# Keyboard Shortcuts
Source: https://docs.getspine.ai/app/basics/keyboard-shortcuts
Speed up your workflow with keyboard shortcuts
## Overview
Use keyboard shortcuts to work faster and more efficiently on your [canvas](/app/canvas).
## Shortcuts
### Canvas Navigation
* **`Cmd+F` (Mac) / `Ctrl+F` (Windows/Linux)** – Open [Quick Search](/app/basics/quick-search) to find blocks instantly
### Block Actions
* **`Cmd+Enter` (Mac) / `Ctrl+Enter` (Windows/Linux)** – Run the currently selected or focused block
### Assistant
* **`Cmd+K` (Mac) / `Ctrl+K` (Windows/Linux)** – Open the assistant
## Creating a New Canvas
To quickly create a new canvas, navigate to [app.getspine.ai/new](https://app.getspine.ai/new) in your browser.
# Quick Search
Source: https://docs.getspine.ai/app/basics/quick-search
Find blocks instantly with quick search using Ctrl+F or Cmd+F
## Overview
Find blocks instantly with our new search feature. Press Ctrl+F (or Cmd+F on Mac) to bring up a search interface in the middle of your screen. Click on any block in the results to jump directly to it, or type to see relevant blocks and words within blocks. Navigate large canvases faster and find exactly what you're looking for in seconds.
## How to Use
1. **Open Quick Search** – Press `Ctrl+F` (Windows/Linux) or `Cmd+F` (Mac) anywhere on your [canvas](/app/canvas).
2. **Type to search** – Enter any text to search for block names or content within blocks.
3. **Navigate results** – Click on any block in the search results to jump directly to it on the canvas.
4. **Find quickly** – Use this to navigate large canvases and locate specific blocks or content instantly.
## Keyboard Shortcuts
* **Windows/Linux:** `Ctrl+F`
* **Mac:** `Cmd+F`
# Shareable Links
Source: https://docs.getspine.ai/app/basics/shareable-links
Share any canvas or deliverable via URL
## Overview
Every canvas and every deliverable can be shared via URL. Send your team a link and they see the full canvas with all artifacts — no exports, screenshots, or manual handoffs required.
## What You Can Share
* **Full canvases** — Share your entire workspace with all blocks, connections, and outputs
* **Individual deliverables** — Share specific outputs like slide decks, documents, spreadsheets, or apps via their hosted link
* **Block outputs** — Share the output of any individual block
## How to Use
1. **Open the share menu** — Click the Share button on a canvas or block
2. **Copy the link** — Get a shareable URL
3. **Send it** — Anyone with the link can view the canvas or deliverable
## Best Practices
* **Use for async review** — Share links instead of static screenshots so collaborators see live context and connections
* **Combine with Team Workspaces** — Add teammates to your workspace so the right people always have access
* **Share deliverables directly** — Slides, Documents, and Excel blocks each produce their own shareable link, so you can share a specific artifact without exposing the full canvas
# App Block
Source: https://docs.getspine.ai/app/blocks/app-block
Generate interactive web applications and prototypes
## Overview
The App Block generates interactive web applications and prototypes. You describe what you want and the block produces a working interactive app (HTML/CSS/JS). Output is live and interactive right on the canvas. Once it's live, you can prompt it again to refine or extend functionality without ever leaving your canvas.
The App block has specific variations for common use cases:
**Prototype Block** — A variation specifically tuned for interactive prototypes. Takes a product description, screenshot, or PRD and generates a working clickable prototype. Good for testing ideas, getting stakeholder feedback, and rapid iteration.
**Landing Page Block** — A variation specifically tuned for landing page generation. Produces styled, responsive landing pages from a product description or brief. Good for testing positioning, generating marketing pages, and exploring different design directions.
## How to Use
1. **Add an App Block** — Click on the canvas → Select "App Block"
2. **Describe Your App** — Type a natural-language prompt or pass in data from another block
3. **Choose your model** — Choose the model you'd like to run
4. **Test and Refine** — Interact with your app, then prompt again (e.g. "Add a download button" or "Change background color to black")
## Example Workflows
* **Prototype Builder** → Prompt: "Create an interactive pricing calculator" → Refine with additional logic and styling
* **Data Visualization Tool** → Connect a Table Block → Prompt: "Visualize this data as a bar chart"
* **Creative App** → Connect an Image Block → Prompt: "Turn this into a color-matching game"
* **Utility Generator** → Prompt: "Build a simple CSV-to-JSON converter" → Test and export
* **Landing Page** → Prompt: "Create a landing page for a project management SaaS" → Iterate on positioning and design
* **Clickable Prototype** → Upload a screenshot or PRD → "Generate a working clickable prototype of this product"
# BrowserUse Block
Source: https://docs.getspine.ai/app/blocks/browseruse-block
Agents that spin up real browser sessions to interact with the web
## Overview
The BrowserUse Block is a critical block and a major contributor to Spine being state of the art on benchmarks. It allows agents to spin up actual browser sessions and interact with the real web: clicking, navigating, scrolling, filling forms, and extracting content.
Multiple BrowserUse blocks can run in parallel, which means agents can browse several sites simultaneously. These blocks can also access web archives, which is essential for research tasks where current web content has changed since the source was published.
BrowserUse is what makes Spine a genuine agentic platform rather than just an LLM wrapper with search. The agent is actually navigating and interacting with web pages the way a human would, not just calling a search API.
## Key Features
* **Real browser sessions** — Agents click, navigate, scroll, fill forms, and extract content from live websites
* **Parallel browsing** — Multiple BrowserUse blocks run simultaneously, gathering information from many sources at once
* **Web archive access** — Access archived versions of web pages for research where current content has changed
* **Context integration** — Extracted content flows into connected downstream blocks automatically
* **Dynamic page interaction** — Interact with JavaScript-heavy pages, SPAs, and authenticated flows
## How Agents Use It
BrowserUse blocks are typically created and managed by L2.5 persona agents as part of larger workflows. A persona agent might:
1. Do a web search to find relevant URLs
2. Spin up a BrowserUse block for each URL
3. Run them in parallel to gather information simultaneously
4. Read the results and use them as input for the next step in the workflow
## How to Use
1. **Add a BrowserUse Block** — Click on the canvas → Select "BrowserUse Block"
2. **Describe the goal** — Natural language instructions for what to do on the web (e.g. "Pull pricing from these three competitor sites")
3. **Connect context** — Link blocks that provide URLs or parameters
4. **Run** — The agent spins up a browser session and executes the task
5. **Use results downstream** — Connect to Prompt, Memo, Table, or artifact blocks to process what was gathered
## Example Use Cases
* **Competitive intelligence** — Browse competitor websites, pricing pages, and product changelogs in parallel
* **Data gathering** — Navigate data portals, government sites, and databases to extract specific information
* **Research verification** — Cross-reference claims by visiting original sources
* **Market monitoring** — Check multiple sites for pricing changes, new products, or news updates
* **Web archive research** — Access historical versions of pages for research where content has changed
# Chat Block
Source: https://docs.getspine.ai/app/blocks/chat-block
Conversational interface for interacting with any AI model
## Features
* **300+ Models Available**: Switch between GPT-5, Claude, Gemini, Grok, Llama, and hundreds more
* **Conversation Branching**: Click the branch button under any message to start a new conversation thread from that point. Your previous thread will be preserved
* **Context Sharing**: Automatically shares conversation context with connected blocks (both in and out)
* **Model Switching**: Change models mid-conversation to get different perspectives
* **Web and Doc Search**: Specify if you want the chat block to search through the web and/or all "documents" anywhere on the canvas (includes files, YouTube videos, webpages). Note: This is for broader web and document search — if you connect specific blocks to the chat block, they will be used as context regardless of these settings
* **Multi-turn Conversation** — Supports iterative exploration, brainstorming, and back-and-forth refinement within a single block
## How to Use
1. **Create a Chat Block**: Double click on canvas → Select "Chat Block"
2. **Change Your Model**: Click the model dropdown to choose your preferred AI model
3. **Start Conversing**: Type your message and press Enter
4. **Branch Conversations**: After sending a message in the chat, you can click the "Branch" button to explore different directions while preserving all chat history and context
5. **Connect to Other Blocks**: Drag connection lines to share context with other blocks
## Best Practices
* **Switch models for different strengths**: Use OpenAI models for creative tasks, Claude for coding and analysis, Gemini 2.5 for coaching, Grok 4 for brainstorming
* **Branch conversations** when you want to explore multiple directions without losing your main thread
* **Connect to other blocks** to transform chat insights into research, visuals, or structured outputs
## Video Demo
# Deep Research Block
Source: https://docs.getspine.ai/app/blocks/deep-research-block
Agentic research that browses the web and synthesizes sources
## Overview
The Deep Research Block is an agentic research block that browses the web, synthesizes sources, and produces structured research output. It runs models in a loop internally, which means it costs more credits but produces significantly deeper output than a single prompt. Good for market research, competitive analysis, literature reviews, and any task that requires gathering and synthesizing information from many sources.
The block uses two components: a planning model that plans the research steps, and a writing model that consolidates findings into the final report. This allows you to combine the planning capabilities of one model with the writing capabilities of another.
## Key Features
* **Real-time Web Search**: Accesses current information from across the internet or documents on the canvas
* **Agentic Research Loop**: Runs models in a loop behind the scenes, producing significantly deeper output than a single prompt
* **Web and Doc Search**: Specify if you want the block to search through the web and/or all "documents" anywhere on the canvas. Note: This is for broader search — connected blocks will be used as context regardless of these settings
* **Search Control**: Scope searching for both web (include/exclude domains, categories, date ranges) and documents (select specific files)
* **Source Citations**: Includes links and references for verification
* **Context Aware**: Uses context from connected blocks to focus research and writing
## How to Use
1. **Create a Deep Research Block**: Click on canvas → Select "Deep Research Block"
2. **Enter Research Topic**: Type your research question or topic
3. **Configure Search**: Select web and/or document search (web turned on by default)
4. **Select Models**: Choose your planner model (determines how/what/where to search) and writer model (consolidates research into final report)
5. **Connect to Other Blocks**: Share research findings with Chat, Prompt, or Memo blocks
## Example Use Cases
* **Market Research**: "Analyze the current state of the AI productivity tools market"
* **Competitive Analysis**: "Research top 5 competitors to Notion and their key features"
* **Industry Trends**: "What are the latest trends in remote work technology?"
* **Technical Research**: "Current best practices for API security in 2025"
## Video Overview
# Document Block
Source: https://docs.getspine.ai/app/blocks/document-block
Generate production-quality .docx files with professional formatting
## Overview
The Document Block generates production-quality .docx files. This is different from the Memo or Prompt blocks, which produce intermediary text on the canvas. The Document block is agentic and focused on high-quality document production: proper formatting, section structure, and professional styling.
It is an artifact builder block — more agentic than intermediary blocks, running models in loops behind the scenes to produce high-quality finished outputs. Documents are downloadable and shareable via hosted link.
## Key Features
* **Production-quality output** — Proper formatting, section structure, and professional styling
* **Downloadable .docx** — Download the finished document as a Word file
* **Shareable links** — Share via URL with your team or stakeholders
* **Context integration** — Synthesizes content from connected blocks into a polished final document
* **Agentic processing** — Runs models in loops to produce high-quality output, not just a single LLM call
## How to Use
1. **Add a Document Block** — Click on the canvas → Select "Document Block"
2. **Describe the document** — Provide instructions on content, structure, audience, and style
3. **Connect context** — Link to Research, Chat, Table, or other blocks to pull in relevant content
4. **Generate** — Click run to produce the document
5. **Download or share** — Download as .docx or share via the hosted link
## Example Use Cases
* **Client deliverables** — Formal reports and proposals ready to send
* **Research reports** — Polished multi-section research documents
* **Policy briefs** — Structured policy analysis with professional formatting
* **White papers** — Long-form technical or thought leadership content
* **RFP responses** — Formatted responses to requests for proposal
* **Investment memos** — Structured investment analysis documents
* **Technical documentation** — Properly formatted technical docs and guides
# Excel Block
Source: https://docs.getspine.ai/app/blocks/excel-block
Generate production-quality .xlsx spreadsheets with formulas, charts, and multiple sheets
## Overview
The Excel Block generates production-quality .xlsx spreadsheets. This is different from the Table block, which produces intermediary structured data on the canvas. The Excel block is agentic and focused on high-quality spreadsheet production: formulas, formatting, multiple sheets, and charts.
It is an artifact builder block — running models in loops behind the scenes to produce finished spreadsheets that are downloadable and shareable.
## Key Features
* **Real formulas** — Generates spreadsheets with working Excel formulas, not just static data
* **Multiple sheets** — Produces multi-sheet workbooks for complex models and analyses
* **Charts** — Includes charts and data visualizations within the spreadsheet
* **Professional formatting** — Proper cell formatting, headers, and styling
* **Downloadable .xlsx** — Download the finished spreadsheet as an Excel file
* **Shareable links** — Share via URL with your team or stakeholders
* **Context integration** — Synthesizes data from connected blocks into structured spreadsheets
## How to Use
1. **Add an Excel Block** — Click on the canvas → Select "Excel Block"
2. **Describe the spreadsheet** — Provide instructions on what data, formulas, and structure you need
3. **Connect context** — Link to Research, Table, List, or other blocks to pull in data
4. **Generate** — Click run to produce the spreadsheet
5. **Download or share** — Download as .xlsx or share via the hosted link
## Example Use Cases
* **Financial models** — Revenue projections, scenario analysis, budget models, unit economics
* **Cap table models** — Equity ownership and dilution modeling
* **Pipeline trackers** — Sales pipeline, deal flow, or clinical trial tracking
* **Pricing models** — Competitive pricing analysis with formulas
* **Data analysis workbooks** — Multi-sheet analysis with charts and summaries
* **Comparison matrices** — Structured comparisons exported from canvas research
# Files Block
Source: https://docs.getspine.ai/app/blocks/file-upload
Upload documents, PDFs, spreadsheets, images, and more to your canvas
## Overview
The Files Block lets you upload documents, PDFs, spreadsheets, images, and other files directly to the canvas. Uploaded content becomes available as context for connected blocks. Supports a wide range of file types.
## Ways To Use
* **Multi-Format Uploads** — Supports PDFs, text files, images, CSVs, Word docs, and more
* **Contextual Integration** — Any connected block (Chat, Prompt, Deep Research, etc.) can reference file content automatically
* **Reusability** — Uploaded files can be reused across multiple blocks and branches without re-uploading
* **Drag-and-Drop Simplicity** — Simply drag files from your computer into the canvas to create a Files Block instantly
* **Copy and Paste** — Easily copy and paste from your clipboard onto the canvas
## Example Workflows
* **Competitive Analysis** → Upload 5 competitor pitch decks → Connect to Deep Research → Summarize positioning and key differentiators
* **Content Summarization** → Upload a whitepaper → Connect to a Prompt Block → Generate executive summaries or tweet threads
* **Creative Workflow** → Upload brand guidelines PDF → Connect to an Image Block → Ensure generated visuals align with brand voice
* **Documentation Search** → Upload internal SOPs → Chat Block queries them like a live knowledge base
# Folder Block
Source: https://docs.getspine.ai/app/blocks/folder-block
Group multiple files together for organized document collections
## Overview
The Folder Block is a container block that holds multiple files on the canvas. When you need to work with a collection of documents — meeting notes, research papers, financial statements, etc. — the Folder Block groups them together. Agents can then use the [Folder Synthesis Block](/app/blocks/folder-synthesis-block) to query across all files in the folder.
## How to Use
1. **Add a Folder Block** — Click on the canvas → Select "Folder Block," or drag a folder from your computer onto the canvas
2. **Add files** — Drag and drop files into the folder, or upload them directly
3. **Organize your collection** — Group related documents together
4. **Connect downstream** — Link the Folder Block to a [Folder Synthesis Block](/app/blocks/folder-synthesis-block) to run queries across all files, or connect directly to Chat, Prompt, Deep Research, or other blocks that should use the folder as a source
## Example Use Cases
* **Meeting notes collection** — Group all meeting notes for a project, then synthesize action items across all of them
* **Research papers** — Collect research papers on a topic for cross-document analysis and theme extraction
* **Financial statements** — Group quarterly reports for trend analysis across periods
* **Customer feedback** — Collect survey responses or support tickets for pattern identification
* **Legal documents** — Group contracts or policy documents for compliance review
* **Due diligence** — Folder of PDFs → Deep Research → executive summary
* **RFP response** — Folder of requirements + past answers → Memo or Document output
# Folder Synthesis Block
Source: https://docs.getspine.ai/app/blocks/folder-synthesis-block
Run prompts against every file in a folder via map-reduce
## Overview
The Folder Synthesis Block runs a prompt against every file in a [Folder Block](/app/blocks/folder-block) via map-reduce and outputs a combined result. The synthesis processes each file individually, then aggregates and synthesizes the results into a single output.
This is fundamentally different from just dumping all files into a context window: it scales to large document collections and handles each file with full attention.
## Key Features
* **Map-reduce processing** — Each file is processed individually with its own dedicated context, then results are aggregated into a final synthesis
* **Scales to large collections** — Works with document collections too large to fit in a single context window
* **Full attention per file** — Each document gets dedicated processing, not diluted attention shared across all files
* **Combined output** — Final synthesis aggregates and reconciles findings across all files into one coherent result
## How to Use
1. **Create a Folder Block** — Group your files into a [Folder Block](/app/blocks/folder-block) first
2. **Add a Folder Synthesis Block** — Click on the canvas → Select "Folder Synthesis Block"
3. **Connect to folder** — Link the Folder Synthesis Block to your Folder Block
4. **Write your prompt** — Describe what you want to extract or analyze across the files
5. **Run** — The block processes each file individually, then synthesizes results
6. **Connect downstream** — Link the output to Memo, Document, Table, or Slides blocks for further refinement
## Example Use Cases
* **"Summarize all my meeting notes"** — Get a unified summary across dozens of meeting documents
* **"Extract action items across these 20 documents"** — Pull out every action item from a collection
* **"Find all mentions of budget changes in this folder"** — Search across a collection for specific topics
* **"Identify common themes across these research papers"** — Cross-document theme extraction and pattern identification
* **Compliance checking** — Check policy compliance across a folder of documents
* **Data extraction** — Extract specific data points across receipt or invoice collections
* **Legal / compliance pass** — Folder of policies → Folder Synthesis → checklist of obligations
* **Research consolidation** — Many PDFs → Folder Synthesis → single structured memo
# Frames Block
Source: https://docs.getspine.ai/app/blocks/frames-block
Organize your workspace into clear sections and groups with frames
## Overview
Organize your workspace into clear sections and groups with frames. Whether you're working on a complex project with multiple components or just want to keep related blocks together, frames help you structure your canvas visually. Group related ideas, separate different phases of work, or create distinct sections for different topics—all with a simple, visual organization system. Frames work seamlessly with templates and are preserved when cloning canvases, making it easy to share structured workflows with your team.
## How to Use
1. **Add a Frame** – Click on the [canvas](/app/canvas) → Select "Frames Block."
2. **Organize Your Blocks** – Drag blocks into the frame to group related content together.
3. **Structure Your Work** – Create multiple frames to separate different phases, topics, or components of your project.
4. **Share Structured Workflows** – Frames are preserved when cloning canvases, making it easy to share organized workflows with your team.
## Video Demo
# Image Generation Block
Source: https://docs.getspine.ai/app/blocks/image-generation-block
Create custom visuals using AI image generation models
## Overview
The Image Generation Block creates custom visuals using AI image generation models. Perfect for logos, illustrations, mockups, and any visual content needs.
## Key Features
* **Multiple AI Models**: Access to models like Flux, Nano Banana, Stable Diffusion and more
* **Context Integration**: Generate images based on information from connected blocks
* **Aspect Ratio and Seed Control**: Fine-tune settings to get the best image results
* **Bulk Generate Variants**: Easily bulk generate variants with the variant button. Learn how to do so in the [Bulk Variant Generation](/app/advanced/cross-model-variations) section
## How to Use
1. **Create an Image Block** — Click on canvas → Select "Image Generation Block"
2. **Describe Your Image** — Write a detailed description of what you want
3. **Select Model** — Choose the best image generation model for your needs
4. **Configure Settings** — Adjust aspect ratio, resolution and seed as needed
5. **Generate** — Click run to create your image
6. **Iterate** — Refine your prompt and regenerate as needed
## Video Overview
# Inputs Block
Source: https://docs.getspine.ai/app/blocks/input-block
Define variables that flow through all connected blocks
## Overview
The Inputs Block is a structured input block for providing specific data, parameters, or instructions that downstream blocks can consume. Changing a single input can instantly update every downstream block, making it the backbone of dynamic, reusable workflows. Good for setting up reusable workflow templates with variable inputs.
## How to Use
1. **Create an Inputs Block** — Click on the canvas → Select "Inputs Block"
2. **Add Fields** — Define parameters like Company, Audience, Goal, or Keyword
3. **Connect to Other Blocks** — Drag lines from your Inputs Block to Prompts, Chats, or Images that depend on those values
4. **Run the Workflow** — Click "Run" to execute all connected blocks using the defined parameters
5. **Modify and Re-run** — Change one or more values (e.g. "Nike" → "Adidas") and re-run to regenerate outputs across the branch automatically
## Video Overview
# List Block
Source: https://docs.getspine.ai/app/blocks/list-block
Generate and manage structured lists with bulk processing
## Overview
The List Block produces structured lists. Good for ranked outputs, checklists, prioritized items, and any content that is naturally list-shaped. Can also do web search when needed. Often used as an intermediate step before downstream synthesis.
It bridges creativity and execution: turning unstructured prompts or messy data into organized, actionable lists.
## How to Use
1. **Create a List Block** — Click on the canvas → Select "List Block"
2. **Generate or Input Items** — Type a prompt like "List 5 SaaS companies disrupting healthcare." Or paste/import items from another block or external file
3. **Connect Downstream Blocks** — Drag a connection from the List Block to a Prompt, Chat, or Image Block. These connected blocks will run once for each list item
4. **Run in Bulk** — Click "Run All" to execute all connected blocks in parallel. Results are grouped by list item for easy comparison
## Bulk Expand List
Take a list block and automatically expand each item into its own block (prompt, memo, image, table, etc.). This is a powerful workflow pattern: generate a list of 10 competitors, then automatically create a research block for each one. Or generate a list of topics, then create a deep research block for each. The expansion is handled by L3 agents and each resulting block connects back to its source list item.
## Example Workflows
* **Competitor Research** → Generate 10 competitor names → Run Deep Research and Prompt Blocks to summarize each
* **Ad Creative Generation** → List 5 product benefits → Generate headlines and visuals for each in parallel
* **Market Validation** → List 20 startups in a niche → Run a research + summary pipeline for each
## Video Overview
# Memo Block
Source: https://docs.getspine.ai/app/blocks/memo-block
Generate polished, multi-section documents and memos
## Overview
The Memo Block generates long-form structured documents. Think research reports, strategy memos, detailed analyses. Designed for polished, multi-section written output that synthesizes context from connected blocks. Perfect for the end of a thinking phase to consolidate findings, share insights, or create assets for other workflows.
## How to Use
1. **Create a Memo Block**: Click on canvas → Select "Memo Block"
2. **Define Your Audience**: Specify who will read this memo (executives, team members, clients, etc.)
3. **Set Your Objective**: Clarify the memo's purpose (decision-making, status update, proposal, etc.)
4. **Provide Instructions**: Detail writing style, structure, length, and any specific requirements
5. **Connect Context Blocks**: Link to Research, Chat, or other blocks to pull in relevant information
6. **Select Model**: Choose the AI model best suited for your writing needs
7. **Generate**: Create your polished, audience-ready memo
## Example Use Cases
* **Executive Summary**: "Create a 1-page executive summary for the board, highlighting key findings from our market research and competitive analysis"
* **Client Proposal**: "Write a client-facing proposal memo that incorporates our technical research and presents solutions in business terms"
* **Team Cheat Sheet**: "Generate a quick reference guide for the team based on our brainstorming session and research findings"
* **Investor Update**: "Create an investor memo that synthesizes our progress metrics, market research, and future roadmap"
* **Sales Battlecard**: "Create a 1-page memo to help the sales team win deals against this competitor"
## Video Overview
# Notes Block
Source: https://docs.getspine.ai/app/blocks/notes-block
Free-form text for human and agent annotations
## Overview
The Notes Block is a free-form text block for human annotations, instructions, observations, or any content that should be available as context but is not AI-generated. Agents and humans both use this to leave structured notes on the canvas.
Perfect for adding comments, hypotheses, instructions, or takeaways to keep your workflows organized and meaningful.
## How to Use
1. **Create a Notes Block** — Click on the canvas → Select "Notes Block"
2. **Type Your Notes** — Add plain text, markdown, or quick bullets to capture your thoughts
3. **Connect to Other Blocks** — Drag a connection line from the Notes Block to associate it with research, prompts, or results
4. **Edit and Reorganize** — Move or resize the Notes Block freely to keep related blocks grouped together
5. **Use as Commentary** — Add summaries, reminders, or next steps for collaborators reviewing your canvas
# Prompt Block
Source: https://docs.getspine.ai/app/blocks/prompt-block
Single-shot AI transformations for structured tasks
## Overview
The Prompt Block is a single-shot LLM call. You write a prompt, pick a model, run it, get output. It is the simplest and most flexible block, and the workhorse of most workflows. Can receive context from any number of connected upstream blocks. Can also do web search when needed. Perfect for structured tasks, data transformation, and when you need a focused AI response without ongoing conversation.
We use it frequently to consolidate "data" after finishing a phase of thinking, preparing for the next phase.
## Key Features
* **List Processing**: Specify if you want output as lists for bulk operations (or a single text response)
* **Model Selection**: Choose the best model for your specific task
* **Context Sharing**: Automatically shares context with connected blocks (both in and out). Can receive context from any number of connected upstream blocks
* **Web and Doc Search**: Specify if you want the prompt block to search through the web and/or all "documents" anywhere on the canvas. Note: This is for broader search — connected blocks will be used as context regardless of these settings
* **Edit in Canvas**: Click on the output box to make direct edits to the returned text
* **Re-run Prompt**: Click the block, hit the edit button to view and modify the settings used to generate the response
## How to Use
1. **Create a Prompt Block**: Click on canvas → Select "Prompt Block"
2. **Add Your Prompt**: Type your instruction or paste your content
3. **Select Model**: Choose the most appropriate model for your task
4. **Configure Search**: Select web and/or document search (turned off by default)
5. **Select Output Type**: Choose text or list format
6. **Run**: Click the run button to get your result
7. **Connect for Context**: Link to other blocks to use their outputs as input
## List Processing
When output type is set to list, Prompt Block returns a list and automatically offers two action types:
* **Single Item Processing**: Hit the "+" for just one item to pipe it to the next block
* **Bulk Actions**: Apply the same next step to every item in the list, or create a process for one item and apply it across all other items
## Video Demo
# Slides Block
Source: https://docs.getspine.ai/app/blocks/slides-block
Generate full presentation decks as downloadable .pptx files
## Overview
The Slides Block generates full presentation decks. It produces .pptx files that are downloadable and hosted at a shareable link. This is an artifact builder block — more agentic than intermediary blocks, running models in loops behind the scenes to produce high-quality multi-slide outputs.
Agents use this to create pitch decks, strategy presentations, client decks, board presentations, sales decks, training decks, conference presentations, internal all-hands decks, and investor updates.
## How to Use
1. **Add a Slides Block** — Click on the canvas → Select "Slides Block"
2. **Connect Context** — Link any relevant blocks (Chat, Deep Research, Prompt, etc.)
3. **Set Slide Count** — Adjust the number of slides you want the AI to create
4. **Generate Slides** — Click "Run" to have Spine organize your content into a presentation
5. **Download or Share** — Download as .pptx or share via the hosted link
## Example Workflows
* **Pitch Deck Generator** → Inputs + Research Blocks → Slides Block → "Create 8 slides for a pitch deck"
* **Weekly Report** → List + Table + Notes Blocks → Slides Block → Summarize into key updates
* **Creative Brief Presentation** → Chat + Image Blocks → Slides Block → Generate a visual presentation draft
* **Strategy Presentation** → Deep Research + Memo → Slides Block → Full strategy deck with supporting data
# Table Block
Source: https://docs.getspine.ai/app/blocks/table-block
Generate structured tabular data for comparisons, summaries, and analysis
## Overview
The Table Block generates structured tabular data. Good for comparison matrices, pipeline trackers, data summaries, and any output that benefits from a rows-and-columns format. Can synthesize data from connected research and prompt blocks into structured tables. Can also do web search when needed.
The Table Block is an intermediary block — often used as an intermediate step before producing a final Document or Excel deliverable.
## Key Features
* **AI-Generated Tables** — Use prompts or connected context to automatically structure unorganized information into columns and rows
* **Context Integration** — Pulls data from any upstream block (e.g. Deep Research, List, Prompt) to create a unified table view
* **Web Search** — Can search the web when needed to populate or enrich table data
* **CSV Export** — Instantly export any table as a downloadable .csv for analysis in Excel, Google Sheets, or Airtable
## How to Use
1. **Create a Table Block** — Double click on the canvas → Select "Table"
2. **Generate Data** — Type a prompt like "Create a comparison table of 5 AI copywriting tools with columns for pricing, key features, and rating." Or connect it to other blocks (e.g., List or Deep Research) to automatically populate data
3. **Export as CSV** — Click the export icon to download the table for use in your preferred spreadsheet tool
## Example Workflows
* **Competitor Matrix** → List Block of competitors → Deep Research → Table Block summarizing pricing, features, and differentiators
* **Market Analysis** → Research 10 companies → Table showing market size, funding, and niche
* **Campaign Tracking** → Prompt AI to generate ad ideas → Table Block organizes copy, visuals, and performance metrics for review
## Video Overview
# Web Page Block
Source: https://docs.getspine.ai/app/blocks/web-page
Import and use any webpage as context in your workflows
## Overview
The Web Page Block imports and renders a web page on the canvas. The imported content becomes available as context for any connected downstream block. Good for pulling in competitor pages, reference material, documentation, articles, and any web-based source.
## How to Use
1. **Create a Web Page Block** — Click on the canvas → Select "Web page". Or just paste a link anywhere on the canvas
2. **Paste a URL** — Enter any public webpage (e.g. [https://www.notion.so/product](https://www.notion.so/product))
3. **Fetch Content** — Click "Save Website"
4. **Connect to Other Blocks** — Drag connection lines from the Web Page Block to a Chat, Prompt, or Deep Research Block to use the page as context
5. **Re-run as Needed** — Edit and change the contents of the URL anytime
## Example Workflows
* **Competitor Benchmarking** → Paste competitor websites → Connect to Deep Research → Generate market comparisons
* **Content Summarization** → Load an article → Connect to a Prompt Block → Produce summaries, quotes, or tweet threads
* **Product Analysis** → Import a SaaS product page → Connect to Chat Block → Ask questions like "What's their main value prop?"
* **SEO Research** → Paste multiple URLs → Run in parallel via List Blocks → Analyze tone, keyword use, and content structure
# YouTube Block
Source: https://docs.getspine.ai/app/blocks/youtube-block
Import YouTube video content as context for your workflows
## Overview
The YouTube Block imports YouTube video content onto the canvas. Extracts transcript and metadata. Makes video content available as context for downstream blocks. Just paste the link, and Spine automatically loads the video so you can use it as live context in any AI workflow.
## Key Features
* **Quick Video Import** — Paste any YouTube URL to instantly load the video and transcript
* **Context Sharing** — Connect the block to others (like Prompt, Chat, or Image) so the AI can reference what's said in the video
* **Versatile Use** — Summarize videos, extract insights, create lists, visuals, or outlines — all powered by the transcript context
* **Lightweight and Fast** — No configuration or settings; just plug in a link and start building
## How to Use
1. **Add a YouTube Block** — Click on the canvas → Select "YouTube Block." OR simply paste a YouTube URL onto the canvas
2. **Paste the Video URL** — Add any public YouTube link
3. **Connect to Other Blocks** — Drag lines to a Prompt, Chat, or Image Block to use the transcript as context
4. **Run an Action** — Ask connected blocks to summarize the video, extract highlights, or generate visuals inspired by its content
## Example Workflows
* **Video Summarizer** → YouTube Block → Prompt Block → "Summarize this video into 5 bullet points"
* **Idea Generator** → YouTube Block → Chat Block → "Create 3 marketing ideas based on this video"
* **Content Repurposing** → YouTube Block → Prompt Block → "Turn this video into a LinkedIn post and short caption"
# Canvas
Source: https://docs.getspine.ai/app/canvas
Your infinite visual workspace for AI workflows
## Overview
The canvas is your visual workspace. This is where you can add blocks, connect context, and build. Both humans and agents work on the canvas, what is good for humans is also good for agents. The same properties that make the canvas legible to a person (structured context, explicit relationships between blocks, visible branching) are exactly the properties that make it a reliable workspace for agents.
Every canvas and every deliverable can be shared via URL. Send your team a link and they see the full canvas with all artifacts.
## Adding Blocks
Double click anywhere on the canvas to open the block menu and add a new block.
## Importing Content
You can bring content onto your canvas in several ways:
* **Paste links**: Paste any link (YouTube videos, web pages, etc.) anywhere on the canvas to automatically create a block
* **Drag and drop files**: Drag files from your computer and drop them anywhere on the canvas to import them as blocks
## Swarm Mode
Describe a project in natural language via the chat. Agents plan, decompose, and execute on the canvas autonomously, spinning up blocks, making connections, and delivering finished outputs. You can watch them work in real time or queue a task and come back to finished deliverables.
## Manual / Hybrid Mode
Work directly on the canvas. Add blocks, write prompts, choose models, make connections, and run blocks yourself. Branch in different directions from the same starting point. You can mix modes freely — let agents do the heavy lifting, then select a subset of blocks and iterate on them through the chat without rerunning the entire workflow.
## Shareable Links
Every canvas and every deliverable can be shared via URL. Send your team a link and they see the full canvas with all artifacts.
## Video Overview
# Blocks
Source: https://docs.getspine.ai/app/general-block-features
The building blocks of every Spine workflow
## Overview
Blocks are the canvas primitives, the atomic units of Spine. Think of them as Lego bricks for AI workflows: each one does something specific, but they can be snapped together and composed in many different ways. You can connect any block to any other block, and that connection guarantees the passing of context regardless of block type.
Blocks fall into five categories:
**AI Output Blocks**: Core reasoning and generation blocks: [Chat](/app/blocks/chat-block), [Prompt](/app/blocks/prompt-block), [Deep Research](/app/blocks/deep-research-block), [Memo](/app/blocks/memo-block)
**Artifact Builder Blocks**: Produce downloadable, shareable, production-quality deliverables. More agentic than other blocks, running models in loops behind the scenes: [Slides](/app/blocks/slides-block), [Document](/app/blocks/document-block), [Excel](/app/blocks/excel-block), [App](/app/blocks/app-block) (including Prototype and Landing Page variations), [Image Generation](/app/blocks/image-generation-block), [Frames](/app/blocks/frames-block)
**Intermediary Blocks**: Produce structured content used as input for downstream blocks or as working artifacts: [Table](/app/blocks/table-block), [List](/app/blocks/list-block)
**Agentic / Execution Blocks**: [BrowserUse](/app/blocks/browseruse-block) (spins up real browser sessions to interact with the web)
**Data and Source Ingestion Blocks**: Bring external content into the canvas: [Web Page](/app/blocks/web-page), [YouTube](/app/blocks/youtube-block), [Files](/app/blocks/file-upload), [Folder](/app/blocks/folder-block), [Folder Synthesis](/app/blocks/folder-synthesis-block), [Inputs](/app/blocks/input-block)
**User and Agent Annotation Blocks**: [Notes](/app/blocks/notes-block) (free-form text for human or agent annotations)
You can draw arrows from blocks to pass context from one block to another. Not all blocks share the same buttons. Below are what all buttons do on blocks.
## Edit Button
After a block has been run, you can hit the pencil button to modify the previous prompt/context and settings.
## Variant Button
Commonly found on image & prompt blocks — allows the user to create variants of the block using the same or different model. Learn more about [bulk variant generation](/app/advanced/cross-model-variations).
## Fullscreen
Puts block into full screen mode.
## More Actions
Menu item that opens more actions.
## Share
Allows you to share the block.
## Copy
Copies the block. Once copied, you can paste anywhere on the canvas.
## Duplicate
Duplicates the block onto the canvas and maintains its context/block connections.
## Bookmark
Saves the block into your bookmarks library for quick access.
## Delete
Deletes the block from the canvas.
## Video Overview
# Pricing
Source: https://docs.getspine.ai/app/team/pricing
Flexible credits, team workspaces, and plans that scale with you
## Overview
Spine uses usage-based credits tied to block usage and the underlying models used. You choose how many credits you want each month and the price adjusts to match. Busy month? Get more. Slow month? Get less. Changes happen right away and you only pay for what you use.
## Plans
**Free Tier** — Enough credits to try a real task.
**Pro (starting at $20/month or $192/year)** — 30,000 monthly credits with 1,500 daily refresh. The daily refresh is not a cap on usage — it is additional credits you get each day (resets nightly). You can use your full balance in a single run.
**Max (starting at $100/month or $960/year)** — Higher credit allocation for power users and teams. Expanded credit levels designed to support growing teams without running out.
**Enterprise** — Custom pricing for private deployments and dedicated support.
All paid plans support flexible credit scaling — choose the credit level that fits your usage and adjust anytime. No more paying for credits you don't touch or running out halfway through a project.
If you're already on a paid plan, nothing changes. Same price, same credits. You just have more options now.
## Team Workspaces
Add your whole team to your workspace at no extra cost per person. Everyone shares one pool of credits under one subscription, and you control how much each person can use.
* **No per-seat charges** — Add as many team members as you need without increasing your subscription cost
* **Shared credit pool** — Your team operates from one pool of credits under one plan
* **Usage controls** — Set limits on how much each team member can use
* **Max plan expanded** — Higher credit levels on the Max plan so growing your team doesn't mean running out of credits
See [Team Workspaces](/app/team/team-workspaces) for full details.
## Flexible Credit Scaling
You're no longer locked into a fixed plan. Choose how many credits you want each month and the price adjusts to match.
* **Scale up instantly** — Having a busy month? Increase your credits right away
* **Scale down anytime** — Slow month? Reduce your credits and pay less
* **Changes take effect immediately** — No waiting for the next billing cycle
* **Pay for what you use** — No wasted credits, no mid-project shortages
## How Credits Work
* **Standard AI blocks** (Chat, Prompt, Image Generation) cost credits based on the model you choose. More powerful models consume more
* **Agentic blocks** (Deep Research, Slides, Document, Excel, BrowserUse) cost more because they run multiple model calls behind the scenes
* **Connected blocks** have a multiplier: for every 3 connected blocks, cost increases by 1x block price
* **Agents** tend to use more credits than manual workflows because they are tuned to get the best possible outcome, which means they pick the best models and do more work
Pricing details may be updated. Check [getspine.ai/pricing](https://getspine.ai/pricing) for the latest.
# Shared Workspaces
Source: https://docs.getspine.ai/app/team/shared-workspaces
Collaborate with your team in a shared workspace with unified billing and flexible permissions
# Shared Workspaces
Shared workspaces let you bring your whole team into Spine. Available on all paid plans, you can invite unlimited members to your workspace with a shared credit pool — so you only pay for what you use, not per seat.
Whether you're collaborating on research, running tasks in parallel, or sharing deliverables, a shared workspace keeps everything in one place.
## Inviting members
Only admins can invite new members. You can send an invite from the sidebar or from **Settings → People**.
Enter an email address, choose a role (admin or editor), and send. The invitee will receive an email with a link to join your workspace.
Admins can also remove members from the workspace at any time from **Settings → People**.
## Roles
There are two roles: **Admin** and **Editor**.
Both have the same canvas capabilities — creating canvases, running tasks, and sharing. Admins can additionally invite and remove members, change roles, and manage billing, plans, and credits.
## Canvas sharing
Canvases have three permission levels:
**Private** — Only visible to the owner. This is the default.
**Team** — Visible to everyone in the workspace.
**Public** — Anyone with the link can view the canvas.
Click the **Share** button on a canvas to change its permission level.
If someone tries to access a private canvas, they can request access. The owner will receive an email and can grant or deny the request.
## Billing & credits
Your workspace shares a single credit pool. All tasks draw from the same balance regardless of who runs them. Every member can see the current credit availability.
Admins can adjust the workspace's credit level at any time from **Settings → Plans & Credits**. Changes take effect immediately and are prorated.
Only admins can manage billing, plans, and credits.
# Team Workspaces
Source: https://docs.getspine.ai/app/team/team-workspaces
Add your whole team to your workspace at no extra cost per person
## Overview
Add your whole team to your workspace at no extra cost per person. Everyone shares one pool of credits under one subscription, and you control how much each person can use.
## Key Features
* **No per-seat pricing** — Add teammates without paying more per person. Your subscription covers the whole team
* **Shared credit pool** — One pool of credits for everyone on the team, managed under one subscription
* **Per-member usage controls** — Set limits on how much each person can use so no one burns through the team's credits unexpectedly
* **Expanded Max plan** — Higher credit levels on the Max plan to support growing teams
## How to Use
1. **Open your workspace settings** — Navigate to your workspace settings from the left sidebar
2. **Invite team members** — Add teammates by email. They join your workspace immediately
3. **Set usage limits** — Control how many credits each team member can use
4. **Monitor usage** — Track credit consumption across your team
## FAQ
**Does adding team members cost extra?**
No. There is no per-seat charge. Everyone shares one pool of credits under your existing subscription.
**Can I control how much each person uses?**
Yes. You can set per-member usage limits so you stay in control of your credit budget.
**What if my team needs more credits?**
You can scale your credit allocation up at any time. Changes take effect immediately. The Max plan has expanded credit levels specifically designed for growing teams.
**What happens to my existing plan?**
If you're already on a paid plan, nothing changes. Same price, same credits. You just have more options now.
# What is Spine?
Source: https://docs.getspine.ai/app/what-is-spine
A multi-agent orchestration platform built on a visual canvas
Spine is a multi-agent orchestration platform built on a visual canvas. You describe a project, and a team of AI agents spins up, works in parallel on an infinite canvas, and delivers finished outputs, market reports, financial models, slide decks, interactive prototypes, competitive analyses, SEO audits, and more.
The core insight: chat is the wrong interface for complex AI work. Real projects are not linear. They branch, they require multiple streams of research running simultaneously, they need different models for different subtasks. Spine gives both humans and agents a workspace where the structure of the work is explicit and controllable, not hidden inside a context window.
Spine is model-agnostic and routes across 300+ models. In a single workflow you can go from an OpenAI LLM call, to an image generation model like Flux or Nano Banana Pro, to Claude generating an interactive app, each block using whatever model fits best.
## Core Concepts
* [Blocks](/app/general-block-features): Individual AI-powered components that perform specific tasks. Think of them as Lego bricks for AI workflows: each one does something specific, but they can be snapped together and composed in many different ways
* [Canvas](/app/canvas): Your infinite workspace where blocks live and connect
* [Context Passing](/app/basics/context-passing): Information automatically shared between connected blocks via a full dependency graph that determines execution order, parallelism, and concurrency
* [Models](/app/advanced/model-management): Choose from 300+ AI models, including GPT-5, Claude, Gemini, Grok, Llama, Nano Banana, Flux and hundreds of specialized models. Spine dynamically selects the best model for each task
* [Agent Architecture](/app/advanced/agent-architecture): A four-tier agent system (L1 / L2 / L2.5 / L3) that decomposes complex projects, coordinates parallel execution, and delivers finished outputs
* [Scheduled Runs](/app/advanced/scheduled-runs): Automate recurring workflows on daily, weekly, or custom schedules
* [Integrations](/app/advanced/integrations): Connect to 2,000+ apps so agents can read from and write to your existing tools
* [BrowserUse](/app/blocks/browseruse-block): Agents spin up real browser sessions to interact with the live web
* [Team Workspaces](/app/team/team-workspaces): Add your whole team at no extra cost per person. One shared credit pool, per-member usage controls
## Modes of Use
Spine supports two primary modes, and most users end up using both.
**Swarm Mode (Autonomous)**: Describe a project in natural language via the chat. Agents plan, decompose, execute in parallel on the canvas, and deliver finished outputs. Agents can run autonomously for 80+ minutes on large projects. You can watch them work in real time, or queue a task and come back to finished deliverables.
**Manual / Hybrid Mode**: Work directly on the canvas. Add blocks, write prompts, choose models, make connections, and run blocks yourself. Branch in different directions from the same starting point. You can mix modes freely, let agents do the heavy lifting, then iterate on specific blocks manually.
## Your First Canvas
1. **Start with a [Chat Block](/app/blocks/chat-block)**: Click anywhere on the canvas and select "Chat Block"
* Chat with any of the hundreds of models on Spine, change the model mid-conversation if you like
2. **Expand your thinking**: Hit the plus icon (or drag and drop an edge from the Chat block) to create new connected blocks. The [Chat Block](/app/blocks/chat-block) will automatically be used as context for the new blocks
3. **Bring your own docs**: Import YouTube videos, files, or previous LLM threads (needs to be publicly shareable) by copying and pasting links or dragging and dropping files. They will automatically show up as blocks on Spine that you can use as context going forward
4. **Let agents take over**: Describe a complex project in the chat and let Spine Swarm decompose it, assign persona agents, and deliver finished outputs across multiple block types
5. **See the big picture**: Zoom out to view your entire thought process
## Video Overview
## Get Involved
Ready to dive deeper? Check out our [roadmap](https://app.getspine.ai/roadmap) to see what features we're building next and vote on what you'd like to see prioritized.
Join our community on [Discord](https://discord.gg/qdkYmxph) to get help, share feedback, and connect with other Spine users.
# Authentication
Source: https://docs.getspine.ai/sdks/python/authentication
How to pass your API key to the SDK and override the base URL.
The Spine API uses API keys sent as the `X-API-KEY` request header. The
SDK adds the header for you on every request — you just need to give it
a key.
## Passing the key
```python Environment variable (preferred) theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
# Shell:
# export SPINE_API_KEY=sk_spine_...
from spine import SpineClient
with SpineClient() as client:
...
```
```python Explicit argument theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
from spine import SpineClient
with SpineClient(api_key="sk_spine_...") as client:
...
```
Never commit keys to source control. Use your deployment platform's
secret manager (AWS Secrets Manager, 1Password, Doppler, etc.) and
inject them at runtime.
If no key is provided and `SPINE_API_KEY` is unset, `SpineClient()`
raises `ValueError` immediately — before any network call.
## Key rotation
Keys revoked in the dashboard stop working on the next request; you'll
see `AuthenticationError` raised from the SDK. Roll new keys through
your secret store before revoking the old one so running processes
don't break mid-run.
## Overriding the base URL
Point the SDK at a staging or enterprise deployment via `base_url` (or
the `SPINE_BASE_URL` env var):
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
client = SpineClient(base_url="https://staging.getspine.ai")
```
The SDK appends `/v1` automatically, so pass the host without the API
prefix.
## Injecting your own HTTP client
For advanced cases (custom proxies, SSL contexts, test doubles), pass a
pre-configured `httpx.Client` or `httpx.AsyncClient`. The SDK still
applies the `X-API-KEY` and `User-Agent` headers — your client does not
need to set them.
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
import httpx
from spine import SpineClient
transport = httpx.HTTPTransport(proxy="http://corp-proxy:8080")
http_client = httpx.Client(transport=transport, base_url="https://api.getspine.ai/v1")
with SpineClient(http_client=http_client) as client:
...
```
When you inject a client, the SDK does **not** close it on `__exit__` —
that's your responsibility.
# Canvas introspection
Source: https://docs.getspine.ai/sdks/python/canvas
Inspect the block graph and task tree produced by a run.
Every run writes its output into a **canvas** — a directed graph of
blocks (documents, spreadsheets, research notes, images, etc.) linked by
dependency edges. The SDK exposes three read-only introspection methods
so you can audit exactly what a run produced.
## The block graph
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
dag = client.canvas.get_dag(handle.canvas_id)
for node in dag.nodes:
print(f"{node.type:24} {node.status:10} {node.name}")
for edge in dag.edges:
print(f"{edge.source_id} -> {edge.target_id}")
```
Each `CanvasNode` exposes:
| Field | Description |
| --------- | ------------------------------------------------------------- |
| `id` | UUID of the block. |
| `name` | Human-readable block name. |
| `type` | Block type (e.g. `document-block`, `excel-block`). |
| `status` | Current state (`idle`, `running`, `completed`, `error`, ...). |
| `content` | Textual content, when applicable. |
| `url` | External or pre-signed download URL, when applicable. |
| `sources` | Source attributions (block-type specific). |
## The task tree
The task tree describes the agent execution that produced the canvas —
parent tasks, persona tasks, individual tool calls. It is split into
completed and in-progress subtrees:
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
tree = client.canvas.get_tasks(handle.canvas_id)
def print_tree(tasks, indent=0):
for t in tasks:
print(" " * indent + f"- {t.name} ({t.task_type}, {t.status})")
if t.children:
print_tree(t.children, indent + 1)
print("Completed:")
print_tree(tree.completed)
print("In progress:")
print_tree(tree.not_completed)
```
## A single task
If you already have a task id (from a progress webhook or a previous
tree), fetch just that one with its immediate children:
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
task = client.canvas.get_task(handle.canvas_id, "task-abc")
print(task.status, task.name)
```
## Async versions
Every method above has an async twin on `AsyncSpineClient`:
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
dag = await async_client.canvas.get_dag(canvas_id)
tree = await async_client.canvas.get_tasks(canvas_id)
task = await async_client.canvas.get_task(canvas_id, task_id)
```
# Errors and retries
Source: https://docs.getspine.ai/sdks/python/errors
Exception hierarchy, retry policy, and timeouts.
Every exception raised by the SDK is a subclass of `SpineError`, so a
single `except SpineError:` clause catches anything the SDK can throw.
## Exception hierarchy
```text theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
SpineError
├── SpineConnectionError # network / transport failures
├── SpineTimeoutError # HTTP timeout or polling timeout
└── SpineAPIError # 4xx / 5xx HTTP responses
├── AuthenticationError # 401
├── BadRequestError # 400
├── NotFoundError # 404
├── RateLimitError # 429 (after retry budget exhausted)
└── ServerError # 5xx (after retry budget exhausted)
```
## Inspecting errors
`SpineAPIError` carries the HTTP status, the server's error message, the
request id (useful when reporting issues), and the raw body:
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
from spine import SpineClient, BadRequestError
try:
with SpineClient() as client:
client.runs.create(prompt="x", template="bogus")
except BadRequestError as exc:
print(exc.status_code) # 400
print(exc.error_message) # "Invalid template: bogus. Valid templates: ..."
print(exc.request_id) # value of X-Request-ID header
print(exc.response_body) # parsed JSON body
```
See [Errors](/api-reference/errors) for the full list of server-side
error messages.
## Automatic retries
The SDK retries transient failures automatically with exponential
backoff:
| Failure | Retried? | Notes |
| ------------------------------------- | -------- | ----------------------------- |
| Connection errors (DNS, refused, TLS) | Yes | Up to `max_retries`. |
| HTTP 429 | Yes | Honours `Retry-After` header. |
| HTTP 5xx | Yes | Up to `max_retries`. |
| HTTP 400 / 401 / 404 | No | Raised immediately. |
When the retry budget is exhausted, the underlying exception
(`ServerError`, `RateLimitError`, `SpineConnectionError`) is raised.
## Tuning the policy
Override the policy on the client:
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
from spine import SpineClient, RetryPolicy
client = SpineClient(
retry_policy=RetryPolicy(
max_retries=5, # default: 3
base_delay=1.0, # default: 0.5
max_delay=60.0, # default: 30.0
jitter=0.2, # ±20% jitter, default: 0.1
),
)
```
Set `max_retries=0` to disable retries entirely — useful in tests.
## Timeouts
The **HTTP timeout** is 60 seconds total / 10 seconds to connect by
default. Override it with an `httpx.Timeout`:
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
import httpx
from spine import SpineClient
client = SpineClient(timeout=httpx.Timeout(120.0, connect=5.0))
```
The **polling timeout** (`handle.wait(timeout=...)`) is independent and
defaults to 15 minutes. Tune it per call:
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
result = handle.wait(timeout=1800) # 30 minutes
```
`SpineTimeoutError` is raised when either timeout fires.
# Python SDK
Source: https://docs.getspine.ai/sdks/python/overview
Official Python client for the Spine API.
The Spine Python SDK (`spine-sdk`) is a typed, documented client for the
[Spine API](/api-reference/overview). It wraps all five public endpoints,
handles polling with exponential backoff, and exposes both a sync and an
async client.
## Install
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
pip install spine-sdk
```
Requires Python 3.9 or newer. The package ships full type hints
(PEP 561 `py.typed`), so mypy and Pyright pick them up out of the box.
## First request
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
from spine import SpineClient, Template
with SpineClient(api_key="sk_spine_...") as client:
handle = client.runs.create(
prompt="Summarise the Q4 AI chip market in 3 paragraphs.",
template=Template.MEMO,
)
result = handle.wait(timeout=600)
print(result.final_output)
for artifact in result.artifacts:
print(artifact.name, artifact.download_url)
```
Prefer the `SPINE_API_KEY` environment variable so keys stay out of your
source code:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
export SPINE_API_KEY=sk_spine_...
```
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
with SpineClient() as client: # picks up SPINE_API_KEY automatically
...
```
## What's in the box
Sync and async clients built on `httpx`. Use whichever matches your
stack.
Pydantic v2 models for every request and response — IDE
autocompletion and mypy coverage out of the box.
`handle.wait()` polls with exponential backoff;
`handle.stream_progress()` yields progress snapshots for UIs.
`AuthenticationError`, `NotFoundError`, `BadRequestError`,
`RateLimitError`, `ServerError`, `SpineTimeoutError` — branch on the
exact failure.
## Next steps
Full end-to-end example with uploads, polling, and artifact download.
All the options on `runs.create`, `wait`, and `stream_progress`.
Walk the block graph and task tree produced by a run.
Exception hierarchy and how to tune the built-in retry policy.
# Quickstart
Source: https://docs.getspine.ai/sdks/python/quickstart
Install the SDK and run your first end-to-end request.
This walks through installing `spine-sdk`, creating a run, waiting for it
to finish, and downloading the generated artifacts. For a broader
conceptual tour of the API, see the [API quickstart](/api-reference/quickstart).
## 1. Install
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
pip install spine-sdk
```
Requires Python 3.9 or newer. Works on macOS, Linux, and Windows.
## 2. Get an API key
Create a key in the [developer portal](https://platform.getspine.ai/keys).
You get **\$5 of free credits** immediately — enough for several test
runs end-to-end. Keys look like `sk_spine_...` and are shown only once.
Export it into your environment so the SDK picks it up automatically:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
export SPINE_API_KEY=sk_spine_...
```
See [Authentication](/sdks/python/authentication) for key rotation, env
vars, and staging overrides.
## 3. Run your first request
```python Sync theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
from spine import SpineClient, Template
with SpineClient() as client:
handle = client.runs.create(
prompt="Summarise the Q4 2025 AI chip market in three paragraphs.",
template=Template.MEMO,
)
print("Run started:", handle.run_id)
result = handle.wait(timeout=600)
print(result.final_output)
for artifact in result.artifacts:
print(artifact.name, artifact.download_url)
```
```python Async theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
import asyncio
from spine import AsyncSpineClient, Template
async def main() -> None:
async with AsyncSpineClient() as client:
handle = await client.runs.create(
prompt="Summarise the Q4 2025 AI chip market.",
template=Template.MEMO,
)
result = await handle.wait(timeout=600)
print(result.final_output)
asyncio.run(main())
```
### What happens
1. `runs.create` submits the prompt and returns a `RunHandle` immediately.
2. `handle.wait` polls `GET /v1/run/{run_id}` with exponential backoff
(starts at 2 s, doubles up to 30 s) until the run is terminal.
3. On success, `result.final_output` holds the synthesized markdown and
`result.artifacts` lists downloadable files (docx, xlsx, pptx, html,
png — depending on the template).
See [Runs and polling](/sdks/python/runs) for all the options.
## 4. Upload files with a run
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
handle = client.runs.create(
prompt="Read the attached files and produce a 1-page summary.",
template=Template.REPORT,
files=[
"./market_data.pdf",
"./notes.docx",
("inline.md", b"# Supplementary context\n..."),
],
)
```
The SDK accepts file paths, file objects, `(filename, bytes)` tuples, and
dict specs. Supported types are documented on
[File uploads](/api-reference/concepts/file-uploads).
## 5. Handle errors
Every failure is a subclass of `SpineError`. Branch on the specific
types when you need to:
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
from spine import SpineClient, BadRequestError, AuthenticationError
try:
with SpineClient() as client:
client.runs.create(prompt="", template="bogus")
except BadRequestError as exc:
print("Rejected:", exc.error_message)
except AuthenticationError:
print("Check your SPINE_API_KEY")
```
See [Errors and retries](/sdks/python/errors) for the full hierarchy and
how transient failures are retried automatically.
## Next steps
Stream progress, tune poll intervals, use the low-level `runs.get`.
Inspect the block graph and task tree a run produced.
# API reference
Source: https://docs.getspine.ai/sdks/python/reference
Method-by-method reference for the Spine Python SDK.
This page is a quick, skimmable reference. For conceptual guides, start
at [Quickstart](/sdks/python/quickstart). For the HTTP-level view, see
[API reference](/api-reference/overview).
## Clients
### `SpineClient(...)` — sync
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
from spine import SpineClient
client = SpineClient(
api_key=None, # str | None — falls back to SPINE_API_KEY
base_url=None, # str | None — falls back to SPINE_BASE_URL or api.getspine.ai
timeout=None, # httpx.Timeout | None — default 60s total, 10s connect
retry_policy=None, # RetryPolicy | None — default 3 retries
http_client=None, # httpx.Client | None — advanced: inject your own
)
```
Use as a context manager (`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](/api-reference/concepts/templates).
### `BlockType`
17 members covering every block type the platform produces. See
[Block types](/api-reference/concepts/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-level
`spine` package:
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
from spine import (
CreateRunResponse, GetRunResponse,
RunProgress, RunResult, RunArtifact, RunMetadata, RunError,
CanvasDAG, CanvasNode, CanvasEdge,
TaskTree, TaskNode,
)
```
Each model uses `extra="ignore"`, so new fields added to the backend
don't break old SDK releases.
## Exceptions
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
from spine import (
SpineError, # base
SpineAPIError,
AuthenticationError, # 401
BadRequestError, # 400
NotFoundError, # 404
RateLimitError, # 429
ServerError, # 5xx
SpineTimeoutError,
SpineConnectionError,
)
```
See [Errors and retries](/sdks/python/errors).
## Retry policy
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
from spine import RetryPolicy
RetryPolicy(
max_retries=3, # int, 0 disables retries
base_delay=0.5, # float seconds
max_delay=30.0, # float seconds
jitter=0.1, # float, ±fraction
)
```
Passed to `SpineClient(retry_policy=...)`.
# Runs and polling
Source: https://docs.getspine.ai/sdks/python/runs
Create runs, wait for them, and stream progress with the Python SDK.
A **run** is an asynchronous canvas-generation task. You submit a
prompt, optionally constrain the templates or block types, and poll
until the run reaches a terminal state. See
[Canvases and runs](/api-reference/concepts/canvases-and-runs) for the
conceptual model.
## Creating a run
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
from spine import SpineClient, Template, BlockType
with SpineClient() as client:
handle = client.runs.create(
prompt="Write a Q4 market memo with supporting charts.",
template=Template.AUTO,
blocks=[BlockType.DOCUMENT, BlockType.EXCEL],
agent_instructions="Keep the tone concise and analytical.",
)
```
All arguments except `prompt` are keyword-only.
| Argument | Type | Default | Description |
| -------------------- | ---------------------------- | --------------- | -------------------------------------------------------------------- |
| `prompt` | `str` | required | The instruction for the run. |
| `template` | `Template \| str` | `Template.AUTO` | Canvas template. See [Templates](/api-reference/concepts/templates). |
| `blocks` | `Iterable[BlockType \| str]` | `None` | Allow-list of block types the run may produce. |
| `agent_instructions` | `str \| None` | `None` | Extra system-prompt instructions for the agent. |
| `webhook_url` | `str \| None` | `None` | Reserved for future webhook delivery. |
| `files` | `Iterable[...]` | `None` | Files to upload — see [below](#uploading-files). |
`runs.create` returns a `RunHandle` (or `AsyncRunHandle`) that holds
`run_id`, `canvas_id`, and a reference back to the client.
## Uploading files
The SDK normalises several shapes so you can mix them freely:
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
handle = client.runs.create(
prompt="Summarise these attachments.",
files=[
"./reports/q4.pdf", # str path
Path("./notes.md"), # pathlib.Path
open("deck.pptx", "rb"), # open file object
("inline.md", b"# notes\nSome bytes"), # (name, bytes)
("custom.bin", b"\x00\x01", "application/x-custom"), # with MIME
],
)
```
Content types are inferred from the filename if you don't pass one.
Paths opened by the SDK are closed automatically after the request.
Supported file types and size limits are documented on
[File uploads](/api-reference/concepts/file-uploads).
## Waiting for completion
`handle.wait()` polls the server with exponential backoff until the run
reaches a terminal state, then returns the `RunResult`:
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
result = handle.wait(timeout=900, poll_interval=2.0, max_poll_interval=30.0)
print(result.final_output)
```
| Argument | Default | Notes |
| ------------------- | --------------- | ---------------------------------------- |
| `timeout` | `900.0` seconds | Raises `SpineTimeoutError` if exceeded. |
| `poll_interval` | `2.0` seconds | Initial delay between polls. |
| `max_poll_interval` | `30.0` seconds | Upper bound for the exponential backoff. |
`wait` raises `SpineAPIError` if the run terminates with status
`failed`. **Partial** successes (some blocks failed, some succeeded)
return normally — inspect `handle.refresh().errors` afterwards.
## Streaming progress
Drive a progress bar with `handle.stream_progress()`. It yields a
`RunProgress` snapshot on each poll and exits silently when the run
terminates — call `wait()` or `refresh()` afterwards to get the result.
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
for progress in handle.stream_progress(poll_interval=2):
pct = progress.tasks_completed / max(progress.tasks_total, 1) * 100
print(f"{progress.tasks_completed}/{progress.tasks_total} ({pct:.0f}%)")
result = handle.wait() # retrieve the final result
```
Async version:
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
async for progress in handle.stream_progress(poll_interval=2):
...
```
## Manual polling
If you want full control, call `client.runs.get()` directly:
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
import time
from spine import RunStatus
while True:
snapshot = client.runs.get(handle.run_id)
if snapshot.status.is_terminal:
break
print(snapshot.progress)
time.sleep(10)
```
See [Polling and status](/api-reference/concepts/polling-and-status) for
the server-side semantics (typical run durations, recommended intervals).
# Webhooks
Source: https://docs.getspine.ai/sdks/python/webhooks
Verify inbound Spine webhook signatures from the Python SDK.
`client.webhooks` verifies the HMAC signature on an inbound webhook and returns a typed `WebhookEvent`. See [Webhooks](/api-reference/concepts/webhooks) for the conceptual model and signing algorithm.
No network call is made — verification is local crypto against the `whsec_...` secret you saved in the developer portal.
## Verifying a delivery
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
import os
from spine import SpineClient, WebhookSignatureError
client = SpineClient() # SPINE_API_KEY picked up from env
def handle_spine_webhook(raw_body: bytes, sig_header: str) -> dict:
try:
event = client.webhooks.construct_event(
payload=raw_body,
sig_header=sig_header,
secret=os.environ["SPINE_WEBHOOK_SECRET"],
)
except WebhookSignatureError:
return {"ok": False}, 400
if event.type == "run.completed":
run = event.data["object"]
# persist run["run_id"] etc.
return {"ok": True}, 200
```
Pass the **raw request body bytes**, not the parsed JSON — frameworks may reorder keys during re-serialization and the signature will no longer verify.
| Argument | Type | Default | Description |
| ------------ | -------------- | -------- | ------------------------------------------------- |
| `payload` | `bytes \| str` | required | Raw request body. `bytes` is preferred. |
| `sig_header` | `str` | required | Value of the `Spine-Signature` request header. |
| `secret` | `str` | required | The `whsec_...` secret from the developer portal. |
| `tolerance` | `int` | `300` | Replay window in seconds. |
Returns a [`WebhookEvent`](#webhookevent). Raises [`WebhookSignatureError`](/api-reference/sdks/python/errors) on any verification failure.
## FastAPI example
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
from fastapi import FastAPI, Header, HTTPException, Request
from spine import SpineClient, WebhookSignatureError
app = FastAPI()
client = SpineClient()
@app.post("/webhooks/spine")
async def spine_webhook(
request: Request,
spine_signature: str = Header(default=""),
):
raw = await request.body()
try:
event = client.webhooks.construct_event(
payload=raw,
sig_header=spine_signature,
secret=os.environ["SPINE_WEBHOOK_SECRET"],
)
except WebhookSignatureError as exc:
raise HTTPException(status_code=400, detail=str(exc))
# Dedupe on event.id, then dispatch
return {"ok": True}
```
## Flask example
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
from flask import Flask, request
from spine import SpineClient, WebhookSignatureError
app = Flask(__name__)
client = SpineClient()
@app.post("/webhooks/spine")
def spine_webhook():
try:
event = client.webhooks.construct_event(
payload=request.get_data(), # raw bytes
sig_header=request.headers.get("Spine-Signature", ""),
secret=os.environ["SPINE_WEBHOOK_SECRET"],
)
except WebhookSignatureError:
return {"ok": False}, 400
# Dedupe on event.id, then dispatch
return {"ok": True}, 200
```
## Async
`AsyncSpineClient.webhooks.construct_event(...)` has the same signature. Verification is CPU-only, so the async variant exists for API-parity with the rest of the client rather than for performance.
```python theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
from spine import AsyncSpineClient
async with AsyncSpineClient() as client:
event = client.webhooks.construct_event(...)
```
## `WebhookEvent`
| Field | Type | Notes |
| ------------- | ------------- | ----------------------------------------------------------- |
| `id` | `str` | `evt_`. Use for idempotency. |
| `type` | `str` | e.g. `"run.completed"`, `"run.failed"`, `"webhook.ping"`. |
| `created` | `int` | Unix seconds. |
| `livemode` | `bool` | `True` in production. |
| `api_version` | `str \| None` | Envelope schema version. |
| `data` | `dict` | Event payload. `data["object"]` carries the primary entity. |
## Notes
* Clock skew matters. If your server drifts more than 5 minutes from Spine's clock, deliveries will be rejected as stale. Run NTP.
* Rotation invalidates the previous secret immediately. Update your env var before rotating if you care about strict uptime.
* The SDK accepts multiple `v1=` values in one header, so a future dual-signing rotation strategy will be forward-compatible.
# Authentication
Source: https://docs.getspine.ai/sdks/typescript/authentication
How to pass your API key to the SDK and override the base URL.
The Spine API uses API keys sent as the `X-API-KEY` request header. The
SDK adds the header for you on every request — you just need to give it
a key.
## Passing the key
```ts Environment variable (preferred) theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
// Shell:
// export SPINE_API_KEY=sk_spine_...
import { Spine } from 'spine-sdk';
const client = new Spine({ apiKey: process.env.SPINE_API_KEY! });
```
```ts Explicit argument theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
import { Spine } from 'spine-sdk';
const client = new Spine({ apiKey: 'sk_spine_...' });
```
Never commit keys to source control. Use your deployment platform's
secret manager (AWS Secrets Manager, 1Password, Doppler, etc.) and
inject them at runtime. Never ship keys to the browser — proxy requests
through your own backend instead.
If `apiKey` is falsy, the `Spine` constructor throws immediately — before
any network call.
## Key rotation
Keys revoked in the dashboard stop working on the next request; you'll
see `SpineAuthError` thrown from the SDK. Roll new keys through your
secret store before revoking the old one so running processes don't
break mid-run. The server caches keys for up to 5 minutes, so leave that
grace window.
## Overriding the base URL
Point the SDK at a staging or enterprise deployment via `baseURL`:
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
const client = new Spine({
apiKey: process.env.SPINE_API_KEY!,
baseURL: 'https://staging.getspine.ai',
});
```
The SDK appends `/v1` paths automatically, so pass the host without the
API prefix.
## Tuning timeouts and retries
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
const client = new Spine({
apiKey: process.env.SPINE_API_KEY!,
timeoutMs: 60_000, // per-request timeout (default: 60_000)
maxRetries: 2, // transient 5xx / network retries (default: 2)
});
```
See [Errors and retries](/sdks/typescript/errors) for the retry policy.
## Injecting your own fetch
For advanced cases (custom proxies, test doubles, alternative runtimes),
pass a pre-configured `fetch` implementation. The SDK still applies
`X-API-KEY` and `User-Agent` headers — your implementation does not need
to set them.
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
import undici from 'undici';
const client = new Spine({
apiKey: process.env.SPINE_API_KEY!,
fetch: undici.fetch as typeof fetch,
});
```
## Observing requests
Use `onRequest` and `onResponse` for tracing every call:
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
const client = new Spine({
apiKey: process.env.SPINE_API_KEY!,
onRequest: ({ method, url }) => console.debug('[spine]', method, url),
onResponse: ({ status, durationMs }) =>
console.debug('[spine]', status, `${durationMs}ms`),
});
```
# Canvas introspection
Source: https://docs.getspine.ai/sdks/typescript/canvas
Inspect the block graph and task tree produced by a run.
Every run writes its output into a **canvas** — a directed graph of
blocks (documents, spreadsheets, research notes, images, etc.) linked by
dependency edges. The SDK exposes three read-only introspection methods
so you can audit exactly what a run produced.
## The block graph
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
const dag = await client.canvases.getDag(canvasId);
for (const node of dag.nodes) {
console.log(`${node.type.padEnd(24)} ${node.status.padEnd(10)} ${node.name}`);
}
for (const edge of dag.edges) {
console.log(`${edge.source_id} -> ${edge.target_id}`);
}
```
Each `Block` exposes:
| Field | Description |
| --------- | ------------------------------------------------------------- |
| `id` | UUID of the block. |
| `name` | Human-readable block name. |
| `type` | Block type (e.g. `document-block`, `excel-block`). |
| `status` | Current state (`idle`, `running`, `completed`, `error`, ...). |
| `content` | Textual content, when applicable. |
| `url` | External or pre-signed download URL, when applicable. |
| `sources` | Source attributions (block-type specific). |
## The task tree
The task tree describes the agent execution that produced the canvas —
parent tasks, persona tasks, individual tool calls. It is split into
completed and in-progress subtrees:
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
const tree = await client.canvases.getTasks(canvasId);
function printTree(tasks: Task[], indent = 0): void {
for (const t of tasks) {
console.log(' '.repeat(indent) + `- ${t.name} (${t.task_type}, ${t.status})`);
if (t.children) printTree(t.children, indent + 1);
}
}
console.log('Completed:');
printTree(tree.completed);
console.log('In progress:');
printTree(tree.not_completed);
```
## A single task
If you already have a task id (from a progress webhook or a previous
tree), fetch just that one with its immediate children:
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
const task = await client.canvases.getTask(canvasId, taskId);
console.log(task.status, task.name);
```
## Timing
A canvas is created during `runs.create`, but its `canvas_id` may not be
populated on the very first poll — the server persists it a moment
after the run starts. Read it from the run object once status moves
past `running`, or after a short wait:
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
const run = await client.runs.retrieve(runId);
if (run.status !== 'running' && run.canvas_id) {
const canvas = await client.canvases.getDag(run.canvas_id);
}
```
# Errors and retries
Source: https://docs.getspine.ai/sdks/typescript/errors
Error hierarchy, retry policy, and timeouts.
Every error thrown by the SDK is a subclass of `SpineError`, so a single
`catch (err instanceof SpineError)` clause catches anything the SDK can
throw.
## Error hierarchy
```text theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
SpineError
├── SpineConnectionError # network / transport failures
├── SpineTimeoutError # HTTP timeout or polling timeout
├── SpineRunFailedError # waitForCompletion: status=failed
└── SpineAPIError # 4xx / 5xx HTTP responses
├── SpineBadRequestError # 400
├── SpineAuthError # 401
├── SpineNotFoundError # 404
└── SpineServerError # 5xx (after retry budget exhausted)
```
## Inspecting errors
`SpineAPIError` carries the HTTP status, the server's error message, the
request id (useful when reporting issues), and the raw body:
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
import { Spine, SpineBadRequestError } from 'spine-sdk';
try {
const client = new Spine({ apiKey: process.env.SPINE_API_KEY! });
await client.runs.create({ prompt: 'x', template: 'bogus' as 'memo' });
} catch (err) {
if (err instanceof SpineBadRequestError) {
console.log(err.statusCode); // 400
console.log(err.message); // "Invalid template: bogus. Valid templates: ..."
console.log(err.requestId); // value of X-Request-ID header (if present)
console.log(err.responseBody); // parsed JSON body
}
}
```
See [Errors](/api-reference/errors) for the full list of server-side
error messages.
## Client-side short-circuit
Some validation runs locally without a network round-trip so you get the
same typed error regardless of where the check fired:
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
await client.runs.create({ prompt: 'hi', blocks: [] }); // SpineBadRequestError
await client.runs.retrieve('not-a-uuid'); // SpineBadRequestError
```
## Automatic retries
The SDK retries transient failures automatically with jittered
exponential backoff:
| Failure | Retried? | Notes |
| ------------------------------------- | -------- | ------------------- |
| Connection errors (DNS, refused, TLS) | Yes | Up to `maxRetries`. |
| HTTP 5xx | Yes | Up to `maxRetries`. |
| HTTP 400 / 401 / 404 | No | Thrown immediately. |
When the retry budget is exhausted, the underlying error (`SpineServerError`
or `SpineConnectionError`) is thrown.
## Tuning retries
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
const client = new Spine({
apiKey: process.env.SPINE_API_KEY!,
maxRetries: 5, // default: 2, set to 0 to disable retries entirely
});
```
## Timeouts
The **HTTP timeout** is 60 seconds per request by default. Override it
with `timeoutMs`:
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
const client = new Spine({
apiKey: process.env.SPINE_API_KEY!,
timeoutMs: 120_000,
});
```
The **polling timeout** (`waitForCompletion`) is independent and defaults
to 15 minutes. Tune it per call:
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
await client.runs.waitForCompletion(runId, { timeoutMs: 30 * 60_000 });
```
`SpineTimeoutError` is thrown when either timeout fires.
## `SpineRunFailedError`
Thrown by `waitForCompletion` when the run terminates with
`status: 'failed'`. Carries `runId` and an `errors: { error: string }[]`
list.
If you would rather handle the failed run as a value:
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
const terminal = await client.runs.waitForCompletion(runId, { resolveOnFailure: true });
if (terminal.status === 'failed') {
console.error(terminal.errors);
}
```
A `'partial'` status is **not** a failure — the run produced usable
output with some blocks skipped. Inspect `terminal.errors` on the
returned object.
# TypeScript SDK
Source: https://docs.getspine.ai/sdks/typescript/overview
Official TypeScript / JavaScript client for the Spine API.
The Spine TypeScript SDK (`spine-sdk`) is a typed, documented client for
the [Spine API](/api-reference/overview). It wraps all five public
endpoints, polls runs with configurable intervals, and narrows response
types through discriminated unions so TypeScript guides you through every
run state.
## Install
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
npm install spine-sdk
```
Works on Node.js 18 or newer, modern browsers, Deno, Bun, and Cloudflare
Workers without any extra configuration — it uses the platform's native
`fetch` and `FormData`. Full type declarations ship in the package, so
TypeScript picks them up out of the box.
## First request
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
import { Spine } from 'spine-sdk';
const client = new Spine({ apiKey: process.env.SPINE_API_KEY! });
const run = await client.runs.create({
prompt: 'Summarise the Q4 AI chip market in 3 paragraphs.',
template: 'memo',
});
const terminal = await client.runs.waitForCompletion(run.run_id);
if (terminal.status === 'completed') {
console.log(terminal.result.final_output);
for (const artifact of terminal.result.artifacts) {
console.log(artifact.name, artifact.download_url);
}
}
```
Prefer the `SPINE_API_KEY` environment variable so keys stay out of your
source code:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
export SPINE_API_KEY=sk_spine_...
```
## What's in the box
`Run` is a discriminated union narrowed by `status`. The compiler
forces you to handle each state before touching `result`, `progress`,
or `errors`.
`client.runs.waitForCompletion()` polls to a terminal state with
configurable interval, timeout, and `AbortSignal` cancellation.
`SpineBadRequestError`, `SpineAuthError`, `SpineNotFoundError`,
`SpineServerError`, `SpineTimeoutError`, and more — branch on the
exact failure.
Node, browsers, Deno, Bun, Cloudflare Workers. One package, zero
runtime dependencies.
## Next steps
Full end-to-end example with uploads, polling, and artifact download.
All the options on `runs.create`, `waitForCompletion`, and manual polling.
Walk the block graph and task tree produced by a run.
Error hierarchy and how to tune the built-in retry policy.
# Quickstart
Source: https://docs.getspine.ai/sdks/typescript/quickstart
Install the SDK and run your first end-to-end request.
This walks through installing `spine-sdk`, creating a run, waiting for it
to finish, and downloading the generated artifacts. For a broader
conceptual tour of the API, see the [API quickstart](/api-reference/quickstart).
## 1. Install
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
npm install spine-sdk
```
Requires Node.js 18 or newer. Also works in modern browsers, Deno, Bun,
and Cloudflare Workers without any extra configuration.
## 2. Get an API key
Create a key in the [developer portal](https://platform.getspine.ai/keys).
You get **\$5 of free credits** immediately — enough for several test
runs end-to-end. Keys look like `sk_spine_...` and are shown only once.
Export it into your environment so the SDK can pick it up:
```bash theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
export SPINE_API_KEY=sk_spine_...
```
See [Authentication](/sdks/typescript/authentication) for key rotation,
staging overrides, and tracing hooks.
## 3. Run your first request
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
import { writeFile } from 'node:fs/promises';
import { Spine, downloadArtifact } from 'spine-sdk';
const client = new Spine({ apiKey: process.env.SPINE_API_KEY! });
const run = await client.runs.create({
prompt: 'Summarise the Q4 2025 AI chip market in three paragraphs.',
template: 'memo',
});
console.log('Run started:', run.run_id);
const terminal = await client.runs.waitForCompletion(run.run_id);
if (terminal.status !== 'failed') {
console.log(terminal.result.final_output);
for (const artifact of terminal.result.artifacts) {
const blob = await downloadArtifact(artifact);
await writeFile(artifact.name, Buffer.from(await blob.arrayBuffer()));
}
}
```
### What happens
1. `runs.create` submits the prompt and returns a `CreatedRun` handle
immediately.
2. `waitForCompletion` polls `GET /v1/run/{run_id}` every 5 seconds until
the run reaches a terminal state.
3. On success, `terminal.result.final_output` holds the synthesized
markdown and `terminal.result.artifacts` lists downloadable files
(docx, xlsx, pptx, html, png — depending on the template).
See [Runs and polling](/sdks/typescript/runs) for all the options.
## 4. Upload files with a run
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
import { readFile } from 'node:fs/promises';
const data = await readFile('./market_data.pdf');
const run = await client.runs.create({
prompt: 'Read the attached files and produce a 1-page summary.',
template: 'report',
files: [
{ data: new Uint8Array(data), filename: 'market_data.pdf', contentType: 'application/pdf' },
{ data: new TextEncoder().encode('# Supplementary context\n...'), filename: 'inline.md' },
],
});
```
Accepts `File`, `Blob`, `ArrayBuffer`, `Uint8Array`, or
`{ data, filename, contentType }` records. Supported types are documented
on [File uploads](/api-reference/concepts/file-uploads).
## 5. Handle errors
Every failure is a subclass of `SpineError`. Branch on the specific
types when you need to:
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
import { Spine, SpineBadRequestError, SpineAuthError } from 'spine-sdk';
try {
const client = new Spine({ apiKey: process.env.SPINE_API_KEY! });
await client.runs.create({ prompt: '', template: 'bogus' as 'memo' });
} catch (err) {
if (err instanceof SpineBadRequestError) {
console.error('Rejected:', err.message);
} else if (err instanceof SpineAuthError) {
console.error('Check your SPINE_API_KEY');
} else {
throw err;
}
}
```
See [Errors and retries](/sdks/typescript/errors) for the full hierarchy
and how transient failures are retried automatically.
## Next steps
Stream progress, tune poll intervals, use the low-level `runs.retrieve`.
Inspect the block graph and task tree a run produced.
# API reference
Source: https://docs.getspine.ai/sdks/typescript/reference
Method-by-method reference for the Spine TypeScript SDK.
A skimmable reference. For conceptual guides, start at
[Quickstart](/sdks/typescript/quickstart). For the HTTP-level view, see
the [API reference](/api-reference/overview).
## Client
### `new Spine(options)`
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
import { Spine } from 'spine-sdk';
const client = new Spine({
apiKey, // string — required, falls back to none (no env-var auto-load)
baseURL, // string — defaults to "https://api.getspine.ai"
timeoutMs, // number — per-request timeout, default 60_000
maxRetries, // number — transient-failure retries, default 2
fetch, // typeof fetch — inject a custom implementation
onRequest, // hook — fires before each request
onResponse, // hook — fires after each response
});
```
## Runs
| Method | Returns | Description |
| ------------------------------------------------ | ---------------------- | -------------------------------------------------- |
| `client.runs.create(params)` | `Promise` | Submit a new run. |
| `client.runs.retrieve(runId)` | `Promise` | One-shot status fetch. |
| `client.runs.waitForCompletion(runId, options?)` | `Promise` | Poll until terminal; throws on timeout or failure. |
### `CreateRunParams`
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
{
prompt: string;
template?: Template;
blocks?: BlockType[];
agent_instructions?: string;
webhook_url?: string;
files?: FileInput[];
}
```
### `WaitForCompletionOptions`
```ts theme={"theme":{"light":"github-light","dark":"tokyo-night"}}
{
pollIntervalMs?: number; // default: 5000
timeoutMs?: number; // default: 900_000
signal?: AbortSignal;
resolveOnFailure?: boolean; // default: false
}
```
## Canvas
| Method | Returns |
| ------------------------------------------- | ------------------- |
| `client.canvases.getDag(canvasId)` | `Promise