AI-APIs commited on
Commit
75374fb
·
verified ·
1 Parent(s): adfbe5c

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +135 -0
README.md ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: other
5
+ pipeline_tag: text-to-audio
6
+ tags:
7
+ - suno
8
+ - text-to-audio
9
+ - music-generation
10
+ inference: false
11
+ ---
12
+
13
+ # Suno API
14
+
15
+ **Model Page:** [Suno API](https://apiframe.ai/models/suno)
16
+
17
+ Community model card for calling Suno through a REST API.
18
+
19
+ Suno has no official public API. This repo documents the `suno` model as exposed by Apiframe: text-to-music on the current V4–V5.5 line, two tracks per job, custom or auto lyrics, and follow-up actions (extend, cover, add vocals, stems).
20
+
21
+ This repository does not host weights. Suno is a closed model. Inference runs remotely.
22
+
23
+ <img src="https://apiframe.ai/models-examples/suno-cover-finish-line.webp" alt="Sample output" width="280" />
24
+
25
+ ## Model description
26
+
27
+ | | |
28
+ |---|---|
29
+ | Architecture | Suno (default `V4_5PLUS`; pin `V4`, `V4_5`, `V5`, or `V5_5`) |
30
+ | Task | text-to-music; lyrics-to-music |
31
+ | Output | 2 tracks (`audioUrl`, `imageUrl`, `title`, `duration`) |
32
+ | Typical latency | ~110s |
33
+
34
+ ## How to use
35
+
36
+ ```bash
37
+ pip install requests
38
+ ```
39
+
40
+ ```python
41
+ import os
42
+ import time
43
+ import requests
44
+
45
+ API = "https://api.apiframe.ai/v2"
46
+ headers = {
47
+ "X-API-Key": os.environ["APIFRAME_API_KEY"],
48
+ "Content-Type": "application/json",
49
+ }
50
+
51
+ job = requests.post(
52
+ f"{API}/music/generate",
53
+ headers=headers,
54
+ json={
55
+ "model": "suno",
56
+ "prompt": "upbeat electronic track with synth arpeggios and driving bass",
57
+ "sunoParams": {
58
+ "model_version": "V4_5PLUS",
59
+ "style": "electronic, synthwave",
60
+ },
61
+ },
62
+ ).json()
63
+
64
+ while True:
65
+ result = requests.get(f"{API}/jobs/{job['jobId']}", headers=headers).json()
66
+ if result["status"] in ("COMPLETED", "FAILED"):
67
+ break
68
+ time.sleep(2)
69
+
70
+ print(result.get("result"))
71
+ ```
72
+
73
+ `result["tracks"]` is a list of 2 songs. Pass `webhookUrl` on the generate call if you do not want to poll.
74
+
75
+ With `custom_mode: false` (default), `prompt` is a description (max 500 characters). With `custom_mode: true`, `prompt` is lyrics (max 5,000 characters). Set `auto_lyrics: true` to keep a long prompt as a description and let Suno write the lyrics.
76
+
77
+ ### Custom lyrics
78
+
79
+ ```python
80
+ import os
81
+ import requests
82
+
83
+ headers = {
84
+ "X-API-Key": os.environ["APIFRAME_API_KEY"],
85
+ "Content-Type": "application/json",
86
+ }
87
+
88
+ requests.post(
89
+ "https://api.apiframe.ai/v2/music/generate",
90
+ headers=headers,
91
+ json={
92
+ "model": "suno",
93
+ "prompt": "[Verse 1]\nWalking through the city lights\nNeon glow on rainy nights\n\n[Chorus]\nWe are the dreamers, we are the stars",
94
+ "sunoParams": {
95
+ "custom_mode": True,
96
+ "title": "City Dreamers",
97
+ "style": "pop, indie",
98
+ "vocal_gender": "f",
99
+ },
100
+ },
101
+ )
102
+ ```
103
+
104
+ ### Follow-up actions
105
+
106
+ ```python
107
+ import os
108
+ import requests
109
+
110
+ headers = {
111
+ "X-API-Key": os.environ["APIFRAME_API_KEY"],
112
+ "Content-Type": "application/json",
113
+ }
114
+
115
+ requests.post(
116
+ "https://api.apiframe.ai/v2/music/suno/action",
117
+ headers=headers,
118
+ json={
119
+ "parentJobId": "JOB_ID",
120
+ "action": "extend", # cover | add_vocals | stems
121
+ "index": 1, # 1-2
122
+ },
123
+ )
124
+ ```
125
+
126
+ ## Limitations
127
+
128
+ - Closed model. No weights, fine-tuning, or local inference.
129
+ - Not an official Suno endpoint. Requires an Apiframe API key (`X-API-Key`).
130
+ - Commercial use follows Suno's terms.
131
+ - Generated media is retained on the CDN for 90 days.
132
+
133
+ ## License
134
+
135
+ Outputs are subject to Suno's terms. This card is documentation only. Apiframe is not affiliated with, endorsed by, or sponsored by Suno, Inc.