from openai import OpenAI
client = OpenAI(
api_key="sk-xxxx",
base_url="https://api.freemodel.app/v1",
)
stream = client.chat.completions.create(
model="gpt-5.4-mini",
messages=[{"role": "user", "content": "Say hello in three words."}],
stream=True,
)
for event in stream:
content = event.choices[0].delta.content
if content:
print(content, end="")