Integrate audio-reactive video generation into your applications with our comprehensive API. Create stunning visuals that respond to music with just a few lines of code.
The Compeller API enables developers to integrate audio-reactive video generation capabilities into their applications. Our RESTful API supports various endpoints for processing audio, generating visuals, and managing content.
https://compeller.ai/api/v1
All API requests require an API key that should be included in the header of each request:
Authorization: Bearer YOUR_API_KEY
/compel/{id}
Returns the current instance of a Compel.
{
"id": "12345",
"status": "PENDING, PROCESSING, COMPLETE, ERROR, DELETED",
"message": "Additional information about the status",
"privacy": "PUBLIC, PRIVATE, FRIENDS",
"title": "My Compel",
"story": "A very cool story",
"timestamp": "2024-04-18T09:30:00Z"
}
/compel
Generate a new video from audio input with optional parameters.
| Parameter | Type | Required | Description |
|---|---|---|---|
audioUrl |
string | Yes | URL to the audio file (MP3, WAV) |
prompt |
string | Yes | Text description of the visual style |
duration |
number | No | Duration in seconds (defaults to audio length) |
resolution |
string | No | Video resolution (e.g., "normal", "hd", "4k") |
orientation |
string | No | (e.g., "portrait", "landscape") |
curl -X POST https://compeller.ai/api/v1/compel \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"audioUrl": "https://example.com/audio.mp3",
"prompt": "Abstract flowing particles responding to bass beats",
"resolution": "normal"
"orientation": "portrait"
}'
{
"id": "12345",
"status": "PENDING",
"estimatedCompletionTime": "2024-04-18T10:15:00Z",
"statusUrl": "https://compeller.ai/api/v1/compell/{id}"
}
const createVideo = async () => {
const response = await fetch('https://compeller.ai/api/v1/compel', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
audioUrl: 'https://example.com/audio.mp3',
prompt: 'Abstract flowing particles responding to bass beats',
resolution: 'hd',
orientation: 'landscape'
})
});
const data = await response.json();
console.log('Video creation started:', data);
// Poll for status
const checkStatus = async () => {
const statusResponse = await fetch(data.statusUrl, {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const statusData = await statusResponse.json();
if (statusData.status === 'completed') {
console.log('Video is ready:', statusData.videoUrl);
} else if (statusData.status === 'processing') {
console.log('Still processing, checking again in 10 seconds...');
setTimeout(checkStatus, 10000);
} else {
console.error('Error processing video:', statusData);
}
};
setTimeout(checkStatus, 10000);
};
createVideo();
import requests
import time
API_KEY = 'YOUR_API_KEY'
BASE_URL = 'https://compeller.ai/api/v1'
def create_video():
url = f"{BASE_URL}/compel"
headers = {
'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'application/json'
}
payload = {
'audioUrl': 'https://example.com/audio.mp3',
'prompt': 'Abstract flowing particles responding to bass beats',
'resolution': 'hd',
'orientation': 'landscape'
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
print(f"Video creation started: {data}")
# Poll for status
if data.get('status') == 'processing':
check_status(data['statusUrl'])
def check_status(status_url):
headers = {
'Authorization': f'Bearer {API_KEY}'
}
while True:
response = requests.get(status_url, headers=headers)
status_data = response.json()
if status_data['status'] == 'completed':
print(f"Video is ready: {status_data['videoUrl']}")
break
elif status_data['status'] == 'processing':
print("Still processing, checking again in 10 seconds...")
time.sleep(10)
else:
print(f"Error processing video: {status_data}")
break
if __name__ == "__main__":
create_video()
# Create a new video
curl -X POST https://compeller.ai/api/v1/compel \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"audioUrl": "https://example.com/audio.mp3",
"prompt": "Abstract flowing particles responding to bass beats",
"resolution": "hd",
"orientation": "landscape"
}'
# Check status of a video
curl -X GET https://compeller.ai/api/v1/compel/{id} \
-H "Authorization: Bearer YOUR_API_KEY"
For detailed API documentation, example projects, and SDKs, visit our developer channel on Discord.