Skip to main content
The workbench repository includes a Python SDK and a single-file TypeScript client. They are not published to PyPI or npm. If you have repository access, use the sources below; otherwise start with the HTTP quickstart and the generated API reference.

Python

From your local decisionone-workbench clone, with Python 3.11 or newer:
Then run this with D1_API_KEY set:
AsyncDecisionOne has the same methods with async with and await. Close clients so their HTTP connections are released. Responses are typed dictionaries.

TypeScript

Copy sdks/typescript/decisionone.ts from your clone into your application. The client uses the standard fetch API without dependencies. This example runs under Node 24:
Use a .js import in a project that compiles TypeScript to JavaScript. Wire fields keep their snake_case names; TypeScript methods use camelCase.

Workflows and errors

The clients provide resource groups for datasets, models, fine-tuning, prompt tuning, labelling and accounts. list returns one page, iter follows cursors, and job wait polls to completion. A wait timeout stops waiting, not the server’s job. API failures raise APIError, with an HTTP status, code, request ID, retryability and validation details. Failed or cancelled jobs raise JobFailed from wait helpers and retain the job document. The default retry budget is two retries for eligible operations. Supported creates keep one idempotency key within a call. Persist and pass your own idempotency_key (Python) or idempotencyKey (TypeScript) to survive a process restart. Inference uses a stable operation key too, including retries while waiting for a cold model. Successful replay responses remain available for 24 hours; terminal failed or expired operations are not rerun. Mutations such as model promotion and rollback require their own state checks; see reliable retries. The backend OpenAPI is the contract. SDK types are convenience views and may not expose every newly added field or endpoint; use HTTP for anything the source client does not yet wrap.