# Image generation
img = client.images.generate(
model="gpt-image-1",
prompt="a corgi surfing a wave at sunset",
size="1024x1024",
)
# TTS — OpenAI native model. For ElevenLabs voices use the
# /elevenlabs/v1/text-to-speech/{voice_id} native passthrough instead.
resp = client.audio.speech.create(
model="gpt-4o-mini-tts",
voice="alloy",
input="qlaud ships frontier models behind one URL",
)
resp.stream_to_file("voice.mp3")
# Transcription
with open("voice.mp3", "rb") as f:
transcript = client.audio.transcriptions.create(
model="whisper-1",
file=f,
)
# Embeddings
emb = client.embeddings.create(
model="text-embedding-3-large",
input="hello world",
)