Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.babou.ai/llms.txt

Use this file to discover all available pages before exploring further.

Build your first launch ad

Five minutes. Four API calls. One launch-ready video. We’ll build a 30-second product launch ad for a new pricing tier.
1

Get Your API Key

If you haven’t already, get your API key from the Babou dashboard and set it as an environment variable:
export BABOU_API_KEY=sk-bab-your-api-key-here
2

Create a Project

Every video starts with a project. Create one with a name and description:
curl -X POST https://api.babou.ai/api/v1/projects \
  -H "Authorization: Bearer $BABOU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Pricing Page Refresh",
    "description": "Launch campaign for the new Team tier"
  }'
Response:
{
  "id": "prj_abc123xyz",
  "name": "Pricing Page Refresh",
  "description": "Launch campaign for the new Team tier",
  "created_at": "2025-12-02T10:00:00Z"
}
Save the project.id - you’ll need it for the next steps!
3

Add a Chapter

Videos are organized into chapters. Let’s add one:
curl -X POST https://api.babou.ai/api/v1/projects/prj_abc123xyz/chapters \
  -H "Authorization: Bearer $BABOU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Launch Ad",
    "duration": 30
  }'
Response:
{
  "id": "cht_def456uvw",
  "project_id": "prj_abc123xyz",
  "name": "Launch Ad",
  "duration": 30,
  "created_at": "2025-12-02T10:01:00Z"
}
4

Submit a Video Prompt

Now for the magic! Submit a text prompt to create video content:
curl -X POST https://api.babou.ai/api/v1/projects/prj_abc123xyz/chapters/cht_def456uvw/prompt \
  -H "Authorization: Bearer $BABOU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "30-second product launch ad for the new Team tier. Lead with the headline from our latest release notes, drop in the new pricing screenshot, and resolve brand colors and type from the catalog."
  }'
Response:
{
  "prompt_id": "int_abc123xyz789",
  "status": "processing",
  "message": "Prompt processing started",
  "estimated_time": "30-90 seconds"
}
The video creation process typically takes 30-90 seconds. The chapter will be updated with the video content automatically.
5

Export Your Video

Once processing is complete, export the final video:
curl -X POST https://api.babou.ai/api/v1/projects/prj_abc123xyz/export \
  -H "Authorization: Bearer $BABOU_API_KEY"
Response:
{
  "status": "queued",
  "message": "Export started",
  "estimated_time": "2-5 minutes"
}
6

Check Export Status

Poll the export endpoint to check when your video is ready:
curl https://api.babou.ai/api/v1/projects/prj_abc123xyz/export \
  -H "Authorization: Bearer $BABOU_API_KEY"
Response (when completed):
{
  "status": "completed",
  "download_url": "https://assets.babou.ai/exports/prj_abc123xyz.mp4",
  "started_at": "2025-12-02T10:05:00Z",
  "completed_at": "2025-12-02T10:08:00Z",
  "duration_seconds": 180
}

Complete Example

Here’s a complete script that creates a video from start to finish:
const BABOU_API_KEY = process.env.BABOU_API_KEY;
const BASE_URL = 'https://api.babou.ai/api/v1';

async function createVideo() {
  // 1. Create project
  const projectRes = await fetch(`${BASE_URL}/projects`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${BABOU_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Pricing Page Refresh',
      description: 'Launch campaign for the new Team tier'
    })
  });
  const project = await projectRes.json();
  console.log('✓ Project created:', project.id);

  // 2. Add chapter
  const chapterRes = await fetch(
    `${BASE_URL}/projects/${project.id}/chapters`,
    {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${BABOU_API_KEY}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        name: 'Launch Ad',
        duration: 30
      })
    }
  );
  const chapter = await chapterRes.json();
  console.log('✓ Chapter created:', chapter.id);

  // 3. Submit prompt
  const promptRes = await fetch(
    `${BASE_URL}/projects/${project.id}/chapters/${chapter.id}/prompt`,
    {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${BABOU_API_KEY}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        content: 'Product launch ad for the new Team tier, pulling the headline from our release notes'
      })
    }
  );
  console.log('✓ Prompt submitted, processing...');

  // Wait for processing
  await new Promise(resolve => setTimeout(resolve, 60000));

  // 4. Export video
  await fetch(`${BASE_URL}/projects/${project.id}/export`, {
    method: 'POST',
    headers: { 'Authorization': `Bearer ${BABOU_API_KEY}` }
  });
  console.log('✓ Export started...');

  // 5. Wait for completion
  while (true) {
    const statusRes = await fetch(
      `${BASE_URL}/projects/${project.id}/export`,
      {
        headers: { 'Authorization': `Bearer ${BABOU_API_KEY}` }
      }
    );
    const status = await statusRes.json();

    if (status.status === 'completed') {
      console.log('✓ Video ready!');
      console.log('Download:', status.download_url);
      break;
    }

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

createVideo();

Next Steps

Upload Assets

Learn how to upload and use custom images, videos, and audio

Video Creation Workflow

Deep dive into creating complex multi-chapter videos

API Reference

Explore all available endpoints and options

MCP Server

Integrate with AI agents like Claude