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.

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.
| Option | What it does |
|---|---|
--url <u> | Fetch the spec from a URL |
--path <file> | Read a local spec file |
--overwrite | Regenerate 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_clientAuthentication
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
- List Sume Formats with GET /v1/formats: limit, next_cursor, has_more
GET /v1/formats pages with a keyset cursor and a default limit of 50. Loop on has_more and pass next_cursor back as cursor to read the whole catalog.
- GitHub Actions and Sume: secret setup and a smoke test
Store SUME_API_KEY as a GitHub Actions secret, never echo it, and run sume account get --json as a read-only smoke test in a manually triggered workflow.
- Give every Seedance 2.5 reference a role in the prompt
With up to 12 references per Sume request, say in the prompt what each one is for. Roles for images, videos and audio, and a worked reference-to-video example.
- A Go client for Sume from OpenAPI, with Retry-After
The docs list only a TypeScript SDK. Generate a Go client from the live OpenAPI schema, send x-api-key, and back off on 429 with retry-after.
Written by Sume