Hey API openapi-ts: generate a Sume client from reference/json

Point @hey-api/openapi-ts at https://api.sume.com/reference/json, pin the version, and send one credential header. When the official SDK is the shorter route.

5 min readSume
All posts

Short answer

Install @hey-api/openapi-ts as an exact-pinned dev dependency, set input to https://api.sume.com/reference/json, set an output directory, and run the CLI. Hey API's get-started page uses npm install @hey-api/openapi-ts -D -E and a config with input and output, and its input docs list a URL as an accepted input value.

Sume's public API page names https://api.sume.com/reference/json as the live schema and the exact source of truth for requests and responses. The official @sume-com/sdk is generated from the same schema, so decide first whether you need your own generated client at all.

What Hey API documents

The tool warns that it is in initial development, which is why the install command pins an exact version. Treat each upgrade as a change to review, since generated names can move.

Hey API openapi-ts facts (read 2026-10-03)
TopicWhat the docs say
Installnpm install @hey-api/openapi-ts -D -E (dev dependency, exact version)
Config fileopenapi-ts.config.ts with defineConfig({ input, output })
Accepted inputfile path, URL, registry shorthand, an object with options, or a spec object
Runadd an openapi-ts script to package.json and run it

Config and script

Fetching the spec from the live URL at generation time means the client tracks the API as of that day. If you need reproducible builds, save the JSON with curl -o sume-openapi.json https://api.sume.com/reference/json, commit it, and point input at the file path instead.

// openapi-ts.config.ts
import { defineConfig } from '@hey-api/openapi-ts';

export default defineConfig({
  input: 'https://api.sume.com/reference/json',
  output: 'src/sume-client',
});

// package.json
// "scripts": { "openapi-ts": "openapi-ts" }
//
// install and run:
//   npm install @hey-api/openapi-ts -D -E
//   npm run openapi-ts

Authentication: send one header

Sume accepts an API key as Authorization: Bearer or as x-api-key, but not both. A request that carries both fails 401 unauthorized with the message Send only one API key credential. The official SDK sends x-api-key only and tells you not to add Authorization yourself. If your generated client already sets one header, do not add the other in a wrapper.

Read the generated function names from the output folder; they follow the schema's operation ids. Sume's response bodies wrap payloads in a data object, which the generated types will show.

What Sume does and does not do

Sume publishes the live schema, a Swagger UI at https://api.sume.com/reference, and an SDK that covers every operation in the public schema plus helpers such as waitForJob and verifyWebhook. It does not promise that a third-party generator's output handles polling or signature checks; those are the helpers a generated client lacks.

If you generate your own client, keep the poll loop and the webhook verifier from the docs in a small hand-written module beside it.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume