OpenAPI spec and SDKs
Every endpoint in this API is described by a single OpenAPI 3.1 document. You can feed that document to a code generator to get a typed client SDK in your own language instead of writing HTTP calls by hand.
The spec
The spec is published unauthenticated and CORS-enabled at:
https://app.toolpath.com/api/public/v0/openapi.json
Download it with curl:
curl -o toolpath-openapi.json \
https://app.toolpath.com/api/public/v0/openapi.json
It is an OpenAPI 3.1.0 document, and its servers block already points at
the production base URL, so generated clients pick up the right host. The
response carries an ETag; send If-None-Match on later requests to get a
304 Not Modified when the spec has not changed.
The API is still v0, so the contract can change between minor versions. Pin a copy of the spec for reproducible builds and regenerate your client whenever you pull a newer one. See Versioning.
Generate a client SDK
OpenAPI Generator reads the spec and produces
a client library in dozens of languages. You can point it straight at the
published URL. The examples below each write into a ./toolpath-client
directory.
TypeScript / JavaScript
For types only (no runtime dependency), openapi-typescript
turns the spec into a single .ts file of exported types you can use with
fetch:
npx openapi-typescript \
https://app.toolpath.com/api/public/v0/openapi.json \
-o toolpath.ts
For a full client with request methods and models:
npx @openapitools/openapi-generator-cli generate \
-i https://app.toolpath.com/api/public/v0/openapi.json \
-g typescript-fetch \
-o toolpath-client
Python
npx @openapitools/openapi-generator-cli generate \
-i https://app.toolpath.com/api/public/v0/openapi.json \
-g python \
-o toolpath-client
Go
npx @openapitools/openapi-generator-cli generate \
-i https://app.toolpath.com/api/public/v0/openapi.json \
-g go \
-o toolpath-client
Other languages
OpenAPI Generator supports many more targets (Java, C#, Ruby, Rust, PHP, Kotlin, Swift, and others). List the available generators with:
npx @openapitools/openapi-generator-cli list
then pass the one you want to -g. The CLI runs on Java; see the
OpenAPI Generator install guide
for native binaries and other install options.
Authenticating the generated client
Generated clients use bearer auth. Pass your API key (see
Authentication) as the bearer token, and confirm the
base URL is https://app.toolpath.com/api/public/v0 if the generator did not
read it from the spec's servers block.