> ## 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.

# Create Video with Avatar

> Learn how to create engaging videos with AI avatars using the Pictory API

> [!NOTE]
>
> **🎉 New Feature!** AI Avatars are now available in the Pictory API. Create presenter-style videos with lifelike avatars that lip-sync to AI narration - no cameras or studios required.

## Introduction

AI avatars bring a human presence to your videos without requiring cameras, studios, or on-screen talent. This guide walks you through creating professional avatar-powered videos using the Pictory API.

> [!NOTE]
>
> Avatar videos combine AI voice-over with lifelike avatar animations that lip-sync to your narration, creating engaging presenter-style content perfect for training, marketing, education, and social media.

***

## Quick Start

Here's a minimal example to create your first avatar video:

```javascript theme={null}
const response = await fetch('https://api.pictory.ai/pictoryapis/v2/video/storyboard', {
  method: 'POST',
  headers: {
    'Authorization': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    videoName: 'my_first_avatar_video',
    language: 'en',
    videoWidth: 1920,
    videoHeight: 1080,

    // Voice-over is required for avatar videos
    voiceOver: {
      enabled: true,
      aiVoices: [{
        speaker: 'Matthew',
        speed: 100
      }]
    },

    // Avatar configuration
    avatar: {
      avatarId: 'Annie_expressive12_public',
      position: 'bottom-right',
      width: '20%'
    },

    // Your content
    scenes: [{
      story: 'Welcome to my video! Today we will explore how AI avatars make video creation simple and engaging.',
      createSceneOnEndOfSentence: true,
      minimumDuration: 4
    }]
  })
});

const result = await response.json();
console.log('Job ID:', result.data.jobId);
```

***

## AI Credits

Avatar video generation consumes AI credits from your account. Ensure you have sufficient AI credits before using the Avatar feature.

