> For the complete documentation index, see [llms.txt](https://anyint.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://anyint.gitbook.io/docs/ai-music/generation-and-creation.md).

# generation and creation

This page covers the routes you use to create new music assets rather than transform uploaded audio.

## Core creation routes

| Route                           | Purpose                                          |
| ------------------------------- | ------------------------------------------------ |
| `POST /suno/generate`           | Create a new song                                |
| `POST /suno/extend`             | Extend an existing generated song                |
| `POST /suno/generate-lyrics`    | Generate lyrics from a short prompt              |
| `POST /suno/timestamped-lyrics` | Fetch aligned word timings for a completed song  |
| `POST /suno/style-generate`     | Expand a rough style hint into richer style text |
| `POST /suno/generate-cover`     | Generate cover art for a completed music task    |

## `/suno/generate`

Use `/suno/generate` for both one-line song creation and fully controlled lyric-based creation.

### Key input fields

| Field          | Required    | Notes                                                 |
| -------------- | ----------- | ----------------------------------------------------- |
| `customMode`   | yes         | `false` for simple mode, `true` for custom mode       |
| `instrumental` | yes         | `true` for instrumental, `false` for vocals           |
| `model`        | yes         | one of `V4`, `V4_5`, `V4_5PLUS`, `V4_5ALL`, `V5`      |
| `callBackUrl`  | yes         | webhook endpoint for task completion                  |
| `prompt`       | conditional | description in simple mode, lyric text in custom mode |
| `style`        | conditional | required in custom mode                               |
| `title`        | conditional | required in custom mode                               |
| `personaId`    | no          | reuse a saved voice identity                          |

### Simple mode example

```bash
curl -X POST "https://gateway.api.anyint.ai/suno/generate" \
  -H "Authorization: Bearer $ANYINT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customMode": false,
    "instrumental": false,
    "model": "V5",
    "prompt": "A bright summer pop song about travel and freedom",
    "callBackUrl": "https://your-domain.com/callback"
  }'
```

### Custom mode example

```bash
curl -X POST "https://gateway.api.anyint.ai/suno/generate" \
  -H "Authorization: Bearer $ANYINT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customMode": true,
    "instrumental": false,
    "model": "V5",
    "title": "Summer Breeze",
    "style": "pop, acoustic, warm vocals",
    "prompt": "[Verse]\nThe city fades behind us\n\n[Chorus]\nWe keep driving toward the light",
    "personaId": "your-persona-id",
    "callBackUrl": "https://your-domain.com/callback"
  }'
```

## `/suno/extend`

Use `/suno/extend` to continue a previously generated track.

### Key input fields

| Field              | Required | Notes                                                       |
| ------------------ | -------- | ----------------------------------------------------------- |
| `audioId`          | yes      | source audio to continue                                    |
| `model`            | yes      | target model version                                        |
| `callBackUrl`      | yes      | async callback target                                       |
| `defaultParamFlag` | yes      | `false` to reuse original song settings, `true` to override |

```bash
curl -X POST "https://gateway.api.anyint.ai/suno/extend" \
  -H "Authorization: Bearer $ANYINT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "audioId": "your-audio-id",
    "model": "V4_5",
    "defaultParamFlag": false,
    "callBackUrl": "https://your-domain.com/callback"
  }'
```

## `/suno/generate-lyrics`

Use this route when you want AI-written lyrics before starting song generation.

```bash
curl -X POST "https://gateway.api.anyint.ai/suno/generate-lyrics" \
  -H "Authorization: Bearer $ANYINT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A late-night R&B song about city life",
    "callBackUrl": "https://your-domain.com/callback"
  }'
```

The callback returns multiple lyric variants, each with `title` and `text`.

## `/suno/timestamped-lyrics`

Use this route after a song is complete when you need karaoke, subtitle, or lyric-sync output.

```bash
curl -X POST "https://gateway.api.anyint.ai/suno/timestamped-lyrics" \
  -H "Authorization: Bearer $ANYINT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "taskId": "your-task-id",
    "audioId": "your-audio-id"
  }'
```

The response includes `data.alignedWords`, where each word includes `startS` and `endS`.

## `/suno/style-generate`

This is a synchronous helper route for improving rough style tags before you submit a full generation request.

```bash
curl -X POST "https://gateway.api.anyint.ai/suno/style-generate" \
  -H "Authorization: Bearer $ANYINT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "content": "Pop, Mysterious, Electronic" }'
```

## `/suno/generate-cover`

Use this route after a music task is complete to create cover art options.

```bash
curl -X POST "https://gateway.api.anyint.ai/suno/generate-cover" \
  -H "Authorization: Bearer $ANYINT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "taskId": "your-task-id",
    "callBackUrl": "https://your-domain.com/callback"
  }'
```

The callback returns `data.images`, which is an array of generated cover URLs.
