import axios from 'axios';
axios.post('https://api.artificialstudio.ai/api/generate', {
model: 'meme-sticker',
input: {
creation_type : "Meme",
reference_image : "https://files.artificialstudio.ai/f80045bb-da1d-4212-b1f7-e7771b1b92d2.png",
text_content : "When you finally fix that bug after 5 hours",
style : "Pixel Art",
additional_instructions : "Add impact font with white text and black outline"
},
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");
});