Skip to content

SDKs & Client Libraries

The TheTerms API publishes an OpenAPI 3.1 specification at:

https://app.theterms.app/api/v1/openapi.json

Use this spec to generate type-safe client libraries in any language.

Terminal window
# Using openapi-typescript for type-safe types
npx openapi-typescript https://app.theterms.app/api/v1/openapi.json -o theterms-api.d.ts
# Or generate a full client with openapi-fetch
npm install openapi-fetch
npx openapi-typescript https://app.theterms.app/api/v1/openapi.json -o theterms-api.d.ts
import createClient from "openapi-fetch";
import type { paths } from "./theterms-api";
const client = createClient<paths>({
baseUrl: "https://app.theterms.app/api/v1",
headers: { "X-Api-Key": process.env.THETERMS_API_KEY },
});
const { data } = await client.GET("/containers");
// data is fully typed

Official first-party SDKs are on the roadmap:

LanguagePackageStatus
TypeScript/JavaScript@theterms/sdkPlanned
PythonthetermsPlanned

In the meantime, the OpenAPI spec provides everything needed to generate a fully typed client in your preferred language.