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/json

Music 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

FieldRequiredTypeDescription
promptYesstringNon-empty description of the track
optionsNoobjectGeneration controls

options

FieldTypeDescription
duration_secondsnumberTarget length, 3–300
instrumentalbooleantrue for no vocals
stylestringOptional style/genre hint
lyricsstringOptional 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"]
  }
}