Suno API
TTAPI Suno service, building a future where anyone can make great music.
Generate Music
POST
https://api.ttapi.io/suno/v1/music
Generate music through text prompts or custom lyrics. Task results is async
Headers
Name | Type | Required | Description |
---|---|---|---|
TT-API-KEY | String | true | Your API Key in TT API used for request authorization |
Request Body
Name | Type | Required | Description |
---|---|---|---|
mv | String | true | The model used to generate the music audio , chirp-v3-0 chirp-v3-5 chirp-v4 default is chirp-v4 |
custom | boolean | true | The flag indicates the music audio is custom or not, if true, the audio will be generated from the lyric, otherwise, the audio will be generated from the prompt |
instrumental | boolean | true | No lyrics option, default is false, when it is true will ignore the lyric input above. |
gpt_description_prompt | String | false | Inspiration mode prompt words Automatically generate lyrics based on this prompt word |
prompt | String | false | Lyrics, for custom mode only |
title | String | false | Title, for custom mode only |
tags | String | false | Style tag, for custom mode only |
music_id | String | false | Song ID, use this field when you need to extend the song |
continue_at | int | false | Song extension time, unit: seconds |
hookUrl | String | false | Send a request to the address for task completion or failed notification. If not set you need to request fetch endpoint to get response |
Example Request
import requests
endpoint = "https://api.ttapi.io/suno/v1/music"
headers = {
"TT-API-KEY": your_key
}
data = {
"mv": "chirp-v4",
"custom": true,
"instrumental": false,
"prompt":"a cat"
}
response = requests.post(endpoint, headers=headers, json=data)
print(response.status_code)
print(response.json())
Example Response
{
"status": "SUCCESS",
"message": "",
"data": {
"jobId": "ed1a1b01-7d64-4c8a-acaa-71185d23a2f3"
}
}
Generate lyrics
POST
https://api.ttapi.io/suno/v1/lyrics
Generate lyrics based on prompt words. Task results is async
Headers
Name | Type | Required | Description |
---|---|---|---|
TT-API-KEY | String | true | Your API Key in TT API used for request authorization |
Request Body
Name | Type | Required | Description |
---|---|---|---|
prompt | String | true | Prompt word |
hookUrl | String | false | Send a request to the address for task completion or failed notification. If not set you need to request fetch endpoint to get response |
Example Request
import requests
endpoint = "https://api.ttapi.io/suno/v1/lyrics"
headers = {
"TT-API-KEY": your_key
}
data = {
"prompt":"a cat"
}
response = requests.post(endpoint, headers=headers, json=data)
print(response.status_code)
print(response.json())
Example Response
{
"status": "SUCCESS",
"message": "",
"data": {
"jobId": "ed1a1b01-7d64-4c8a-acaa-71185d23a2f3"
}
}
Fetch Suno Result
POST
https://api.ttapi.io/suno/v1/fetch
Query the music & lyrics generation results by jobId, free endpoint
Headers
Name | Type | Description |
---|---|---|
TT-API-KEY* | String | Your API Key in TT API used for request authorization |
Query param
Name | Type | Required | Description |
---|---|---|---|
jobId | String | true | ed1a1b01-7d64-4c8a-acaa-71185d23a2f3 |
Example Request
import requests
endpoint = "https://api.ttapi.io/suno/v1/fetch"
headers = {
"TT-API-KEY": your_key
}
data = {
"jobId": "f11a93ac-128d-4b09-9b43-2a7e60488f9c",
}
response = requests.post(endpoint, headers=headers, json=data)
print(response.status_code)
print(response.json())
Async callback & fetch json
{
"status": "SUCCESS",
"message": "success",
"jobId": "34505837-41f0-4c68-b830-e8e051b72148",
"data": {
"jobId": "34505837-41f0-4c68-b830-e8e051b72148",
"action": "extend",
"progress": "100%",
"mv": "chirp-v3-0",
"quota": "5",
"hookUrl": null,
"musics": [
{
"musicId": "a7d3712d-2507-4d87-80d0-b60bb375a049",
"prompt": "[Verse]\n远方你的微笑\n穿越时空寻找\n夜晚的风轻飘\n心跳为你燃烧\n\n[Bridge]\n梦里花落几场\n想你思念成霜\n星光作伴凄凉\n入骨相思难忘\n\n[Chorus]\n思念入骨髓\n心已随风飞\n两地相隔泪\n只为与你归",
"title": "思念入骨髓 (Longing in My Bones)",
"tags": "harmonized melancholic traditional chinese",
"imageUrl": "https://cdn2.suno.ai/image_a7d3712d-2507-4d87-80d0-b60bb375a049.jpeg",
"imageLargeUrl": "https://cdn2.suno.ai/image_large_a7d3712d-2507-4d87-80d0-b60bb375a049.jpeg",
"audioUrl": "https://cdn1.suno.ai/a7d3712d-2507-4d87-80d0-b60bb375a049.mp3",
"videoUrl": "https://cdn1.suno.ai/a7d3712d-2507-4d87-80d0-b60bb375a049.mp4"
},
{
"musicId": "ab763675-b371-44d5-ae1b-6aea35fe4403",
"prompt": "[Verse]\n远方你的微笑\n穿越时空寻找\n夜晚的风轻飘\n心跳为你燃烧\n\n[Bridge]\n梦里花落几场\n想你思念成霜\n星光作伴凄凉\n入骨相思难忘\n\n[Chorus]\n思念入骨髓\n心已随风飞\n两地相隔泪\n只为与你归",
"title": "思念入骨髓 (Longing in My Bones)",
"tags": "harmonized melancholic traditional chinese",
"imageUrl": "https://cdn2.suno.ai/image_ab763675-b371-44d5-ae1b-6aea35fe4403.jpeg",
"imageLargeUrl": "https://cdn2.suno.ai/image_large_ab763675-b371-44d5-ae1b-6aea35fe4403.jpeg",
"audioUrl": "https://cdn1.suno.ai/ab763675-b371-44d5-ae1b-6aea35fe4403.mp3",
"videoUrl": "https://cdn1.suno.ai/ab763675-b371-44d5-ae1b-6aea35fe4403.mp4"
}
]
}
}