Complete guide to using the Clipyard API for video generation.
https://clipyard.ai/api/external/v1The Clipyard API uses an asynchronous request-response pattern. When you submit a video generation request, it enters a queue and processes in the background. This approach offers several advantages:
All API requests require authentication using an API key. You can create and manage API keys in your dashboard settings.
Include your API key in the Authorization header:
curl -H "Authorization: Bearer rg_live_your_api_key_here" \
https://clipyard.ai/api/external/v1/accountImportant: Keep your API keys secure. Never expose them in client-side code or public repositories. If a key is compromised, revoke it immediately in your dashboard.
API usage counts towards your existing subscription quota. Each video or image generated via the API is deducted from your plan's monthly allowance, just like generations made through the dashboard.
Video Generation
Each video created via the API uses 1 video credit from your plan.
Image Generation
Each image created via the API uses 1 image credit from your plan.
Check your current usage and remaining limits via the /account endpoint.
The following endpoints are available for interacting with the Clipyard API.
Retrieve your account information, subscription details, and current usage limits.
curl -X GET "https://clipyard.ai/api/external/v1/account" \
-H "Authorization: Bearer rg_live_your_api_key"{
"user_id": "uuid-here",
"api_key": {
"id": "key-uuid",
"name": "My API Key",
"is_platform_key": false
},
"subscription": {
"plan": "pro",
"status": "active"
},
"usage": {
"videos": {
"used": 5,
"limit": 50,
"remaining": 45
},
"images": {
"used": 10,
"limit": 100,
"remaining": 90
},
"avatar_credits": {
"total": 10,
"used": 2,
"remaining": 8
}
}
}List all available text-to-speech voices for video narration.
curl -X GET "https://clipyard.ai/api/external/v1/voices" \
-H "Authorization: Bearer rg_live_your_api_key"{
"voices": [
{
"id": "voice_id_here",
"name": "Rachel",
"provider": "elevenlabs",
"category": "premade",
"language": "en",
"gender": "female",
"age": "young",
"description": "Clear and professional",
"preview_url": "https://..."
}
],
"total": 50
}Submit a new video generation request. The video will be processed asynchronously.
| Parameter | Type | Required | Description |
|---|---|---|---|
| script | string | Required | The narration script (max 10,000 characters) |
| voice_id | string | Optional | Voice ID from /voices endpoint |
| voice_settings | object | Optional | Voice parameters (stability, speed, etc.) |
| visual_style | string | Optional | "ai_generated" or "avatar" |
| visual_prompt | string | Optional | Prompt for AI-generated visuals |
| avatar_url | string | Optional | URL of avatar image (if visual_style is "avatar") |
| aspect_ratio | string | Optional | "16:9", "9:16", or "1:1" (default: "9:16") |
| subtitles | object | Optional | Subtitle configuration |
| webhook_url | string | Optional | URL to receive completion webhook |
| metadata | object | Optional | Custom metadata returned in webhook |
| Parameter | Type | Required | Description |
|---|---|---|---|
| stability | number | Optional | Voice stability (0-1) |
| similarity_boost | number | Optional | Voice similarity (0-1) |
| style | number | Optional | Voice style exaggeration (0-1) |
| speed | number | Optional | Speaking speed multiplier |
| Parameter | Type | Required | Description |
|---|---|---|---|
| enabled | boolean | Optional | Enable subtitles (default: true) |
| style | string | Optional | Subtitle style preset |
| font | string | Optional | Font family (default: "Montserrat") |
| color | string | Optional | Text color hex (default: "#FFFFFF") |
| position | string | Optional | "top", "center", or "bottom" |
curl -X POST "https://clipyard.ai/api/external/v1/videos/generate" \
-H "Authorization: Bearer rg_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"script": "Welcome to our product demo. Today we will show you...",
"voice_id": "EXAVITQu4vr4xnSDxMaL",
"visual_style": "ai_generated",
"visual_prompt": "Professional tech product showcase",
"aspect_ratio": "9:16",
"subtitles": {
"enabled": true,
"position": "bottom",
"color": "#FFFFFF"
},
"webhook_url": "https://your-server.com/webhooks/clipyard",
"metadata": {
"campaign_id": "summer-2024",
"internal_ref": "video-001"
}
}'{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "pending",
"estimated_duration_seconds": 45,
"webhook_registered": true,
"created_at": "2024-01-20T12:00:00Z"
}Check the status and retrieve the result of a video generation job.
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | uuid | Required | The job_id returned from /videos/generate |
curl -X GET "https://clipyard.ai/api/external/v1/videos/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer rg_live_your_api_key"{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"type": "VIDEO",
"progress": 50,
"created_at": "2024-01-20T12:00:00Z",
"started_at": "2024-01-20T12:00:05Z"
}{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"type": "VIDEO",
"progress": 100,
"result": {
"video_url": "https://cdn.clipyard.ai/videos/...",
"thumbnail_url": "https://cdn.clipyard.ai/thumbnails/...",
"duration_seconds": 45,
"file_size_bytes": 15728640
},
"created_at": "2024-01-20T12:00:00Z",
"completed_at": "2024-01-20T12:02:30Z",
"metadata": {
"campaign_id": "summer-2024",
"internal_ref": "video-001"
}
}| Status | Description |
|---|---|
| pending | Job is queued and waiting to start |
| processing | Job is currently being processed |
| completed | Job finished successfully, video is ready |
| failed | Job failed, check error field for details |
If you provide a webhook_url when generating a video, we'll send a POST request to that URL when the job completes.
{
"event": "video.completed",
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"result": {
"video_url": "https://cdn.clipyard.ai/videos/...",
"thumbnail_url": "https://cdn.clipyard.ai/thumbnails/...",
"duration_seconds": 45,
"file_size_bytes": 15728640
},
"metadata": {
"campaign_id": "summer-2024",
"internal_ref": "video-001"
},
"timestamp": "2024-01-20T12:02:30Z"
}{
"event": "video.failed",
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "failed",
"error": "Script contains unsupported characters",
"metadata": {
"campaign_id": "summer-2024",
"internal_ref": "video-001"
},
"timestamp": "2024-01-20T12:01:00Z"
}Tip: Your webhook endpoint should respond with a 2xx status code within 30 seconds. If we don't receive a response, we'll retry up to 3 times with exponential backoff.
The API uses standard HTTP status codes to indicate success or failure.
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 404 | Not Found - Resource doesn't exist |
| 429 | Rate Limited - Too many requests or usage limit reached |
| 500 | Internal Server Error |
{
"error": "Description of what went wrong"
}import requests
import time
API_KEY = "rg_live_your_api_key"
BASE_URL = "https://clipyard.ai/api/external/v1"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
# Generate a video
response = requests.post(f"{BASE_URL}/videos/generate", headers=headers, json={
"script": "Welcome to our product demo...",
"voice_id": "EXAVITQu4vr4xnSDxMaL",
"visual_style": "ai_generated",
"aspect_ratio": "9:16"
})
job = response.json()
job_id = job["job_id"]
print(f"Job created: {job_id}")
# Poll for completion
while True:
status_response = requests.get(f"{BASE_URL}/videos/{job_id}", headers=headers)
status = status_response.json()
if status["status"] == "completed":
print(f"Video ready: {status['result']['video_url']}")
break
elif status["status"] == "failed":
print(f"Job failed: {status.get('error')}")
break
print(f"Progress: {status.get('progress', 0)}%")
time.sleep(5)const API_KEY = 'rg_live_your_api_key';
const BASE_URL = 'https://clipyard.ai/api/external/v1';
async function generateVideo() {
// Generate a video
const response = await fetch(`${BASE_URL}/videos/generate`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
script: 'Welcome to our product demo...',
voice_id: 'EXAVITQu4vr4xnSDxMaL',
visual_style: 'ai_generated',
aspect_ratio: '9:16'
})
});
const job = await response.json();
console.log('Job created:', job.job_id);
// Poll for completion
while (true) {
const statusResponse = await fetch(`${BASE_URL}/videos/${job.job_id}`, {
headers: { 'Authorization': `Bearer ${API_KEY}` }
});
const status = await statusResponse.json();
if (status.status === 'completed') {
console.log('Video ready:', status.result.video_url);
break;
} else if (status.status === 'failed') {
console.log('Job failed:', status.error);
break;
}
console.log('Progress:', status.progress + '%');
await new Promise(r => setTimeout(r, 5000));
}
}
generateVideo();For n8n integration, use the HTTP Request node with these settings:
{
"method": "POST",
"url": "https://clipyard.ai/api/external/v1/videos/generate",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"headerAuth": {
"name": "Authorization",
"value": "Bearer {{ $credentials.apiKey }}"
},
"sendBody": true,
"bodyContentType": "json",
"body": {
"script": "{{ $json.script }}",
"voice_id": "{{ $json.voice_id }}",
"webhook_url": "your-n8n-webhook-url"
}
}