dub_payment_required. Subtitle outputs report it too, as available: false with unavailable_reason: dub_payment_required.
Why there is no free preparation
A project dubs by itself after translation.auto_dub defaults to true, and auto_dub: false answers 403 prepare_mode_not_enabled: a project without the auto-dub is not available. To choose voices before the dub is paid, send speaker_voices when you create the project.
createProject also checks the money up front. A balance that cannot cover the auto-dub estimate answers 402 insufficient_balance, and a price cap (expected_cost_minutes) below the current total answers 409 cost_changed. createProjectCopies does the same. The text of each copy opens separately, as the table below says.
How it opens
Usually you do nothing. The auto-dub is charged when translation ends, and the text opens with that charge.If the auto-dub was skipped
The balance or the price can change between the request and the moment translation ends. Then the auto-dub is skipped, nothing is charged, and the text stays closed:auto_dub.state is skipped, and auto_dub.skipped_reason is insufficient_balance or cost_changed. The reason is null
when the dub could not start for another reason, for example because the key that created the project was revoked.
To open it, add minutes if needed, then estimate the dub. When its total_minutes is within the price cap the project was
created with (auto_dub.max_minutes), send it as expected_cost_minutes, with an Idempotency-Key you save first and send again on a retry. When it is
higher, the skip is what kept the higher price from being charged: ask whoever accepted the first price before you dub.
In the example below, the estimate’s total_minutes is 1.
trial_project_dub_not_allowed. Create a new project instead.
What is closed and what stays open
The outputs held back are
dubbed_subtitles, source_subtitles, source_subtitles_speakers, target_subtitles and target_subtitles_speakers. In the contract, closed operations carry x-rask-operation.dub_payment_gate, and the operation table marks them.
The rule covers projects created through v3. Projects created in other ways are not gated.