---
title: "Write a video script from a topic"
method: POST
path: "/scripts"
tags: ["Tools"]
---

# Write a video script from a topic

`POST /scripts`

Generates 2 distinct narration script variations for a topic, sized to your target duration. Pick the one you like (or edit it) and pass it to `POST /videos/generate` as the `script` with `inputType: "script"`.

**Cost:** 1 credit per minute of target duration (minimum 1 credit).

## Request body

- object
  - `prompt` string, required — The topic or idea to write a script about. Example: "5 mind-blowing facts about the deep ocean".
  - `duration` number, required — Target video duration in seconds (15-1200). The script length is sized so narration fits this duration.
  - `language` string — Language for the script (ISO 639-1 code like "en", "es", "hi"). Default: English.
  - `source` 'tool_page' | 'inline' — Where the request came from, for analytics only. Dashboard use; safe to omit.
  - `templateId` string — Creation template the request came from, for analytics only. Dashboard use; safe to omit.

## Response `200`

OK

- object
  - `variations` object[], required — Two distinct script variations for the topic.
    - `content` string, required — The full narration script as one text block.
  - `provider` string, required — Which AI model wrote the scripts.
  - `creditsUsed` number, required — Credits deducted for this generation.
  - `success` boolean, required

## Other responses

- `401` — 401
- `402` — 402
- `403` — 403

---

[API](https://skmtc.net/aituber/apis/aituber-api.md) · [All operations](https://skmtc.net/aituber/apis/aituber-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aituber/aituber-api/revisions/35448566f143/schema)
