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.

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.
| Topic | What the docs say |
|---|---|
| Install | npm install @hey-api/openapi-ts -D -E (dev dependency, exact version) |
| Config file | openapi-ts.config.ts with defineConfig({ input, output }) |
| Accepted input | file path, URL, registry shorthand, an object with options, or a spec object |
| Run | add 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-tsAuthentication: 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
- Hide the seam in an AI image edit with a feathered composite in Pillow
A hard-edged paste of an AI edit leaves a visible line. Blur the mask a few pixels so the edit fades into the original. Short Pillow script and settings.
- Home Assistant response_variable: read a Sume job id and status
Home Assistant rest_command returns status, content and headers in response_variable. Here is how to pull the Sume job id from it and branch on the status read.
- Home Assistant rest_command 10-second timeout and Sume async jobs
rest_command times out at 10 seconds by default. Sume sync waits cap at 30. Submit with mode async, take the job id, and poll in a second command.
- How many characters is one minute of TTS audio? 1,200 s math
A vendor rule of thumb says a minute of speech is 750-800 characters. Here is what that means for a 1,200-second Sume TTS job and its 20,000-char cap.
Written by Sume