実際のところ
from openai import OpenAI from dotenv import dotenv_values def genImage(client): response = client.images.generate( model="dall-e-3", prompt="a black cat on an american classic car.", size="1024x1024", quality="standard", n=1 ) return response config = dotenv_values(".env") yourclient = OpenAI( api_key= config["OPENAI_API_KEY"] ) result = genImage(yourclient) image_url = result.data[0].url print(image_url)
試しにやってみるとURLが表示され…
$ python3 imagegenTest.py https://oaidalleapiprodscus.blob.core.windows.net/private/org-n...
アクセスすると、こんなのが出てきます。