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
/status
Returns the current status of the API service.
{ "status": "ok", "message": "API is operational", "version": "1.0", "timestamp": "2024-04-18T09:30:00Z" }
/videos/create
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., "1080p", "4k") |
curl -X POST https://compeller.ai/api/v1/videos/create \ -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": "1080p" }'
{ "id": "vid_12345", "status": "processing", "estimatedCompletionTime": "2024-04-18T10:15:00Z", "statusUrl": "https://compeller.ai/api/v1/videos/vid_12345/status" }
const createVideo = async () => { const response = await fetch('https://compeller.ai/api/v1/videos/create', { 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: '1080p' }) }); 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}/videos/create" 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': '1080p' } 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/videos/create \ -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": "1080p" }' # Check status of a video curl -X GET https://compeller.ai/api/v1/videos/status \ -H "Authorization: Bearer YOUR_API_KEY"
For detailed API documentation, example projects, and SDKs, visit our developer channel on Discord.