SubFT

Python API reference

Signatures, parameters, return contracts and public exports of subft-client.

Parameters, returns and errors

This is a thin synchronous HTTP client. It does not prompt, scan automatically or orchestrate paid work for you. Use the complete recipe before adapting it. API methods need an account/token and access to the selected project. Planning and estimation do not charge; committing an operation does. Token generation/revocation needs the authenticated account and replaces/revokes its single active token.

positional-only, positional-or-keyword, keyword-only and variadic kinds describe Python calling syntax. A dash in Default means no default; required arguments must be supplied. _UNSET means omit a field, while None can explicitly clear a nullable project field.

JsonValue is Any, not a validated response model. HTTP helpers return decoded JSON, or None for an empty response; use the response-schema sections below for documented fields. request and put_upload_target return httpx.Response; close returns None, and resolve_url returns a URL string.

Catch SubftMaintenanceError before SubftApiError; inspect status_code, payload, response, mode and maintenance_until. SubftTransportError retains request_error. SubftError covers client-originated failures; local argument validation can also raise ValueError. A 409 requires a fresh read/plan, not replaying stale guards. Keep technical messages in internal logs and map codes to translated text in public interfaces. Do not blindly retry a charge-bearing commit after an ambiguous transport failure: reconcile the accepted operation first.

HTTP errors use {"detail":{"code":"…","params":{…}}}. Read SubftApiError.code and SubftApiError.params; raw server prose is diagnostic only. Credit amounts, maintenance metadata and subtitle line numbers are parameters. For example, an unreadable subtitle can return {"detail":{"code":"invalid_subtitles","params":{"line":2}}}. Unknown codes require a translated generic fallback in public interfaces.

SubftClient

Create one client and close it with a context manager. Optional extras are imported explicitly; the base package does not load FFmpeg or WebSocket dependencies.

Python
SubftClient(
    base_url: str,
    *,
    token: str | None = None,
    timeout: float | httpx.Timeout = 30.0,
    headers: Mapping[str, str] | None = None,
    cookies: Mapping[str, str] | None = None,
    transport: httpx.BaseTransport | None = None
) -> None
ParameterTypePassingDefaultMeaning
base_urlstrpositional-or-keyword—Gateway URL serving API, authentication and realtime routes; a trailing slash is normalized.
tokenstr | Nonekeyword-onlyNoneAPI token from Developer access. Keep it in a protected environment variable.
timeoutfloat | httpx.Timeoutkeyword-only30.0Timeout in seconds; inspect the signature for the specific request, probe or subscription default.
headersMapping[str, str] | Nonekeyword-onlyNoneHTTP headers. Pass the upload target headers unchanged; ordinary request headers override constructor headers.
cookiesMapping[str, str] | Nonekeyword-onlyNoneOptional HTTP cookies for this client session.
transporthttpx.BaseTransport | Nonekeyword-onlyNoneOptional HTTPX transport; use MockTransport in tests, not a live gateway.

Client methods

Every public method is listed once below. Returns and shared exception behavior follow the contract above; endpoint-specific conflicts preserve the server status and payload.

abandon_content_preparation

Abandon one still-actionable source preparation, preserving the operation’s other sources.

Python
abandon_content_preparation(
    operation_id: str, media_id: str, content_id: str
) -> JsonValue
ParameterTypePassingDefaultMeaning
operation_idstrpositional-or-keyword—ID of the committed operation; retain it before leaving or retrying preparation.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
content_idstrpositional-or-keyword—One source item inside an operation, not a project-media or artifact ID.

abort_operation

Abort accepted server work using the operation’s allowed action; this differs from detaching a watcher.

Python
abort_operation(operation_id: str) -> JsonValue
ParameterTypePassingDefaultMeaning
operation_idstrpositional-or-keyword—ID of the committed operation; retain it before leaving or retrying preparation.

add_project_media

Register one locally inspected inventory item and its physical sources.

