Api
Music Generation API
Create music generation tasks with POST /api/v1/music.
Create a music task
POST /api/v1/music generates an original music track from a text prompt and consumes credits when accepted.
POST https://vidrush-ai.com/api/v1/music
Authorization: Bearer sk-your-api-key
Content-Type: application/jsonMusic renders synchronously: the response usually already carries status: "success" and the result URL in data.taskUrls. The same data.id still works with GET /api/v1/tasks/{taskId} if you prefer a uniform polling flow.
Request body
| Field | Required | Type | Description |
|---|---|---|---|
prompt | Yes | string | Non-empty description of the track |
options | No | object | Generation controls |
options
| Field | Type | Description |
|---|---|---|
duration_seconds | number | Target length, 3–300 |
instrumental | boolean | true for no vocals |
style | string | Optional style/genre hint |
lyrics | string | Optional lyrics |
Call GET /api/v1/models?type=music for the current model catalog and credit cost.
Example
curl -X POST https://vidrush-ai.com/api/v1/music \
-H "Authorization: Bearer $VIDRUSH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Warm lo-fi hip-hop with a mellow piano loop",
"options": { "duration_seconds": 30, "instrumental": true }
}'Successful response
{
"code": 0,
"message": "ok",
"data": {
"id": "task_123",
"status": "success",
"costCredits": 10,
"taskUrls": ["https://.../music.mp3"]
}
}