import axios from 'axios';
axios.post('https://api.artificialstudio.ai/api/generate', {
model: 'style-transfer',
input: {
content : "https://replicate.delivery/pbxt/KYFoBTcecGDJxqaLteTG4NKj6ULxoMKewHxqZ50KqftYLP7Y/0_3.webp",
style : "https://replicate.delivery/pbxt/KYFoBZMM7k3ZEmgB8rU5cok5MRjHsnkLEEEEEIT95zYFwqwG/Self-portrait-with-Straw-Hat-1887-88-857x1024.jpg"
},
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");
});