Generate script
generate_scriptWrite a full multi-episode script from a story premise. This CREATES A NEW PROJECT — it does not edit an existing one, and it takes no project_id. While the job runs, job.output carries live progress (phase, completedEpisodes, totalEpisodes). On success the new project also has its characters, locations, episodes, shots and segments seeded, ready for the other tools. Spends credits. Returns a job id — poll it with get_job.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| genre | No | Genre label. | Vertical Drama |
| language | No | Language to write in. | English |
| story_idea | Yes | The story premise to write from. | |
| screen_ratio | No | Aspect ratio. | 9:16 |
| visual_style | No | Visual style. Defaults to Realistic TV Drama. | |
| episode_count | No | How many episodes to write. | |
| idempotency_key | Yes | Stable key identifying this generation request. Reuse the SAME key when retrying the same request — the original job is returned and no second charge is made. Use a NEW key when you deliberately want another generation. | |
| target_platform | No | Platform the episodes are cut for. | TikTok |
| episode_length_seconds | Yes | Target length of each episode, in seconds. |