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

# Quickstart

> Build a launch ad with Babou in under 5 minutes

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

<Steps>
  <Step title="Get Your API Key">
    If you haven't already, [get your API key](/authentication) from the Babou dashboard and set it as an environment variable:

    ```bash theme={null}
    export BABOU_API_KEY=sk-bab-your-api-key-here
    ```
  </Step>

  <Step title="Create a Project">
    Every video starts with a project. Create one with a name and description:

    <CodeGroup>
      ```bash curl theme={null}
      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"
        }'
      ```

      ```typescript TypeScript theme={null}
      const response = await fetch('https://api.babou.ai/api/v1/projects', {
        method: 'POST',
        headers: {
          'Authorization': `Bearer ${process.env.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 response.json();
      console.log('Project ID:', project.id);
      ```

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

      response = requests.post(
          'https://api.babou.ai/api/v1/projects',
          headers={
              'Authorization': f'Bearer {os.environ["BABOU_API_KEY"]}',
              'Content-Type': 'application/json'
          },
          json={
              'name': 'Pricing Page Refresh',
              'description': 'Launch campaign for the new Team tier'
          }
      )

      project = response.json()
      print('Project ID:', project['id'])
      ```
    </CodeGroup>

    **Response:**

    ```json theme={null}
    {
      "id": "prj_abc123xyz",
      "name": "Pricing Page Refresh",
      "description": "Launch campaign for the new Team tier",
      "created_at": "2025-12-02T10:00:00Z"
    }
    ```

    <Tip>Save the `project.id` - you'll need it for the next steps!</Tip>
  </Step>

  <Step title="Add a Chapter">
    Videos are organized into chapters. Let's add one:

    <CodeGroup>
      ```bash curl theme={null}
      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
        }'
      ```

      ```typescript TypeScript theme={null}
      const projectId = 'prj_abc123xyz'; // From previous step

      const response = await fetch(
        `https://api.babou.ai/api/v1/projects/${projectId}/chapters`,
        {
          method: 'POST',
          headers: {
            'Authorization': `Bearer ${process.env.BABOU_API_KEY}`,
            'Content-Type': 'application/json'
          },
          body: JSON.stringify({
            name: 'Launch Ad',
            duration: 30
          })
        }
      );

      const chapter = await response.json();
      console.log('Chapter ID:', chapter.id);
      ```

      ```python Python theme={null}
      project_id = 'prj_abc123xyz'  # From previous step

      response = requests.post(
          f'https://api.babou.ai/api/v1/projects/{project_id}/chapters',
          headers={
              'Authorization': f'Bearer {os.environ["BABOU_API_KEY"]}',
              'Content-Type': 'application/json'
          },
          json={
              'name': 'Launch Ad',
              'duration': 30
          }
      )

      chapter = response.json()
      print('Chapter ID:', chapter['id'])
      ```
    </CodeGroup>

    **Response:**

    ```json theme={null}
    {
      "id": "cht_def456uvw",
      "project_id": "prj_abc123xyz",
      "name": "Launch Ad",
      "duration": 30,
      "created_at": "2025-12-02T10:01:00Z"
    }
    ```
  </Step>

  <Step title="Submit a Video Prompt">
    Now for the magic! Submit a text prompt to create video content:

    <CodeGroup>
      ```bash curl theme={null}
      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."
        }'
      ```

      ```typescript TypeScript theme={null}
      const projectId = 'prj_abc123xyz';
      const chapterId = 'cht_def456uvw';

      const response = await fetch(
        `https://api.babou.ai/api/v1/projects/${projectId}/chapters/${chapterId}/prompt`,
        {
          method: 'POST',
          headers: {
            'Authorization': `Bearer ${process.env.BABOU_API_KEY}`,
            'Content-Type': 'application/json'
          },
          body: JSON.stringify({
            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.'
          })
        }
      );

      const result = await response.json();
      console.log('Status:', result.status);
      console.log('Estimated time:', result.estimated_time);
      ```

      ```python Python theme={null}
      project_id = 'prj_abc123xyz'
      chapter_id = 'cht_def456uvw'

      response = requests.post(
          f'https://api.babou.ai/api/v1/projects/{project_id}/chapters/{chapter_id}/prompt',
          headers={
              'Authorization': f'Bearer {os.environ["BABOU_API_KEY"]}',
              'Content-Type': 'application/json'
          },
          json={
              '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.'
          }
      )

      result = response.json()
      print('Status:', result['status'])
      print('Estimated time:', result['estimated_time'])
      ```
    </CodeGroup>

    **Response:**

    ```json theme={null}
    {
      "prompt_id": "int_abc123xyz789",
      "status": "processing",
      "message": "Prompt processing started",
      "estimated_time": "30-90 seconds"
    }
    ```

    <Info>
      The video creation process typically takes 30-90 seconds. The chapter will be updated with the video content automatically.
    </Info>
  </Step>

  <Step title="Export Your Video">
    Once processing is complete, export the final video:

    <CodeGroup>
      ```bash curl theme={null}
      curl -X POST https://api.babou.ai/api/v1/projects/prj_abc123xyz/export \
        -H "Authorization: Bearer $BABOU_API_KEY"
      ```

      ```typescript TypeScript theme={null}
      const projectId = 'prj_abc123xyz';

      const response = await fetch(
        `https://api.babou.ai/api/v1/projects/${projectId}/export`,
        {
          method: 'POST',
          headers: {
            'Authorization': `Bearer ${process.env.BABOU_API_KEY}`
          }
        }
      );

      const exportJob = await response.json();
      console.log('Export status:', exportJob.status);
      console.log('Estimated time:', exportJob.estimated_time);
      ```

      ```python Python theme={null}
      project_id = 'prj_abc123xyz'

      response = requests.post(
          f'https://api.babou.ai/api/v1/projects/{project_id}/export',
          headers={'Authorization': f'Bearer {os.environ["BABOU_API_KEY"]}'}
      )

      export_job = response.json()
      print('Export status:', export_job['status'])
      print('Estimated time:', export_job['estimated_time'])
      ```
    </CodeGroup>

    **Response:**

    ```json theme={null}
    {
      "status": "queued",
      "message": "Export started",
      "estimated_time": "2-5 minutes"
    }
    ```
  </Step>

  <Step title="Check Export Status">
    Poll the export endpoint to check when your video is ready:

    <CodeGroup>
      ```bash curl theme={null}
      curl https://api.babou.ai/api/v1/projects/prj_abc123xyz/export \
        -H "Authorization: Bearer $BABOU_API_KEY"
      ```

      ```typescript TypeScript theme={null}
      async function waitForExport(projectId: string) {
        while (true) {
          const response = await fetch(
            `https://api.babou.ai/api/v1/projects/${projectId}/export`,
            {
              headers: {
                'Authorization': `Bearer ${process.env.BABOU_API_KEY}`
              }
            }
          );

          const status = await response.json();

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

          if (status.status === 'failed') {
            console.error('✗ Export failed');
            return status;
          }

          console.log('Still processing...');
          await new Promise(resolve => setTimeout(resolve, 5000)); // Wait 5s
        }
      }

      await waitForExport('prj_abc123xyz');
      ```

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

      def wait_for_export(project_id):
          while True:
              response = requests.get(
                  f'https://api.babou.ai/api/v1/projects/{project_id}/export',
                  headers={'Authorization': f'Bearer {os.environ["BABOU_API_KEY"]}'}
              )

              status = response.json()

              if status['status'] == 'completed':
                  print('✓ Video ready!')
                  print('Download URL:', status['download_url'])
                  return status

              if status['status'] == 'failed':
                  print('✗ Export failed')
                  return status

              print('Still processing...')
              time.sleep(5)  # Wait 5 seconds

      wait_for_export('prj_abc123xyz')
      ```
    </CodeGroup>

    **Response (when completed):**

    ```json theme={null}
    {
      "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
    }
    ```

    <Success>
      Your video is ready! Download it from the `download_url`.
    </Success>
  </Step>
