REST API v1  LOADING    

Compeller API Documentation

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.

-
Uptime
-
DB Response
-
Active Threads
0%
CPU Load

Overview

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.

Base URL

https://compeller.ai/api/v1

Authentication

All API requests require an API key that should be included in the header of each request:

Authorization: Bearer YOUR_API_KEY
Note: To obtain an API key, please contact our support team or visit your account dashboard.

API Endpoints

GET /status

Check API Status

Returns the current status of the API service.

Response

{
  "status": "ok",
  "message": "API is operational",
  "version": "1.0",
  "timestamp": "2024-04-18T09:30:00Z"
}
POST /videos/create

Create Video

Generate a new video from audio input with optional parameters.

Request 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")

Example Request

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"
  }'

Response

{
  "id": "vid_12345",
  "status": "processing",
  "estimatedCompletionTime": "2024-04-18T10:15:00Z",
  "statusUrl": "https://compeller.ai/api/v1/videos/vid_12345/status"
}

Code Examples

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"

Resources

Need More Help?

For detailed API documentation, example projects, and SDKs, visit our developer channel on Discord.