const main = async () => { const response = await fetch('https://api.aimlapi.com/v1/images/generations', { method: 'POST', headers: { Authorization: 'Bearer <YOUR_API_KEY>', 'Content-Type': 'application/json', }, body: JSON.stringify({ prompt: 'A jellyfish in the ocean', model: 'google/imagen4/preview', }), }).then((res) => res.json()); console.log('Generation:', response); }; main();