You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] docs: add an audio example for create_speech, create_sfx and create_music #174
Domain: audio. The client exposes create_speech (POST /audio/speech), create_sfx (POST /audio/sfx, from a text prompt or by scoring a video) and create_music (POST /audio/music). They were added in v0.19.0 and create_sfx gained video scoring in v0.25.0, but no example demonstrates any of them: there is no examples/audio/ directory and the root README.md does not mention speech, sound effects or music at all. A user cannot learn from the README that these methods return raw audio bytes instead of a response model, that the gateway needs AUDIO_ENABLED=true, or which create_sfx arguments apply to a text prompt versus a video.
Acceptance Criteria
Add examples/audio/main.py that calls client.create_speech(model=..., input=..., voice=...) and writes the returned bytes to a file, taking the model from an env var like the other examples.
In examples/audio/main.py, call client.create_sfx(model=..., prompt=..., duration_seconds=...) for text-to-sfx and, when a VIDEO_URL env var is set, client.create_sfx(model=..., video=..., output="sfx") to score a video.
In examples/audio/main.py, call client.create_music(model=..., prompt=..., duration_seconds=..., instrumental=True) and save the clip.
Add examples/audio/README.md covering the prerequisites (AUDIO_ENABLED=true on the gateway and a provider with audio support such as openai, elevenlabs or mirelo), the response_format argument and the 400 error returned by providers without support.
Add a short "Audio" section to the root README.md with a create_speech snippet, and list the new example in the README.md "Examples" section and in examples/README.md.
examples/audio/main.py calls create_speech, create_sfx (from a text prompt, and from a video when VIDEO_URL is set, with output="sfx") and create_music(instrumental=True). Each result is raw bytes and is saved to an .mp3 file. Models come from SPEECH_MODEL, SFX_MODEL, MUSIC_MODEL and VIDEO_SFX_MODEL.
examples/audio/README.md explains:
the setup you need: AUDIO_ENABLED=true and a provider with audio support (openai, elevenlabs or mirelo)
the 400 error from providers that don't support audio
which create_sfx arguments apply to a text prompt and which apply to a video
the response_format argument
The root README.md has a new "Audio" section with a create_speech snippet. The new example is also listed in both README.md "Examples" and examples/README.md.
What I couldn't check
task lint didn't run because black, isort and mypy aren't installed in this sandbox, and installing the dev dependencies needed approval. I only syntax-checked the new file with py_compile.
I didn't run the example against a real gateway.
I didn't open a [DOCS] issue because this PR only changes examples and README text, not SDK behavior. The PR body says so.
| Branch
Activity
edenreich commentedon Nov 17, 2026
@claude can you work on this?
inference-gateway-maintainer commentedon Nov 17, 2026
Claude finished @edenreich's task in 1m 17s —— View job •
feat/issue-174-20261117-1939• [Create PR ➔](https://github.com/inference-gateway/python-sdk/compare/main...feat/issue-174-20261117-1939?quick_pull=1&title=Issue%20%23174%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23174%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)Audio example added
examples/audio/main.pyexamples/audio/README.mdREADME.mdandexamples/README.mdWhat changed
examples/audio/main.pycallscreate_speech,create_sfx(from a text prompt, and from a video whenVIDEO_URLis set, withoutput="sfx") andcreate_music(instrumental=True). Each result is rawbytesand is saved to an.mp3file. Models come fromSPEECH_MODEL,SFX_MODEL,MUSIC_MODELandVIDEO_SFX_MODEL.examples/audio/README.mdexplains:AUDIO_ENABLED=trueand a provider with audio support (openai,elevenlabsormirelo)create_sfxarguments apply to a text prompt and which apply to a videoresponse_formatargumentREADME.mdhas a new "Audio" section with acreate_speechsnippet. The new example is also listed in bothREADME.md"Examples" andexamples/README.md.What I couldn't check
task lintdidn't run becauseblack,isortandmypyaren't installed in this sandbox, and installing the dev dependencies needed approval. I only syntax-checked the new file withpy_compile.[DOCS]issue because this PR only changes examples and README text, not SDK behavior. The PR body says so.| Branch
inference-gateway-releaser commentedon Nov 17, 2026
🎉 This issue has been resolved in version 0.26.0 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