AU
Kling Audio API
AI audio generation - text-to-audio sound effects, video dubbing, and TTS.
Quick Start
1
Get your API key from the Console2
Choose a Kling audio model3
Send POST request to create task4
Poll GET request for audio resultAuthentication
Add Authorization header with Bearer token to all requests:
Authorization: Bearer YOUR_API_KEY
Available Models
| Model | API Name | Features | Price (85% off) |
|---|---|---|---|
| Sound Effects | kling-sound-effects | Sound effects, 3-10s | $0.0295/call |
| Video-to-Audio | kling-video-to-audio | Video dubbing with SFX+BGM, 3-20s video | $0.0027/call |
| TTS | kling-tts | Text-to-speech, multiple voices | $0.0006/call |
Pricing (85% off)
| Model | Price |
|---|---|
kling-sound-effects | $0.0295/call |
kling-video-to-audio | $0.0027/call |
kling-tts | $0.0006/call |
Endpoints
POST
/api/v1/audio/generationsCreate a Kling audio generation task. Routes to text-to-audio, video-to-audio, or TTS based on the model parameter.
GET
/api/v1/audio/generations?task_id=xxxQuery task status and get audio URL
Request Parameters
Sound Effects (kling-sound-effects)
modelrequiredstring
"kling-sound-effects"
promptrequiredstring
Text description of the sound effect
durationrequiredstring
"3.0" to "10.0" (supports 1 decimal place)
callback_urlstring
Webhook URL for completion notification
Video-to-Audio (kling-video-to-audio)
modelrequiredstring
"kling-video-to-audio"
video_idstring
Kling video ID (within 30 days, 3-20s). One of video_id/video_url required.
video_urlstring
Video URL (MP4/MOV, <=100MB, 3-20s). One of video_id/video_url required.
sound_effect_promptstring
Sound effect prompt
bgm_promptstring
Background music prompt
asmr_modeboolean
Enhance detail sounds
callback_urlstring
Webhook URL for completion notification
Text-to-Speech (kling-tts)
modelrequiredstring
"kling-tts"
textrequiredstring
Text to synthesize (max 1000 chars)
voice_idrequiredstring
Voice ID
voice_languagerequiredstring
Language code e.g. "zh", "en"
voice_speednumber
0.8-2.0, default 1.0
callback_urlstring
Webhook URL for completion notification
Code Examples
curl -X POST https://apimodels.app/api/v1/audio/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-sound-effects",
"prompt": "Strong wind blowing through a forest with rustling leaves",
"duration": "5.0"
}'Response Format
Create Task Response
{
"code": 200,
"msg": "success",
"data": {
"taskId": "clxxx...",
"state": "pending",
"model": "kling-audio/kling-sound-effects"
}
}Success Response
{
"code": 200,
"msg": "success",
"data": {
"taskId": "clxxx...",
"state": "completed",
"model": "kling-audio/kling-sound-effects",
"resultUrls": ["https://...audio.mp3"],
"createTime": 1705123450000,
"completeTime": 1705123500000
}
}Failed Response
{
"code": 200,
"msg": "success",
"data": {
"taskId": "clxxx...",
"state": "failed",
"model": "kling-audio/kling-sound-effects",
"failMsg": "Content policy violation"
}
}Task States
pendingTask queued, waiting to processprocessingAudio is being generatedcompletedAudio generation successfulfailedAudio generation failedError Codes
400Bad Request - Missing or invalid parameters401Unauthorized - Invalid API key402Payment Required - Insufficient credits404Not Found - Task ID not found500Internal Server ErrorImportant Notes
- *Audio files are stored for 7 days, download promptly
- *Text-to-audio supports duration from 3.0s to 10.0s
- *Video-to-audio requires video between 3-20 seconds
- *TTS supports max 1000 characters per request
- *For video-to-audio, provide either video_id or video_url
- *Poll every 5-10 seconds to check status