> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pictory.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Brief to Video

> Generate a video script automatically from an AI brief using the Pictory API

This guide shows you how to use an AI brief to automatically generate a video script from a simple prompt. Instead of writing your own story content, let AI create engaging, platform-optimized scripts tailored to your video type and tone preferences.

> [!TIP]
>
> Want the AI to design the scenes as well as write the script? Add `aiStoryboard: { "enabled": true }` to the request and remove `createSceneOnEndOfSentence` and `createSceneOnNewLine` from the `brief` scene; the AI decides the scenes. See the [AI Storyboard guide](https://docs.pictory.ai/guides/text-to-video/ai-storyboard.md).

## What You'll Learn

> [card] AI Script Generation
>
> Generate video scripts from simple prompts

> [card] Video Type Optimization
>
> Create content optimized for different video types

> [card] Platform Targeting
>
> Tailor scripts for specific social platforms

> [card] Tone Control
>
> Adjust the voice and style of generated content

## Before You Begin

Make sure you have:

* A [Pictory API key](https://app.pictory.ai/api-access)
* Node.js or Python installed on your machine
* A clear idea of your video topic
* Understanding of your target audience and platform

```bash npm theme={null}
npm install axios
```

```bash pip theme={null}
pip install requests
```

## How an AI Brief Works

When you use an AI brief to generate a video:

1. **Prompt Submission** - You provide a topic or description for your video
2. **AI Processing** - The AI analyzes your prompt along with video type, platform, and tone settings
3. **Script Generation** - AI generates an optimized script tailored to your specifications
4. **Scene Creation** - The generated script is split into scenes based on your settings
5. **Visual Selection** - AI selects appropriate stock visuals for each scene
6. **Video Rendering** - Final video is assembled with voiceover, visuals, and captions

> [!NOTE]
>
> An AI brief generates content based on your prompt and settings. The AI considers video type, target platform, and tone to create contextually appropriate scripts that engage your intended audience.

## Complete Example

```javascript Node.js theme={null}
import axios from "axios";

const API_BASE_URL = "https://api.pictory.ai/pictoryapis";
const API_KEY = "YOUR_API_KEY";

async function createVideoWithBrief() {
  try {
    console.log("Creating video with AI-generated script...");

    const response = await axios.post(
      `${API_BASE_URL}/v2/video/storyboard/render`,
      {
        videoName: "ai_generated_video",

        // Voice-over configuration
        voiceOver: {
          enabled: true,
          aiVoices: [
            {
              speaker: "Brian",
              speed: 100,
              amplificationLevel: 0,
            },
          ],
        },

        // Scene with an AI brief
        scenes: [
          {
            // AI brief configuration
            brief: {
              prompt: "How artificial intelligence is transforming video creation and making professional content accessible to everyone",
              videoGoal: "Explainer",           // Goal of the video
              duration: 60,                      // Target duration in seconds
              platform: "YouTube",               // Target platform
              tone: "informative",               // Content tone
            },
            createSceneOnEndOfSentence: true,
          },
        ],
      },
      {
        headers: {
          "Content-Type": "application/json",
          Authorization: API_KEY,
        },
      }
    );

    const jobId = response.data.data.jobId;
    console.log("✓ Video creation started!");
    console.log("Job ID:", jobId);

    // Monitor progress
    console.log("\nMonitoring video creation...");
    let jobCompleted = false;
    let jobResult = null;

    while (!jobCompleted) {
      const statusResponse = await axios.get(
        `${API_BASE_URL}/v1/jobs/${jobId}`,
        {
          headers: { Authorization: API_KEY },
        }
      );

      const status = statusResponse.data.data.status;
      console.log("Status:", status);

      if (status === "completed") {
        jobCompleted = true;
        jobResult = statusResponse.data;
        console.log("\n✓ Video with AI-generated script is ready!");
        console.log("Video URL:", jobResult.data.videoURL);
      } else if (status === "failed") {
        throw new Error("Video creation failed: " + JSON.stringify(statusResponse.data));
      }

      await new Promise(resolve => setTimeout(resolve, 5000));
    }

    return jobResult;
  } catch (error) {
    console.error("Error:", error.response?.data || error.message);
    throw error;
  }
}

createVideoWithBrief();
```

```python Python theme={null}
import requests
import time
import json

API_BASE_URL = 'https://api.pictory.ai/pictoryapis'
API_KEY = 'YOUR_API_KEY'

def create_video_with_story_copilot():
    try:
        print("Creating video with AI-generated script...")

        response = requests.post(
            f'{API_BASE_URL}/v2/video/storyboard/render',
            json={
                'videoName': 'ai_generated_video',

                # Voice-over configuration
                'voiceOver': {
                    'enabled': True,
                    'aiVoices': [
                        {
                            'speaker': 'Brian',
                            'speed': 100,
                            'amplificationLevel': 0
                        }
                    ]
                },

                # Scene with an AI brief
                'scenes': [
                    {
                        # AI brief configuration
                        'brief': {
                            'prompt': 'How artificial intelligence is transforming video creation and making professional content accessible to everyone',
                            'videoGoal': 'Explainer',           # Goal of the video
                            'duration': 180,                      # Target duration in seconds
                            'platform': 'YouTube',               # Target platform
                            'tone': 'informative'                # Content tone
                        },
                        'createSceneOnEndOfSentence': True
                    }
                ]
            },
            headers={
                'Content-Type': 'application/json',
                'Authorization': API_KEY
            }
        )
        response.raise_for_status()

        job_id = response.json()['data']['jobId']
        print("✓ Video creation started!")
        print(f"Job ID: {job_id}")

        # Monitor progress
        print("\nMonitoring video creation...")
        job_completed = False
        job_result = None

        while not job_completed:
            status_response = requests.get(
                f'{API_BASE_URL}/v1/jobs/{job_id}',
                headers={'Authorization': API_KEY}
            )
            status_response.raise_for_status()

            status = status_response.json()['data']['status']
            print(f"Status: {status}")

            if status == 'completed':
                job_completed = True
                job_result = status_response.json()
                print("\n✓ Video with AI-generated script is ready!")
                print(f"Video URL: {job_result['data']['videoURL']}")
            elif status == 'failed':
                raise Exception(f"Video creation failed: {status_response.json()}")

            time.sleep(5)

        return job_result

    except requests.exceptions.RequestException as error:
        print(f"Error: {error}")
        if hasattr(error, 'response') and error.response is not None:
            print(f"Response: {error.response.text}")
        raise

if __name__ == '__main__':
    create_video_with_story_copilot()
```

## Understanding the Parameters

### AI Brief Configuration

| Parameter | Type | Required | Description |
| - | - | - | - |
| `brief.prompt` | string | Yes | The topic or description for AI to generate content (1–5000 characters) |
| `brief.videoGoal` | string | No | Goal of the video (default: "Explainer") |
| `brief.duration` | number | No | Target video duration in seconds (1–600) |
| `brief.platform` | string | No | Target social media platform for optimization |
| `brief.tone` | string | No | Tone and style of the generated content |

### Video Goals

| Value | Description | Best Used For |
| - | - | - |
| `Explainer` | Educational content that explains concepts clearly | How-to videos, concept explanations, educational content |
| `Marketing` | Promotional content designed to engage and convert | Product promotions, brand awareness, advertising |
| `Internal Communication` | Professional content for internal teams | Company updates, training videos, team announcements |
| `Tutorial` | Step-by-step instructional content | Software tutorials, DIY guides, learning materials |
| `Product` | Product-focused content highlighting features | Product demos, feature showcases, launch videos |

### Target Platforms

| Value | Optimization | Typical Duration |
| - | - | - |
| `YouTube` | Longer-form, detailed content | 2-10 minutes |
| `TikTok` | Short, punchy, trend-aware content | 15-60 seconds |
| `Instagram` | Visual-first, engaging content | 30-90 seconds |
| `Facebook` | Shareable, social-friendly content | 1-3 minutes |
| `LinkedIn` | Professional, business-focused content | 1-3 minutes |
| `Twitter` | Concise, attention-grabbing content | 15-45 seconds |

### Content Tones

| Value | Style | Best Used For |
| - | - | - |
| `professional` | Formal, business-appropriate | Corporate content, B2B videos |
| `casual` | Relaxed, everyday language | Social media, lifestyle content |
| `friendly` | Warm, approachable | Customer-facing content, tutorials |
| `informative` | Clear, fact-focused | Educational content, explainers |
| `persuasive` | Compelling, action-oriented | Marketing, sales videos |
| `exciting` | Energetic, enthusiastic | Product launches, announcements |
| `educational` | Teaching-focused, structured | Training, learning materials |
| `humorous` | Light-hearted, entertaining | Social media, brand personality |
| `serious` | Grave, important | Announcements, compliance content |
| `conversational` | Natural, dialogue-like | Vlogs, personal content |

> [!WARNING]
>
> **Important Considerations**
>
> * An AI brief requires a valid prompt (1–5000 characters)
> * Cannot be used together with `story`, `blogUrl`, `pptUrl`, `audioUrl`, or `videoUrl` in the same scene
> * The generated content quality depends on the clarity and specificity of your prompt
> * Duration is a target guide - actual length may vary based on generated content

## Common Use Cases

### YouTube Explainer Video

```javascript theme={null}
{
  scenes: [{
    brief: {
      prompt: "The benefits of renewable energy sources and how they're changing the future of power generation",
      videoGoal: "Explainer",
      duration: 180,
      platform: "YouTube",
      tone: "informative"
    },
    createSceneOnEndOfSentence: true
  }]
}
```

### TikTok Marketing Content

```javascript theme={null}
{
  scenes: [{
    brief: {
      prompt: "Why our new fitness app helps you achieve your workout goals faster than any other app",
      videoGoal: "Marketing",
      duration: 30,
      platform: "TikTok",
      tone: "exciting"
    },
    createSceneOnEndOfSentence: true
  }]
}
```

### LinkedIn Professional Update

```javascript theme={null}
{
  scenes: [{
    brief: {
      prompt: "How remote work is reshaping corporate culture and what leaders need to know",
      videoGoal: "Internal Communication",
      duration: 90,
      platform: "LinkedIn",
      tone: "professional"
    },
    createSceneOnEndOfSentence: true
  }]
}
```

### Instagram Product Showcase

```javascript theme={null}
{
  scenes: [{
    brief: {
      prompt: "Introducing our new eco-friendly water bottle with temperature control technology",
      videoGoal: "Product",
      duration: 45,
      platform: "Instagram",
      tone: "friendly"
    },
    createSceneOnEndOfSentence: true
  }]
}
```

### Tutorial Video

```javascript theme={null}
{
  scenes: [{
    brief: {
      prompt: "Step-by-step guide to setting up a home office for maximum productivity",
      videoGoal: "Tutorial",
      duration: 120,
      platform: "YouTube",
      tone: "educational"
    },
    createSceneOnEndOfSentence: true
  }]
}
```

## Combining with Other Features

### With Custom Voice Settings

```javascript theme={null}
{
  voiceOver: {
    enabled: true,
    aiVoices: [{
      speaker: "Emma",
      speed: 95,
      amplificationLevel: 0
    }]
  },
  scenes: [{
    brief: {
      prompt: "Your topic here...",
      videoGoal: "Explainer",
      tone: "friendly"
    },
    createSceneOnEndOfSentence: true
  }]
}
```

### With Background Music

```javascript theme={null}
{
  backgroundMusic: {
    enabled: true,
    autoMusic: true,
    volume: 0.3
  },
  voiceOver: {
    enabled: true,
    aiVoices: [{
      speaker: "Brian",
      speed: 100
    }]
  },
  scenes: [{
    brief: {
      prompt: "Your topic here...",
      videoGoal: "Marketing",
      tone: "exciting"
    },
    createSceneOnEndOfSentence: true
  }]
}
```

### With Brand Settings

```javascript theme={null}
{
  brandName: "Your Brand Name",
  voiceOver: {
    enabled: true,
    aiVoices: [{
      speaker: "Matthew",
      speed: 100
    }]
  },
  scenes: [{
    brief: {
      prompt: "Your topic here...",
      videoGoal: "Marketing",
      platform: "LinkedIn",
      tone: "professional"
    },
    createSceneOnEndOfSentence: true
  }]
}
```

### With Subtitle Styling

```javascript theme={null}
{
  subtitleStyleName: "Corporate Blue",
  voiceOver: {
    enabled: true,
    aiVoices: [{
      speaker: "Joanna",
      speed: 100
    }]
  },
  scenes: [{
    brief: {
      prompt: "Your topic here...",
      videoGoal: "Internal Communication",
      tone: "professional"
    },
    createSceneOnEndOfSentence: true
  }]
}
```

## Writing Effective Prompts

> [accordion] Be Specific and Detailed
>
> More detail in your prompt leads to better results:
>
> **Less Effective:**
>
> ```
> "Talk about AI"
> ```
>
> **More Effective:**
>
> ```
> "Explain how artificial intelligence is being used in healthcare to improve patient diagnosis accuracy and reduce waiting times in emergency rooms"
> ```

> [accordion] Include Key Points
>
> Mention specific points you want covered:
>
> **Example:**
>
> ```
> "Create a video about electric vehicles covering: environmental benefits, cost savings on fuel, available tax incentives, and the growing charging infrastructure"
> ```

> [accordion] Specify Your Audience
>
> Help the AI understand who you are speaking to:
>
> **Example:**
>
> ```
> "Explain blockchain technology for small business owners who have no technical background but want to understand how it could benefit their operations"
> ```

> [accordion] Include Call-to-Action Intent
>
> If you want viewers to take action, mention it:
>
> **Example:**
>
> ```
> "Promote our new project management software, highlighting the time-saving features and encouraging viewers to sign up for a free trial"
> ```

> [accordion] Set the Context
>
> Provide background information when helpful:
>
> **Example:**
>
> ```
> "Given the recent rise in remote work, explain how team collaboration tools have evolved and what features modern teams should look for in 2024"
> ```

## Best Practices

> [accordion] Match Video Type to Content
>
> Choose the video type that best fits your goal:
>
> * **Explainer:** When educating or informing
> * **Marketing:** When promoting or selling
> * **Tutorial:** When teaching step-by-step processes
> * **Product:** When showcasing features and benefits
> * **Internal Communication:** For company/team content

> [accordion] Optimize for Platform
>
> Set the platform to get content optimized for that audience:
>
> * **TikTok:** Shorter, trend-aware, attention-grabbing
> * **YouTube:** More detailed, structured, SEO-friendly
> * **LinkedIn:** Professional, business-focused language
> * **Instagram:** Visual-first, engaging hooks

> [accordion] Use Appropriate Tone
>
> Match tone to your brand and audience:
>
> * **B2B Content:** Professional, informative
> * **Consumer Marketing:** Friendly, exciting, persuasive
> * **Educational:** Informative, educational
> * **Social Media:** Casual, conversational, humorous

> [accordion] Set Realistic Durations
>
> Guide the AI with appropriate target lengths:
>
> * Short social content: 15-60 seconds
> * Standard videos: 60-180 seconds
> * Detailed content: 180-600 seconds
> * The AI will adjust content density accordingly

> [accordion] Review and Iterate
>
> An AI brief is a starting point:
>
> * Review the generated content
> * Create variations with different prompts
> * Adjust tone or platform settings for different results
> * Use the best output as your final video

## Troubleshooting

> [accordion] Generated content is too generic
>
> **Problem:** The AI-generated script lacks specificity.
>
> **Solution:**
>
> * Make your prompt more detailed and specific
> * Include key points you want covered
> * Mention your target audience
> * Add context or background information
> * Specify industry or domain terminology

> [accordion] Content Does Not Match Expected Tone
>
> **Problem:** The generated script does not feel right for your brand.
>
> **Solution:**
>
> * Try a different tone setting
> * Adjust the `videoGoal` to better match your needs
> * Include tone guidance in your prompt
> * Combine tones (e.g., "professional yet friendly")
> * Test multiple tone options to find the best fit

> [accordion] Video is too long or too short
>
> **Problem:** Generated content does not match target duration.
>
> **Solution:**
>
> * Adjust the `duration` parameter
> * Note that duration is a target, not exact
> * Longer prompts may generate longer content
> * Shorter prompts may generate shorter content
> * Platform setting also influences content length

> [accordion] Error: Cannot Use brief With story
>
> **Problem:** API returns error about conflicting parameters.
>
> **Solution:**
>
> * Remove the `story` parameter when using `brief`
> * Only one content source allowed per scene
> * Choose either: brief, story, blogUrl, pptUrl, audioUrl, or videoUrl
> * Each scene can only have one content source

> [accordion] Content seems off-topic
>
> **Problem:** Generated script does not address your intended topic.
>
> **Solution:**
>
> * Rephrase your prompt more clearly
> * Start with the main topic explicitly stated
> * Remove ambiguous wording
> * Be direct about what you want covered
> * Check for typos or unclear references

## Next Steps

Enhance your AI-generated videos with these features:

> [card] [AI Voice-Over](https://docs.pictory.ai/guides/text-to-video/ai-voiceover.md)
>
> Add professional narration to your videos

> [card] [Background Music](https://docs.pictory.ai/guides/advanced-features/background-music.md)
>
> Add music to complement your content

> [card] [Brand Settings](https://docs.pictory.ai/guides/branding-customization/brand-settings.md)
>
> Apply consistent branding across videos

> [card] [Smart Layouts](https://docs.pictory.ai/guides/smart-layouts-and-subtitles/smart-layouts.md)
>
> Use pre-designed layouts for professional presentation

## API Reference

For complete technical details, see:

* [Render Storyboard Video](https://docs.pictory.ai/api-reference/videos/render-storyboard-video.md) - Full API specification
* [Get Job Status](https://docs.pictory.ai/api-reference/jobs/get-video-render-job-by-id.md) - Monitor job status and progress
* [Get Voiceover Tracks](https://docs.pictory.ai/api-reference/voiceovers/get-voiceover-tracks.md) - List available AI voices


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.