curl https://hakanaiktn.com/v1/images/generations \ -H "Content-Type: application/json" \ -H "Authorization: Bearer sk-xxxxxxxx" \ -d '{ "model": "gpt-image-2", "prompt": "A cute Japanese idol producer business card design, pale yellow and white color scheme, premium fan merchandise style", "size": "1536x1024", "n": 1 }'
from openai import OpenAIclient = OpenAI( api_key="sk-xxxxxxxx", base_url="https://hakanaiktn.com/v1",)response = client.images.generate( model="gpt-image-2", prompt="A cute Japanese idol producer business card design, pale yellow and white color scheme, premium fan merchandise style", size="1536x1024", n=1,)print("图片地址:", response.data[0].url)
import OpenAI from 'openai';const client = new OpenAI({ apiKey: 'sk-xxxxxxxx', baseURL: 'https://hakanaiktn.com/v1',});const response = await client.images.generate({ model: 'gpt-image-2', prompt: 'A minimal illustration of a banana on a clean white background', size: '1024x1024', n: 1,});console.log(response.data[0].url);