---
title: "Generate a sound effect from a text prompt"
method: POST
path: "/audio/sfx"
tags: ["Audio"]
---

# Generate a sound effect from a text prompt

`POST /audio/sfx`

Generates a non-speech audio clip - a sound effect or ambience - from
a text prompt. Gateway extension: OpenAI has no sound-effects
endpoint, so this mirrors the shape of `POST /audio/speech` (JSON in,
raw audio bytes out) rather than an upstream OpenAI operation. The
response is the generated audio as raw binary bytes; the actual
`Content-Type` header of the response reflects the requested
`response_format` (e.g. `audio/mpeg` for `mp3`).

Not every provider implements sound-effect generation. Requests routed
to a provider that does not support it return `400 Bad Request` with an
explanatory error message.

## Query parameters

- `provider` 'ollama' | 'ollama_cloud' | 'groq' | 'llamacpp' | 'openai' | 'cloudflare' | 'cohere' | 'anthropic' | 'deepseek' | 'elevenlabs' | 'google' | 'mistral' | 'minimax' | 'moonshot' | 'nvidia' | 'zai'

## Request body

- CreateSFXRequest — Request body for generating a non-speech audio clip - a sound effect or ambience - from a text prompt.
  - `model` string, required — Model ID to use for sound-effect generation (e.g. `elevenlabs/eleven_text_to_sound_v2`).
  - `prompt` string, required — Description of the sound to generate (e.g. `distant thunder rolling over a valley`).
  - `duration_seconds` number — Length of the generated clip in seconds. Omit to let the provider pick a length that fits the prompt.
  - `prompt_influence` number — How closely the generation follows the prompt. Higher values stay closer to the prompt, lower values allow more variation. Omit to use the provider default.
  - `loop` boolean — Whether to generate a clip that loops seamlessly.
  - `response_format` 'mp3' | 'opus' | 'aac' | 'flac' | 'pcm' — The audio format of the response.

## Response `200`

The generated audio as raw binary bytes. The actual `Content-Type`
header of the response reflects the requested `response_format`.

## Other responses

- `400` — The selected provider does not implement sound-effect generation. The gateway returns this when a request is routed to a provider without text-to-sound-effect support.
- `401` — Unauthorized
- `500` — Internal server error

## Changes

- **2026-09-22** `8ba1cde82f00` — 1 breaking
  - removed the enum value `wav` of the request property `response_format`
- **2026-09-22** `a137b0cca33b` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/inference-gateway/apis/inference-gateway-api/changes/audio/sfx/post.md)

---

[API](https://skmtc.dev/inference-gateway/apis/inference-gateway-api.md) · [All operations](https://skmtc.dev/inference-gateway/apis/inference-gateway-api/llms.txt) · [OpenAPI document](https://skmtc.dev/inference-gateway/apis/inference-gateway-api/revisions/1b23a23c6ece?raw)
