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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"story_idea": "<story_idea>",
"episode_length_seconds": "<episode_length_seconds>",
"idempotency_key": "<idempotency_key>"
},
"name": "generate_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| genre | No | Genre label. Omit to let the story set it. | |
| language | No | Language for dialogue, voiceover and on-screen text. Omit to use the language the story asks for. | |
| story_idea | Yes | The story premise to write from. | |
| video_model | No | Video model for the project's clips: Seedance 2.5, Seedance 2.0 Fast (cheaper) or Kling 4.0. Defaults to Seedance 2.5. | |
| 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. null to let the model choose. | |
| 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. null to let the model choose. |