Audio

Generate a sound effect

Generates a short sound effect from a text description. Omitting durationSeconds lets the provider pick the length (and bills at its default); promptInfluence trades prompt fidelity (1) against variation (0). Credits are reserved before generation and refunded if it fails. The default encoding: "binary" returns the raw audio bytes; encoding: "base64" returns JSON. Audio over the ~4MB response ceiling is returned by signed URL (a 303 for binary, the delivery: "url" variant for base64). Generated audio is saved to the file browser unless the call sets preview; the outcome is reported in the JSON save fields and the X-B4M-Audio-* headers - fetch the saved copy from fileUrl / X-B4M-Audio-File-Url, since GET /api/files/{id} fails closed until moderation completes. Authenticate with an API key (b4m_live_) or a JWT.

post/api/ai/sound-effects

Request

  • Base URL: https://your-deployment.example.com
  • URL: https://your-deployment.example.com/api/ai/sound-effects
  • Auth: one of:
    • HTTP bearer
    • API key in header x-api-key

Request body

provider'elevenlabs'
textstring required
durationSecondsnumber
promptInfluencenumber
formatstring
encoding'binary' | 'base64'
previewboolean

Example request

{
  "text": "heavy wooden door creaking open",
  "durationSeconds": 3,
  "promptInfluence": 0.5
}

Response

Sound effect generated. Binary bodies carry a Content-Type that follows the requested format (mp3 by default). The default encoding: "binary" returns the raw audio bytes; encoding: "base64" returns the JSON body. Audio over the ~4MB response ceiling cannot ride in the body: the binary encoding answers 303 instead, and the base64 encoding returns the delivery: "url" variant, whose url is a time-limited signed GET for the audio (bytes is its size).

OR

Changes

No recorded changes to this operation across all 1 revision of this API.