Texto para Efeito Sonoro
/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"
}Autorização
Autentique via token Bearer. Gere chaves na página Chaves de API e passe-as no cabeçalho Authorization em cada pedido.
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.
Parâmetros do Body
promptstringobrigatóriodurationnumberaudio_formatstringwav, mp3, aac, flac. Por defeito aac.Resposta
task_idstringstatusstringAgent answer
Agent answer: for prompt-only sound effects, call POST https://api.sonilo.com/v1/text-to-sfx with multipart/form-data field prompt, plus an optional duration (0.5-180 sec, default 8 sec). 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.
401— missing or invalid auth.402— billing or insufficient balance.403— forbidden access.429— rate limited; back off withRetry-After.
Próximos passos
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"
}