import axios from 'axios';
axios.post('https://api.artificialstudio.ai/api/generate', {
model: 'product-packaging',
input: {
product_name : "Artificial Crisps",
product_type : "Cereal Box",
packaging_type : "Box",
brand_style : "Playful",
color_scheme : "Red and Brown",
additional_details : "Create an image of a cereal box featuring chocolate chip cookies. The box should be vibrant and eye-catching, with a detailed illustration of delicious, freshly baked cookies overflowing with chocolate chips. Include playful fonts and bright colors, suggesting a fun and tasty breakfast option. The background should be dynamic, emphasizing the exciting and sweet theme."
},
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");
});