Docs menu

Text to Sound Effect

Generate a sound effect from a text prompt with a caller-specified duration. Returns 202 Accepted with a task_id; poll GET /v1/tasks/:task_id until the task reaches a terminal status.

POST/v1/text-to-sfxmultipart/form-data
curl -X POST https://api.sonilo.com/v1/text-to-sfx \
  -H "Authorization: Bearer sk_your_api_key" \
  -F "prompt=heavy rain on a tin roof with distant thunder" \
  -F "duration=10"
# => {"task_id": "9f5f2f7e-...", "status": "processing"}

curl https://api.sonilo.com/v1/tasks/9f5f2f7e-... \
  -H "Authorization: Bearer sk_your_api_key"
# poll until "status" is "succeeded" or "failed"
{
  "task_id": "9f5f2f7e-…",
  "status": "processing"
}

Authorization

Authenticate via Bearer token. Generate keys at the API Keys page and pass them in the Authorization header on every request.

Authorization: Bearer sk_your_api_key

Body Parameters

promptstringrequired
Text prompt describing the sound effect to generate. 1-2000 characters.
durationintegerrequired
Desired duration of the output audio. Min 1 sec, max 180 sec.
audio_formatstring
Output audio format. One of wav, mp3, aac, flac. Defaults to aac.

Response

task_idstring
The task identifier. Poll the Get Task endpoint (GET /v1/tasks/:task_id) until the task reaches a terminal status.
statusstring
Always processing on submission — generation runs asynchronously.