---
title: "Make segment clips, waiting loops and ending shots (costs credits per second)"
method: POST
path: "/v1/storyboards/{id}/generate"
tags: ["Storyboards"]
---

# Make segment clips, waiting loops and ending shots (costs credits per second)

`POST /v1/storyboards/{id}/generate`

## Request

- Base URL: `https://nanostudiopro.com/api`
- URL: `https://nanostudiopro.com/api/v1/storyboards/{id}/generate`
- Auth: HTTP bearer

Each target is one video clip, made exactly as `POST /v1/videos` makes one, from the storyboard's own keyframe pictures, model, length, resolution, draft mode and dialogue: a **segment** (start frame = its first keyframe; end frame = the next keyframe when the join is connected) a decision's **waiting loop** (starts and ends on the decision keyframe), or a keyframe's **ending shot** (the last moment of a path, set with `updatePanel` `patch.ending: { prompt, durationS }`: starts on that keyframe, no end frame, and plays instead of its still hold). Every prompt for a model with sound asks for natural ambience and dialogue only, no background music. **Costs credits per second of video.** Quote first with `dry_run: true` (every target's price and the total, nothing submitted), get the user's OK, then send the same body without it. The total is checked against your balance and the token's daily cap before anything starts; credits are deducted as each clip completes. Each new take is recorded on the storyboard (the first take of a segment becomes its active one; `activate: true` makes every new one active) and answers its `task_id` for `GET /v1/tasks/{id}`. Targets that cannot be made yet (a keyframe with no picture) come back in `refused` with the reason. A storyboard whose owner approves agent spending answers `403` except for the quote.

## Request body

- object
  - `targets` union[], required
    - union
      - object
        - `kind` 'segment', required
        - `id` string, required
      - object
        - `kind` 'loop', required
        - `decisionId` string, required
      - object
        - `kind` 'ending', required
        - `panelId` string, required
  - `activate` boolean: Make each new take the active one even when the segment already has one.
  - `dry_run` boolean: Quote only: nothing is submitted or charged.

## Response `200`

The takes started (or, with dry_run, the quote)

- object
  - `takes` object[]
    - `target` object
    - `take_id` string
    - `task_id` string
    - `credits` integer
    - `draft` boolean
  - `targets` object[]: dry_run: each target's price
    - `target` object
    - `credits` integer
    - `model` string
    - `seconds` integer
    - `resolution` string
    - `draft` boolean
  - `total_credits` integer
  - `refused` object[]
    - `target` object
    - `reason` string
  - `failed` object[]

## Other responses

- `400`: the keyframe "Mira jumps." has no picture yet
- `401`: Missing or invalid token
- `402`: Insufficient credits
- `403`: The owner approves an agent's spending on this storyboard
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/nanostudiopro/apis/nano-studio-pro-api.md) · [All operations](https://skmtc.dev/nanostudiopro/apis/nano-studio-pro-api/llms.txt) · [OpenAPI document](https://skmtc.dev/nanostudiopro/apis/nano-studio-pro-api/revisions/b454211e598e?raw)
