Skip to content

[DOCS] Document the Audio API (POST /v1/audio/speech) and rust-sdk create_speech client #613

Closed

Description

Summary

The rust-sdk now exposes the Audio API: POST /audio/speech is available on the SDK as InferenceGatewayAPI::create_speech(provider: Option<Provider>, request: CreateSpeechRequest) -> Result<Vec<u8>, GatewayError> (implemented in inference-gateway/rust-sdk#133, types sync from schemas v0.25.0).

The gateway docs do not yet describe the Audio endpoint from a client perspective: what the request body supports (model, input up to 4096 chars, voice, response_format mp3/opus/aac/flac/wav/pcm, speed, reference_audio for voice cloning), that the server must have ENABLE_AUDIO enabled, and that only providers with speech support can serve it (others return 400 with "The Audio API is not supported by this provider yet.").

Acceptance Criteria

  • The Audio API endpoint (POST /v1/audio/speech) is documented alongside the other provider APIs, noting the ENABLE_AUDIO server flag and provider support caveat
  • The CreateSpeechRequest body fields and defaults (response_format mp3, speed 1.0) are described
  • If usage examples are kept per SDK, a rust-sdk example using create_speech is linked to feat: add Audio API client support (create_speech) rust-sdk#133

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 3m 11s —— View job • docs/issue-613-20260831-1238 • [Create PR ➔](https://github.com/inference-gateway/docs/compare/main...docs/issue-613-20260831-1238?quick_pull=1&title=Issue%20%23613%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23613%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)


    Done - PR #619

    Most of this issue was already shipped. The real gap was the rust-sdk client, so that is what I wrote.

    • Gather context
    • Audio API endpoint documented + ENABLE_AUDIO flag + provider caveat - already present (api-reference.md "Audio API", configuration.md)
    • CreateSpeechRequest fields and defaults - already present for the REST body and the Go SDK
    • rust-sdk create_speech example linked to rust-sdk#133 - added
    • Validate (lint:md, format:check, build)
    • Commit + open PR + move to QA on the roadmap board

    What changed

    sdks.md - new Speech synthesis section in the Rust chapter, mirroring the existing Go one:

    • create_speech(Option<Provider>, CreateSpeechRequest) -> Result<Vec<u8>, GatewayError>, noting None lets the gateway route from the model prefix.
    • The double gate: ENABLE_AUDIO=true (else 404) and speech-capable providers only (else GatewayError::BadRequest("The Audio API is not supported by this provider yet.")).
    • Field table with defaults (response_format: Mp3, speed: 1.0), plus the two things that bite in Rust specifically: input is a validating CreateSpeechRequestInput newtype built with .parse() (4096-char cap enforced), and reference_audio is pre-encoded base64 Option<String>, not raw bytes like Go's *[]byte.
    • Voice-cloning example against llama.cpp, and a link to rust-sdk#133.

    api-reference.md - one cross-link from the Audio API section to CreateSpeech (Go) and create_speech (Rust).

    Also corrected the stale rust-sdk version in sdks.md: 0.13.4 -> 0.23.0 (current Cargo.toml).

    Notes

    • Signatures, field types, defaults and the Default impl were read from rust-sdk@main (src/lib.rs, src/generated/schemas.rs, src/tests.rs), not guessed.
    • There is no examples/speech in rust-sdk yet, so the section links the PR rather than a runnable example. Worth adding upstream alongside examples/images.
    • #speech-synthesis-1 anchor verified against the built HTML.
      | Branch | PR #619
  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