stream = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Write a story"}], stream=True)for chunk in stream: if chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="")# The complete response is logged when streaming finishes
from muxx import Muxxfrom openai import OpenAImuxx = Muxx()# Point to gateway for caching/rate limiting# SDK still adds tracingclient = muxx.wrap(OpenAI( base_url="https://gateway.muxx.dev/v1", default_headers={"X-Muxx-Api-Key": muxx.api_key}))