# Generate Music

**What**：Generate a piece of music from a style description (optionally with lyrics).

**When**：Use for background music, short-video soundtracks or song demos. No image / video materials.

## Endpoints
- POST `/api/cqt/generator/lyria`
- GET `/api/cqt/info/lyria?id={taskId}`

## Sub-models

| model | Usage | Materials | Output | Price (credits/call) |
| --- | --- | --- | --- | --- |
| `lyria-3.0-clip` | Short clip | prompt + optional lyrics | ~30 s clip | 30 |
| `lyria-3.0-pro` | Full song | prompt + optional lyrics | ~3 min full song | 60 |

## Request params
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| model | string | Yes | Sub-model: lyria-3.0-clip / lyria-3.0-pro |
| prompt | string | Yes | Style / mood / instruments (optional when lyrics is given) |
| lyrics | string | — | Lyrics (optional); [verse] / [chorus] section tags supported |

## Request example
```bash
curl -X POST https://api.novapi.ai/api/cqt/generator/lyria \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "lyria-3.0-pro",
    "prompt": "upbeat synth-pop, female vocal, summer night vibe",
    "lyrics": "[verse]\nNeon lights on the rainy street\nEvery step falls on the beat\n[chorus]\nWe are young tonight\nDancing in the city light"
  }'
# -> { "code":200, "data":"<taskId>" }
```

## Response example
```json
{
  "code": 200,
  "msg": "success",
  "data": {
    "id": "0ef4cd7639b040c9b2ce60a8e140a5dc",
    "resultUrl": "https://cdn.novapi.ai/lyria/1791950053246_daadc785e716401c9967cf344e98f11b.mp3",
    "status": "succeeded",
    "errorMsg": null,
    "createTime": "2026-10-14 11:53:33",
    "completeTime": "2026-10-14 11:54:14"
  }
}
```

## Response fields
| Field | Type | Description |
| --- | --- | --- |
| code | number | 200 means success |
| data.id | string | Task ID (taskId) |
| data.status | string | queued / running / succeeded / failed |
| data.resultUrl | string | Result URL(s) on our CDN (long-lived); multiple results are comma-separated; null until done or on failure |
| data.errorMsg | string \| null | Failure reason; null on success |
