SDK reference

The onepin Python client — construction and every resource method.

The onepin Python SDK ships with pip install onepin. For task walkthroughs see the Guides; this page is the method index.

Construction

1from onepin import OnepinClient
2
3client = OnepinClient() # key from `onepin login`, then ONEPIN_API_KEY
4client = OnepinClient(api_key="op_live_...") # explicit
5client = OnepinClient(base_url="https://api.onepin.ai", timeout=120.0)

Use AsyncOnepinClient for the async client (same methods, await them). Build once and reuse; it is not a context manager. Every method also takes request_options={"timeout_in_seconds": ..., "max_retries": ..., "additional_headers": {...}}.

Return shape: list methods return a counted envelope (.data holds the page); single-object methods return an envelope with the object at .data. Page with offset / limit.

1for wf in client.workflows.list(limit=50).data:
2 print(wf.id)
3
4wf = client.workflows.get(workflow_id="...").data

workflows

client.workflows.<method>

MethodPurpose
list(limit=, offset=, status=, search=, sort=, order=)List workflows
get(workflow_id=)Get one (with definition)
create_workflow(name=, description=, definition=)Create from a definition
update_workflow(workflow_id, ...) / patch_workflow(workflow_id, definition=)Update (definition is full-replace)
duplicate_workflow(workflow_id)Copy a workflow
delete_workflow(workflow_id)Delete
list_workflow_uploads(workflow_id)Uploads bound to a workflow
estimate_workflow(workflow_id) / preview_run(workflow_id)Estimate run cost
download_run(workflow_id, run_id) / download_run_node(workflow_id, run_id, node_id)Get a 15-min pre-signed download URL
runs_summary, get_run_steps, get_run_overview, get_run_dataRun detail views
pause_run(workflow_id, run_id) / resume_run(...)Pause / resume a run

workflows.runs

client.workflows.runs.<method>

MethodPurpose
start(workflow_id, script_text=, source_language=)Start a run (optional run-scoped script)
status(workflow_id, run_id)Lightweight status + step progress
get(workflow_id, run_id)Full run object
list(workflow_id, ...)Run history
cancel(workflow_id, run_id)Cancel a run

voices

client.voices.<method>

MethodPurpose
list(language=, provider=, gender=, favorites_only=, search=, limit=)List voices
get(voice_id=)Get one
similar(voice_id=)Similar voices
get_voice_facets()Available filter facets
favorite_voice(voice_id) / unfavorite_voice(voice_id)Manage favorites

templates

client.templates.<method>

MethodPurpose
list(category=, search=, sort=, favorites_only=, limit=)List gallery templates
get(template_id=)Get one
clone(template_id, name=)Clone into a workflow
create_template(...) / update_template(...) / delete_template(...)Manage templates
estimate_template(template_id)Estimate cost
favorite_template(...) / unfavorite_template(...)Manage favorites

uploads

client.uploads.<method> — three-step presigned flow (see Upload a file).

MethodPurpose
create(filename=, category=)Create the record + get a presigned URL
confirm(upload_id, context_type=, context_id=)Bind a confirmed upload to a workflow
delete(upload_id)Delete an upload

providers

client.providers.<method> — the catalog for voice_map identifiers (see Generator).

MethodPurpose
list_catalog_providers() / get_catalog_provider(provider)Providers
list_catalog_provider_models(provider)Models for a provider (.model is what voice_map accepts)
list_catalog_provider_model_voices(provider, model, limit=)Provider-native voices for a model
get_catalog_provider_model(provider, model)One model

dictionary

client.dictionary.<method> — custom pronunciations (dictionary:read / dictionary:write).

MethodPurpose
list_dictionary_entries(language=) / search_dictionary_entries(search=)Read entries
create_dictionary_entry(word=, method=, language=, ...) / update_dictionary_entry(...) / delete_dictionary_entry(...)Manage entries
list_dictionary_languages()Supported languages
suggest_pronunciation(word=, language=)Ask for a suggested pronunciation

usage

client.usage.<method> — see Check usage.

MethodPurpose
usage_summary(range=) / usage_by_language(range=) / usage_activity(range=)Consumption over 30d / 60d / 90d

nodes

client.nodes.<method>

MethodPurpose
list_nodes()Node types with their ports
get_node_detail(node_type)Full config schema for one node type

Errors

All methods raise typed exceptions on non-2xx — see Handle errors.