> [!WARNING]
>
> Avatar generation costs **22.5 AI credits per 30 seconds** of video with one of Pictory's library avatars, and **52.5 AI credits per 30 seconds** with a custom avatar you created from your own video. Plan your video length accordingly to manage credit usage.
>
> The [Get Avatars](https://docs.pictory.ai/api-reference/avatars/get-avatars.md) API lists only Pictory's library avatars. Custom avatars are the ones you created in your Pictory account.

***

## Prerequisites

Before creating avatar videos, you need:

1. **API Key** - Get your API key from the Pictory dashboard
2. **Avatar Details** - Use the [Get Avatars](https://docs.pictory.ai/api-reference/avatars/get-avatars.md) API to retrieve available `avatarId` values
3. **Voice Selection** - Choose an AI voice from the [Get Voiceover Tracks](https://docs.pictory.ai/api-reference/voiceovers/get-voiceover-tracks.md) API
4. **AI Credits** - Sufficient AI credits in your account (22.5 credits per 30 seconds of video with a library avatar, or 52.5 with a custom avatar)

***

## Step-by-Step Guide

### Step 1: Configure Basic Video Settings

Start with the essential video parameters:

```json theme={null}
{
  "videoName": "corporate_training_video",
  "language": "en",
  "videoWidth": 1920,
  "videoHeight": 1080,
  "saveProject": true
}
```

**videoName** `string` *required*

Give your video a descriptive name (alphanumeric, spaces, underscores, hyphens)

**language** `string`

Content language: `en`, `es`, `fr`, `de`, `it`, `pt`, `ja`, `ko`, `zh`, `nl`, `ru`, `hi`

**videoWidth** `integer`

Video width in pixels (e.g., 1920 for Full HD)

**videoHeight** `integer`

Video height in pixels (e.g., 1080 for Full HD)

**saveProject** `boolean`

Save project for future editing (recommended: `true`)

***

### Step 2: Set Up Voice-Over

Voice-over is **required** when using avatars - the avatar will lip-sync to the narration:

```json theme={null}
{
  "voiceOver": {
    "enabled": true,
    "aiVoices": [
      {
        "speaker": "Matthew",
        "speed": 100,
        "amplificationLevel": 0
      }
    ]
  }
}
```

> [!TIP]
>
> **Voice Selection Tips:**
>
> * Match voice gender to your avatar when possible
> * Use professional voices (Brian, Matthew, Emma) for business content
> * Adjust speed to 90-110 for natural delivery
> * Get available voices from [Get Voiceover Tracks](https://docs.pictory.ai/api-reference/voiceovers/get-voiceover-tracks.md)

***

### Step 3: Configure Your Avatar

Add the avatar configuration with appearance and positioning:

```json theme={null}
{
  "avatar": {
    "avatarId": "Annie_expressive12_public",
    "position": "bottom-right",
    "width": "20%",
    "borderRadius": "100",
    "borderColor": "rgba(185,185,186,1)",
    "borderThickness": 4,
    "backgroundColor": "rgba(255,255,255,1)"
  }
}
```

#### Required Avatar Fields

**avatarId** `string` *required*

Unique identifier for the avatar (e.g., "Annie\_expressive12\_public"). Get from [Get Avatars](https://docs.pictory.ai/api-reference/avatars/get-avatars.md) API.

#### Optional Styling

**position** `string`

Preset position: `top-left`, `top-center`, `top-right`, `center-left`, `center-center`, `center-right`, `bottom-left`, `bottom-center`, `bottom-right`

Default: `bottom-right`

**width** `string`

Avatar width as percentage. Must be an integer percentage from 0% to 100% (e.g., "20%", "25%", "30%"). Decimal percentages like "25.5%" are not supported.

Default: `"20%"`

Recommended: 15-30% for optimal balance

**borderRadius** `string`

Corner rounding: `0` (square), `50` (rounded), `100` (circular)

**backgroundColor** `string`

Background color in RGBA format (e.g., "rgba(255,255,255,1)")

***

### Step 4: Add Your Content

Define scenes with the text your avatar will narrate:

```json theme={null}
{
  "scenes": [
    {
      "story": "Welcome to Pictory. In this video, we will explore how AI avatars work.",
      "createSceneOnEndOfSentence": true,
      "minimumDuration": 4
    },
    {
      "story": "You can create professional videos without cameras or studios.",
      "createSceneOnEndOfSentence": true,
      "minimumDuration": 4,
      "background": {
        "type": "video",
        "visualUrl": "https://example.com/background.mp4",
        "settings": {
          "mute": true,
          "loop": true
        }
      }
    }
  ]
}
```

> [!TIP]
>
> **Scene Best Practices:**
>
> * Use `createSceneOnEndOfSentence: true` for natural pacing
> * Set minimum duration of 3-5 seconds
> * Keep individual scenes under 15 seconds
> * Use clear, conversational language

***

### Step 5: Add Background Music (Optional)

Enhance your video with background music:

```json theme={null}
{
  "backgroundMusic": {
    "enabled": true,
    "autoMusic": true,
    "volume": 0.15
  }
}
```

> [!WARNING]
>
> **Volume Recommendations:**
>
> * Keep music volume between 0.1-0.2 when using voice-over
> * Higher volumes may overpower the avatar's narration
> * Test different levels to find the right balance

***

## Complete Example

Here's a full example with all features:

```javascript JavaScript theme={null}
const response = await fetch('https://api.pictory.ai/pictoryapis/v2/video/storyboard', {
  method: 'POST',
  headers: {
    'Authorization': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    videoName: 'complete_avatar_demo',
    language: 'en',
    videoWidth: 1920,
    videoHeight: 1080,
    saveProject: true,

    voiceOver: {
      enabled: true,
      aiVoices: [{
        speaker: 'Matthew',
        speed: 100,
        amplificationLevel: 0
      }]
    },

    backgroundMusic: {
      enabled: true,
      autoMusic: true,
      volume: 0.15
    },

    avatar: {
      avatarId: 'Annie_expressive12_public',
      position: 'bottom-right',
      width: '20%',
      borderRadius: '100',
      borderColor: 'rgba(185,185,186,1)',
      borderThickness: 4,
      backgroundColor: 'rgba(255,255,255,1)'
    },

    scenes: [
      {
        story: 'Welcome to our training session. Today we will cover three important topics.',
        createSceneOnEndOfSentence: true,
        minimumDuration: 4
      },
      {
        story: 'First, we will explore the fundamentals of our product.',
        createSceneOnEndOfSentence: true,
        minimumDuration: 4
      },
      {
        story: 'Then we will learn about best practices and common use cases.',
        createSceneOnEndOfSentence: true,
        minimumDuration: 4
      }
    ]
  })
});

const result = await response.json();
console.log('Job ID:', result.data.jobId);
```

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

response = requests.post(
    'https://api.pictory.ai/pictoryapis/v2/video/storyboard',
    headers={
        'Authorization': 'YOUR_API_KEY',
        'Content-Type': 'application/json'
    },
    json={
        'videoName': 'complete_avatar_demo',
        'language': 'en',
        'videoWidth': 1920,
        'videoHeight': 1080,
        'saveProject': True,

        'voiceOver': {
            'enabled': True,
            'aiVoices': [{
                'speaker': 'Matthew',
                'speed': 100,
                'amplificationLevel': 0
            }]
        },

        'backgroundMusic': {
            'enabled': True,
            'autoMusic': True,
            'volume': 0.15
        },

        'avatar': {
            'avatarId': 'Annie_expressive12_public',
            'position': 'bottom-right',
            'width': '20%',
            'borderRadius': '100',
            'borderColor': 'rgba(185,185,186,1)',
            'borderThickness': 4,
            'backgroundColor': 'rgba(255,255,255,1)'
        },

        'scenes': [
            {
                'story': 'Welcome to our training session. Today we will cover three important topics.',
                'createSceneOnEndOfSentence': True,
                'minimumDuration': 4
            },
            {
                'story': 'First, we will explore the fundamentals of our product.',
                'createSceneOnEndOfSentence': True,
                'minimumDuration': 4
            },
            {
                'story': 'Then we will learn about best practices and common use cases.',
                'createSceneOnEndOfSentence': True,
                'minimumDuration': 4
            }
        ]
    }
)

result = response.json()
print(f"Job ID: {result['data']['jobId']}")
```

```bash cURL theme={null}
curl --request POST \
  --url https://api.pictory.ai/pictoryapis/v2/video/storyboard \
  --header 'Authorization: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "videoName": "complete_avatar_demo",
    "language": "en",
    "videoWidth": 1920,
    "videoHeight": 1080,
    "saveProject": true,
    "voiceOver": {
      "enabled": true,
      "aiVoices": [{
        "speaker": "Matthew",
        "speed": 100,
        "amplificationLevel": 0
      }]
    },
    "backgroundMusic": {
      "enabled": true,
      "autoMusic": true,
      "volume": 0.15
    },
    "avatar": {
      "avatarId": "Annie_expressive12_public",
      "position": "bottom-right",
      "width": "20%",
      "borderRadius": "100",
      "borderColor": "rgba(185,185,186,1)",
      "borderThickness": 4,
      "backgroundColor": "rgba(255,255,255,1)"
    },
    "scenes": [
      {
        "story": "Welcome to our training session. Today we will cover three important topics.",
        "createSceneOnEndOfSentence": true,
        "minimumDuration": 4
      }
    ]
  }'
```

***

## Monitoring Progress

After creating your avatar video, poll the job status:

```javascript theme={null}
// Poll for job completion
const checkStatus = async (jobId) => {
  const response = await fetch(
    `https://api.pictory.ai/pictoryapis/v1/jobs/${jobId}`,
    {
      headers: { 'Authorization': 'YOUR_API_KEY' }
    }
  );

  const job = await response.json();

  if (job.data.status === 'completed') {
    console.log('Video ready!');
    console.log('Preview URL:', job.data.previewUrl);
    console.log('Project URL:', job.data.projectUrl);
    console.log('Video URL:', job.data.videoURL);
  } else if (job.data.status === 'failed') {
    console.error('Video creation failed');
  } else {
    console.log('Status:', job.data.status);
    // Poll again after 5 seconds
    setTimeout(() => checkStatus(jobId), 5000);
  }
};

// Start polling
checkStatus(result.data.jobId);
```

***

## Common Use Cases

> [accordion] Corporate Training Videos
>
> Create training modules with a professional avatar instructor:
>
> * Use formal voices (Matthew, Brian)
> * Position avatar prominently (center-left or center-right)
> * Include clear topic transitions
> * Add relevant background visuals

> [accordion] Product Demo Videos
>
> Showcase products with an avatar guide:
>
> * Use friendly voices (Emma, Joanna)
> * Position avatar in bottom corner to not block product
> * Keep narration concise and benefits-focused
> * Use product images/videos as backgrounds

> [accordion] Social Media Content
>
> Create engaging social posts:
>
> * Use 9:16 aspect ratio (vertical)
> * Position avatar prominently (center or top-third)
> * Keep videos under 60 seconds
> * Use dynamic voice pacing

> [accordion] Educational Content
>
> Build course content with avatar teachers:
>
> * Use clear, measured voice pacing
> * Position avatar consistently across lessons
> * Break content into 5-10 minute segments
> * Include visual aids in backgrounds

***

## Best Practices

> [card] Script Writing
>
> * Write in conversational tone
> * Use short, clear sentences
> * Include natural pauses
> * Test pronunciation of technical terms

> [card] Avatar Positioning
>
> * Don't overlap subtitles or key visuals
> * Keep size between 15-25% of frame
> * Use consistent positioning
> * Consider background contrast

> [card] Audio Balance
>
> * Set music volume to 0.1-0.2
> * Use clear AI voices
> * Adjust speed to 90-110
> * Test audio clarity

> [card] Scene Pacing
>
> * 4-5 seconds minimum per scene
> * Natural sentence breaks
> * Add pauses between topics
> * Keep scenes under 15 seconds

***

## Troubleshooting

> [accordion] Avatar Not Appearing
>
> **Issue:** Avatar does not show in video
>
> **Solutions:**
>
> * Verify all required avatar fields are provided
> * Check avatar URLs are accessible
> * Ensure voiceOver is enabled with at least one AI voice
> * Validate avatarId field

> [accordion] Lip Sync Issues
>
> **Issue:** Avatar lip movements do not match audio
>
> **Solutions:**
>
> * Ensure voice-over is properly configured
> * Check that speaker is available for your plan
> * Try adjusting voice speed to 100
> * Contact support if issue persists

> [accordion] Audio Too Quiet/Loud
>
> **Issue:** Voice or music volume is off
>
> **Solutions:**
>
> * Adjust `amplificationLevel` (-1 to 1)
> * Reduce background music volume (0.1-0.2)
> * Test different volume combinations
> * Keep music instrumental only

> [accordion] Avatar Position Issues
>
> **Issue:** Avatar overlaps important content
>
> **Solutions:**
>
> * Try different preset positions
> * Use custom top/left positioning
> * Reduce avatar width
> * Adjust per-scene if needed

***

## Next Steps

> [card] [Get Avatars](https://docs.pictory.ai/api-reference/avatars/get-avatars.md)
>
> Browse available avatars and their looks

> [card] [Avatar Positioning](https://docs.pictory.ai/guides/video-with-avatar/avatar-positioning.md)
>
> Learn advanced positioning techniques

> [card] [Scene-Level Customization](https://docs.pictory.ai/guides/video-with-avatar/scene-level-customization.md)
>
> Customize avatars per scene

> [card] [API Reference](https://docs.pictory.ai/api-reference/videos/create-storyboard-preview.md)
>
> Full API documentation

> [card] [Voice-Over Guide](https://docs.pictory.ai/guides/text-to-video/ai-voiceover.md)
>
> Master AI voice-over settings


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