Skip to content

[DOCS] Document the new POST /audio/sfx operation #704

Closed

Description

Summary

A new public API operation was added to the Inference Gateway schema: POST /audio/sfx, which turns a text prompt into a non-speech audio clip (sound effect or ambience), the way POST /audio/speech turns text into a voice. It is a gateway extension - OpenAI has no sound-effects endpoint - shaped like /audio/speech: JSON in, raw audio bytes out, provider chosen by the provider/model prefix or the provider query parameter. First provider is ElevenLabs (eleven_text_to_sound_v2).

Request body (CreateSFXRequest):

  • model (string, required), e.g. elevenlabs/eleven_text_to_sound_v2
  • prompt (string, required): description of the sound
  • duration_seconds (number, 0.5-30, optional): omitted means the provider picks the length
  • prompt_influence (number, 0-1, optional)
  • loop (boolean, optional)
  • response_format (mp3 / opus / aac / flac / wav / pcm, default mp3)

Schema PR: inference-gateway/schemas#211 (closes inference-gateway/schemas#208).

Affected pages: the API reference / Audio section (wherever /audio/speech is documented), and the supported-providers page for the ElevenLabs entry.

Acceptance Criteria

  • API reference documents POST /audio/sfx alongside /audio/speech, with every field's range and default
  • A usage example (curl and at least one SDK) generating a sound effect via ElevenLabs
  • ElevenLabs provider page notes sound-effect support
  • Note that providers without support return 400

Activity

  1. added
    documentation
    on Sep 22, 2026
  2. moved this to Todo in 2026on Sep 22, 2026
  3. edenreich commented on Sep 22, 2026

    @edenreich
    Contributor

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

  4. added theissue type on Sep 22, 2026
  5. inference-gateway-maintainer commented on Sep 22, 2026

    @inference-gateway-maintainer
    ContributorAuthor

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


    Documenting POST /audio/sfx

    • Gather context (read the canonical schemas openapi.yaml, the gateway SFXHandler and the ElevenLabs translator)
    • Add a Sound effects subsection to the Audio API in api-reference.md
    • curl example via ElevenLabs + a raw-HTTP TypeScript example
    • ElevenLabs entry on supported-providers.md notes sound-effect support
    • Document the separate 400 for providers without text-to-sound support
    • lint:md, format:check, bun test, build (anchors verified in the built HTML)
    • Commit and open PR docs: document the POST /audio/sfx operation #708

    What changed

    api-reference.md

    • Audio API intro now covers both operations; the speech material moved under a #### Speech synthesis heading.
    • New #### Sound effects subsection: endpoint, provider routing (provider/model prefix or ?provider=), shared AUDIO_ENABLED gate, curl example with elevenlabs/eleven_text_to_sound_v2, raw-bytes response, and the full CreateSFXRequest table with every range and default (duration_seconds 0.5-30, prompt_influence 0-1, loop, response_format default mp3).
    • Noted a detail the issue did not mention but users will hit: the gateway's ElevenLabs translator only maps mp3, opus and pcm, so aac/flac/wav come back 400 naming the supported set.
    • Unsupported providers now documents the SFX-specific error, Sound effect generation is not supported by this provider yet., and explains that it is gated separately from speech.

    supported-providers.md - ElevenLabs is described as audio-only (speech plus sound effects) rather than speech-only, linking to the new section; frontmatter description updated to match.

    One deviation from the acceptance criteria

    "at least one SDK" example: no SDK implements this yet - createSFX/create_sfx only exist in inference-gateway/inference-gateway and the schema, none of the four SDK repos. Rather than document a method that does not exist, the second example is a plain fetch call with a note that the SDKs do not wrap the endpoint yet. Tracked in #710 (SDK coverage across typescript/go/rust/python plus the docs swap).

    Also filed #709: the schema carries a sibling POST /audio/music operation that is undocumented too - out of scope here.

  6. moved this from Todo to In progress in 2026on Sep 22, 2026
  7. moved this from In progress to QA in 2026on Sep 22, 2026
  8. 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 📦🚀

  9. moved this from QA to Done in 2026on Sep 22, 2026
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