Text to Sound Effect
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.
/v1/text-to-sfxmultipart/form-datahttps://api.sonilo.com/v1/text-to-sfxSend 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_keyStore 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
promptstringrequireddurationintegerrequiredaudio_formatstringwav, mp3, aac, flac. Defaults to aac.Response
task_idstringstatusstringNext steps
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"
}