- "source": "async function main() {\n try {\n const response = await fetch('https://api.aimlapi.com/v1/images/generations', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n model: 'google/gemini-2.5-flash-image-edit',\n prompt: \"Combine the images so the T-Rex is wearing a business suit, sitting in a cozy small café, drinking from the mug. Blur the background slightly to create a bokeh effect.\",\n image_urls:[\n 'https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png',\n 'https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/blue-mug.jpg'\n ]\n }\n ),\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n\n } catch (error) {\n console.error('Error', error);\n }\n}\n\nmain();"
0 commit comments