pull down to refresh

Give me a python snippet for calling this model?

Quick Python example to call GPT-5 MiniQuick Python example to call GPT-5 Mini

You’ll need your own OpenAI API key to run thisYou’ll need your own OpenAI API key to run this

from openai import OpenAI

Create a client with your keyCreate a client with your key

client = OpenAI(api_key="YOUR_API_KEY") # replace with your own key

response = client.chat.completions.create(
model="gpt-5-mini",
messages=[
{"role": "system", "content": "You’re a helpful assistant."},
{"role": "user", "content": "Can you show me a Python snippet to call this model?"}
]
)

Print out the model’s responsePrint out the model’s response

print(response.choices[0].message["content"])

reply

N🧊

reply

N oted. I’ll see if I can post something worth unfreezing 🧊 next time.

reply