Audio Generation
Authorizationstring*Replace {your api key} with your token
Token {your api key}modelstring*Model name. Available value: audio1.0
audio1.0promptstring*Text prompt. Description used to generate the audio. Must not exceed 1500 characters
Morning birdsongAuthorizationstring*Replace {your api key} with your token
Token {your api key}idstring*The ID of the task, taken from the path.
{your_id}idstring*Task ID, returned upon successful creation by the create task API
durationnumberAudio duration. Default 10, available range: 2–10 seconds
10seedintegerRandom seed. If not passed or passed as 0, a random number is generated automatically; passing a fixed value produces a deterministic result
0callback_urlstringCallback protocol. You need to actively set callback_url when creating the task; the request method is POST. When the video generation task's status changes, Vidu will send a callback request containing the task's latest status to this address. The structure of the callback request content is consistent with the response body of the task query API. The "status" values returned in the callback include the following states:- processing: task in progress- success: task completed (if sending fails, up to three callbacks will be sent)- failed: task failed (if sending fails, up to three callbacks will be sent)Vidu uses a callback signature algorithm for authentication. For details, see: Callback Signature Algorithm
application/jsonResponse fields
idstringTask ID
statestringProcessing status
Available values:
created Created successfully
queueing Task queued
processing Task in progress
success Task succeeded
failed Task failed
err_codestringError code, see the error code table for details
creditsintegerNumber of credits consumed by this task, unit: credits
payloadapplication/jsonResponse fields
task_idstringTask ID generated by Vidu
statestringProcessing status. Available values:
-created Created successfully
-queueing Task queued
-processing Task in progress
-success Task succeeded
-failed Task failed
modelstringModel name used in this call
Pass-through parameter provided when this task was called
bgmbooleanWhether BGM was used in this task call
off_peakbooleanWhether off-peak mode was used in this task call
creationsarrayGeneration results
idstringGeneration result ID, used to identify different generation results
urlstringGeneration result URL, valid for 24 hours
cover_urlstringGeneration result cover, valid for 24 hours
watermarked_urlstringWatermarked generation result URL, valid for 24 hours
promptPrompt parameter used in this call
durationintegerVideo duration parameter used in this call
seedintegerRandom seed parameter used in this call
creditsintegerNumber of credits consumed by this call
created_atstringTask creation time
curl --request POST \
--url 'https://api.vidu.com/ent/v2/text2audio' \
--header 'Authorization: Token {your api key}' \
--header 'Content-Type: application/json' \
--data '{
"model": "audio1.0",
"prompt": "Morning birdsong",
"duration": 10,
"seed": 0,
"callback_url": "string"
}'{
"task_id": "your_task_id_here",
"state": "created",
"model": "audio1.0",
"prompt": "Morning birdsong",
"duration": 10,
"seed": random_number,
"credits":credits_number,
"created_at": "2025-01-01T15:41:31.968916Z"
}curl --request GET \
--url 'https://api.vidu.com/ent/v2/tasks/{your_id}/creations' \
--header 'Authorization: Token {your api key}' \
--header 'Content-Type: application/json'{
"id":"your_task_id",
"state": "success",
"err_code": "",
"credits": 4,
"payload": "",
"creations": [
{
"id": "your_creations_id",
"url": "your_generated_results_url",
"cover_url": "your_generated_results_cover_url",
"watermarked_url": "your_generated_results_watermarked_url"
}
]
}