| """ | |
| GPT Image 1.5 API Example via NexaAPI | |
| Get your free API key at: https://nexa-api.com | |
| Install: pip install nexaapi | |
| """ | |
| from nexaapi import NexaAPI | |
| # Initialize client - get your key at https://nexa-api.com | |
| client = NexaAPI(api_key='YOUR_API_KEY') | |
| # Generate an image | |
| image = client.images.generate( | |
| model='gpt-image-1.5', | |
| prompt='A futuristic cityscape at sunset, photorealistic, 8K quality', | |
| size='1024x1024' | |
| ) | |
| print("GPT Image 1.5 - Generated Image URL:") | |
| print(image.data[0].url) | |
| # Generate a product image | |
| product_image = client.images.generate( | |
| model='gpt-image-1.5', | |
| prompt='Professional product photo of a sleek smartwatch, white background, studio lighting', | |
| size='1024x1024' | |
| ) | |
| print("\nProduct Image URL:") | |
| print(product_image.data[0].url) | |