Python
add_project_media(
    project_id: str, media: Mapping[str, Any]
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
mediaMapping[str, Any]positional-or-keyword—Backend-ready inventory records or selected project-media IDs; obtain IDs from current responses.

add_project_media_bulk

Register a complete batch of inspected media records.

Python
add_project_media_bulk(
    project_id: str, media: Iterable[Mapping[str, Any]]
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
mediaIterable[Mapping[str, Any]]positional-or-keyword—Backend-ready inventory records or selected project-media IDs; obtain IDs from current responses.

apply_project_directory_sync

Apply a reviewed directory snapshot with current observation guards; a stale response requires another preview.

Python
apply_project_directory_sync(
    project_id: str,
    *,
    files: Iterable[Mapping[str, Any]],
    media: Iterable[Mapping[str, Any]] | None = None,
    confirmed_moves: Iterable[Mapping[str, Any]] | None = None,
    confirm_reviewed: bool = False,
    expected_assets: Mapping[str, Any] | None = None,
    complete: bool = True
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
filesIterable[Mapping[str, Any]]keyword-only—Complete directory snapshot, file list or observation evidence required by this endpoint; build it from local files.
mediaIterable[Mapping[str, Any]] | Nonekeyword-onlyNoneBackend-ready inventory records or selected project-media IDs; obtain IDs from current responses.
confirmed_movesIterable[Mapping[str, Any]] | Nonekeyword-onlyNoneReviewed old/new media path mappings returned by the directory preview.
confirm_reviewedboolkeyword-onlyFalseExplicit approval of reviewed directory changes; no implicit approval is added by the client.
expected_assetsMapping[str, Any] | Nonekeyword-onlyNoneCurrent observation/generation/save guards from the relevant read or begin-check response; stale guards require a fresh read.
completeboolkeyword-onlyTrueWhether the snapshot is complete; do not mark a partially failed local scan as complete.

archive_project

Archive a settled project as read-only. Repeating the request preserves its archive date.

Python
archive_project(project_id: str) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.

restore_project

Restore an archived project so it can be changed again. Restoring an active project changes nothing.

Python
restore_project(project_id: str) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.

delete_project

Permanently delete an archived project and its workspace, results and submitted inputs. Operation and credit records remain. The trimmed confirmation name must match exactly, including case.

Python
delete_project(project_id: str, confirmation_name: str) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
confirmation_namestrpositional-or-keyword—Exact project name after trimming; case-sensitive.

attach_project_media_sidecars

Attach reviewed subtitle sidecars to a media item using its check baseline.

Python
attach_project_media_sidecars(
    project_id: str,
    media_id: str,
    sidecars: Iterable[Mapping[str, Any]],
    *,
    expected_assets: Iterable[Mapping[str, Any]] = ()
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
sidecarsIterable[Mapping[str, Any]]positional-or-keyword—Observed subtitle sidecars and their pairing/classification metadata.
expected_assetsIterable[Mapping[str, Any]]keyword-only()Current observation/generation/save guards from the relevant read or begin-check response; stale guards require a fresh read.

begin_media_asset_checks

Read the current asset-check baseline before reconciling physical observations.

Python
begin_media_asset_checks(
    project_id: str, media_id: str, *, scope: Mapping[str, Any] | None = None
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
scopeMapping[str, Any] | Nonekeyword-onlyNoneEndpoint-specific asset kind, check scope, readiness or placement selector; follow that endpoint’s contract.

begin_project_directory_checks

Read asset-check baselines for a complete directory preview/apply cycle.

Python
begin_project_directory_checks(project_id: str) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.

clone_media_asset

Create an editable copy or duplicate using the current snapshot guards.

Python
clone_media_asset(
    project_id: str, media_id: str, asset_id: str, payload: Mapping[str, Any]
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
asset_idstrpositional-or-keyword—ID of the selected subtitle/audio asset owned by its media.
payloadMapping[str, Any]positional-or-keyword—Endpoint-specific request mapping. Use its schema and preserve required observation or preparation guards.

close

Close the HTTP connection pool; the context manager calls this automatically.

Python
close() -> None

compare_media_asset_exports

Compare selected export candidates without extracting or writing local files.

Python
compare_media_asset_exports(
    project_id: str, media_id: str, asset_id: str, payload: Mapping[str, Any]
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
asset_idstrpositional-or-keyword—ID of the selected subtitle/audio asset owned by its media.
payloadMapping[str, Any]positional-or-keyword—Endpoint-specific request mapping. Use its schema and preserve required observation or preparation guards.

complete_media_asset_checks

Complete guarded physical checks and reconcile newly observed sources.

Python
complete_media_asset_checks(
    project_id: str, media_id: str, payload: Mapping[str, Any]
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
payloadMapping[str, Any]positional-or-keyword—Endpoint-specific request mapping. Use its schema and preserve required observation or preparation guards.

complete_upload

Finalize a direct upload for its current content, upload and preparation attempt.

Python
complete_upload(
    operation_id: str,
    media_id: str,
    *,
    content_id: str,
    attempt_id: str,
    upload_id: str,
    content_hash: str | None = None
) -> JsonValue
ParameterTypePassingDefaultMeaning
operation_idstrpositional-or-keyword—ID of the committed operation; retain it before leaving or retrying preparation.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
content_idstrkeyword-only—One source item inside an operation, not a project-media or artifact ID.
attempt_idstrkeyword-only—A fresh UUID chosen by the caller and confirmed by the preparation response; use it for every request of that attempt.
upload_idstrkeyword-only—Upload ID from the current target response, paired with the current attempt.
content_hashstr | Nonekeyword-onlyNoneHash of the prepared bytes (or the documented paired-file hash), not the original media fingerprint.

create_blank_media_asset

Create a blank editable subtitle asset using the endpoint’s guarded request.

Python
create_blank_media_asset(
    project_id: str, media_id: str, payload: Mapping[str, Any]
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
payloadMapping[str, Any]positional-or-keyword—Endpoint-specific request mapping. Use its schema and preserve required observation or preparation guards.

create_project

Create an empty file or directory project; local inventory is submitted separately.

Python
create_project(
    *, name: str, mode: str, root_label: str | None = None
) -> JsonValue
ParameterTypePassingDefaultMeaning
namestrkeyword-only—Project display name; update_project may use None to clear a nullable value.
modestrkeyword-only—Project mode: file or directory.
root_labelstr | Nonekeyword-onlyNoneHuman-readable root label, not a server-accessible local filesystem path.

create_project_operation

Commit the estimated, guarded source selections and charge the accepted estimate.

Python
create_project_operation(
    project_id: str,
    *,
    media_ids: Iterable[str],
    target_language: str,
    content_overrides: Iterable[Mapping[str, Any]] | None = None,
    metrics: Iterable[Mapping[str, Any]] | None = None,
    source_selections: Iterable[Mapping[str, Any]]
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idsIterable[str]keyword-only—Backend-ready inventory records or selected project-media IDs; obtain IDs from current responses.
target_languagestrkeyword-only—Target language code for generated or translated subtitles.
content_overridesIterable[Mapping[str, Any]] | Nonekeyword-onlyNoneOverrides keyed by stable source_ref: enable a source or explicitly override its source language.
metricsIterable[Mapping[str, Any]] | Nonekeyword-onlyNoneOnly source metrics requested by the current plan; derive them locally. Audio duration is already in probed inventory.
source_selectionsIterable[Mapping[str, Any]]keyword-only—Guarded selections from the estimated plan, plus canonical source_language; preserve snapshots and observations.

create_project_operation_plan

Request a source/stage plan without charging or uploading data.

Python
create_project_operation_plan(
    project_id: str,
    *,
    media_ids: Iterable[str],
    target_language: str,
    content_overrides: Iterable[Mapping[str, Any]] | None = None
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idsIterable[str]keyword-only—Backend-ready inventory records or selected project-media IDs; obtain IDs from current responses.
target_languagestrkeyword-only—Target language code for generated or translated subtitles.
content_overridesIterable[Mapping[str, Any]] | Nonekeyword-onlyNoneOverrides keyed by stable source_ref: enable a source or explicitly override its source language.

create_upload_target

Request or refresh a direct-upload target after the preparation enters hashing/uploading.

Python
create_upload_target(
    operation_id: str,
    media_id: str,
    *,
    content_id: str,
    attempt_id: str,
    content_hash: str,
    filename: str | None = None
) -> JsonValue
ParameterTypePassingDefaultMeaning
operation_idstrpositional-or-keyword—ID of the committed operation; retain it before leaving or retrying preparation.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
content_idstrkeyword-only—One source item inside an operation, not a project-media or artifact ID.
attempt_idstrkeyword-only—A fresh UUID chosen by the caller and confirmed by the preparation response; use it for every request of that attempt.
content_hashstrkeyword-only—Hash of the prepared bytes (or the documented paired-file hash), not the original media fingerprint.
filenamestr | Nonekeyword-onlyNonePrepared filename, including its real extension, used to select storage format.

estimate_project_operation_plan

Estimate the current plan using real requested metrics; inspect can_commit before asking for approval.

Python
estimate_project_operation_plan(
    project_id: str,
    *,
    media_ids: Iterable[str],
    target_language: str,
    content_overrides: Iterable[Mapping[str, Any]] | None = None,
    metrics: Iterable[Mapping[str, Any]] | None = None
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idsIterable[str]keyword-only—Backend-ready inventory records or selected project-media IDs; obtain IDs from current responses.
target_languagestrkeyword-only—Target language code for generated or translated subtitles.
content_overridesIterable[Mapping[str, Any]] | Nonekeyword-onlyNoneOverrides keyed by stable source_ref: enable a source or explicitly override its source language.
metricsIterable[Mapping[str, Any]] | Nonekeyword-onlyNoneOnly source metrics requested by the current plan; derive them locally. Audio duration is already in probed inventory.

export_media_asset

Capture a saved asset’s subtitle export with current snapshot/version and metadata guards.

Python
export_media_asset(
    project_id: str, media_id: str, asset_id: str, payload: Mapping[str, Any]
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
asset_idstrpositional-or-keyword—ID of the selected subtitle/audio asset owned by its media.
payloadMapping[str, Any]positional-or-keyword—Endpoint-specific request mapping. Use its schema and preserve required observation or preparation guards.

export_project_operation_artifact

Export a specific successful immutable stage; downloading does not create an editable or physical asset.

Python
export_project_operation_artifact(
    project_id: str,
    operation_id: str,
    artifact_id: str,
    *,
    output_target: str | None = None
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
operation_idstrpositional-or-keyword—ID of the committed operation; retain it before leaving or retrying preparation.
artifact_idstrpositional-or-keyword—ID of an immutable successful operation stage returned by the result list.
output_targetstr | Nonekeyword-onlyNoneexternal_srt, external_vtt, external_ass or embedded; None uses the endpoint/account default.

export_project_operation_result

Export the final successful stage for one operation source item.

Python
export_project_operation_result(
    project_id: str,
    operation_id: str,
    content_id: str,
    *,
    output_target: str | None = None
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
operation_idstrpositional-or-keyword—ID of the committed operation; retain it before leaving or retrying preparation.
content_idstrpositional-or-keyword—One source item inside an operation, not a project-media or artifact ID.
output_targetstr | Nonekeyword-onlyNoneexternal_srt, external_vtt, external_ass or embedded; None uses the endpoint/account default.

export_project_operation_result_names

Final file names of the selected results written together to one ZIP or directory. Names that would clash get the source's asset number or a running number (clip.en.3.srt).

Python
export_project_operation_result_names(
    project_id: str,
    operation_id: str,
    artifact_ids: list[str],
    *,
    output_target: str
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
operation_idstrpositional-or-keyword—ID of the committed operation; retain it before leaving or retrying preparation.
artifact_idslist[str]positional-or-keyword—IDs of the immutable successful operation stages written together, as returned by the result list.
output_targetstrkeyword-only—external_srt, external_vtt or external_ass; embedded results have no file names of their own.

generate_api_token

Generate the single active API token, replacing the previous token; callers own confirmation and secret handling.

Python
generate_api_token() -> JsonValue

get_api_token_status

Read token status without recovering an existing secret.

Python
get_api_token_status() -> JsonValue

get_asset_document

Read a consistent saved subtitle document and its current version.

Python
get_asset_document(
    project_id: str, media_id: str, asset_id: str
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
asset_idstrpositional-or-keyword—ID of the selected subtitle/audio asset owned by its media.

get_maintenance_status

Read gateway maintenance state without authentication.

Python
get_maintenance_status() -> JsonValue

get_media_asset

Read one current asset and its binding/snapshot metadata.

Python
get_media_asset(
    project_id: str, media_id: str, asset_id: str
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
asset_idstrpositional-or-keyword—ID of the selected subtitle/audio asset owned by its media.

get_operation

Read canonical global operation state; reconcile this after events and reconnects.

Python
get_operation(operation_id: str) -> JsonValue
ParameterTypePassingDefaultMeaning
operation_idstrpositional-or-keyword—ID of the committed operation; retain it before leaving or retrying preparation.

get_project

Read a project and its current inventory overview.

Python
get_project(project_id: str) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.

get_project_media

Read one current project-media record.

Python
get_project_media(project_id: str, media_id: str) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.

get_project_operation

Read an operation through its owning project route.

Python
get_project_operation(project_id: str, operation_id: str) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
operation_idstrpositional-or-keyword—ID of the committed operation; retain it before leaving or retrying preparation.

get_session

Read the authenticated session resource.

Python
get_session() -> JsonValue

get_workflow_preferences

Read account workflow and export defaults; explicit choices may override them.

Python
get_workflow_preferences() -> JsonValue

hide_media_asset

Hide an asset using current guards while retaining its producing history.

Python
hide_media_asset(
    project_id: str,
    media_id: str,
    asset_id: str,
    *,
    expected_autosave_version: int | None = None,
    guards: Mapping[str, Any] | None = None
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
asset_idstrpositional-or-keyword—ID of the selected subtitle/audio asset owned by its media.
expected_autosave_versionint | Nonekeyword-onlyNoneCurrent observation/generation/save guards from the relevant read or begin-check response; stale guards require a fresh read.
guardsMapping[str, Any] | Nonekeyword-onlyNoneCurrent observation/generation/save guards from the relevant read or begin-check response; stale guards require a fresh read.

import_project

Create a project from a complete supplied file/inventory setup.

Python
import_project(
    *,
    name: str,
    mode: str,
    root_label: str | None = None,
    media: Iterable[Mapping[str, Any]] | None = None,
    file_evidence: Iterable[Mapping[str, Any]] | None = None
) -> JsonValue
ParameterTypePassingDefaultMeaning
namestrkeyword-only—Project display name; update_project may use None to clear a nullable value.
modestrkeyword-only—Project mode: file or directory.
root_labelstr | Nonekeyword-onlyNoneHuman-readable root label, not a server-accessible local filesystem path.
mediaIterable[Mapping[str, Any]] | Nonekeyword-onlyNoneBackend-ready inventory records or selected project-media IDs; obtain IDs from current responses.
file_evidenceIterable[Mapping[str, Any]] | Nonekeyword-onlyNoneComplete directory snapshot, file list or observation evidence required by this endpoint; build it from local files.

list_media_assets

List saved assets belonging to one project-media item.

Python
list_media_assets(
    project_id: str,
    media_id: str,
    *,
    limit: int = 50,
    offset: int = 0,
    content_type: str | None = None,
    kind: str | None = None,
    search: str | None = None,
    language: str | None = None,
    forced: bool | None = None,
    sdh: bool | None = None,
    commentary: bool | None = None,
    classification: str | None = None,
    readiness: str | None = None,
    placement: str | None = None,
    sort: str = 'created_at',
    direction: str = 'asc'
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
limitintkeyword-only50Page size or zero-based offset; continue pagination until the reported total is reached.
offsetintkeyword-only0Page size or zero-based offset; continue pagination until the reported total is reached.
content_typestr | Nonekeyword-onlyNoneMIME type of prepared data; target headers take precedence if they already specify it.
kindstr | Nonekeyword-onlyNoneEndpoint-specific asset kind, check scope, readiness or placement selector; follow that endpoint’s contract.
searchstr | Nonekeyword-onlyNoneOptional search text for the requested project or media list.
languagestr | Nonekeyword-onlyNoneSubtitle language or normal/Forced/SDH/Commentary classification; technical language codes remain unchanged.
forcedbool | Nonekeyword-onlyNoneSubtitle language or normal/Forced/SDH/Commentary classification; technical language codes remain unchanged.
sdhbool | Nonekeyword-onlyNoneSubtitle language or normal/Forced/SDH/Commentary classification; technical language codes remain unchanged.
commentarybool | Nonekeyword-onlyNoneSubtitle language or normal/Forced/SDH/Commentary classification; technical language codes remain unchanged.
classificationstr | Nonekeyword-onlyNoneSubtitle language or normal/Forced/SDH/Commentary classification; technical language codes remain unchanged.
readinessstr | Nonekeyword-onlyNoneEndpoint-specific asset kind, check scope, readiness or placement selector; follow that endpoint’s contract.
placementstr | Nonekeyword-onlyNoneEndpoint-specific asset kind, check scope, readiness or placement selector; follow that endpoint’s contract.
sortstrkeyword-only'created_at'Sort field or direction supported by the list endpoint.
directionstrkeyword-only'asc'Sort field or direction supported by the list endpoint.

list_operations

List global operations with explicit pagination.

Python
list_operations(*, limit: int = 50, offset: int = 0) -> JsonValue
ParameterTypePassingDefaultMeaning
limitintkeyword-only50Page size or zero-based offset; continue pagination until the reported total is reached.
offsetintkeyword-only0Page size or zero-based offset; continue pagination until the reported total is reached.

list_project_media

List project media with filters and pagination; inspect total and status_counts.

Python
list_project_media(
    project_id: str,
    *,
    limit: int = 50,
    offset: int = 0,
    search: str | None = None,
    status: str = 'all',
    media_ids: Iterable[str] | None = None
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
limitintkeyword-only50Page size or zero-based offset; continue pagination until the reported total is reached.
offsetintkeyword-only0Page size or zero-based offset; continue pagination until the reported total is reached.
searchstr | Nonekeyword-onlyNoneOptional search text for the requested project or media list.
statusstrkeyword-only'all'Status filter or new status, as appropriate to the method; archived projects retain saved results.
media_idsIterable[str] | Nonekeyword-onlyNoneBackend-ready inventory records or selected project-media IDs; obtain IDs from current responses.

list_project_operation_results

List successful saved stage artifacts, including useful results from partially failed work.

Python
list_project_operation_results(
    project_id: str, operation_id: str
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
operation_idstrpositional-or-keyword—ID of the committed operation; retain it before leaving or retrying preparation.

list_project_operations

List operations owned by a project, optionally scoped to one media item.

Python
list_project_operations(
    project_id: str,
    *,
    limit: int = 50,
    offset: int = 0,
    media_id: str | None = None
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
limitintkeyword-only50Page size or zero-based offset; continue pagination until the reported total is reached.
offsetintkeyword-only0Page size or zero-based offset; continue pagination until the reported total is reached.
media_idstr | Nonekeyword-onlyNoneMedia ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.

list_archived_projects

List archived projects with mode, search, sort and pagination. Newest archive date comes first by default.

Python
list_archived_projects(
    *,
    limit: int = 50,
    offset: int = 0,
    mode: str | None = None,
    search: str | None = None,
    sort: str = 'archived_at',
    direction: str = 'desc'
) -> JsonValue
ParameterTypePassingDefaultMeaning
limitintkeyword-only50Page size or zero-based offset; continue pagination until the reported total is reached.
offsetintkeyword-only0Page size or zero-based offset; continue pagination until the reported total is reached.
modestr | Nonekeyword-onlyNoneProject mode: file or directory.
searchstr | Nonekeyword-onlyNoneOptional search text for the requested project or media list.
sortstrkeyword-only'archived_at'Sort field or direction supported by the list endpoint.
directionstrkeyword-only'desc'Sort field or direction supported by the list endpoint.

list_projects

List active projects with mode, search, sort and pagination.

Python
list_projects(
    *,
    limit: int = 50,
    offset: int = 0,
    mode: str | None = None,
    search: str | None = None,
    sort: str = 'updated_at',
    direction: str = 'desc'
) -> JsonValue
ParameterTypePassingDefaultMeaning
limitintkeyword-only50Page size or zero-based offset; continue pagination until the reported total is reached.
offsetintkeyword-only0Page size or zero-based offset; continue pagination until the reported total is reached.
modestr | Nonekeyword-onlyNoneProject mode: file or directory.
searchstr | Nonekeyword-onlyNoneOptional search text for the requested project or media list.
sortstrkeyword-only'updated_at'Sort field or direction supported by the list endpoint.
directionstrkeyword-only'desc'Sort field or direction supported by the list endpoint.

materialize_asset

Register locally extracted physical subtitle text using current observation guards.

Python
materialize_asset(
    project_id: str, media_id: str, asset_id: str, payload: Mapping[str, Any]
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
asset_idstrpositional-or-keyword—ID of the selected subtitle/audio asset owned by its media.
payloadMapping[str, Any]positional-or-keyword—Endpoint-specific request mapping. Use its schema and preserve required observation or preparation guards.

preview_project_directory_sync

Compare a complete local snapshot with current inventory before applying changes.

Python
preview_project_directory_sync(
    project_id: str, files: Iterable[Mapping[str, Any]]
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
filesIterable[Mapping[str, Any]]positional-or-keyword—Complete directory snapshot, file list or observation evidence required by this endpoint; build it from local files.

preview_project_sidecars

Find sidecar matches and ambiguities before attaching them.

Python
preview_project_sidecars(
    project_id: str, sidecars: Iterable[Mapping[str, Any]]
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
sidecarsIterable[Mapping[str, Any]]positional-or-keyword—Observed subtitle sidecars and their pairing/classification metadata.

put_upload_target

Upload directly using backend-issued method and headers; the SubFT token is omitted.

Python
put_upload_target(
    upload_url: str,
    *,
    method: str = 'PUT',
    data: Any | None = None,
    content: Any | None = None,
    headers: Mapping[str, str] | None = None,
    content_type: str = 'application/octet-stream'
) -> httpx.Response
ParameterTypePassingDefaultMeaning
upload_urlstrpositional-or-keyword—URL from the API; relative URLs resolve against the gateway. Upload URLs receive no SubFT token.
methodstrkeyword-only'PUT'HTTP method; preserve the backend-issued method for direct upload.
dataAny | Nonekeyword-onlyNoneForm or upload data accepted by HTTPX; do not combine it with content for direct upload.
contentAny | Nonekeyword-onlyNoneRaw bytes or an iterable of byte chunks. For uploads use the prepared file.
headersMapping[str, str] | Nonekeyword-onlyNoneHTTP headers. Pass the upload target headers unchanged; ordinary request headers override constructor headers.
content_typestrkeyword-only'application/octet-stream'MIME type of prepared data; target headers take precedence if they already specify it.

register_verified_asset_outputs

Register locally verified physical outputs using their frozen capture; downloading alone does not register them.

Python
register_verified_asset_outputs(
    project_id: str, media_id: str, payload: Mapping[str, Any]
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
payloadMapping[str, Any]positional-or-keyword—Endpoint-specific request mapping. Use its schema and preserve required observation or preparation guards.

remove_project_media

Remove a media item from active inventory through the project route.

Python
remove_project_media(project_id: str, media_id: str) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.

replace_project_media

Reconcile a changed local media file using its fresh inventory evidence.

Python
replace_project_media(
    project_id: str, media_id: str, media: Mapping[str, Any]
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
mediaMapping[str, Any]positional-or-keyword—Backend-ready inventory records or selected project-media IDs; obtain IDs from current responses.

report_content_progress

Report attempt-scoped client progress with the current progress contract and increasing revision.

Python
report_content_progress(
    operation_id: str,
    media_id: str,
    content_id: str,
    payload: Mapping[str, Any]
) -> JsonValue
ParameterTypePassingDefaultMeaning
operation_idstrpositional-or-keyword—ID of the committed operation; retain it before leaving or retrying preparation.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
content_idstrpositional-or-keyword—One source item inside an operation, not a project-media or artifact ID.
payloadMapping[str, Any]positional-or-keyword—Endpoint-specific request mapping. Use its schema and preserve required observation or preparation guards.

request

Send an HTTP request and return the raw response after shared error handling.

Python
request(
    method: str,
    path: str,
    *,
    params: Mapping[str, Any] | None = None,
    json: JsonValue | None = None,
    data: Any | None = None,
    content: Any | None = None,
    headers: Mapping[str, str] | None = None,
    authenticated: bool = True
) -> httpx.Response
ParameterTypePassingDefaultMeaning
methodstrpositional-or-keyword—HTTP method; preserve the backend-issued method for direct upload.
pathstrpositional-or-keyword—HTTP path relative to base_url, or an absolute URL; this is not a local filesystem path.
paramsMapping[str, Any] | Nonekeyword-onlyNoneQuery parameters; None values and empty collections are omitted.
jsonJsonValue | Nonekeyword-onlyNoneJSON request body. It must match the endpoint contract.
dataAny | Nonekeyword-onlyNoneForm or upload data accepted by HTTPX; do not combine it with content for direct upload.
contentAny | Nonekeyword-onlyNoneRaw bytes or an iterable of byte chunks. For uploads use the prepared file.
headersMapping[str, str] | Nonekeyword-onlyNoneHTTP headers. Pass the upload target headers unchanged; ordinary request headers override constructor headers.
authenticatedboolkeyword-onlyTrueWhether the client may add its SubFT Authorization header. Direct upload uses False.

request_json

Send an HTTP request and decode JSON; empty responses return None.

Python
request_json(
    method: str,
    path: str,
    *,
    params: Mapping[str, Any] | None = None,
    json: JsonValue | None = None,
    headers: Mapping[str, str] | None = None,
    authenticated: bool = True
) -> JsonValue
ParameterTypePassingDefaultMeaning
methodstrpositional-or-keyword—HTTP method; preserve the backend-issued method for direct upload.
pathstrpositional-or-keyword—HTTP path relative to base_url, or an absolute URL; this is not a local filesystem path.
paramsMapping[str, Any] | Nonekeyword-onlyNoneQuery parameters; None values and empty collections are omitted.
jsonJsonValue | Nonekeyword-onlyNoneJSON request body. It must match the endpoint contract.
headersMapping[str, str] | Nonekeyword-onlyNoneHTTP headers. Pass the upload target headers unchanged; ordinary request headers override constructor headers.
authenticatedboolkeyword-onlyTrueWhether the client may add its SubFT Authorization header. Direct upload uses False.

resolve_url

Resolve a backend relative URL against the client gateway.

Python
resolve_url(url: str) -> str
ParameterTypePassingDefaultMeaning
urlstrpositional-or-keyword—URL from the API; relative URLs resolve against the gateway. Upload URLs receive no SubFT token.

restore_project_media

Restore an archived item. A video or audio item needs media, its file's fresh inventory evidence: unchanged streams keep their assets. A subtitle item needs none.

Python
restore_project_media(
    project_id: str, media_id: str, media: Mapping[str, Any] | None = None
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
mediaMapping[str, Any] | Nonepositional-or-keywordNoneInventory record of the item's file, as for replace_project_media; omit it for a subtitle item.

retry_content_preparation

Start a fresh attempt for eligible preparation, guarded by the previous attempt ID; this starts no new operation.

Python
retry_content_preparation(
    operation_id: str,
    media_id: str,
    content_id: str,
    *,
    attempt_id: str,
    previous_attempt_id: str
) -> JsonValue
ParameterTypePassingDefaultMeaning
operation_idstrpositional-or-keyword—ID of the committed operation; retain it before leaving or retrying preparation.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
content_idstrpositional-or-keyword—One source item inside an operation, not a project-media or artifact ID.
attempt_idstrkeyword-only—A fresh UUID chosen by the caller and confirmed by the preparation response; use it for every request of that attempt.
previous_attempt_idstrkeyword-only—The attempt ID in the latest canonical preparation snapshot, used as a retry guard.

revoke_api_token

Revoke the active server token; removing a locally stored token does not do this.

Python
revoke_api_token() -> JsonValue

save_media_asset_document

Save editable cues with snapshot/version guards; conflicts require a fresh document read.

Python
save_media_asset_document(
    project_id: str, media_id: str, asset_id: str, payload: Mapping[str, Any]
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
asset_idstrpositional-or-keyword—ID of the selected subtitle/audio asset owned by its media.
payloadMapping[str, Any]positional-or-keyword—Endpoint-specific request mapping. Use its schema and preserve required observation or preparation guards.

scan_project_directory

Ask the backend to classify a supplied local snapshot; the server cannot scan the caller’s disk.

Python
scan_project_directory(files: Iterable[str]) -> JsonValue
ParameterTypePassingDefaultMeaning
filesIterable[str]positional-or-keyword—Complete directory snapshot, file list or observation evidence required by this endpoint; build it from local files.

start_content_preparation

Start an allowed preparation attempt with a new UUID before hashing and upload.

Python
start_content_preparation(
    operation_id: str, media_id: str, content_id: str, *, attempt_id: str
) -> JsonValue
ParameterTypePassingDefaultMeaning
operation_idstrpositional-or-keyword—ID of the committed operation; retain it before leaving or retrying preparation.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
content_idstrpositional-or-keyword—One source item inside an operation, not a project-media or artifact ID.
attempt_idstrkeyword-only—A fresh UUID chosen by the caller and confirmed by the preparation response; use it for every request of that attempt.

update_content_preparation

Advance preparation, renew its heartbeat or report an awaiting_retry failure with the same attempt token.

Python
update_content_preparation(
    operation_id: str,
    media_id: str,
    content_id: str,
    attempt_id: str,
    payload: Mapping[str, Any]
) -> JsonValue
ParameterTypePassingDefaultMeaning
operation_idstrpositional-or-keyword—ID of the committed operation; retain it before leaving or retrying preparation.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
content_idstrpositional-or-keyword—One source item inside an operation, not a project-media or artifact ID.
attempt_idstrpositional-or-keyword—A fresh UUID chosen by the caller and confirmed by the preparation response; use it for every request of that attempt.
payloadMapping[str, Any]positional-or-keyword—Endpoint-specific request mapping. Use its schema and preserve required observation or preparation guards.

update_media_asset

Update allowed asset metadata, leaving subtitle content unchanged.

Python
update_media_asset(
    project_id: str, media_id: str, asset_id: str, metadata: Mapping[str, Any]
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
media_idstrpositional-or-keyword—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
asset_idstrpositional-or-keyword—ID of the selected subtitle/audio asset owned by its media.
metadataMapping[str, Any]positional-or-keyword—Allowed language/classification metadata for the asset; this does not edit subtitle cues.

update_project

Update supplied project fields. Omitted _UNSET fields differ from explicitly cleared None values.

Python
update_project(
    project_id: str,
    *,
    name: str | None | object = _UNSET,
    root_label: str | None | object = _UNSET
) -> JsonValue
ParameterTypePassingDefaultMeaning
project_idstrpositional-or-keyword—ID of the durable project, returned when creating or listing projects.
namestr | None | objectkeyword-only_UNSETProject display name; update_project may use None to clear a nullable value.
root_labelstr | None | objectkeyword-only_UNSETHuman-readable root label, not a server-accessible local filesystem path.

verify_auth

Verify the effective credential and read its account identity.

Python
verify_auth() -> JsonValue

Root exports

Import from subft_client. Local functions need the local extra and the selected system tools. Inspect returned failures before updating backend inventory. Realtime needs its extra and performs no canonical HTTP reconciliation.

JsonArray

Public constant or type alias. The value below comes from source; identifiers and units retain their technical meaning.

Python
JsonArray = list[Any]

JsonObject

Public constant or type alias. The value below comes from source; identifiers and units retain their technical meaning.

Python
JsonObject = dict[str, Any]

JsonValue

Public constant or type alias. The value below comes from source; identifiers and units retain their technical meaning.

Python
JsonValue = Any

SubftApiError

Public exception. Catch the specific type when recovery differs; the base exception covers its subclasses. Optional constructor fields preserve HTTP status, payload or transport evidence as annotated.

Python
SubftApiError(
    status_code: int,
    message: str,
    *,
    payload: Any | None = None,
    response: httpx.Response | None = None
) -> None

SubftClient

Public client or immutable record. Fields are returned local/realtime evidence, not an instruction to launch work. Public methods below expose its recorded values.

Python
SubftClient(
    base_url: str,
    *,
    token: str | None = None,
    timeout: float | httpx.Timeout = 30.0,
    headers: Mapping[str, str] | None = None,
    cookies: Mapping[str, str] | None = None,
    transport: httpx.BaseTransport | None = None
) -> None

SubftError

Public exception. Catch the specific type when recovery differs; the base exception covers its subclasses. Optional constructor fields preserve HTTP status, payload or transport evidence as annotated.

SubftMaintenanceError

Public exception. Catch the specific type when recovery differs; the base exception covers its subclasses. Optional constructor fields preserve HTTP status, payload or transport evidence as annotated.

Python
SubftMaintenanceError(
    status_code: int,
    message: str,
    *,
    payload: Any | None = None,
    response: httpx.Response | None = None,
    mode: str | None = None,
    maintenance_until: str | None = None
) -> None

SubftTransportError

Public exception. Catch the specific type when recovery differs; the base exception covers its subclasses. Optional constructor fields preserve HTTP status, payload or transport evidence as annotated.

Python
SubftTransportError(
    message: str, *, request_error: httpx.RequestError
) -> None

__version__

Public constant or type alias. The value below comes from source; identifiers and units retain their technical meaning.

Python
__version__ = '0.1.0'

Local helpers and records

Import from subft_client.local. Local functions need the local extra and the selected system tools. Inspect returned failures before updating backend inventory. Realtime needs its extra and performs no canonical HTTP reconciliation.

AUDIO_EXTENSIONS

Public constant or type alias. The value below comes from source; identifiers and units retain their technical meaning.

Python
AUDIO_EXTENSIONS = frozenset({'mp3', 'wav', 'flac', 'aac', 'ogg', 'm4a'})

DEFAULT_HASH_CHUNK_SIZE

Public constant or type alias. The value below comes from source; identifiers and units retain their technical meaning.

Python
DEFAULT_HASH_CHUNK_SIZE = 4 * 1024 * 1024

DirectorySnapshotFile

Public client or immutable record. Fields are returned local/realtime evidence, not an instruction to launch work. Public methods below expose its recorded values.

FieldTypeRequiredDeclaration / defaultMeaning
pathstrTrue—Local root, path or POSIX relative path. Scan helpers exclude symlinks; keep paths inside the chosen root.
size_bytesintTrue—Actual file/transfer size or measured byte progress.
last_modified_msintTrue—Observed filesystem modification time in milliseconds.
mime_typestr | NoneTrue—Detected MIME type; this alone does not establish codec support.
file_kindLocalFileKindTrue—Recognized extension, inventory classification or probed container.
file_fingerprint_hashstr | NoneFalseNoneFingerprint/hash measured from the source; observe the record’s fingerprint kind.
language_text_samplestr | NoneFalseNoneBounded real subtitle text used as language evidence.
Python
to_api_dict() -> JsonObject

DirectorySnapshotResult

Public client or immutable record. Fields are returned local/realtime evidence, not an instruction to launch work. Public methods below expose its recorded values.

FieldTypeRequiredDeclaration / defaultMeaning
filestuple[DirectorySnapshotFile, ...]True—Complete directory snapshot, file list or observation evidence required by this endpoint; build it from local files.
failurestuple[LocalFailure, ...]True—Recorded per-item failures; this list does not make a partial inventory safe to submit.
Python
to_api_dict() -> JsonObject

ExtractedFile

Public client or immutable record. Fields are returned local/realtime evidence, not an instruction to launch work. Public methods below expose its recorded values.

FieldTypeRequiredDeclaration / defaultMeaning
pathPathTrue—Local root, path or POSIX relative path. Scan helpers exclude symlinks; keep paths inside the chosen root.
filenamestrTrue—Prepared filename, including its real extension, used to select storage format.
content_typestrTrue—MIME type of prepared data; target headers take precedence if they already specify it.
Python
to_api_dict() -> JsonObject

FfmpegTools

Public client or immutable record. Fields are returned local/realtime evidence, not an instruction to launch work. Public methods below expose its recorded values.

FieldTypeRequiredDeclaration / defaultMeaning
wrapper_availableboolTrue—Observed tool installation, version or diagnostic; Python extras do not install system binaries.
ffmpeg_pathstr | NoneTrue—Observed tool installation, version or diagnostic; Python extras do not install system binaries.
ffmpeg_versionstr | NoneTrue—Observed tool installation, version or diagnostic; Python extras do not install system binaries.
ffmpeg_errorstr | NoneTrue—Observed tool installation, version or diagnostic; Python extras do not install system binaries.
ffprobe_pathstr | NoneTrue—Observed tool installation, version or diagnostic; Python extras do not install system binaries.
ffprobe_versionstr | NoneTrue—Observed tool installation, version or diagnostic; Python extras do not install system binaries.
ffprobe_errorstr | NoneTrue—Observed tool installation, version or diagnostic; Python extras do not install system binaries.
Python
ffmpeg_available: bool
Python
ffprobe_available: bool
Python
available: bool
Python
to_api_dict() -> JsonObject

FfmpegUnavailableError

Public exception. Catch the specific type when recovery differs; the base exception covers its subclasses. Optional constructor fields preserve HTTP status, payload or transport evidence as annotated.

FileFingerprint

Public client or immutable record. Fields are returned local/realtime evidence, not an instruction to launch work. Public methods below expose its recorded values.

FieldTypeRequiredDeclaration / defaultMeaning
kindFingerprintKindTrue—Endpoint-specific asset kind, check scope, readiness or placement selector; follow that endpoint’s contract.
hashstrTrue—Fingerprint/hash measured from the source; observe the record’s fingerprint kind.
Python
to_api_dict() -> JsonObject

GRAPHICAL_SUBTITLE_EXTENSIONS

Public constant or type alias. The value below comes from source; identifiers and units retain their technical meaning.

Python
GRAPHICAL_SUBTITLE_EXTENSIONS = frozenset({'sup', 'idx', 'sub'})

InventoryResult

Public client or immutable record. Fields are returned local/realtime evidence, not an instruction to launch work. Public methods below expose its recorded values.

FieldTypeRequiredDeclaration / defaultMeaning
itemstuple[MediaInventoryItem, ...]True—Inspected media inventory records; check failures before submitting them.
failurestuple[LocalFailure, ...]True—Recorded per-item failures; this list does not make a partial inventory safe to submit.
total_candidatesintTrue—Number of scan candidates before unsupported files or failures are filtered.
Python
to_api_dict() -> JsonObject

LANGUAGE_SAMPLE_BYTES

Public constant or type alias. The value below comes from source; identifiers and units retain their technical meaning.

Python
LANGUAGE_SAMPLE_BYTES = 64 * 1024

LocalFailure

Public client or immutable record. Fields are returned local/realtime evidence, not an instruction to launch work. Public methods below expose its recorded values.

FieldTypeRequiredDeclaration / defaultMeaning
pathstrTrue—Local root, path or POSIX relative path. Scan helpers exclude symlinks; keep paths inside the chosen root.
error_typestrTrue—Technical diagnostic data for internal logging; public interfaces must map codes to translated text.
messagestrTrue—Technical diagnostic data for internal logging; public interfaces must map codes to translated text.
Python
from_exception(path: str | Path, error: Exception) -> LocalFailure
Python
to_api_dict() -> JsonObject

LocalFile

Public client or immutable record. Fields are returned local/realtime evidence, not an instruction to launch work. Public methods below expose its recorded values.

FieldTypeRequiredDeclaration / defaultMeaning
absolute_pathPathTrue—Resolved caller-local path; never publish it in public search.
relative_pathstrTrue—Local root, path or POSIX relative path. Scan helpers exclude symlinks; keep paths inside the chosen root.
size_bytesintTrue—Actual file/transfer size or measured byte progress.
last_modified_msintTrue—Observed filesystem modification time in milliseconds.
mime_typestr | NoneTrue—Detected MIME type; this alone does not establish codec support.
suffixstrTrue—Recognized extension, inventory classification or probed container.
file_kindLocalFileKindTrue—Recognized extension, inventory classification or probed container.
Python
to_api_dict() -> JsonObject

LocalFileChangedError

Public exception. Catch the specific type when recovery differs; the base exception covers its subclasses. Optional constructor fields preserve HTTP status, payload or transport evidence as annotated.

LocalHashError

Public exception. Catch the specific type when recovery differs; the base exception covers its subclasses. Optional constructor fields preserve HTTP status, payload or transport evidence as annotated.

LocalPathError

Public exception. Catch the specific type when recovery differs; the base exception covers its subclasses. Optional constructor fields preserve HTTP status, payload or transport evidence as annotated.

LocalProgress

Public client or immutable record. Fields are returned local/realtime evidence, not an instruction to launch work. Public methods below expose its recorded values.

FieldTypeRequiredDeclaration / defaultMeaning
phaseProgressPhaseTrue—Local progress phase and measured item/byte completion; callbacks are synchronous.
pathstr | NoneTrue—Local root, path or POSIX relative path. Scan helpers exclude symlinks; keep paths inside the chosen root.
currentintTrue—Local progress phase and measured item/byte completion; callbacks are synchronous.
totalintTrue—Local progress phase and measured item/byte completion; callbacks are synchronous.
loaded_bytesint | NoneFalseNoneActual file/transfer size or measured byte progress.
total_bytesint | NoneFalseNoneActual file/transfer size or measured byte progress.
Python
percent: float
Python
to_api_dict() -> JsonObject

LocalScanError

Public exception. Catch the specific type when recovery differs; the base exception covers its subclasses. Optional constructor fields preserve HTTP status, payload or transport evidence as annotated.

MediaInventoryItem

Public client or immutable record. Fields are returned local/realtime evidence, not an instruction to launch work. Public methods below expose its recorded values.

FieldTypeRequiredDeclaration / defaultMeaning
pathstrTrue—Local root, path or POSIX relative path. Scan helpers exclude symlinks; keep paths inside the chosen root.
display_namestrTrue—Reader-visible name of this locally observed media item.
size_bytesintTrue—Actual file/transfer size or measured byte progress.
last_modified_msintTrue—Observed filesystem modification time in milliseconds.
mime_typestr | NoneTrue—Detected MIME type; this alone does not establish codec support.
file_fingerprint_hashstr | NoneTrue—Fingerprint/hash measured from the source; observe the record’s fingerprint kind.
duration_secondsfloatTrue—Measured duration in seconds, not a promised processing time.
container_formatstr | NoneTrue—Recognized extension, inventory classification or probed container.
probe_dataJsonObject | NoneTrue—Actual FFprobe container/stream evidence; opaque dictionaries retain the probe’s fields.
streamstuple[ProbeStream, ...]True—Normalized audio/subtitle stream records, with original stream indexes.
statusstrFalse'active'Status filter or new status, as appropriate to the method; archived projects retain saved results.
Python
to_api_dict() -> JsonObject

MediaEmbeddingError

Public exception. Catch the specific type when recovery differs; the base exception covers its subclasses. Optional constructor fields preserve HTTP status, payload or transport evidence as annotated.

MediaExtractionError

Public exception. Catch the specific type when recovery differs; the base exception covers its subclasses. Optional constructor fields preserve HTTP status, payload or transport evidence as annotated.

MediaProbe

Public client or immutable record. Fields are returned local/realtime evidence, not an instruction to launch work. Public methods below expose its recorded values.

FieldTypeRequiredDeclaration / defaultMeaning
duration_secondsfloatTrue—Measured duration in seconds, not a promised processing time.
has_audioboolTrue—Whether this observed stream/source can be selected or contains audio.
streamstuple[ProbeStream, ...]True—Normalized audio/subtitle stream records, with original stream indexes.
formatJsonObjectTrue—Actual FFprobe container/stream evidence; opaque dictionaries retain the probe’s fields.
raw_streamstuple[JsonObject, ...]True—Actual FFprobe container/stream evidence; opaque dictionaries retain the probe’s fields.
Python
to_api_dict() -> JsonObject

MediaProbeError

Public exception. Catch the specific type when recovery differs; the base exception covers its subclasses. Optional constructor fields preserve HTTP status, payload or transport evidence as annotated.

MuxedMedia

Public client or immutable record. Fields are returned local/realtime evidence, not an instruction to launch work. Public methods below expose its recorded values.

FieldTypeRequiredDeclaration / defaultMeaning
pathPathTrue—Local root, path or POSIX relative path. Scan helpers exclude symlinks; keep paths inside the chosen root.
size_bytesintTrue—Actual file/transfer size or measured byte progress.
last_modified_msintTrue—Observed filesystem modification time in milliseconds.
Python
to_api_dict() -> JsonObject

ProbeStream

Public client or immutable record. Fields are returned local/realtime evidence, not an instruction to launch work. Public methods below expose its recorded values.

FieldTypeRequiredDeclaration / defaultMeaning
stream_indexint | NoneTrue—FFprobe stream index or explicit indexes to replace, not the order in a filtered list.
stream_typestrTrue—Actual stream codec or subtitle classification, independently of import recognition.
stream_classStreamClassTrue—Normal, or any combination of Commentary, Forced and SDH.
codec_typestrTrue—Actual stream codec or subtitle classification, independently of import recognition.
codec_namestr | NoneTrue—Actual stream codec or subtitle classification, independently of import recognition.
languagestr | NoneTrue—Subtitle language or normal/Forced/SDH/Commentary classification; technical language codes remain unchanged.
tagsJsonObject | NoneTrue—Current stream metadata and physical evidence used by observation guards.
dispositionJsonObject | NoneTrue—Current stream metadata and physical evidence used by observation guards.
selectableboolFalseTrueWhether this observed stream/source can be selected or contains audio.
language_text_samplestr | NoneFalseNoneBounded real subtitle text used as language evidence.
sidecar_pathstr | NoneFalseNoneObserved companion-file identity and evidence; preserve the matching file pair.
sidecar_display_namestr | NoneFalseNoneObserved companion-file identity and evidence; preserve the matching file pair.
sidecar_size_bytesint | NoneFalseNoneObserved companion-file identity and evidence; preserve the matching file pair.
sidecar_last_modified_msint | NoneFalseNoneObserved companion-file identity and evidence; preserve the matching file pair.
sidecar_content_hashstr | NoneFalseNoneObserved companion-file identity and evidence; preserve the matching file pair.
source_observationJsonObject | NoneFalseNoneCurrent stream metadata and physical evidence used by observation guards.
text_contentstr | NoneFalseNoneComplete subtitle text stored by file projects; None for other streams.
Python
to_api_dict() -> JsonObject

SUBTITLE_EXTENSIONS

Public constant or type alias. The value below comes from source; identifiers and units retain their technical meaning.

Python
SUBTITLE_EXTENSIONS = frozenset({'srt', 'vtt', 'ass'})

ScanResult

Public client or immutable record. Fields are returned local/realtime evidence, not an instruction to launch work. Public methods below expose its recorded values.

FieldTypeRequiredDeclaration / defaultMeaning
filestuple[LocalFile, ...]True—Complete directory snapshot, file list or observation evidence required by this endpoint; build it from local files.
failurestuple[LocalFailure, ...]True—Recorded per-item failures; this list does not make a partial inventory safe to submit.
Python
to_api_dict() -> JsonObject

SubftLocalError

Public exception. Catch the specific type when recovery differs; the base exception covers its subclasses. Optional constructor fields preserve HTTP status, payload or transport evidence as annotated.

SubtitleMuxInput

Public client or immutable record. Fields are returned local/realtime evidence, not an instruction to launch work. Public methods below expose its recorded values.

FieldTypeRequiredDeclaration / defaultMeaning
pathPathTrue—Local root, path or POSIX relative path. Scan helpers exclude symlinks; keep paths inside the chosen root.
languagestr | NoneFalseNoneSubtitle language or normal/Forced/SDH/Commentary classification; technical language codes remain unchanged.
stream_classStreamClassFalse'normal'Normal, or any combination of Commentary, Forced and SDH.

VIDEO_EXTENSIONS

Public constant or type alias. The value below comes from source; identifiers and units retain their technical meaning.

Python
VIDEO_EXTENSIONS = frozenset({'mp4', 'mkv', 'avi', 'mov', 'webm'})

VOBSUB_EXTENSIONS

Public constant or type alias. The value below comes from source; identifiers and units retain their technical meaning.

Python
VOBSUB_EXTENSIONS = frozenset({'idx', 'sub'})

build_directory_snapshot

Build complete files, fingerprints and bounded language samples for directory reconciliation.

Python
build_directory_snapshot(
    source: FileCollection,
    *,
    include_hidden: bool = False,
    hash_media_paths: Iterable[str | os.PathLike[str]] = (),
    include_text_samples: bool = False,
    on_progress: ProgressCallback | None = None
) -> DirectorySnapshotResult
ParameterTypePassingDefaultMeaning
sourceFileCollectionpositional-or-keyword—Existing local source file, LocalFile record or file collection as annotated; inspect failures before submitting inventory.
include_hiddenboolkeyword-onlyFalseInclude dot-prefixed files/directories when True; symlinks remain excluded.
hash_media_pathsIterable[str | os.PathLike[str]]keyword-only()Relative media paths whose fingerprints are needed for this directory snapshot.
include_text_samplesboolkeyword-onlyFalseInclude bounded subtitle language samples, or set their maximum source-byte count.
on_progressProgressCallback | Nonekeyword-onlyNoneSynchronous callback receiving LocalProgress. Raising cancels work; callback errors propagate.

build_inventory

Inspect scanned media into API-ready inventory; any recorded failure must be handled before submission.

Python
build_inventory(
    source: FileCollection,
    *,
    include_hidden: bool = False,
    ffprobe_executable: str = 'ffprobe',
    probe_timeout: float = 30.0,
    on_progress: ProgressCallback | None = None
) -> InventoryResult
ParameterTypePassingDefaultMeaning
sourceFileCollectionpositional-or-keyword—Existing local source file, LocalFile record or file collection as annotated; inspect failures before submitting inventory.
include_hiddenboolkeyword-onlyFalseInclude dot-prefixed files/directories when True; symlinks remain excluded.
ffprobe_executablestrkeyword-only'ffprobe'System executable name or path; installing the Python extra does not install these binaries.
probe_timeoutfloatkeyword-only30.0Timeout in seconds; inspect the signature for the specific request, probe or subscription default.
on_progressProgressCallback | Nonekeyword-onlyNoneSynchronous callback receiving LocalProgress. Raising cancels work; callback errors propagate.

check_ffmpeg_tools

Return tool availability without requiring all tools to exist.

Python
check_ffmpeg_tools(
    *,
    ffmpeg_executable: str = 'ffmpeg',
    ffprobe_executable: str = 'ffprobe',
    timeout: float = 5.0
) -> FfmpegTools
ParameterTypePassingDefaultMeaning
ffmpeg_executablestrkeyword-only'ffmpeg'System executable name or path; installing the Python extra does not install these binaries.
ffprobe_executablestrkeyword-only'ffprobe'System executable name or path; installing the Python extra does not install these binaries.
timeoutfloatkeyword-only5.0Timeout in seconds; inspect the signature for the specific request, probe or subscription default.

count_pgs_images

Count graphical subtitle images from the real source; paired VobSub input requires both files.

Python
count_pgs_images(content: bytes) -> int
ParameterTypePassingDefaultMeaning
contentbytespositional-or-keyword—Raw bytes or an iterable of byte chunks. For uploads use the prepared file.

count_vobsub_images

Count graphical subtitle images from the real source; paired VobSub input requires both files.

Python
count_vobsub_images(text: str) -> int
ParameterTypePassingDefaultMeaning
textstrpositional-or-keyword—Actual subtitle text or its format (SRT/VTT/ASS); metrics normalize formatting instead of counting raw file bytes.

embed_subtitle_tracks

Write a caller-owned muxed output, preserving unrelated streams; installation and registration are separate.

Python
embed_subtitle_tracks(
    source: LocalSource,
    subtitles: Iterable[SubtitleMuxInput],
    output_path: str | os.PathLike[str],
    *,
    ffmpeg_executable: str = 'ffmpeg',
    ffprobe_executable: str = 'ffprobe',
    timeout: float = 1800.0,
    on_progress: ProgressCallback | None = None,
    replace_stream_indexes: Iterable[int] = ()
) -> MuxedMedia
ParameterTypePassingDefaultMeaning
sourceLocalSourcepositional-or-keyword—Existing local source file, LocalFile record or file collection as annotated; inspect failures before submitting inventory.
subtitlesIterable[SubtitleMuxInput]positional-or-keyword—SubtitleMuxInput records naming real SRT files, languages and stream classes to add.
output_pathstr | os.PathLike[str]positional-or-keyword—Caller-owned new output path. Extraction/mux helpers do not replace the original or register backend assets.
ffmpeg_executablestrkeyword-only'ffmpeg'System executable name or path; installing the Python extra does not install these binaries.
ffprobe_executablestrkeyword-only'ffprobe'System executable name or path; installing the Python extra does not install these binaries.
timeoutfloatkeyword-only1800.0Timeout in seconds; inspect the signature for the specific request, probe or subscription default.
on_progressProgressCallback | Nonekeyword-onlyNoneSynchronous callback receiving LocalProgress. Raising cancels work; callback errors propagate.
replace_stream_indexesIterable[int]keyword-only()FFprobe stream index or explicit indexes to replace, not the order in a filtered list.

extract_audio_stream

Extract one selected audio stream as MP3 without changing the original.

Python
extract_audio_stream(
    source: LocalSource,
    stream_index: int,
    output_path: str | os.PathLike[str],
    *,
    ffmpeg_executable: str = 'ffmpeg',
    timeout: float = 1800.0,
    on_progress: ProgressCallback | None = None
) -> ExtractedFile
ParameterTypePassingDefaultMeaning
sourceLocalSourcepositional-or-keyword—Existing local source file, LocalFile record or file collection as annotated; inspect failures before submitting inventory.
stream_indexintpositional-or-keyword—FFprobe stream index or explicit indexes to replace, not the order in a filtered list.
output_pathstr | os.PathLike[str]positional-or-keyword—Caller-owned new output path. Extraction/mux helpers do not replace the original or register backend assets.
ffmpeg_executablestrkeyword-only'ffmpeg'System executable name or path; installing the Python extra does not install these binaries.
timeoutfloatkeyword-only1800.0Timeout in seconds; inspect the signature for the specific request, probe or subscription default.
on_progressProgressCallback | Nonekeyword-onlyNoneSynchronous callback receiving LocalProgress. Raising cancels work; callback errors propagate.

extract_subtitle_stream

Extract text as SRT or copy graphical subtitles to Matroska; the caller owns cleanup.

Python
extract_subtitle_stream(
    source: LocalSource,
    stream_index: int,
    output_path: str | os.PathLike[str],
    *,
    graphical: bool = False,
    source_format: str = 'srt',
    ffmpeg_executable: str = 'ffmpeg',
    timeout: float = 1800.0,
    on_progress: ProgressCallback | None = None
) -> ExtractedFile
ParameterTypePassingDefaultMeaning
sourceLocalSourcepositional-or-keyword—Existing local source file, LocalFile record or file collection as annotated; inspect failures before submitting inventory.
stream_indexintpositional-or-keyword—FFprobe stream index or explicit indexes to replace, not the order in a filtered list.
output_pathstr | os.PathLike[str]positional-or-keyword—Caller-owned new output path. Extraction/mux helpers do not replace the original or register backend assets.
graphicalboolkeyword-onlyFalseWhether extraction copies a graphical subtitle stream into Matroska rather than producing SRT.
source_formatstrkeyword-only'srt'Actual subtitle text or its format (SRT/VTT/ASS); metrics normalize formatting instead of counting raw file bytes.
ffmpeg_executablestrkeyword-only'ffmpeg'System executable name or path; installing the Python extra does not install these binaries.
timeoutfloatkeyword-only1800.0Timeout in seconds; inspect the signature for the specific request, probe or subscription default.
on_progressProgressCallback | Nonekeyword-onlyNoneSynchronous callback receiving LocalProgress. Raising cancels work; callback errors propagate.

fingerprint_media_file

Compute the compatible full or partial media fingerprint and reject source mutation.

Python
fingerprint_media_file(
    source: LocalSource,
    *,
    chunk_size: int = DEFAULT_HASH_CHUNK_SIZE,
    on_progress: ProgressCallback | None = None
) -> FileFingerprint
ParameterTypePassingDefaultMeaning
sourceLocalSourcepositional-or-keyword—Existing local source file, LocalFile record or file collection as annotated; inspect failures before submitting inventory.
chunk_sizeintkeyword-onlyDEFAULT_HASH_CHUNK_SIZEPositive number of bytes read per hashing chunk; preserve the default for compatible partial fingerprints.
on_progressProgressCallback | Nonekeyword-onlyNoneSynchronous callback receiving LocalProgress. Raising cancels work; callback errors propagate.

hash_file_sha256

Stream all bytes into a SHA-256 FileFingerprint; read its hash field for API requests.

Python
hash_file_sha256(
    source: LocalSource,
    *,
    chunk_size: int = DEFAULT_HASH_CHUNK_SIZE,
    on_progress: ProgressCallback | None = None
) -> FileFingerprint
ParameterTypePassingDefaultMeaning
sourceLocalSourcepositional-or-keyword—Existing local source file, LocalFile record or file collection as annotated; inspect failures before submitting inventory.
chunk_sizeintkeyword-onlyDEFAULT_HASH_CHUNK_SIZEPositive number of bytes read per hashing chunk; preserve the default for compatible partial fingerprints.
on_progressProgressCallback | Nonekeyword-onlyNoneSynchronous callback receiving LocalProgress. Raising cancels work; callback errors propagate.

hash_text_subtitle

Hash subtitle text after newline and surrounding-whitespace normalization.

Python
hash_text_subtitle(source: LocalSource) -> FileFingerprint
ParameterTypePassingDefaultMeaning
sourceLocalSourcepositional-or-keyword—Existing local source file, LocalFile record or file collection as annotated; inspect failures before submitting inventory.

inspect_media

Inspect one supported file and return actual probe evidence and source observations.

Python
inspect_media(
    source: LocalFile | str | os.PathLike[str],
    *,
    relative_path: str | None = None,
    ffprobe_executable: str = 'ffprobe',
    probe_timeout: float = 30.0,
    on_progress: ProgressCallback | None = None,
    file_project: bool = False
) -> MediaInventoryItem
ParameterTypePassingDefaultMeaning
sourceLocalFile | str | os.PathLike[str]positional-or-keyword—Existing local source file, LocalFile record or file collection as annotated; inspect failures before submitting inventory.
relative_pathstr | Nonekeyword-onlyNoneLocal root, path or POSIX relative path. Scan helpers exclude symlinks; keep paths inside the chosen root.
ffprobe_executablestrkeyword-only'ffprobe'System executable name or path; installing the Python extra does not install these binaries.
probe_timeoutfloatkeyword-only30.0Timeout in seconds; inspect the signature for the specific request, probe or subscription default.
on_progressProgressCallback | Nonekeyword-onlyNoneSynchronous callback receiving LocalProgress. Raising cancels work; callback errors propagate.
file_projectboolkeyword-onlyFalseApply file-project rules: include complete subtitle text and reject graphical subtitle files.

pgs_duration_seconds

Derive subtitle duration in seconds from actual cue/image timing.

Python
pgs_duration_seconds(content: bytes) -> float
ParameterTypePassingDefaultMeaning
contentbytespositional-or-keyword—Raw bytes or an iterable of byte chunks. For uploads use the prepared file.

probe_media

Read FFprobe duration, streams and container evidence without modifying the file.

Python
probe_media(
    source: LocalSource,
    *,
    ffprobe_executable: str = 'ffprobe',
    timeout: float = 30.0
) -> MediaProbe
ParameterTypePassingDefaultMeaning
sourceLocalSourcepositional-or-keyword—Existing local source file, LocalFile record or file collection as annotated; inspect failures before submitting inventory.
ffprobe_executablestrkeyword-only'ffprobe'System executable name or path; installing the Python extra does not install these binaries.
timeoutfloatkeyword-only30.0Timeout in seconds; inspect the signature for the specific request, probe or subscription default.

read_subtitle_language_sample

Read a bounded source-text sample for language classification.

Python
read_subtitle_language_sample(
    source: LocalSource, *, max_bytes: int = LANGUAGE_SAMPLE_BYTES
) -> str | None
ParameterTypePassingDefaultMeaning
sourceLocalSourcepositional-or-keyword—Existing local source file, LocalFile record or file collection as annotated; inspect failures before submitting inventory.
max_bytesintkeyword-onlyLANGUAGE_SAMPLE_BYTESInclude bounded subtitle language samples, or set their maximum source-byte count.

require_ffmpeg_tools

Require the selected tools and raise FfmpegUnavailableError if prerequisites are absent.

Python
require_ffmpeg_tools(
    *,
    ffmpeg_executable: str = 'ffmpeg',
    ffprobe_executable: str = 'ffprobe',
    timeout: float = 5.0,
    require_ffmpeg: bool = True,
    require_ffprobe: bool = True
) -> FfmpegTools
ParameterTypePassingDefaultMeaning
ffmpeg_executablestrkeyword-only'ffmpeg'System executable name or path; installing the Python extra does not install these binaries.
ffprobe_executablestrkeyword-only'ffprobe'System executable name or path; installing the Python extra does not install these binaries.
timeoutfloatkeyword-only5.0Timeout in seconds; inspect the signature for the specific request, probe or subscription default.
require_ffmpegboolkeyword-onlyTrueWhether this tool check requires the corresponding executable to be available.
require_ffprobeboolkeyword-onlyTrueWhether this tool check requires the corresponding executable to be available.

scan_directory

Scan deterministically, skip symlinks and record per-path failures.

Python
scan_directory(
    root: str | os.PathLike[str],
    *,
    include_hidden: bool = False,
    on_progress: ProgressCallback | None = None
) -> ScanResult
ParameterTypePassingDefaultMeaning
rootstr | os.PathLike[str]positional-or-keyword—Local root, path or POSIX relative path. Scan helpers exclude symlinks; keep paths inside the chosen root.
include_hiddenboolkeyword-onlyFalseInclude dot-prefixed files/directories when True; symlinks remain excluded.
on_progressProgressCallback | Nonekeyword-onlyNoneSynchronous callback receiving LocalProgress. Raising cancels work; callback errors propagate.

subtitle_duration_seconds

Derive subtitle duration in seconds from actual cue/image timing.

Python
subtitle_duration_seconds(
    text: str, format_hint: str | None = None
) -> float
ParameterTypePassingDefaultMeaning
textstrpositional-or-keyword—Actual subtitle text or its format (SRT/VTT/ASS); metrics normalize formatting instead of counting raw file bytes.
format_hintstr | Nonepositional-or-keywordNoneActual subtitle text or its format (SRT/VTT/ASS); metrics normalize formatting instead of counting raw file bytes.

vobsub_duration_seconds

Derive subtitle duration in seconds from actual cue/image timing.

Python
vobsub_duration_seconds(text: str) -> float
ParameterTypePassingDefaultMeaning
textstrpositional-or-keyword—Actual subtitle text or its format (SRT/VTT/ASS); metrics normalize formatting instead of counting raw file bytes.

vobsub_pair_hash

Combine matching IDX/SUB fingerprints in the documented deterministic order.

Python
vobsub_pair_hash(idx_hash: str, sub_hash: str) -> str
ParameterTypePassingDefaultMeaning
idx_hashstrpositional-or-keyword—Hashes of the real matching IDX and SUB files, used to form a stable paired-source hash.
sub_hashstrpositional-or-keyword—Hashes of the real matching IDX and SUB files, used to form a stable paired-source hash.

visible_subtitle_character_count

Count visible subtitle characters using the billing normalization rules.

Python
visible_subtitle_character_count(
    text: str, format_hint: str | None = None
) -> int
ParameterTypePassingDefaultMeaning
textstrpositional-or-keyword—Actual subtitle text or its format (SRT/VTT/ASS); metrics normalize formatting instead of counting raw file bytes.
format_hintstr | Nonepositional-or-keywordNoneActual subtitle text or its format (SRT/VTT/ASS); metrics normalize formatting instead of counting raw file bytes.

Realtime helpers and records

Import from subft_client.realtime. Local functions need the local extra and the selected system tools. Inspect returned failures before updating backend inventory. Realtime needs its extra and performs no canonical HTTP reconciliation.

OperationEvent

Public client or immutable record. Fields are returned local/realtime evidence, not an instruction to launch work. Public methods below expose its recorded values.

FieldTypeRequiredDeclaration / defaultMeaning
eventstrTrue—Realtime event/connection data; fetch canonical HTTP state before deciding the outcome.
operation_idstrTrue—ID of the committed operation; retain it before leaving or retrying preparation.
content_idstr | NoneTrue—One source item inside an operation, not a project-media or artifact ID.
session_idstr | NoneTrue—Realtime event/connection data; fetch canonical HTTP state before deciding the outcome.
statusstr | NoneTrue—Status filter or new status, as appropriate to the method; archived projects retain saved results.
payloadMapping[str, Any]True—Endpoint-specific request mapping. Use its schema and preserve required observation or preparation guards.

RealtimeConnectionState

Public client or immutable record. Fields are returned local/realtime evidence, not an instruction to launch work. Public methods below expose its recorded values.

FieldTypeRequiredDeclaration / defaultMeaning
statusConnectionStatusTrue—Status filter or new status, as appropriate to the method; archived projects retain saved results.
attemptintTrue—Realtime event/connection data; fetch canonical HTTP state before deciding the outcome.
reconnectedboolTrue—Whether the event follows a successful reconnect; fetch canonical state again.
reasonstr | NoneFalseNoneTechnical reason for this connection state; use canonical HTTP state to decide recovery.

RealtimeDependencyError

Public exception. Catch the specific type when recovery differs; the base exception covers its subclasses. Optional constructor fields preserve HTTP status, payload or transport evidence as annotated.

RealtimeProtocolError

Public exception. Catch the specific type when recovery differs; the base exception covers its subclasses. Optional constructor fields preserve HTTP status, payload or transport evidence as annotated.

RealtimeSubscriptionError

Python
RealtimeSubscriptionError(code: str='request_failed', params: Mapping[str, Any] | None=None)

Realtime subscription rejections use event: "failed" with a {code, params} descriptor in payload.error. RealtimeSubscriptionError exposes code and params; diagnostic text is not a presentation contract.

Public exception. Catch the specific type when recovery differs; the base exception covers its subclasses. Optional constructor fields preserve HTTP status, payload or transport evidence as annotated.

SubftRealtimeError

Public exception. Catch the specific type when recovery differs; the base exception covers its subclasses. Optional constructor fields preserve HTTP status, payload or transport evidence as annotated.

watch_operation_events

Yield operation events and connection changes with reconnect/backoff; canonical HTTP reconciliation remains the caller’s responsibility.

Python
watch_operation_events(
    base_url: str,
    operation_id: str,
    *,
    token: str,
    heartbeat_interval: float = DEFAULT_HEARTBEAT_INTERVAL,
    pong_timeout: float = DEFAULT_PONG_TIMEOUT,
    subscribe_timeout: float = DEFAULT_SUBSCRIBE_TIMEOUT,
    reconnect_initial_delay: float = DEFAULT_RECONNECT_INITIAL_DELAY,
    reconnect_max_delay: float = DEFAULT_RECONNECT_MAX_DELAY,
    _sleep: Callable[[float], Awaitable[None]] = asyncio.sleep
) -> AsyncGenerator[RealtimeMessage, None]
ParameterTypePassingDefaultMeaning
base_urlstrpositional-or-keyword—Gateway URL serving API, authentication and realtime routes; a trailing slash is normalized.
operation_idstrpositional-or-keyword—ID of the committed operation; retain it before leaving or retrying preparation.
tokenstrkeyword-only—API token from Developer access. Keep it in a protected environment variable.
heartbeat_intervalfloatkeyword-onlyDEFAULT_HEARTBEAT_INTERVALHeartbeat, pong or reconnect interval in seconds; reconnect uses capped backoff.
pong_timeoutfloatkeyword-onlyDEFAULT_PONG_TIMEOUTHeartbeat, pong or reconnect interval in seconds; reconnect uses capped backoff.
subscribe_timeoutfloatkeyword-onlyDEFAULT_SUBSCRIBE_TIMEOUTTimeout in seconds; inspect the signature for the specific request, probe or subscription default.
reconnect_initial_delayfloatkeyword-onlyDEFAULT_RECONNECT_INITIAL_DELAYHeartbeat, pong or reconnect interval in seconds; reconnect uses capped backoff.
reconnect_max_delayfloatkeyword-onlyDEFAULT_RECONNECT_MAX_DELAYHeartbeat, pong or reconnect interval in seconds; reconnect uses capped backoff.
_sleepCallable[[float], Awaitable[None]]keyword-onlyasyncio.sleepOptional async sleep implementation for deterministic tests; ordinary integrations retain the default.

Request and response schemas

The tables reproduce declared fields, including inherited fields. Required uses True/False. A dash means no default declaration; Field(...) records actual Pydantic defaults and constraints. Nullable fields can still be required. Named types describe nested records; dict[str, Any] is deliberately open, not an invented exhaustive schema. Upload targets additionally return upload_id, operation_id, media_id, content_id, upload_url, method, headers, expires_at and optional sidecar; preserve their identity, expiry and method. The worked recipe validates the fields it consumes.

AssetSelection

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
media_idstrTrueField(max_length=64)Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
asset_idstrTrueField(max_length=64)ID of the selected subtitle/audio asset owned by its media.
source_languagestrTrueField(max_length=32)Canonical source language captured with the guarded selection.
expected_snapshot_idstr | NoneFalseField(default=None, max_length=64)Current immutable snapshot or physical check generation used to pin the source.
expected_autosave_versionint | NoneFalseNoneCurrent observation/generation/save guards from the relevant read or begin-check response; stale guards require a fresh read.
expected_observationSourceObservation | NoneFalseNonePhysical files and stream evidence that must still match at commit.
check_generationint | NoneFalseNoneCurrent immutable snapshot or physical check generation used to pin the source.

CapturedExport

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
asset_idstrTrueField(max_length=64)ID of the selected subtitle/audio asset owned by its media.
snapshot_idstrTrueField(max_length=64)Producing/result asset and immutable snapshot lineage; preserve these identities across export.
autosave_versionint | NoneTrue—Current editable save version used to detect concurrent edits.
effective_metadataEffectiveMetadataTrue—Captured container language or effective language/classification for the output.
container_languagestrTrueField(max_length=32)Captured container language or effective language/classification for the output.
formatLiteral['srt', 'vtt', 'ass']True—Actual FFprobe container/stream evidence; opaque dictionaries retain the probe’s fields.
optionsExportOptionsFalseField(default_factory=ExportOptions)Export destination identity or endpoint-specific export options.
mime_typestrTrueField(max_length=255)Detected MIME type; this alone does not establish codec support.
suggested_pathstrTrueField(max_length=2048)Frozen export metadata, backend-suggested relative filename or actual serialized subtitle text.
serializer_versionintTrue—Version of the parser or export serializer used for the captured document.
parser_versionintTrue—Version of the parser or export serializer used for the captured document.
text_contentstrTrueField(max_length=20000000)Frozen export metadata, backend-suggested relative filename or actual serialized subtitle text.

CommittedSource

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

Value under source_ref_map keyed as project-media-ID:asset-ID. Use its runtime media_id/content_id for preparation and upload; plans identify sources with source_ref.

FieldTypeRequiredDeclaration / defaultMeaning
media_idstrTrue—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
content_idstrTrue—One source item inside an operation, not a project-media or artifact ID.
project_media_idstrTrue—Operation/project media relationship and the recorded relative media path.

ContentFlow

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
statusstrTrue—Status filter or new status, as appropriate to the method; archived projects retain saved results.
stepstrTrue—Machine-readable execution step; use the enclosing flow/progress type and its enumerated values.
execution_countintTrue—Number of execution attempts recorded for this source flow.
failure_codestr | NoneTrue—Nullable machine-readable failure code; map it to localized user text.
failure_classstr | NoneTrue—Nullable machine classification of the failure, separate from failure_code.
runnable_atstr | NoneTrue—Nullable timestamp at which this flow becomes eligible for execution.

ContentPreparation

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

Canonical preparation has states awaiting_client, preparing, hashing, uploading, awaiting_retry, ready, abandoned and not_required. attempt_id and lease/upload expiry may be null. allowed_actions contains only currently eligible start_preparation, retry_preparation or abandon_source. Retry requires the previous attempt_id and a fresh UUID; ready and terminal work must not be resupplied blindly.

FieldTypeRequiredDeclaration / defaultMeaning
statestrTrue—State of this record; preparation states and operation states are distinguished in the enclosing schema explanation.
attempt_idstr | NoneTrue—A fresh UUID chosen by the caller and confirmed by the preparation response; use it for every request of that attempt.
attempt_numberintTrue—Preparation attempt revision, failure code or expiry; expired attempts/targets require canonical recovery.
client_progress_revisionintTrue—Increasing revision of accepted client progress within the current attempt.
failure_codestr | NoneTrue—Nullable machine-readable failure code; map it to localized user text.
updated_atstr | NoneTrue—Recorded server timestamp; a nullable value means the event has not occurred or is unavailable.
lease_expires_atstr | NoneTrue—Nullable ISO expiry for the preparation lease or issued upload target.
upload_expires_atstr | NoneTrue—Nullable ISO expiry for the preparation lease or issued upload target.
allowed_actionstuple[str, ...]True—Actions currently permitted by the canonical state, not a promise for later requests.

ContentPreparationResponse

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

This is the nested preparation snapshot, not operation execution_state. The preparation endpoint wraps it with operation_id, content_id and progress. Its state is preparing after an accepted start/retry; verify the echoed attempt_id. media_id comes from the route/source_ref_map, not this response wrapper.

FieldTypeRequiredDeclaration / defaultMeaning
stateLiteral['awaiting_client', 'preparing', 'hashing', 'uploading', 'awaiting_retry', 'ready', 'abandoned', 'not_required']True—State of this record; preparation states and operation states are distinguished in the enclosing schema explanation.
attempt_idstr | NoneFalseNoneA fresh UUID chosen by the caller and confirmed by the preparation response; use it for every request of that attempt.
attempt_numberintTrue—Preparation attempt revision, failure code or expiry; expired attempts/targets require canonical recovery.
client_progress_revisionintTrue—Increasing revision of accepted client progress within the current attempt.
failure_codestr | NoneFalseNoneNullable machine-readable failure code; map it to localized user text.
updated_atstr | NoneFalseNoneRecorded server timestamp; a nullable value means the event has not occurred or is unavailable.
lease_expires_atstr | NoneFalseNoneNullable ISO expiry for the preparation lease or issued upload target.
upload_expires_atstr | NoneFalseNoneNullable ISO expiry for the preparation lease or issued upload target.
allowed_actionslist[Literal['start_preparation', 'retry_preparation', 'abandon_source']]True—Actions currently permitted by the canonical state, not a promise for later requests.

ContentProgress

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
versionintTrue—Progress schema version, currently 4; reject unsupported versions rather than guessing their structure.
revisionintTrue—Increasing canonical progress revision; reconcile stale events with HTTP state.
statusProgressStatusTrue—Status filter or new status, as appropriate to the method; archived projects retain saved results.
phase_plantuple[str, ...]True—Ordered phases in the admitted workflow; absent stages are not implied work.
current_phasestr | NoneTrue—Nullable active phase or step. A terminal snapshot can have no active phase/step.
current_step_namestr | NoneTrue—Machine-readable execution step; use the enclosing flow/progress type and its enumerated values.
active_work_unitsintTrue—Number of work units currently active in this step, phase or snapshot.
countsMapping[str, int]True—Nested workflow phase counts: total, resolved, completed, skipped and failed.
phasesMapping[str, ProgressPhase]True—Nested per-phase or per-step records keyed by the corresponding enum value; inspect their status and measurements.

CreditEstimate

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
required_creditsintTrue—Credit quote or admission decision from the current estimate; inspect the enclosing field type.
available_creditsintTrue—Credit quote or admission decision from the current estimate; inspect the enclosing field type.
shortfallintTrue—Credit quote or admission decision from the current estimate; inspect the enclosing field type.
missing_metricsintTrue—Number of required source metrics still absent; must be zero before committing.
can_commitboolTrue—Credit quote or admission decision from the current estimate; inspect the enclosing field type.
contentstuple[CreditEstimateContent, ...]True—Nested source items or per-source estimate rows, according to the enclosing record.

CreditEstimateContent

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
source_refSourceRefTrue—Stable pair of project media ID and selected asset ID; runtime content IDs are different.
media_pathstrTrue—Operation/project media relationship and the recorded relative media path.
typeContentTypeTrue—Source category text, audio or graphical; it determines the requested metrics and stages.
stream_classstrTrue—Normal, or any combination of Commentary, Forced and SDH.
stream_indexint | NoneTrue—FFprobe stream index or explicit indexes to replace, not the order in a filtered list.
character_countint | NoneTrue—Measured visible characters or graphical images requested by the plan; never substitute guessed counts.
image_countint | NoneTrue—Measured visible characters or graphical images requested by the plan; never substitute guessed counts.
duration_secondsfloat | NoneTrue—Measured duration in seconds, not a promised processing time.
creditsint | NoneTrue—Credits quoted for this source.

EffectiveMetadata

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
languagestrFalseField(default='und', max_length=32)Subtitle language or normal/Forced/SDH/Commentary classification; technical language codes remain unchanged.
classificationtuple[Disposition, ...] | NoneFalseField(default=None, max_length=16)Subtitle language or normal/Forced/SDH/Commentary classification; technical language codes remain unchanged.

ExportOptions

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FileObservation

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
roleLiteral['primary', 'index', 'data']False'primary'Physical-file role, observed fingerprint or stream descriptor used for guarded checks.
size_bytesStrictIntTrueField(ge=0)Actual file/transfer size or measured byte progress.
last_modified_msStrictIntTrue—Observed filesystem modification time in milliseconds.
sampled_fingerprintstr | NoneFalseField(default=None, max_length=128)Physical-file role, observed fingerprint or stream descriptor used for guarded checks.

OperationBaseResponse

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

execution_state is pending/running/finished. outcome is null until finished, then succeeded/partially_succeeded/failed/canceled. display_status is the state or terminal outcome. Counts summarize the enabled contents; state_version and event_sequence order observations. Every operation has committed_at and charged_credits; transient plans have no charge. media is open in this response declaration; the parser records below describe the consumed nested fields.

FieldTypeRequiredDeclaration / defaultMeaning
operation_idstrTrue—ID of the committed operation; retain it before leaving or retrying preparation.
project_idstr | NoneFalseNoneID of the durable project, returned when creating or listing projects.
kindstrTrue—Endpoint-specific asset kind, check scope, readiness or placement selector; follow that endpoint’s contract.
target_languagestr | NoneFalseNoneTarget language code for generated or translated subtitles.
execution_stateLiteral['pending', 'running', 'finished']True—Canonical lifecycle field: execution, terminal outcome, display or monotonic revision/sequence.
outcomeLiteral['succeeded', 'partially_succeeded', 'failed', 'canceled'] | NoneTrue—Canonical lifecycle field: execution, terminal outcome, display or monotonic revision/sequence.
display_statusLiteral['pending', 'running', 'succeeded', 'partially_succeeded', 'failed', 'canceled']True—Canonical lifecycle field: execution, terminal outcome, display or monotonic revision/sequence.
state_versionintTrue—Canonical lifecycle field: execution, terminal outcome, display or monotonic revision/sequence.
event_sequenceintTrue—Canonical lifecycle field: execution, terminal outcome, display or monotonic revision/sequence.
phase_countsWorkflowPhaseCountsTrue—Nested workflow and count projections; see the named schema rather than treating them as a status string.
content_countsOperationLifecycleContentCountsResponseTrue—Nested workflow and count projections; see the named schema rather than treating them as a status string.
preparation_countsOperationPreparationCountsResponseTrue—Nested workflow and count projections; see the named schema rather than treating them as a status string.
allowed_actionslist[Literal['abort']]True—Actions currently permitted by the canonical state, not a promise for later requests.
started_atstr | NoneFalseNoneRecorded server timestamp; a nullable value means the event has not occurred or is unavailable.
finished_atstr | NoneFalseNoneRecorded server timestamp; a nullable value means the event has not occurred or is unavailable.
updated_atstr | NoneFalseNoneRecorded server timestamp; a nullable value means the event has not occurred or is unavailable.
created_atstr | NoneFalseNoneRecorded server timestamp; a nullable value means the event has not occurred or is unavailable.
committed_atstrTrue—Required server timestamp recorded when the operation was committed.
charged_creditsintTrue—Credits deducted when the work started.
charged_atstr | NoneFalseNoneRecorded server timestamp; a nullable value means the event has not occurred or is unavailable.
refunded_creditsintTrue—Credits returned later for eligible stages or sources.
used_creditsintTrue—Charged credits minus refunded credits, never below zero.
workflowOperationWorkflowSummaryResponseFalseField(default_factory=OperationWorkflowSummaryResponse)Nested workflow and count projections; see the named schema rather than treating them as a status string.

OperationContent

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

Nested source item as normalized by the CLI parser. source_ref contains project media_id and asset_id. asset_input.selection carries server-issued AssetSelection guards unchanged. preparation is described below; flow can be null. progress is version 4, not a completion percentage. Optional/null annotations in these parser records describe normalized values, not an exhaustive HTTP validation model.

FieldTypeRequiredDeclaration / defaultMeaning
source_refSourceRefTrue—Stable pair of project media ID and selected asset ID; runtime content IDs are different.
enabledboolTrue—Source inclusion or explicit language override in the current plan.
typeContentTypeTrue—Source category text, audio or graphical; it determines the requested metrics and stages.
stream_classstrTrue—Normal, or any combination of Commentary, Forced and SDH.
codec_typestr | NoneTrue—Actual stream codec or subtitle classification, independently of import recognition.
codec_namestr | NoneTrue—Actual stream codec or subtitle classification, independently of import recognition.
stream_indexint | NoneTrue—FFprobe stream index or explicit indexes to replace, not the order in a filtered list.
filenamestr | NoneTrue—Prepared filename, including its real extension, used to select storage format.
languagestr | NoneTrue—Subtitle language or normal/Forced/SDH/Commentary classification; technical language codes remain unchanged.
language_overridestr | NoneTrue—Source inclusion or explicit language override in the current plan.
workflow_kindstr | NoneTrue—Selected stage workflow and its planning explanation; null when no workflow is selected.
workflow_reasonstr | NoneTrue—Selected stage workflow and its planning explanation; null when no workflow is selected.
input_snapshot_idstr | NoneTrue—Producing/result asset and immutable snapshot lineage; preserve these identities across export.
asset_inputdict[str, Any]True—Server-issued input contract; preserve its selection guards and asset identity.
idstrTrue—Identifier of the returned resource.
statusstrTrue—Status filter or new status, as appropriate to the method; archived projects retain saved results.
preparationContentPreparationTrue—Canonical attempt snapshot, including state, attempt guard and allowed actions.
flowContentFlow | NoneTrue—Nullable canonical flow state: status, step, execution_count, failure_code, failure_class and runnable_at.
failure_codestr | NoneTrue—Nullable machine-readable failure code; map it to localized user text.
progress_updated_atstr | NoneTrue—Nullable timestamp of the latest accepted progress update.
progressContentProgressTrue—Progress version 4 with phase_plan, current phase/step/measurement, phases and revision. It is not a legacy percent value.

OperationLifecycleContentCountsResponse

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
totalintTrue—Local progress phase and measured item/byte completion; callbacks are synchronous.
pendingintTrue—Number of sources in this named lifecycle or preparation state; counts are not percentages.
uploadingintTrue—Number of sources in this named lifecycle or preparation state; counts are not percentages.
processingintTrue—Number of sources in this named lifecycle or preparation state; counts are not percentages.
completedintTrue—Measured units completed, from 0 through total. A measurement cannot exceed its total.
failedintTrue—Number of sources in this named lifecycle or preparation state; counts are not percentages.
skippedintTrue—Number of sources in this named lifecycle or preparation state; counts are not percentages.
terminalintTrue—Number of sources in this named lifecycle or preparation state; counts are not percentages.

OperationMedia

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

Nested operation media. id is the runtime media ID, while project_media_id is its durable project destination. contents is a JSON array on the wire and a tuple in this CLI parser record. Disabled items must not be supplied.

FieldTypeRequiredDeclaration / defaultMeaning
idstrTrue—Identifier of the returned resource.
project_media_idstrTrue—Operation/project media relationship and the recorded relative media path.
pathstrTrue—Local root, path or POSIX relative path. Scan helpers exclude symlinks; keep paths inside the chosen root.
enabledboolTrue—Source inclusion or explicit language override in the current plan.
contentstuple[OperationContent, ...]True—Nested source items or per-source estimate rows, according to the enclosing record.

OperationPreparationCountsResponse

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
awaiting_clientintTrue—Number of sources in this named lifecycle or preparation state; counts are not percentages.
preparingintTrue—Number of sources in this named lifecycle or preparation state; counts are not percentages.
hashingintTrue—Number of sources in this named lifecycle or preparation state; counts are not percentages.
uploadingintTrue—Number of sources in this named lifecycle or preparation state; counts are not percentages.
awaiting_retryintTrue—Number of sources in this named lifecycle or preparation state; counts are not percentages.
readyintTrue—Number of sources in this named lifecycle or preparation state; counts are not percentages.
abandonedintTrue—Number of sources in this named lifecycle or preparation state; counts are not percentages.
not_requiredintTrue—Number of sources in this named lifecycle or preparation state; counts are not percentages.

OperationResultExportResponse

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
artifact_idstrTrue—ID of an immutable successful operation stage returned by the result list.
snapshot_idstrTrue—Producing/result asset and immutable snapshot lineage; preserve these identities across export.
content_idstrTrue—One source item inside an operation, not a project-media or artifact ID.
output_targetOutputTargetTrue—external_srt, external_vtt, external_ass or embedded; None uses the endpoint/account default.
captureCapturedExportTrue—Frozen export metadata, backend-suggested relative filename or actual serialized subtitle text.
suggested_pathstrTrue—Frozen export metadata, backend-suggested relative filename or actual serialized subtitle text.
mime_typestrTrue—Detected MIME type; this alone does not establish codec support.
text_contentstrTrue—Frozen export metadata, backend-suggested relative filename or actual serialized subtitle text.
media_pathstrTrue—Operation/project media relationship and the recorded relative media path.
languagestr | NoneFalseNoneSubtitle language or normal/Forced/SDH/Commentary classification; technical language codes remain unchanged.
stream_indexint | NoneFalseNoneFFprobe stream index or explicit indexes to replace, not the order in a filtered list.
stream_classstr | NoneFalseNoneNormal, or any combination of Commentary, Forced and SDH.

OperationWorkflowSummaryResponse

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
requestedWorkflowStageFlagsResponseFalseField(default_factory=WorkflowStageFlagsResponse)Nested stage flags: audio_transcription, ocr_transcription and translation. Distinguish the requested plan from stages still needed after settlement skips unstarted stages.
neededWorkflowStageFlagsResponseFalseField(default_factory=WorkflowStageFlagsResponse)Nested stage flags: audio_transcription, ocr_transcription and translation. Distinguish the requested plan from stages still needed after settlement skips unstarted stages.
skippedWorkflowStageFlagsResponseFalseField(default_factory=WorkflowStageFlagsResponse)Number of sources in this named lifecycle or preparation state; counts are not percentages.

ProgressMeasurement

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
completedAnnotated[int, Field(ge=0, le=2 ** 63 - 1)]True—Measured units completed, from 0 through total. A measurement cannot exceed its total.
totalAnnotated[int, Field(gt=0, le=2 ** 63 - 1)]True—Local progress phase and measured item/byte completion; callbacks are synchronous.
unitProgressUnitTrue—Measurement unit from ProgressUnit, bytes, items, chunks or milliseconds; use the declared enum values.

ProgressMeasurementSnapshot

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
completedintTrue—Measured units completed, from 0 through total. A measurement cannot exceed its total.
totalintTrue—Local progress phase and measured item/byte completion; callbacks are synchronous.
unitstrTrue—Measurement unit from ProgressUnit, bytes, items, chunks or milliseconds; use the declared enum values.
percentfloatTrueField(ge=0, le=100)Local progress phase and measured item/byte completion; callbacks are synchronous.

ProgressPhase

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

JSON
{
  "PREPARATION": "preparation",
  "UPLOADING": "uploading",
  "TRANSCRIPTION": "transcription",
  "TRANSLATION": "translation"
}

ProgressPhaseSnapshot

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
statusProgressStatusFalseProgressStatus.PENDINGStatus filter or new status, as appropriate to the method; archived projects retain saved results.
current_stepProgressStep | NoneFalseNoneNullable active phase or step. A terminal snapshot can have no active phase/step.
measurementProgressMeasurementSnapshot | NoneFalseNoneNullable completed/total/unit measurement for actual work, with percent only in snapshots.
active_work_unitsintFalseField(default=0, ge=0)Number of work units currently active in this step, phase or snapshot.
stepsdict[ProgressStep, ProgressStepSnapshot]True—Nested per-phase or per-step records keyed by the corresponding enum value; inspect their status and measurements.

ProgressSnapshotV4

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
versionLiteral[4]FalsePROGRESS_SCHEMA_VERSIONProgress schema version, currently 4; reject unsupported versions rather than guessing their structure.
revisionintFalseField(default=0, ge=0)Increasing canonical progress revision; reconcile stale events with HTTP state.
statusProgressStatusFalseProgressStatus.PENDINGStatus filter or new status, as appropriate to the method; archived projects retain saved results.
phase_planlist[ProgressPhase]True—Ordered phases in the admitted workflow; absent stages are not implied work.
countsWorkflowPhaseCountsTrue—Nested workflow phase counts: total, resolved, completed, skipped and failed.
current_phaseProgressPhase | NoneFalseNoneNullable active phase or step. A terminal snapshot can have no active phase/step.
current_stepProgressStep | NoneFalseNoneNullable active phase or step. A terminal snapshot can have no active phase/step.
measurementProgressMeasurementSnapshot | NoneFalseNoneNullable completed/total/unit measurement for actual work, with percent only in snapshots.
active_work_unitsintFalseField(default=0, ge=0)Number of work units currently active in this step, phase or snapshot.
phasesdict[ProgressPhase, ProgressPhaseSnapshot]True—Nested per-phase or per-step records keyed by the corresponding enum value; inspect their status and measurements.

ProgressStatus

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

JSON
{
  "PENDING": "pending",
  "RUNNING": "running",
  "COMPLETED": "completed",
  "SKIPPED": "skipped",
  "FAILED": "failed"
}

ProgressStep

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

JSON
{
  "EXTRACTING_STREAM": "extracting_stream",
  "HASHING_SOURCE": "hashing_source",
  "UPLOADING_SOURCE": "uploading_source",
  "DOWNLOADING_SOURCE": "downloading_source",
  "STARTING_RUNTIME": "starting_runtime",
  "RESOLVING_MODEL": "resolving_model",
  "LOADING_TOKENIZER": "loading_tokenizer",
  "LOADING_MODEL": "loading_model",
  "LOADING_INPUT": "loading_input",
  "RUNNING_INFERENCE": "running_inference",
  "ALIGNING_TIMESTAMPS": "aligning_timestamps",
  "EXTRACTING_SUBTITLE_TRACK": "extracting_subtitle_track",
  "RUNNING_OCR": "running_ocr",
  "PARSING_OCR_OUTPUT": "parsing_ocr_output",
  "FINALIZING_RESULT": "finalizing_result"
}

ProgressStepSnapshot

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
statusProgressStatusFalseProgressStatus.PENDINGStatus filter or new status, as appropriate to the method; archived projects retain saved results.
measurementProgressMeasurementSnapshot | NoneFalseNoneNullable completed/total/unit measurement for actual work, with percent only in snapshots.
active_work_unitsintFalseField(default=0, ge=0)Number of work units currently active in this step, phase or snapshot.
started_atdatetime | NoneFalseNoneRecorded server timestamp; a nullable value means the event has not occurred or is unavailable.

ProgressUnit

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

JSON
{
  "BYTES": "bytes",
  "ITEMS": "items",
  "CHUNKS": "chunks",
  "MILLISECONDS": "milliseconds"
}

ProgressUpdateV4

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
versionLiteral[4]FalsePROGRESS_SCHEMA_VERSIONProgress schema version, currently 4; reject unsupported versions rather than guessing their structure.
phaseProgressPhaseTrue—Local progress phase and measured item/byte completion; callbacks are synchronous.
stepProgressStepTrue—Machine-readable execution step; use the enclosing flow/progress type and its enumerated values.
statusProgressStatusTrue—Status filter or new status, as appropriate to the method; archived projects retain saved results.
work_unit_idAnnotated[str, Field(min_length=1, max_length=255)]True—Identity of this measured work unit; preserve it across increasing progress updates.
sequenceAnnotated[int, Field(ge=0, le=2 ** 63 - 1)]True—Increasing update sequence within one work unit; stale updates must not replace newer state.
measurementProgressMeasurement | NoneFalseNoneNullable completed/total/unit measurement for actual work, with percent only in snapshots.

ProjectOperationCommitRequest

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
media_idslist[Annotated[str, Field(max_length=64)]]TrueField(min_length=1, max_length=OPERATION_MEDIA_MAX_COUNT)Backend-ready inventory records or selected project-media IDs; obtain IDs from current responses.
target_languagestrTrueField(min_length=1, max_length=32)Target language code for generated or translated subtitles.
content_overrideslist[ProjectOperationContentOverride]FalseField(default_factory=list, max_length=OPERATION_MEDIA_MAX_COUNT * 4)Overrides keyed by stable source_ref: enable a source or explicitly override its source language.
metricslist[ProjectOperationMetricEntry]FalseField(default_factory=list, max_length=OPERATION_MEDIA_MAX_COUNT * 4)Only source metrics requested by the current plan; derive them locally. Audio duration is already in probed inventory.
source_selectionslist[AssetSelection]TrueField(max_length=OPERATION_MEDIA_MAX_COUNT * 4)Guarded selections from the estimated plan, plus canonical source_language; preserve snapshots and observations.

ProjectOperationCommitResponse

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
operationdict[str, Any]True—Plan/estimate/commit object or guarded source mapping. These dict[str, Any] payloads are open; the recipe validates its used fields.
commitdict[str, Any]True—Plan/estimate/commit object or guarded source mapping. These dict[str, Any] payloads are open; the recipe validates its used fields.
source_ref_mapdict[str, dict[str, str]]True—Plan/estimate/commit object or guarded source mapping. These dict[str, Any] payloads are open; the recipe validates its used fields.

ProjectOperationContentOverride

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
source_refProjectOperationSourceRefTrue—Stable pair of project media ID and selected asset ID; runtime content IDs are different.
enabledbool | NoneFalseNoneSource inclusion or explicit language override in the current plan.
language_overridestr | NoneFalseField(default=None, max_length=32)Source inclusion or explicit language override in the current plan.

ProjectOperationMetricEntry

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
source_refProjectOperationSourceRefTrue—Stable pair of project media ID and selected asset ID; runtime content IDs are different.
duration_secondsfloat | int | NoneFalseNoneMeasured duration in seconds, not a promised processing time.
image_countint | NoneFalseNoneMeasured visible characters or graphical images requested by the plan; never substitute guessed counts.

ProjectOperationPlanContentResponse

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
source_refProjectOperationSourceRefTrue—Stable pair of project media ID and selected asset ID; runtime content IDs are different.
source_asset_idstr | NoneTrue—Producing/result asset and immutable snapshot lineage; preserve these identities across export.
enabledboolTrue—Source inclusion or explicit language override in the current plan.
sparse_normalboolTrue—Suggests checking an automatic Normal text subtitle with sparse known cues for the media duration.
languagestrTrue—Subtitle language or normal/Forced/SDH/Commentary classification; technical language codes remain unchanged.
language_modestr | NoneTrue—Source-language evidence used by the planner; language codes remain canonical.
language_sourcestr | NoneTrue—Source-language evidence used by the planner; language codes remain canonical.
language_declaredstr | NoneTrue—Source-language evidence used by the planner; language codes remain canonical.
language_declared_sourcestr | NoneTrue—Source-language evidence used by the planner; language codes remain canonical.
language_guessstr | NoneTrue—Source-language evidence used by the planner; language codes remain canonical.
language_guess_sourcestr | NoneTrue—Source-language evidence used by the planner; language codes remain canonical.
language_overridestr | NoneTrue—Source inclusion or explicit language override in the current plan.
language_guess_statusstr | NoneTrue—Readiness of source-language detection before committing.
language_guess_confidencefloat | NoneTrue—Confidence of the source-language guess.
language_profiledict[str, Any] | NoneTrue—Source-language profile supplied with the language evidence.
typestr | NoneTrue—Source category text, audio or graphical; it determines the requested metrics and stages.
stream_typestr | NoneTrue—Actual stream codec or subtitle classification, independently of import recognition.
stream_classstr | NoneTrue—Normal, or any combination of Commentary, Forced and SDH.
codec_typestr | NoneTrue—Actual stream codec or subtitle classification, independently of import recognition.
codec_namestr | NoneTrue—Actual stream codec or subtitle classification, independently of import recognition.
filenamestr | NoneTrue—Prepared filename, including its real extension, used to select storage format.
input_snapshot_idstr | NoneTrue—Producing/result asset and immutable snapshot lineage; preserve these identities across export.
stream_indexint | NoneTrue—FFprobe stream index or explicit indexes to replace, not the order in a filtered list.
asset_inputdict[str, Any] | NoneTrue—Server-issued input contract; preserve its selection guards and asset identity.
workflow_kindstrTrue—Selected stage workflow and its planning explanation; null when no workflow is selected.
workflow_reasonstrTrue—Selected stage workflow and its planning explanation; null when no workflow is selected.
needs_audio_transcriptionboolTrue—Whether this source requires the named processing stage.
needs_ocr_transcriptionboolTrue—Whether this source requires the named processing stage.
needs_translationboolTrue—Whether this source requires the named processing stage.
translation_decisionstrTrue—Whether the plan requires translation or skips it.
audio_transcription_enginestr | NoneTrue—Server-selected processing route, model or selection evidence for this stage.
audio_transcription_appstr | NoneTrue—Server-selected processing route, model or selection evidence for this stage.
audio_transcription_modelstr | NoneTrue—Server-selected processing route, model or selection evidence for this stage.
audio_transcription_model_modestr | NoneTrue—Server-selected processing route, model or selection evidence for this stage.
audio_transcription_route_reasonstr | NoneTrue—Server-selected processing route, model or selection evidence for this stage.
audio_transcription_route_rulestr | NoneTrue—Server-selected processing route, model or selection evidence for this stage.
ocr_enginestr | NoneTrue—Server-selected processing route, model or selection evidence for this stage.
ocr_modelstr | NoneTrue—Server-selected processing route, model or selection evidence for this stage.
translation_providerstr | NoneTrue—Server-selected processing route, model or selection evidence for this stage.
translation_modelstr | NoneTrue—Server-selected processing route, model or selection evidence for this stage.
translation_model_modestr | NoneTrue—Server-selected processing route, model or selection evidence for this stage.
translation_route_reasonstr | NoneTrue—Server-selected processing route, model or selection evidence for this stage.
translation_route_rulestr | NoneTrue—Server-selected processing route, model or selection evidence for this stage.
estimated_character_countint | NoneTrue—Estimated source workload measured for the selected source.
estimated_cue_countint | NoneTrue—Estimated number of visible subtitle cues in the selected snapshot.
estimated_image_countint | NoneTrue—Estimated source workload measured for the selected source.
estimated_duration_secondsint | NoneTrue—Estimated source workload measured for the selected source.
estimated_creditsint | NoneTrue—Estimated credits reserved for this source or named processing stage.
estimated_audio_transcription_creditsint | NoneTrue—Estimated credits reserved for this source or named processing stage.
estimated_ocr_transcription_creditsint | NoneTrue—Estimated credits reserved for this source or named processing stage.
estimated_translation_creditsint | NoneTrue—Estimated credits reserved for this source or named processing stage.

ProjectOperationPlanSlotResponse

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
slotstrTrue—Result classification: normal, forced, sdh, commentary or a combination.
source_asset_idstrTrue—Recommended source asset for this result slot, computed before user overrides.
availableboolTrue—Whether reliable text already exists in the target language for this slot.

ProjectOperationPlanMediaResponse

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
project_media_idstrTrue—Operation/project media relationship and the recorded relative media path.
pathstrTrue—Local root, path or POSIX relative path. Scan helpers exclude symlinks; keep paths inside the chosen root.
probe_datadict[str, Any] | NoneTrue—Actual FFprobe container/stream evidence; opaque dictionaries retain the probe’s fields.
contentslist[ProjectOperationPlanContentResponse]True—Nested source items or per-source estimate rows, according to the enclosing record.
slotslist[ProjectOperationPlanSlotResponse]True—Result slots with a candidate source, their recommendation and availability.

ProjectOperationPlanPayload

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
target_languagestrTrue—Target language code for generated or translated subtitles.
medialist[ProjectOperationPlanMediaResponse]True—Inventory record of the item's file, as for replace_project_media; omit it for a subtitle item.

ProjectOperationPlanEstimateRequest

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
media_idslist[Annotated[str, Field(max_length=64)]]TrueField(min_length=1, max_length=OPERATION_MEDIA_MAX_COUNT)Backend-ready inventory records or selected project-media IDs; obtain IDs from current responses.
target_languagestrTrueField(min_length=1, max_length=32)Target language code for generated or translated subtitles.
content_overrideslist[ProjectOperationContentOverride]FalseField(default_factory=list, max_length=OPERATION_MEDIA_MAX_COUNT * 4)Overrides keyed by stable source_ref: enable a source or explicitly override its source language.
metricslist[ProjectOperationMetricEntry]FalseField(default_factory=list, max_length=OPERATION_MEDIA_MAX_COUNT * 4)Only source metrics requested by the current plan; derive them locally. Audio duration is already in probed inventory.

ProjectOperationPlanEstimateResponse

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
planProjectOperationPlanPayloadTrue—Non-persisted plan with source references and projected work; durable operation IDs are created at commit.
estimatedict[str, Any]True—Plan/estimate/commit object or guarded source mapping. These dict[str, Any] payloads are open; the recipe validates its used fields.

ProjectOperationPlanRequest

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
media_idslist[Annotated[str, Field(max_length=64)]]TrueField(min_length=1, max_length=OPERATION_MEDIA_MAX_COUNT)Backend-ready inventory records or selected project-media IDs; obtain IDs from current responses.
target_languagestrTrueField(min_length=1, max_length=32)Target language code for generated or translated subtitles.
content_overrideslist[ProjectOperationContentOverride]FalseField(default_factory=list, max_length=OPERATION_MEDIA_MAX_COUNT * 4)Overrides keyed by stable source_ref: enable a source or explicitly override its source language.

ProjectOperationPlanResponse

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
planProjectOperationPlanPayloadTrue—Non-persisted plan with source references and projected work; durable operation IDs are created at commit.

ProjectOperationResultListResponse

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
resultslist[ProjectOperationResultResponse]FalseField(default_factory=list)Successful immutable stage records, including stages retained after another stage fails.
totalintFalse0Local progress phase and measured item/byte completion; callbacks are synchronous.

ProjectOperationResultResponse

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

Each row is a successful immutable stage, including intermediate transcription/ocr and final translation. A partially failed operation can still have these rows. Export the chosen artifact_id; editing requires a separate editable asset copy.

FieldTypeRequiredDeclaration / defaultMeaning
artifact_idstrTrue—ID of an immutable successful operation stage returned by the result list.
stageLiteral['transcription', 'ocr', 'translation']True—Producing transcription, OCR or translation stage.
result_asset_idstrTrue—Producing/result asset and immutable snapshot lineage; preserve these identities across export.
snapshot_idstrTrue—Producing/result asset and immutable snapshot lineage; preserve these identities across export.
generating_artifact_idstrTrue—Producing/result asset and immutable snapshot lineage; preserve these identities across export.
source_asset_idstrTrue—Producing/result asset and immutable snapshot lineage; preserve these identities across export.
source_asset_numberint | NoneFalseNoneThe source's number within its media item; exports add it to names that would otherwise clash (clip.en.3.srt).
source_languagestrTrue—Canonical source language captured with the guarded selection.
target_languagestr | NoneFalseNoneTarget language code for generated or translated subtitles.
input_snapshot_idstr | NoneFalseNoneProducing/result asset and immutable snapshot lineage; preserve these identities across export.
content_idstrTrue—One source item inside an operation, not a project-media or artifact ID.
operation_media_idstrTrue—Operation/project media relationship and the recorded relative media path.
project_media_idstr | NoneFalseNoneOperation/project media relationship and the recorded relative media path.
media_pathstrTrue—Operation/project media relationship and the recorded relative media path.
media_name_numberint | NoneFalseNoneNumber that tells same-named items of a file project apart (shown as clip.mp4 · 2); None for the oldest entry or a unique name.
export_stemstrTrue—Export file name without format (S01/clip.en), before clashes within one destination are numbered.
languagestr | NoneFalseNoneSubtitle language or normal/Forced/SDH/Commentary classification; technical language codes remain unchanged.
stream_indexint | NoneFalseNoneFFprobe stream index or explicit indexes to replace, not the order in a filtered list.
stream_typestr | NoneFalseNoneActual stream codec or subtitle classification, independently of import recognition.
stream_classstr | NoneFalseNoneNormal, or any combination of Commentary, Forced and SDH.
codec_namestr | NoneFalseNoneActual stream codec or subtitle classification, independently of import recognition.
result_created_atstrTrue—Saved result creation time or number of subtitle cues.
cue_countintFalse0Saved result creation time or number of subtitle cues.

ProjectOperationSourceRef

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
media_idstrTrueField(min_length=1, max_length=64)Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
asset_idstrTrueField(min_length=1, max_length=64)ID of the selected subtitle/audio asset owned by its media.

SourceObservation

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
filestuple[FileObservation, ...]TrueField(min_length=1, max_length=2)Complete directory snapshot, file list or observation evidence required by this endpoint; build it from local files.
stream_indexStrictInt | NoneFalseNoneFFprobe stream index or explicit indexes to replace, not the order in a filtered list.
stream_descriptordict[Annotated[str, Field(max_length=128)], JsonValue]FalseField(default_factory=dict, max_length=128)Physical-file role, observed fingerprint or stream descriptor used for guarded checks.

SourceRef

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
media_idstrTrue—Media ID in this route: a project-media ID for project routes, an operation-media ID for upload/preparation routes.
asset_idstrTrue—ID of the selected subtitle/audio asset owned by its media.

UploadTarget

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

Normalized target record: expires_at is a datetime here and an ISO timestamp in HTTP JSON. The response additionally carries upload_id and operation/media/content identity plus nullable sidecar with the same target shape. headers is an opaque string mapping, not an API-token destination. Preserve the issued method and headers, renew expired targets, and complete only the matching attempt/upload/hash.

FieldTypeRequiredDeclaration / defaultMeaning
upload_urlstrTrue—URL from the API; relative URLs resolve against the gateway. Upload URLs receive no SubFT token.
methodstrTrue—HTTP method; preserve the backend-issued method for direct upload.
headersMapping[str, str]True—HTTP headers. Pass the upload target headers unchanged; ordinary request headers override constructor headers.
expires_atdatetimeTrue—Expiry of the signed target; renew it before attempting an expired upload.

WorkflowPhaseCounts

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
total_phasesintFalseField(default=0, ge=0)Number of workflow phases with this outcome. Resolved includes completed, skipped and failed phases.
resolved_phasesintFalseField(default=0, ge=0)Number of workflow phases with this outcome. Resolved includes completed, skipped and failed phases.
completed_phasesintFalseField(default=0, ge=0)Number of workflow phases with this outcome. Resolved includes completed, skipped and failed phases.
skipped_phasesintFalseField(default=0, ge=0)Number of workflow phases with this outcome. Resolved includes completed, skipped and failed phases.
failed_phasesintFalseField(default=0, ge=0)Number of workflow phases with this outcome. Resolved includes completed, skipped and failed phases.

WorkflowStageFlagsResponse

Source-derived contract. Keep required fields and guards when adapting the recipe; nullable values are distinct from missing required fields.

FieldTypeRequiredDeclaration / defaultMeaning
audio_transcriptionboolFalseFalsePer-stage flags or counts. requested describes planned work; needed describes work remaining after settlement skips unstarted stages, according to the nested field type.
ocr_transcriptionboolFalseFalsePer-stage flags or counts. requested describes planned work; needed describes work remaining after settlement skips unstarted stages, according to the nested field type.
translationboolFalseFalsePer-stage flags or counts. requested describes planned work; needed describes work remaining after settlement skips unstarted stages, according to the nested field type.