# Suno API

> Full songs with vocals from a text prompt.

- **Provider**: Suno
- **Model id**: `suno`
- **Modality**: music
- **Price**: 13.21 credits

## Overview

Suno is called in two steps: create a generation task, then poll the task until the result is ready.

## Authentication

All requests require a Bearer Token in the request header:

```
Authorization: Bearer YOUR_API_KEY
```

## Create Task

`POST https://you.bot/api/v1/generate`

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| modelId | string | Yes | Model id: `suno` |
| input | object | Yes | Input parameters object (see below) |
| callbackUrl | string | No | https URL to receive a signed webhook on completion |

### input object parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| modelVersion | string | Yes | Options: V5_5 | V5 | V4_5PLUS | V4_5 | V4_5ALL | V4 (default: V4_5PLUS) |
| customMode | boolean | No | True/false (default: false) |
| duration | number | No | Track length in seconds, 10–360. Only used by V5_5 in Custom Mode. (range 10-360) |
| prompt | string | Conditional | when `customMode` is `false`: Text value Max 500 characters. · when `customMode` is `true` and `modelVersion` is `V5_5`/`V5`/`V4_5PLUS`/`V4_5`/`V4_5ALL`: Used verbatim as the sung lyrics. Required unless Instrumental is on. Max 5000 characters. · when `customMode` is `true` and `modelVersion` is `V4`: Used verbatim as the sung lyrics. V4 allows up to 3,000 characters. Max 3000 characters. |
| title | string | Yes | Text value Max 80 characters. |
| style | string | Conditional | when `customMode` is `true` and `modelVersion` is `V5_5`/`V5`/`V4_5PLUS`/`V4_5`/`V4_5ALL`: Text value Max 1000 characters. · when `customMode` is `true` and `modelVersion` is `V4`: V4 allows up to 200 characters. Max 200 characters. |
| personaId | string | No | From Generate Persona. Requires a V5 or V5_5 model. |
| instrumental | boolean | No | True/false (default: false) |
| audioWeight | number | No | Range 0-1 (default: 0.65) |
| vocalGender | string | No | Options:  | m | f |
| styleWeight | number | No | Range 0-1 |
| weirdnessConstraint | number | No | Range 0-1 |
| negativeTags | string | No | Text value |

### Request example

```json
{
  "modelId": "suno",
  "input": {
    "modelVersion": "V4_5PLUS",
    "customMode": false,
    "prompt": "An upbeat synthwave track with driving bass, bright arpeggios and a nostalgic 80s feel.",
    "instrumental": false,
    "audioWeight": "0.65"
  }
}
```

### Response example

```json
{
  "taskId": "281e5b0…f39b9",
  "creditsCharged": 24
}
```

## Query Task

`GET https://you.bot/api/v1/task/{taskId}?model=suno`

When `state` is `success`, the output is in `resultUrls`: `{ "state": "success", "resultUrls": [ ... ] }`. (Text models return inline in the create response.)

## Error Codes

| Code | Description |
|------|-------------|
| 200 | Request successful |
| 400 | Invalid request parameters |
| 401 | Authentication failed, check API Key |
| 402 | Insufficient account balance |
| 422 | Parameter validation failed |
| 429 | Request rate limit exceeded |
| 500 | Internal server error |
