Skip to main content
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.

1. Install

Requires Python 3.9 or newer. Works on macOS, Linux, and Windows.

2. Get an API key

Create a key in the developer portal. 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:
See Authentication for key rotation, env vars, and staging overrides.

3. Run your first request

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 for all the options.

4. Upload files with a run

The SDK accepts file paths, file objects, (filename, bytes) tuples, and dict specs. Supported types are documented on File uploads.

5. Handle errors

Every failure is a subclass of SpineError. Branch on the specific types when you need to:
See Errors and retries for the full hierarchy and how transient failures are retried automatically.

Next steps

Runs and polling

Stream progress, tune poll intervals, use the low-level runs.get.

Canvas introspection

Inspect the block graph and task tree a run produced.