Generate a Python client from the Sume OpenAPI JSON

Point openapi-python-client at the live Sume OpenAPI document, regenerate on each release, and keep a thin wrapper for polling, retries and the data envelope.

5 min readSume
All posts

Install the generator with pipx install openapi-python-client --include-deps, then run openapi-python-client generate --url https://api.sume.com/reference/json. You get a package with a client module, an api module organised by tag, and a models module. Sume ships an official TypeScript SDK but no Python one, so generating is the shortest route.

Commands

The Sume SDK docs name the live OpenAPI document as https://api.sume.com/reference/json, and the docs site keeps a local snapshot at /api/openapi.json. The generator README documents --url, --path, --overwrite and --output-path.

Generator options (read 2026-10-04)
OptionWhat it does
--url <u>Fetch the spec from a URL
--path <file>Read a local spec file
--overwriteRegenerate into an existing directory
--output-path <dir>Choose the output directory
pipx install openapi-python-client --include-deps
openapi-python-client generate --url https://api.sume.com/reference/json --output-path sume_api_client --overwrite
pip install ./sume_api_client

Authentication

The generator README says the client module holds Client and AuthenticatedClient. How AuthenticatedClient sends the key is not covered on the README page I read, so open the generated client.py and check its token, header name and prefix options before use. Sume accepts x-api-key or Authorization: Bearer, but sending both returns 401, so make sure only one is sent.

What to wrap by hand

Generated functions cover single requests. They do not poll. Wrap them in your own loop that stops on data.terminal; see a Python poll with a wall-clock deadline. Responses use a data envelope, so most generated models hang their fields under data.

Keeping it current

Regenerate when the API changes, commit the diff, and review it like a dependency bump. Do not edit generated files; put changes in the wrapper so --overwrite stays safe.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume