---
title: "Generate a Client"
description: "Generate a typed SignatureAPI client in TypeScript from the OpenAPI specification with openapi-typescript and openapi-fetch, using pinned versions."
canonical: "https://signatureapi.com/docs/api/guides/how-to/generate-client"
source: "https://signatureapi.com/docs/api/guides/how-to/generate-client.md"
last_verified_api_version: "1.18.0"
last_modified: "2026-11-18T17:35:44Z"
---

# Generate a Client

Generate a typed SignatureAPI client in TypeScript from the OpenAPI specification with openapi-typescript and openapi-fetch, using pinned versions.

_Last verified against API version 1.18.0._

SignatureAPI has no official SDK. The API is plain HTTP and JSON, and the [OpenAPI specification](https://signatureapi.com/docs/api/openapi) describes every endpoint, so you can generate types and a typed client from it. This guide uses [openapi-typescript](https://openapi-ts.dev) for the types and its companion [openapi-fetch](https://openapi-ts.dev/openapi-fetch/) for the requests.

The versions below are pinned and were run against the current specification. Pin them in your project too, and upgrade on purpose.

## Install the Tools

You need Node.js 24 or later.

```bash
npm install openapi-fetch@0.17.0
npm install --save-dev openapi-typescript@7.13.0 typescript@6.0.3 @types/node@24
```

## Generate the Types

```bash
npx openapi-typescript https://spec.signatureapi.com/openapi.yaml -o signatureapi.d.ts
```

```text
✨ openapi-typescript 7.13.0
🚀 https://spec.signatureapi.com/openapi.yaml → signatureapi.d.ts
```

The output is one declaration file with a `paths` type for every endpoint and a `components` type for every schema. It has no runtime code. Commit it, and run the command again when you want new API features.

## Make a Request

Create the client with the base URL and your API key, then call endpoints by their path. The paths in the specification start after `/v1`, so the base URL ends with `/v1`.

```typescript list.ts
import createClient from "openapi-fetch";
import type { paths } from "./signatureapi";

const client = createClient<paths>({
  baseUrl: "https://api.signatureapi.com/v1",
  headers: { "X-API-Key": process.env.SIGNATUREAPI_KEY },
});

const { data, error } = await client.GET("/envelopes", {
  params: { query: { status: "completed", limit: 5 } },
});
if (error) throw new Error(`${error.status} ${error.title}`);

for (const envelope of data.data ?? []) {
  console.log(envelope.id, envelope.title);
}
```

TypeScript now checks the path, the query parameters, the request body and the response. A typo in `status`, or a missing required field in a `POST` body, fails at compile time. When the API answers with an error, `error` holds the [problem details](https://signatureapi.com/docs/api/errors) body.

The type-only import needs no file extension when `moduleResolution` is `bundler`:

```json tsconfig.json
{
  "compilerOptions": {
    "strict": true,
    "target": "es2022",
    "module": "esnext",
    "moduleResolution": "bundler",
    "types": ["node"],
    "noEmit": true
  }
}
```

Check the types with `npx tsc -p .`, and run it with `node list.ts` while `SIGNATUREAPI_KEY` holds your API key. Node.js 24 runs TypeScript files directly.

## Keep It Up to Date

The specification always matches the deployed API. New fields and endpoints appear there first, so regenerate `signatureapi.d.ts` when you need them, and let the compiler show what changed.

For webhooks, the specification describes each event payload, but the client does not verify deliveries. Use [Verify webhook signatures](https://signatureapi.com/docs/api/guides/how-to/verify-webhooks) for that.
