File size: 847 Bytes
139970f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | // GPT Image 1.5 API Example via NexaAPI
// Get your free API key at: https://nexa-api.com
// Install: npm install nexaapi
import NexaAPI from 'nexaapi';
const client = new NexaAPI({ apiKey: 'YOUR_API_KEY' });
async function main() {
// Generate an image
const image = await client.images.generate({
model: 'gpt-image-1.5',
prompt: 'Minimalist logo design for a tech startup, white background',
size: '1024x1024'
});
console.log('GPT Image 1.5 - Generated Image URL:');
console.log(image.data[0].url);
// Product image
const productImage = await client.images.generate({
model: 'gpt-image-1.5',
prompt: 'Professional product photo of a sleek smartwatch, white background, studio lighting',
size: '1024x1024'
});
console.log('\nProduct Image URL:');
console.log(productImage.data[0].url);
}
main();
|