For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create from a Custom Script

This snippet recreates the 📜 Create from a Custom Script recipe using Python. Review the Python guide for environment setup before running it.

# pip install requests
import os
import requests


def main() -> None:
    token = os.environ.get("AUTOCONTENT_TOKEN", "YOUR_API_TOKEN")
    endpoint = "https://api.autocontentapi.com/video/CreateShortsFromScript"

    payload = {
        "script": [
            {"avatarId": 1, "text": "Welcome back!"},
            {"avatarId": 2, "text": "Today we dig into productivity fundamentals."},
        ],
        "subtitles": True,
    }

    response = requests.post(
        endpoint,
        headers={
            "Authorization": f"Bearer {token}",
            "Content-Type": "application/json",
            "Accept": "application/json",
        },
        json=payload,
        timeout=30,
    )
    response.raise_for_status()
    print("Request accepted:", response.json())


if __name__ == "__main__":
    main()

Replace YOUR_API_TOKEN (or set the AUTOCONTENT_TOKEN environment variable) before running the request.

This is the dedicated legacy Avatar/TTS flow. /content/Create video requests treat text as a NotebookLM instruction and do not preserve it as an exact narration script.

See also

Last updated