import axios from 'axios';
axios.post('https://api.artificialstudio.ai/api/generate', {
model: 'youtube-thumbnail',
input: {
title : "10 COOKING HACKS That Will Change Your Life",
content_type : "Tutorial",
style : "Professional",
additional_elements : "Show kitchen utensils, food ingredients, surprised expression",
reference_image : "https://files.artificialstudio.ai/41151789-45e6-46ff-91b2-829e0f5da08d.png"
},
webhook: 'https://your-webhook-url.com/api/webhook',
}, {
headers: {
'Content-Type': 'application/json',
'Authorization': 'YOUR_API_KEY'
}
}).then(res => {
console.log('Success:', res.data);
}).catch(error => {
console.error('Error:', error);
});
app.post("/api/webhook", (req: any, res: any) => {
console.log(req.body) // id, output, status, model, payload, error...
res.send("Webhook received");
});