Generate V2
Music Generation API V2
Although we have developed the v2 API, don't worry, the v1 API is still fully supported
Overview
Generate AI music based on text prompts using various models. The API supports two modes: Inspiration Mode and Custom Mode. In Inspiration Mode, Suno will automatically generate lyrics, title, and style tags based on your description.
Authentication
Authentication is required for all API requests. Include your API key in the request headers:
API Endpoint
URL: POST https://udioapi.pro/api/v2/generate
Content-Type: application/json
Generation Modes
1. Inspiration Mode
In this mode, you only need to provide a description prompt, and Suno will automatically generate lyrics, title, and style tags.
2. Custom Mode
In this mode, you have full control over the song details by providing specific parameters.
Code Examples
Inspiration Mode Examples
Custom Mode Examples
Request Parameters
Inspiration Mode Parameters
Parameter | Type | Required | Description |
---|---|---|---|
gpt_description_prompt | string | Yes | Description of the music you want to generate |
make_instrumental | boolean | No | Generate instrumental version |
model | string | Yes | Model version (default: "chirp-v3-5") |
Custom Mode Parameters
Parameter | Type | Required | Description |
---|---|---|---|
prompt | string | Yes | Text prompt describing the music you want to generate |
title | string | Yes | Title of the music |
tags | string | Yes | Style tags for the music |
make_instrumental | boolean | No | Generate instrumental version |
model | string | Yes | Model version (default: "chirp-v3-5") |
Response Format
A successful response will return a JSON object with the following structure:
Field | Type | Description |
---|---|---|
code | number | HTTP status code |
message | string | Response message |
workId | string | Unique identifier for the generation task. Use this ID with the feed API to check generation status |
Error Codes
Code | Description |
---|---|
400 | Invalid request / No body provided |
401 | Invalid API key / No API key provided in Authorization header |
402 | Not enough credits |
500 | Internal Server Error |
Note
The workId
returned in the response can be used with the feed API to check the status of your generation request and retrieve the final results.
Query Generation Results
API Endpoint
URL: GET https://udioapi.pro/api/v2/feed
Query Parameter: workId
Code Examples
Response Format
A successful response will return a JSON object with the following structure:
Response Fields
Field | Type | Description |
---|---|---|
code | number | HTTP status code |
message | string | Response message |
data.type | string | Result type ("SUCCESS", "IN_PROGRESS", etc.) |
data.request_body | object | Original generation request parameters |
data.response_data | array | Array of generated results |
data.created_at | string | Timestamp of the generation request |
Generated Result Fields
Field | Type | Description |
---|---|---|
audio_url | string | URL to the generated audio file (MP3) |
image_url | string | URL to the generated cover image |
image_large_url | string | URL to the high-resolution cover image |
video_url | string | URL to the generated music video |
created_at | string | Timestamp of the result creation |
status | string | Status of the generation ("complete", "pending", etc.) |
title | string | Title of the generated music |
prompt | string | Original prompt used for generation |
tags | string | Style tags of the generated music |