The API, in the language you already write
Two official packages, TypeScript and Python, wrapping the same key authenticated API. Auth, retries, typed errors and the polling loop are the client's problem, not yours.
Six things you do not write
Bearer auth
Give the client a key and a base URL once. Every call carries the header.
Retry with backoff
Rate limits, server errors and dropped connections are retried with exponential backoff. Other client errors fail fast.
Typed errors
An API error arrives as a typed exception carrying the status and the server's message, not as a string to parse.
Submit and wait
Video is a job. The client submits it and polls until the job finishes, with the interval and timeout in your hands.
Types from the spec
Request and response types are generated from the OpenAPI spec, so the client and the API cannot disagree about a field.
Limits you can read
Cost per frame, the longest video allowed and today's usage are account settings. Read them from the client rather than hard coding them.
The polling loop, gone
A video is a job: submitted, then polled until it finishes. The client does the polling and hands you the finished job, with the verdict on it. Set the interval and the timeout if the defaults do not suit; leave them if they do.