Generate API
Music Generation API
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.
Callback Mode ?
if you want to use callback, you need to provide a callback url, and use generate with callback api.
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.