File size: 779 Bytes
a987ec5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""
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)