prepare shorter audio
audio-trims_createTrim the first durationSeconds of an authorized audio asset into a new reusable asset when a lipsync needs only the opening audio.
Instructions
Save the first durationSeconds of an authorized audio asset (assetId) as a new, reusable audio asset. Use it only when audio is longer than a lipsync can take and only its beginning is needed. Not for a partial video lipsync: there, leave the original video and draft unchanged and set options.sync_mode to cut_off on lipsync_create.
Explain and confirm the partial duration first. This prepares audio only: it never generates video, spends generation credits, or consumes a free generation. Persist one idempotencyKey before calling and reuse it with identical inputs only after an uncertain response. Failed operations require an explicit new attempt.
Returns id and status (queued, processing, completed or failed) at once; assetId and durationSeconds stay null until completed, errorCode is set on failure, and retryAfterMs is the wait in milliseconds before the next read. Poll audio-trims_get until completed (jobs_get and jobs_wait do not read trims), then use its assetId and actual duration for a fresh quote.
Pass assetId, not its deprecated alias audioAssetId; the call fails when neither is given or the two name different assets. projectId saves the new asset in that project and needs projectIntent=explicit, which only an explicit user choice or a project just created for this request allows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assetId | No | Saved AUDIO asset to shorten, from assets_list or assets_create. Required in practice; audioAssetId is only its deprecated alias. | |
| projectId | No | Project to save the shortened audio in, from projects_create or projects_list. | |
| audioAssetId | No | Deprecated alias of assetId. | |
| projectIntent | No | Required with projectId. Set only for an explicit user project selection/update, or the new project just created for this request. Never infer intent from a matching project name, workflow name or active editor. | |
| idempotencyKey | Yes | A new UUID saved before the call. Reuse it with identical input only to recover an uncertain response. | |
| durationSeconds | Yes | Seconds to keep from the start of the audio, up to 3600. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||