Rewrite the script
rewrite_scriptRewrites the WHOLE piece under the brief with the format's writer (the same revision pass the writing pipeline runs), then re-dresses only the scenes whose narration changed (visuals are kept). It covers a brief that spans the piece («more rhythm in the second act, and let the ending return to the thesis»); a single scene has its own re-authoring op. Asynchronous: returns a run id, and the project status reports the job by run_id — once completed, with the new version id (job.result.editorialVersionId, also in latestRunByKind.editorial_rewrite). as_branch=false (default) makes the result THE CUT the line renders, as committing a draft does. Writers that require spend confirmation need confirm_spend=true. Requires write. Spends LLM budget: a full script pass, priced like the writing profile of the piece (writingProfiles[].measure in the catalogue of formats).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| brief | Yes | What to change, in any language (max 4000 chars). | |
| as_branch | No | Keep the rewrite as a branch instead of making it the cut. Default false. | |
| project_id | Yes | ||
| version_id | No | Optional: the base version; default the project's head. | |
| confirm_spend | No | Required when the piece's writer requires spend confirmation (`requiresSpendConfirmation` in the catalogue of formats). |