Story Video Generator Agent Skill - AI Pass API
Story Video Generator Agent Skill
This agent skill enables AI agents to transform written stories into animated videos using the AI Pass API. Perfect for content creation workflows, educational tools, and automated video production.
Skill Overview
The Story Video Generator skill provides:
- Automated video creation from story text
- Multiple animation styles (2D, 3D, anime, watercolor, realistic)
- Customizable duration and resolution options
- Voiceover integration with AI-generated or custom audio
- Scene-aware generation with automatic transitions
Installation
Add this skill to your agent by including the following skillContent:
{
"skillName": "story-video-generator",
"skillVersion": "1.0.0",
"description": "Transform written stories into animated videos using AI Pass API",
"skillContent": {
"name": "generateStoryVideo",
"description": "Generate an animated video from a written story",
"parameters": {
"type": "object",
"properties": {
"storyText": {
"type": "string",
"description": "The written story or narrative script"
},
"animationStyle": {
"type": "string",
"enum": ["2d", "3d", "anime", "watercolor", "realistic"],
"description": "Animation style for the video",
"default": "2d"
},
"duration": {
"type": "number",
"description": "Video duration in seconds (30-300)",
"default": 60,
"minimum": 30,
"maximum": 300
},
"resolution": {
"type": "string",
"enum": ["720", "1080", "2160"],
"description": "Video resolution (720p, 1080p, 4K)",
"default": "1080"
},
"includeVoiceover": {
"type": "boolean",
"description": "Include AI-generated voiceover",
"default": true
},
"mood": {
"type": "string",
"description": "Overall mood of the video (magical, adventure, romantic, suspense, etc.)",
"default": "neutral"
},
"characters": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"description": { "type": "string" }
}
},
"description": "Character descriptions for consistency"
}
},
"required": ["storyText"]
},
"apiEndpoint": "https://aipass.one/api/v1/generate/image",
"model": "gemini/gemini-3-pro-image-preview",
"temperature": 1
}
}
API Authentication
To use this skill, you need an AI Pass API key:
- Go to AI Pass Developer Dashboard
- Navigate to API Keys section
- Click Generate New API Key
- Copy your API key
- IMPORTANT: Never hardcode API keys in your agent code. Use environment variables or secure configuration.
Usage Example
// Example implementation
async function generateStoryVideo(storyText, options = {}) {
const API_KEY = process.env.AIPASS_API_KEY || '$AIPASS_API_KEY';
const {
animationStyle = '2d',
duration = 60,
resolution = '1080',
includeVoiceover = true,
mood = 'neutral',
characters = []
} = options;
// First, generate detailed video prompt using GPT-5
const characterDescriptions = characters
.map(c => `${c.name}: ${c.description}`)
.join('\n');
const textPrompt = `Create a detailed video generation prompt for this story:
Story: ${storyText}
Animation style: ${animationStyle}
Duration: ${duration} seconds
Resolution: ${resolution}p
Voiceover: ${includeVoiceover ? 'Yes' : 'No'}
Mood: ${mood}
${characters.length ? `Characters:\n${characterDescriptions}` : ''}
Provide a structured prompt that includes:
- Scene breakdown with timestamps
- Character descriptions and expressions
- Visual style, lighting, and atmosphere
- Color palette and mood
- Camera angles and movements
- Transitions between scenes`;
// Generate the prompt
const promptResponse = await fetch('https://aipass.one/api/v1/generate/text', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${API_KEY}`
},
body: JSON.stringify({
model: 'gpt-5-mini',
prompt: textPrompt,
temperature: 1,
max_tokens: 16000
})
});
const promptData = await promptResponse.json();
const videoPrompt = promptData.text;
// Generate the video
const videoResponse = await fetch('https://aipass.one/api/v1/generate/image', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${API_KEY}`
},
body: JSON.stringify({
model: 'gemini/gemini-3-pro-image-preview',
prompt: videoPrompt,
style: animationStyle,
duration: duration,
resolution: resolution,
voiceover: includeVoiceover
})
});
const videoData = await videoResponse.json();
return {
prompt: videoPrompt,
video: videoData,
metadata: {
style: animationStyle,
duration: duration,
resolution: resolution,
voiceover: includeVoiceover
}
};
}
// Usage
const result = await generateStoryVideo(
'Once upon a time, a curious young girl named Luna discovered a magical forest. The trees whispered secrets, and flowers glowed with soft light. Luna smiled and stepped deeper into the enchanted woods, wondering what adventure awaited her.',
{
animationStyle: '2d',
duration: 60,
resolution: '1080',
includeVoiceover: true,
mood: 'magical',
characters: [
{
name: 'Luna',
description: 'Young girl, 10 years old, curious expression, long brown hair, blue eyes, wearing a red dress'
}
]
}
);
console.log('Video prompt:', result.prompt);
console.log('Video generated:', result.video);
Skill Parameters
storyText (required)
- Type: string
- Description: The written story or narrative script
- Example: "Once upon a time, a curious young girl discovered a magical forest..."
animationStyle (optional)
- Type: enum
- Default: "2d"
- Values: "2d", "3d", "anime", "watercolor", "realistic"
- Description: Animation style for the video
duration (optional)
- Type: number
- Default: 60
- Range: 30-300 seconds
- Description: Video duration in seconds
resolution (optional)
- Type: enum
- Default: "1080"
- Values: "720" (720p), "1080" (1080p), "2160" (4K)
- Description: Video resolution
includeVoiceover (optional)
- Type: boolean
- Default: true
- Description: Include AI-generated voiceover
mood (optional)
- Type: string
- Default: "neutral"
- Description: Overall mood of the video
- Examples: "magical", "adventure", "romantic", "suspense", "happy", "sad"
characters (optional)
- Type: array of objects
- Description: Character descriptions for consistency across scenes
- Properties:
name: Character namedescription: Visual description
Model Configuration
model: gemini/gemini-3-pro-image-preview
- Why: Advanced visual understanding and generation
- Performance: High-quality video scenes with rich detail
- Use case: Story visualization and scene creation
temperature: 1
- Why: Maximum creativity and variation
- Effect: Each video generation is unique
- Use case: Stories benefit from creative visual interpretations
Best Practices
- Be descriptive: More story detail = better visual output
- Define characters clearly: Ensure consistency across scenes
- Specify mood: Helps AI match visual tone to story tone
- Use dialogue: AI can create lip-sync and character expressions
- Include transitions: Keywords like "suddenly", "meanwhile" help create scene changes
Error Handling
try {
const result = await generateStoryVideo(storyText, options);
} catch (error) {
if (error.status === 401) {
console.error('Invalid API key. Get your key from: https://aipass.one/developer/dashboard');
} else if (error.status === 429) {
console.error('Rate limit exceeded. Please retry later.');
} else if (error.status === 400) {
console.error('Invalid parameters. Check story length and duration limits.');
} else {
console.error('Error generating video:', error.message);
}
}
Integration Examples
Content Management System
// Auto-generate videos from stories
stories.forEach(async (story) => {
if (!story.videoUrl) {
const result = await generateStoryVideo(
story.content,
{
animationStyle: story.animationStyle,
mood: story.mood
}
);
story.videoUrl = result.video.url;
await updateStory(story);
}
});
Educational Platform
// Create animated lessons
async function createLessonVideo(lesson) {
const story = lessonToStory(lesson);
const video = await generateStoryVideo(story, {
animationStyle: '2d',
duration: 120,
mood: 'educational',
includeVoiceover: true
});
return video;
}
Social Media Automation
// Generate content for multiple platforms
async function createSocialVideos(story) {
const platforms = [
{ name: 'instagram', duration: 30, resolution: '1080' },
{ name: 'youtube', duration: 120, resolution: '2160' },
{ name: 'tiktok', duration: 60, resolution: '1080' }
];
return Promise.all(
platforms.map(p =>
generateStoryVideo(story, p)
)
);
}
Get Your API Key
- Visit AI Pass Developer Dashboard
- Sign up or log in ($1 free credit on signup)
- Go to API Keys section
- Click Generate New API Key
- Store securely in environment variables
Pricing
- gemini/gemini-3-pro-image-preview: Advanced video generation
- $1 free credit on signup to test the skill
- Pay-as-you-go pricing after free credit
Support
Security Notes
- NEVER commit API keys to version control
- Use environment variables for API keys
- Rotate API keys regularly
- Implement rate limiting in your agent
- Validate all inputs before API calls
- Sanitize user-provided story content