Sound Effects
Generate sound effects from text prompts as async tasks. You control prompt detail, duration, and loop behavior, then read the finished audio from the task result.
Endpoint
http
POST https://api.cheapaiapi.com/v1/task/sound-effectRequest Fields
textstringrequiredPrompt describing the sound effect.duration_secondsnumberOptional duration from 0.5 to 30 seconds.prompt_influencenumberPrompt adherence between 0 and 1.loopbooleanWhether to produce a loopable result.model_idstringModel id when model choice is exposed.receive_urlstringOptional webhook endpoint.Example Request
bash
curl -X POST "https://api.cheapaiapi.com/v1/task/sound-effect" \
-H "Authorization: Bearer sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"text": "Thunder rolling with heavy rain",
"duration_seconds": 5.0,
"prompt_influence": 0.3,
"loop": false
}'Task Pattern
json
{
"success": true,
"task_id": "uuid_task_id",
"ec_remain_credits": 123456
}Poll the common task endpoint for progress:
http
GET https://api.cheapaiapi.com/v1/task/{task_id}Completed Task Example
json
{
"id": "uuid_task_id",
"status": "done",
"credit_cost": 200,
"metadata": {
"output_uri": "https://example.com/sound.mp3",
"character_cost": 200,
"duration_seconds": 5
},
"type": "sound_effect"
}Good UX Details
- Keep the prompt field large enough for descriptive sound design language.
- Show loop and duration options next to each other because they affect output behavior together.
- Switch to task tracking immediately after submit instead of pretending the result is synchronous.
- Preview the generated audio directly from the task result page when the task is done.