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:Response:
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"
}'
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);
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'])
{
"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:Response:
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
}'
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);
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'])
{
"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:Response:
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."
}'
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);
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'])
{
"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:Response:
curl -X POST https://api.babou.ai/api/v1/projects/prj_abc123xyz/export \
-H "Authorization: Bearer $BABOU_API_KEY"
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);
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'])
{
"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:Response (when completed):
curl https://api.babou.ai/api/v1/projects/prj_abc123xyz/export \
-H "Authorization: Bearer $BABOU_API_KEY"
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');
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')
{
"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();
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()
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