curl -X POST https://app.ai4chat.co/api/v1/video/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A serene sunset over the mountains",
"aspectRatio": "16:9",
"model": "Luma Ray2 Flash",
"img2video": false
}'
const fetch = require('node-fetch');
const url = 'https://app.ai4chat.co/api/v1/video/generate';
const apiKey = 'YOUR_API_KEY';
const data = {
prompt: "A serene sunset over the mountains",
aspectRatio: "16:9",
model: "Luma Ray2 Flash",
img2video: false
};
fetch(url, {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => {
console.log('Success:', data);
console.log('Video URL:', data.videoUrl);
})
.catch((error) => {
console.error('Error:', error);
});
import requests
url = "https://app.ai4chat.co/api/v1/video/generate"
api_key = "YOUR_API_KEY"
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
payload = {
"prompt": "A serene sunset over the mountains",
"aspectRatio": "16:9",
"model": "Luma Ray2 Flash",
"img2video": False
}
response = requests.post(url, headers=headers, json=payload)
if response.status_code == 200:
data = response.json()
print("Video URL:", data['videoUrl'])
else:
print("Error:", response.status_code, response.text)