Skip to content

[DOCS] Document the Python SDK create_speech (Audio API) client method #616

Closed

Description

Summary

The Python SDK now implements the Audio API in the client (inference-gateway/python-sdk#112, synced from schemas v0.25.0): InferenceGatewayClient.create_speech posts a validated CreateSpeechRequest to POST /v1/audio/speech and returns the synthesized audio as raw bytes (format chosen via response_format, default mp3; optional provider, instructions, speed, reference_audio). The docs do not cover this new client surface yet.

Acceptance Criteria

  • Python SDK docs (README and/or SDK reference) document create_speech with a short usage snippet
  • Document that the response is raw audio bytes and how to persist it (e.g. write to a file), and that response_format/speed are omitted when unset so gateway defaults apply
  • Document that providers without speech support return HTTP 400 per the SpeechNotSupported response, and that reference_audio voice cloning is honored only by providers supporting it

Reference: inference-gateway/python-sdk#112

Activity

  1. added
    documentation
    on Aug 31, 2026
  2. added theissue type on Aug 31, 2026
  3. moved this to Todo in 2026on Aug 31, 2026
  4. edenreich commented on Aug 31, 2026

    @edenreich
    Contributor

    @claude Can you work on this? use /ponytail:ponytail

  5. inference-gateway-maintainer commented on Aug 31, 2026

    @inference-gateway-maintainer
    ContributorAuthor

    Claude finished @edenreich's task in 1m 45s —— View job • docs/issue-616-20260831-1250 • [Create PR ➔](https://github.com/inference-gateway/docs/compare/main...docs/issue-616-20260831-1250?quick_pull=1&title=Issue%20%23616%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23616%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)


    Documented Python SDK create_speech

    • Gather context (TS/Rust/Go speech sections, python-sdk create_speech signature)
    • Add Python "Speech synthesis" section to sdks.md
    • Validate: bun run lint:md, bun run format:check, bun run build - all pass
    • Commit + open PR -> docs(sdks): document python create_speech #621

    New section sits between the Responses API and "Models, tools, and health" in the Python part of sdks.md, mirroring the other SDKs:

    • create_speech(model, input, voice, provider=None, ...) snippet returning raw bytes, written to speech.mp3
    • Argument table (instructions, response_format, speed, reference_audio), noting optional args left at None are omitted from the body so gateway defaults for response_format/speed apply, and that validation happens locally via CreateSpeechRequest
    • Double gating: ENABLE_AUDIO=true or 404; unsupported providers answer 400 (SpeechNotSupported), raised as InferenceGatewayAPIError
    • Base64 reference_audio voice-cloning example, honored only by cloning-capable providers (llama.cpp/Qwen3-TTS, not OpenAI)

    Issue moved to QA on the Roadmap board.
    | Branch

  6. moved this from Todo to In progress in 2026on Aug 31, 2026
  7. moved this from In progress to QA in 2026on Aug 31, 2026
  8. moved this from QA to Done in 2026on Aug 31, 2026
  9. inference-gateway-releaser commented on Sep 22, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.9.14 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationreleased

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions