Authentication

All API requests require an API key passed in the x-api-key header. Create a free account to get your API key.

x-api-key: cl_your_api_key_here

Base URL

https://api.cliplab.dev

For local development: http://localhost:3000

Video Endpoints

POST /api/combine

Combine 2 to 5 videos into one sequential video.

Request

Content-Type: multipart/form-data

Field Type Description
videos File[] 2 to 5 video files (mp4, avi, mov, mkv)

Response

Returns the combined video file as binary data (Content-Type: video/mp4)

Examples

curl -X POST http://localhost:3000/api/combine \ -H "x-api-key: YOUR_API_KEY" \ -F "videos=@intro.mp4" \ -F "videos=@main.mp4" \ -F "videos=@outro.mp4" \ --output combined.mp4
const formData = new FormData(); formData.append('videos', introFile); formData.append('videos', mainFile); formData.append('videos', outroFile); const response = await fetch('http://localhost:3000/api/combine', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY' }, body: formData }); const blob = await response.blob(); const url = URL.createObjectURL(blob);
import requests files = [ ('videos', open('intro.mp4', 'rb')), ('videos', open('main.mp4', 'rb')), ('videos', open('outro.mp4', 'rb')) ] headers = {'x-api-key': 'YOUR_API_KEY'} response = requests.post( 'http://localhost:3000/api/combine', files=files, headers=headers ) with open('combined.mp4', 'wb') as f: f.write(response.content)

Audio Endpoints

POST /api/audio/remove

Remove the audio track from a video (mute).

Request

Content-Type: multipart/form-data

Field Type Description
video File Video file (mp4, avi, mov, mkv)

Response

Returns the muted video file as binary data (Content-Type: video/mp4)

Examples

curl -X POST http://localhost:3000/api/audio/remove \ -H "x-api-key: YOUR_API_KEY" \ -F "video=@input.mp4" \ --output muted.mp4
const formData = new FormData(); formData.append('video', videoFile); const response = await fetch('http://localhost:3000/api/audio/remove', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY' }, body: formData }); const blob = await response.blob();
import requests files = {'video': open('input.mp4', 'rb')} headers = {'x-api-key': 'YOUR_API_KEY'} response = requests.post( 'http://localhost:3000/api/audio/remove', files=files, headers=headers ) with open('muted.mp4', 'wb') as f: f.write(response.content)
POST /api/audio/replace

Replace the audio track of a video with a new audio file.

Request

Content-Type: multipart/form-data

Field Type Description
video File Video file (mp4, avi, mov, mkv)
audio File Audio file (mp3, wav, aac, ogg, m4a, flac)

Response

Returns the video with replaced audio as binary data (Content-Type: video/mp4)

Examples

curl -X POST http://localhost:3000/api/audio/replace \ -H "x-api-key: YOUR_API_KEY" \ -F "video=@input.mp4" \ -F "audio=@music.mp3" \ --output replaced.mp4
const formData = new FormData(); formData.append('video', videoFile); formData.append('audio', audioFile); const response = await fetch('http://localhost:3000/api/audio/replace', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY' }, body: formData }); const blob = await response.blob();
import requests files = { 'video': open('input.mp4', 'rb'), 'audio': open('music.mp3', 'rb') } headers = {'x-api-key': 'YOUR_API_KEY'} response = requests.post( 'http://localhost:3000/api/audio/replace', files=files, headers=headers ) with open('replaced.mp4', 'wb') as f: f.write(response.content)
POST /api/audio/extract

Extract the audio track from a video as MP3.

Request

Content-Type: multipart/form-data

Field Type Description
video File Video file (mp4, avi, mov, mkv)

Response

Returns the extracted audio as MP3 file (Content-Type: audio/mpeg)

Examples

curl -X POST http://localhost:3000/api/audio/extract \ -H "x-api-key: YOUR_API_KEY" \ -F "video=@input.mp4" \ --output extracted.mp3
const formData = new FormData(); formData.append('video', videoFile); const response = await fetch('http://localhost:3000/api/audio/extract', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY' }, body: formData }); const blob = await response.blob();
import requests files = {'video': open('input.mp4', 'rb')} headers = {'x-api-key': 'YOUR_API_KEY'} response = requests.post( 'http://localhost:3000/api/audio/extract', files=files, headers=headers ) with open('extracted.mp3', 'wb') as f: f.write(response.content)

Error Responses

All errors return a JSON body with an error field describing the issue.

{ "error": "Error message here" }
Status Description
400 Bad request (fewer than 2 or more than 5 files, invalid type, or file too large)
401 Invalid or missing API key
500 Server error during processing