Skip to main content

SDK installation

@toolpath/api is a ready-made TypeScript client for the Engine API. Rather than building HTTP requests, setting headers, and picking apart JSON yourself, you call functions and get typed objects back — and the key handling described in Authentication is done for you on every request.

Using it is optional. The API is JSON over HTTPS, so anything that can make a web request can call it directly. The client saves you that boilerplate and keeps your code in step with the API as it changes.

It is generated from the same OpenAPI document as the API Reference, so its types match the published contract exactly. It also includes a helper for uploading a CAD file to the presigned URL returned when you create a part.

TypeScript

npm install @toolpath/api

Requires Node.js 20 or newer.

import { createToolpathClient, uploadToPresignedUrl } from '@toolpath/api'

const client = createToolpathClient({ apiKey: process.env.TOOLPATH_API_KEY! })
const part = await client.parts.createPart({ filename: 'bracket.step' })

await uploadToPresignedUrl(part.uploadUrl, stepFileBytes)
const processing = await client.parts.updatePart({ id: part.partId })

Building a user interface

npm install @toolpath/viewer @toolpath/ui

For a React application, @toolpath/viewer renders an analyzed part's mesh, and @toolpath/ui provides Toolpath's React and Tailwind UI primitives. See each package's README for its required peer dependencies and setup.

Python

A Python pip package is coming soon. Until then, call the API directly using your preferred HTTP library and the API Reference.

What the API client does not do

It is a transport client. It exposes the documented operations and models directly and does not add a higher-level workflow of its own — there is no single call that uploads a part and returns a finished part. Sequencing the steps, and waiting while processing runs, stays your code's job.

SDK usage examples shows that sequence written out in TypeScript.