Generation
POST
/videos/{id}/script

Runs the AI script writer and stores the result on the video's brief as brief.text. Charges one generation's worth of credits, so a workspace with an empty balance is refused with warning-no-credits.

Pass prompt to restate what the script should be about; it is saved as scriptPrompt and reused next time. Without it the video must already carry a scriptPrompt or a prompt.

Synchronous: the call returns the finished script.

Authorization

bearerAuth
AuthorizationBearer <token>

An API key created under Settings > API & Webhooks. Keys start with sf_live_.

In: header

Path Parameters

id*string

Header Parameters

Idempotency-Key?string

Unique key per action (a UUID works well). Reusing it replays the first response instead of running the action again, so a retry after a timeout can never generate, render, publish or charge twice.

Lengthlength <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/videos/string/script" \  -H "Content-Type: application/json" \  -d '{    "prompt": "Three habits that quietly wreck a founder\'s week"  }'
{  "data": {    "videoId": "7bQxL2mF9dR4tK1sv",    "script": "Most founders do not burn out from working too much. They burn out from never finishing anything."  }}