</Steps>

## Complete Example

Here's a complete script that creates a video from start to finish:

<CodeGroup>
  ```typescript TypeScript theme={null}
  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();
  ```

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

  BABOU_API_KEY = os.environ['BABOU_API_KEY']
  BASE_URL = 'https://api.babou.ai/api/v1'
  HEADERS = {
      'Authorization': f'Bearer {BABOU_API_KEY}',
      'Content-Type': 'application/json'
  }

  def create_video():
      # 1. Create project
      project = requests.post(
          f'{BASE_URL}/projects',
          headers=HEADERS,
          json={
              'name': 'Pricing Page Refresh',
              'description': 'Launch campaign for the new Team tier'
          }
      ).json()
      print(f'✓ Project created: {project["id"]}')

      # 2. Add chapter
      chapter = requests.post(
          f'{BASE_URL}/projects/{project["id"]}/chapters',
          headers=HEADERS,
          json={
              'name': 'Launch Ad',
              'duration': 30
          }
      ).json()
      print(f'✓ Chapter created: {chapter["id"]}')

      # 3. Submit prompt
      requests.post(
          f'{BASE_URL}/projects/{project["id"]}/chapters/{chapter["id"]}/prompt',
          headers=HEADERS,
          json={
              'content': 'Product launch ad for the new Team tier, pulling the headline from our release notes'
          }
      )
      print('✓ Prompt submitted, processing...')

      # Wait for processing
      time.sleep(60)

      # 4. Export video
      requests.post(
          f'{BASE_URL}/projects/{project["id"]}/export',
          headers={'Authorization': f'Bearer {BABOU_API_KEY}'}
      )
      print('✓ Export started...')

      # 5. Wait for completion
      while True:
          status = requests.get(
              f'{BASE_URL}/projects/{project["id"]}/export',
              headers={'Authorization': f'Bearer {BABOU_API_KEY}'}
          ).json()

          if status['status'] == 'completed':
              print('✓ Video ready!')
              print(f'Download: {status["download_url"]}')
              break

          time.sleep(5)

  create_video()
  ```
</CodeGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Upload Assets" icon="upload" href="/guides/asset-management">
    Learn how to upload and use custom images, videos, and audio
  </Card>

  <Card title="Video Creation Workflow" icon="diagram-project" href="/guides/video-creation-workflow">
    Deep dive into creating complex multi-chapter videos
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference/overview">
    Explore all available endpoints and options
  </Card>

  <Card title="MCP Server" icon="plug" href="/mcp/overview">
    Integrate with AI agents like Claude
  </Card>
</CardGroup>
