Create WAV Format Audio Generation Task
POSThttps://apibox.erweima.ai/api/v1/wav/generate
Create a WAV format audio generation task based on existing audio.
Parameter Details
- Need to provide taskId or audioId
Important Notes
- Generated files are retained for 15 days
- Callback has only one stage: complete (generation complete)
Request
- application/json
Bodyrequired
taskIdstringrequired
Task ID returned from audio generation task (required)
Example:
5c79****be8e
audioIdstringrequired
Audio ID of playable music (required)
Example:
5c79****be8e
callBackUrlurirequired
Callback URL for task completion. See callback example
Example:
https://api.example.com/callback
Responses
- 200
- 500
Request successful
- application/json
- Schema
- Example (auto)
Schema
- ✅ 200 - Request successful
- ⚠️ 400 - Invalid parameters
- ⚠️ 401 - Unauthorized access
- ⚠️ 404 - Invalid request method or path
- ⚠️ 405 - Rate limit exceeded
- ⚠️ 413 - Theme or prompt too long
- ⚠️ 429 - Insufficient credits
- ⚠️ 455 - System maintenance
- ❌ 500 - Server error
codeinteger
Status Codes
Possible values: [200
, 400
, 401
, 404
, 405
, 413
, 429
, 455
, 500
]
Example:
200
msgstring
Error message when code != 200
Example:
success
data object
{
"code": 200,
"msg": "success",
"data": {
"taskId": "5c79****be8e"
}
}
Server error
Callbacks
- POST wavGenerated
POST{$request.body#/callBackUrl}
System will call this callback when WAV format audio generation is complete.
Callback Example
{
"code": 200,
"msg": "success",
"data": {
"audio_wav_url": "https://example.com/s/04e6****e727.wav",
"task_id": "988e****c8d3"
}
}
- application/json
Body
codeinteger
Status code
Example:
200
msgstring
Response message
Example:
success
data object
Callbacks Responses
- 200
Callback received successfully
Authorization: http
name: BearerAuthtype: httpscheme: bearerbearerFormat: API Keydescription: # 🔑 API Authentication All endpoints require authentication using Bearer Token. ## Get API Key 1. Visit the [API Key Management Page](https://sunoapi.org/api-key) to obtain your API Key ## Usage Add to request headers: ``` Authorization: Bearer YOUR_API_KEY ``` > **⚠️ Note:** > - Keep your API Key secure and do not share it with others > - If you suspect your API Key has been compromised, reset it immediately from the management page
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://apibox.erweima.ai/api/v1/wav/generate");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"taskId\": \"5c79****be8e\",\n \"audioId\": \"5c79****be8e\",\n \"callBackUrl\": \"https://api.example.com/callback\"\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear