Skip to main content
This guide shows you how to use the Story CoPilot feature to automatically generate video scripts 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.

What You’ll Learn

AI Script Generation

Generate video scripts from simple prompts

Video Type Optimization

Create content optimized for different video types

Platform Targeting

Tailor scripts for specific social platforms

Tone Control

Adjust the voice and style of generated content

Before You Begin

Make sure you have:
  • A Pictory API key (get one here)
  • Node.js or Python installed on your machine
  • A clear idea of your video topic
  • Understanding of your target audience and platform
npm install axios

How Story CoPilot Works

When you use Story CoPilot to generate a video:
  1. Prompt Submission - You provide a topic or description for your video
  2. AI Processing - The CoPilot 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
Story CoPilot 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

import axios from "axios";

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

async function createVideoWithStoryCoPilot() {
  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 Story CoPilot
        scenes: [
          {
            // Story CoPilot configuration
            storyCoPilot: {
              prompt: "How artificial intelligence is transforming video creation and making professional content accessible to everyone",
              videoType: "Explainer",           // Type of 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;
  }
}

createVideoWithStoryCoPilot();

Understanding the Parameters

Story CoPilot Configuration

ParameterTypeRequiredDescription
storyCoPilot.promptstringYesThe topic or description for AI to generate content (1-5000 characters)
storyCoPilot.videoTypestringNoType of video to create (default: “Explainer”)
storyCoPilot.durationnumberNoTarget video duration in seconds (1-600)
storyCoPilot.platformstringNoTarget social media platform for optimization
storyCoPilot.tonestringNoTone and style of the generated content

Video Types

ValueDescriptionBest Used For
ExplainerEducational content that explains concepts clearlyHow-to videos, concept explanations, educational content
MarketingPromotional content designed to engage and convertProduct promotions, brand awareness, advertising
Internal CommunicationProfessional content for internal teamsCompany updates, training videos, team announcements
TutorialStep-by-step instructional contentSoftware tutorials, DIY guides, learning materials
ProductProduct-focused content highlighting featuresProduct demos, feature showcases, launch videos

Target Platforms

ValueOptimizationTypical Duration
YouTubeLonger-form, detailed content2-10 minutes
TikTokShort, punchy, trend-aware content15-60 seconds
InstagramVisual-first, engaging content30-90 seconds
FacebookShareable, social-friendly content1-3 minutes
LinkedInProfessional, business-focused content1-3 minutes
TwitterConcise, attention-grabbing content15-45 seconds

Content Tones

ValueStyleBest Used For
professionalFormal, business-appropriateCorporate content, B2B videos
casualRelaxed, everyday languageSocial media, lifestyle content
friendlyWarm, approachableCustomer-facing content, tutorials
informativeClear, fact-focusedEducational content, explainers
persuasiveCompelling, action-orientedMarketing, sales videos
excitingEnergetic, enthusiasticProduct launches, announcements
educationalTeaching-focused, structuredTraining, learning materials
humorousLight-hearted, entertainingSocial media, brand personality
seriousGrave, importantAnnouncements, compliance content
conversationalNatural, dialogue-likeVlogs, personal content
Important Considerations
  • Story CoPilot 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

{
  scenes: [{
    storyCoPilot: {
      prompt: "The benefits of renewable energy sources and how they're changing the future of power generation",
      videoType: "Explainer",
      duration: 180,
      platform: "YouTube",
      tone: "informative"
    },
    createSceneOnEndOfSentence: true
  }]
}

TikTok Marketing Content

{
  scenes: [{
    storyCoPilot: {
      prompt: "Why our new fitness app helps you achieve your workout goals faster than any other app",
      videoType: "Marketing",
      duration: 30,
      platform: "TikTok",
      tone: "exciting"
    },
    createSceneOnEndOfSentence: true
  }]
}

LinkedIn Professional Update

{
  scenes: [{
    storyCoPilot: {
      prompt: "How remote work is reshaping corporate culture and what leaders need to know",
      videoType: "Internal Communication",
      duration: 90,
      platform: "LinkedIn",
      tone: "professional"
    },
    createSceneOnEndOfSentence: true
  }]
}

Instagram Product Showcase

{
  scenes: [{
    storyCoPilot: {
      prompt: "Introducing our new eco-friendly water bottle with temperature control technology",
      videoType: "Product",
      duration: 45,
      platform: "Instagram",
      tone: "friendly"
    },
    createSceneOnEndOfSentence: true
  }]
}

Tutorial Video

{
  scenes: [{
    storyCoPilot: {
      prompt: "Step-by-step guide to setting up a home office for maximum productivity",
      videoType: "Tutorial",
      duration: 120,
      platform: "YouTube",
      tone: "educational"
    },
    createSceneOnEndOfSentence: true
  }]
}

Combining with Other Features

With Custom Voice Settings

{
  voiceOver: {
    enabled: true,
    aiVoices: [{
      speaker: "Emma",
      speed: 95,
      amplificationLevel: 0
    }]
  },
  scenes: [{
    storyCoPilot: {
      prompt: "Your topic here...",
      videoType: "Explainer",
      tone: "friendly"
    },
    createSceneOnEndOfSentence: true
  }]
}

With Background Music

{
  backgroundMusic: {
    enabled: true,
    autoMusic: true,
    volume: 0.3
  },
  voiceOver: {
    enabled: true,
    aiVoices: [{
      speaker: "Brian",
      speed: 100
    }]
  },
  scenes: [{
    storyCoPilot: {
      prompt: "Your topic here...",
      videoType: "Marketing",
      tone: "exciting"
    },
    createSceneOnEndOfSentence: true
  }]
}

With Brand Settings

{
  brandName: "Your Brand Name",
  voiceOver: {
    enabled: true,
    aiVoices: [{
      speaker: "Matthew",
      speed: 100
    }]
  },
  scenes: [{
    storyCoPilot: {
      prompt: "Your topic here...",
      videoType: "Marketing",
      platform: "LinkedIn",
      tone: "professional"
    },
    createSceneOnEndOfSentence: true
  }]
}

With Subtitle Styling

{
  subtitleStyleName: "Corporate Blue",
  voiceOver: {
    enabled: true,
    aiVoices: [{
      speaker: "Joanna",
      speed: 100
    }]
  },
  scenes: [{
    storyCoPilot: {
      prompt: "Your topic here...",
      videoType: "Internal Communication",
      tone: "professional"
    },
    createSceneOnEndOfSentence: true
  }]
}

Writing Effective Prompts

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"
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"
Help the AI understand who you’re 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"
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"
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

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
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
Match tone to your brand and audience:
  • B2B Content: Professional, informative
  • Consumer Marketing: Friendly, exciting, persuasive
  • Educational: Informative, educational
  • Social Media: Casual, conversational, humorous
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
Story CoPilot 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

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
Problem: The generated script doesn’t feel right for your brand.Solution:
  • Try a different tone setting
  • Adjust the videoType 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
Problem: Generated content doesn’t 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
Problem: API returns error about conflicting parameters.Solution:
  • Remove the story parameter when using storyCoPilot
  • Only one content source allowed per scene
  • Choose either: storyCoPilot, story, blogUrl, pptUrl, audioUrl, or videoUrl
  • Each scene can only have one content source
Problem: Generated script doesn’t 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:

API Reference

For complete technical details, see: