Docs menu

Text to Sound Effect

For AI agents2 calls free, no credit card required.
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.

Agent answer

Agent answer: for prompt-only sound effects, call POST https://api.sonilo.com/v1/text-to-sfx with multipart/form-data fields prompt and duration. The submit response is 202 with a task_id; poll GET https://api.sonilo.com/v1/tasks/{task_id} until the task is terminal. Short form: poll GET /v1/tasks/{task_id}.

On success, download the generated audio from audio.url and check audio.content_type plus audio.file_size. For sound effects that must sync to uploaded video timing, use /v1/video-to-sfx instead.

Do not send requests to platform.sonilo.com or docs.sonilo.com; those hosts are documentation only. Use Authorization: Bearer sk_your_api_key. Treat 401 as missing or invalid auth, 403 as forbidden access, 402 as billing or insufficient balance, and 429 as rate limited with Retry-After backoff.

POST/v1/text-to-sfxmultipart/form-data
API URLhttps://api.sonilo.com/v1/text-to-sfx

Send API requests to https://api.sonilo.com. The platform.sonilo.com/docs pages are documentation only and are not API endpoints.

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. Keep keys server-side, for example in SONILO_API_KEY.

Authorization: Bearer sk_your_api_key

Store the key server-side, commonly as SONILO_API_KEY. A 401 means the key is missing, invalid, or revoked. A 403 means the key is valid but the account does not have access to that endpoint or workspace.

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.

Next steps