SDKs & Client Libraries
OpenAPI Specification
Section titled “OpenAPI Specification”The TheTerms API publishes an OpenAPI 3.1 specification at:
https://app.theterms.app/api/v1/openapi.jsonUse this spec to generate type-safe client libraries in any language.
Generating a Client
Section titled “Generating a Client”# Using openapi-typescript for type-safe typesnpx openapi-typescript https://app.theterms.app/api/v1/openapi.json -o theterms-api.d.ts
# Or generate a full client with openapi-fetchnpm install openapi-fetchnpx openapi-typescript https://app.theterms.app/api/v1/openapi.json -o theterms-api.d.tsimport 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 typedpip install openapi-python-clientopenapi-python-client generate \ --url https://app.theterms.app/api/v1/openapi.jsonUse OpenAPI Generator for 50+ languages:
npx @openapitools/openapi-generator-cli generate \ -i https://app.theterms.app/api/v1/openapi.json \ -g <language> \ -o ./theterms-clientReplace <language> with go, ruby, java, csharp, rust, php, etc.
Official SDKs
Section titled “Official SDKs”Official first-party SDKs are on the roadmap:
| Language | Package | Status |
|---|---|---|
| TypeScript/JavaScript | @theterms/sdk | Planned |
| Python | theterms | Planned |
In the meantime, the OpenAPI spec provides everything needed to generate a fully typed client in your preferred language.