nickyni's picture
Upload examples/gptimage15_example.js with huggingface_hub
139970f verified
Raw
History Blame Contribute Delete
847 Bytes
// 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();