● nureta
Docs
Video

Edit the storyboard

Get the storyboard first, edit the shots, then render the video or cancel it for a full refund.

This page uses NURETA_URL, NURETA_KEY and the wait_task helper from Get started.

With mode: "edit", the API writes the storyboard, stops, and waits for you. You pay at create. You can edit, then render, or cancel for a full refund.

  1. Create the draft (16 seconds, $3.02 reserved):
TASK_ID=$(curl -s -X POST "$NURETA_URL/api/v3/contents/generations/tasks" \
  -H "Authorization: Bearer $NURETA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "seahorse-480p", "duration": 16, "mode": "edit",
       "content": [{"type": "text", "text": "A couple cooks dinner together, then dances in the kitchen"}]}' | jq -r .id)
  1. Wait until status is planned (1–3 minutes), and read the shots:
DRAFT=$(wait_task "$NURETA_URL/api/v3/contents/generations/tasks/$TASK_ID")
printf '%s' "$DRAFT" | jq '{status, locked: .scene.lockedDurationSeconds, total: .scene.renderedDurationSeconds,
                     shots: [.scene.segments[] | {index, beat, durationSeconds, explicit}]}'
  1. Edit with a structured edit. List every shot you keep, in the order you want: a shot you leave out is removed, and an entry without index is a new shot. The durations must add up to scene.lockedDurationSeconds (16 here):
curl -s -X PUT "$NURETA_URL/api/v3/contents/generations/tasks/$TASK_ID/plan/structured" \
  -H "Authorization: Bearer $NURETA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"segments": [
        {"index": 1, "beat": "They chop vegetables side by side and laugh", "duration_seconds": 8},
        {"index": 2, "beat": "He takes her hand and they dance slowly by the stove", "duration_seconds": 8}
      ]}' | jq '{status, step}'

The edit answers 202. The API now rewrites the full prompts. Wait until scene.reexpandStatus is ready:

until R=$(curl -s "$NURETA_URL/api/v3/contents/generations/tasks/$TASK_ID" -H "Authorization: Bearer $NURETA_KEY" \
          | jq -r .scene.reexpandStatus); [ "$R" = ready ] || [ "$R" = failed ]; do sleep 5; done; echo "$R"
  1. Render it, or cancel it:
# Render: the task goes on like any other task.
curl -s -X POST "$NURETA_URL/api/v3/contents/generations/tasks/$TASK_ID/render" -H "Authorization: Bearer $NURETA_KEY" | jq '{status}'
wait_task "$NURETA_URL/api/v3/contents/generations/tasks/$TASK_ID" | jq '{status, video: .content.video_url}'

# Or cancel: the full price is refunded at once.
# curl -s -X POST "$NURETA_URL/api/v3/contents/generations/tasks/$TASK_ID/cancel" -H "Authorization: Bearer $NURETA_KEY"

A draft that you do not render or cancel within 24 hours is refunded and ends failed with DraftExpired.

Common errors

You getWhyFix
400 InvalidParameter on an editThe durations do not add up to scene.lockedDurationSeconds.Change the durations so that they do.
409 on an edit or a renderA re-expansion still runs, or the task is not planned.Wait for scene.reexpandStatus: "ready".
400 on a renderThe last re-expansion failed (scene.reexpandError).Edit again, then render.

On this page