runapi-suno 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -8
- data/lib/runapi/suno/client.rb +53 -11
- data/lib/runapi/suno/contract_gen.rb +744 -0
- data/lib/runapi/suno/resources/add_instrumental.rb +8 -7
- data/lib/runapi/suno/resources/add_vocals.rb +8 -7
- data/lib/runapi/suno/resources/boost_style.rb +3 -2
- data/lib/runapi/suno/resources/check_voice.rb +3 -2
- data/lib/runapi/suno/resources/convert_audio.rb +8 -7
- data/lib/runapi/suno/resources/cover_audio.rb +8 -7
- data/lib/runapi/suno/resources/create_mashup.rb +8 -7
- data/lib/runapi/suno/resources/extend_music.rb +8 -7
- data/lib/runapi/suno/resources/generate_artwork.rb +8 -7
- data/lib/runapi/suno/resources/generate_lyrics.rb +8 -7
- data/lib/runapi/suno/resources/generate_midi.rb +8 -7
- data/lib/runapi/suno/resources/generate_persona.rb +3 -2
- data/lib/runapi/suno/resources/generate_voice.rb +8 -7
- data/lib/runapi/suno/resources/get_timestamped_lyrics.rb +3 -2
- data/lib/runapi/suno/resources/regenerate_validation_phrase.rb +8 -7
- data/lib/runapi/suno/resources/replace_section.rb +8 -7
- data/lib/runapi/suno/resources/separate_audio_stems.rb +8 -7
- data/lib/runapi/suno/resources/text_to_music.rb +8 -7
- data/lib/runapi/suno/resources/text_to_sound.rb +8 -7
- data/lib/runapi/suno/resources/visualize_music.rb +8 -7
- data/lib/runapi/suno/resources/voice_to_validation_phrase.rb +8 -7
- data/lib/runapi/suno/types.rb +40 -0
- data/lib/runapi/suno/validators.rb +37 -45
- data/lib/runapi/suno.rb +1 -0
- metadata +11 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 124108c4cd23a7de517f3ab0f0eac3b38b898c43774965bb4819c946e8f62a28
|
|
4
|
+
data.tar.gz: 35d6431cf52fb7159d390a45adfd5899220b72862e5282e2f56053ad64870997
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 93841c24e1ba681727532961006a2ea959dece477c1b7419d09acfc322893e25eab178efe282bc1c250363c7e001fcd8af337ec0ce36b7a106be459b48c498bd
|
|
7
|
+
data.tar.gz: 1aeb7d43eea7c6d2aac1e08a28ac2cc6aacc6f82c6cd57929c240a4880f3ae4fd25cd2b87eef65dc51169949858c5696926b2d71d698db44952946e141ae4ac6
|
data/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# Suno
|
|
1
|
+
# Suno API Ruby SDK for RunAPI
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The Suno Ruby SDK is the language-specific package for Suno on RunAPI. Use this package for song generation, lyrics, vocals, extension, and audio transformation workflows when your application needs request bodies, task status lookup, and consistent RunAPI errors in Ruby.
|
|
4
4
|
|
|
5
|
-
This
|
|
5
|
+
This README is the Ruby package guide inside the public `suno-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/suno; for API reference, use https://runapi.ai/docs#suno; for SDK docs, use https://runapi.ai/docs#sdk-suno.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -13,27 +13,29 @@ gem install runapi-suno
|
|
|
13
13
|
## Quick start
|
|
14
14
|
|
|
15
15
|
```ruby
|
|
16
|
-
require "runapi
|
|
16
|
+
require "runapi/suno"
|
|
17
17
|
|
|
18
18
|
client = RunApi::Suno::Client.new
|
|
19
|
-
task = client.
|
|
19
|
+
task = client.text_to_music.create(
|
|
20
20
|
# Pass the Suno JSON request body from https://runapi.ai/docs#suno.
|
|
21
21
|
)
|
|
22
|
-
status = client.
|
|
22
|
+
status = client.text_to_music.get(task.id)
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
Use `create` when you want to submit a task and return quickly, `get` when you need the latest task state, and `run` when a script should create and poll until completion. In web request handlers, prefer `create` plus webhook or later `get` polling so a worker is not held open.
|
|
26
26
|
|
|
27
|
+
RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
|
|
28
|
+
|
|
27
29
|
## Language notes
|
|
28
30
|
|
|
29
|
-
Use Ruby keyword arguments and the `RunApi::Suno` error classes when building music jobs, Rails workers, or scripts. The available resources
|
|
31
|
+
Use Ruby keyword arguments and the `RunApi::Suno` error classes when building music jobs, Rails workers, or scripts. The available resources are `text_to_music`, `extend_music`, `generate_artwork`, `cover_audio`, `add_instrumental`, `add_vocals`, `separate_audio_stems`, `generate_midi`, `convert_audio`, `visualize_music`, `generate_lyrics`, `get_timestamped_lyrics`, `replace_section`, `create_mashup`, `text_to_sound`, `voice_to_validation_phrase`, `regenerate_validation_phrase`, `generate_voice`, `check_voice`, `generate_persona`, and `boost_style`. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.
|
|
30
32
|
|
|
31
33
|
## Links
|
|
32
34
|
|
|
33
35
|
- Model page: https://runapi.ai/models/suno
|
|
34
36
|
- SDK docs: https://runapi.ai/docs#sdk-suno
|
|
35
37
|
- Product docs: https://runapi.ai/docs#suno
|
|
36
|
-
- Pricing and rate limits: https://runapi.ai/models/suno/
|
|
38
|
+
- Pricing and rate limits: https://runapi.ai/models/suno/v4
|
|
37
39
|
- Provider comparison: https://runapi.ai/providers/suno
|
|
38
40
|
- Full catalog: https://runapi.ai/models
|
|
39
41
|
- Repository: https://github.com/runapi-ai/suno-sdk
|
data/lib/runapi/suno/client.rb
CHANGED
|
@@ -2,19 +2,61 @@
|
|
|
2
2
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
# Suno music platform client covering song generation, extension, covers, stems,
|
|
6
|
+
# MIDI, lyrics, mashups, sound effects, visualization, personas, and voice cloning.
|
|
7
|
+
#
|
|
8
|
+
# @example Generate a song from a text prompt
|
|
9
|
+
# client = RunApi::Suno::Client.new(api_key: "sk-your-api-key")
|
|
10
|
+
# result = client.text_to_music.run(
|
|
11
|
+
# prompt: "A chill lo-fi beat with soft vocals",
|
|
12
|
+
# model: "suno-v4.5-plus"
|
|
13
|
+
# )
|
|
14
|
+
class Client < RunApi::Core::Client
|
|
15
|
+
# @return [Resources::TextToMusic] generates songs from a text prompt with configurable vocal mode, style, and persona
|
|
16
|
+
attr_reader :text_to_music
|
|
17
|
+
# @return [Resources::ExtendMusic] continues an existing track from a specified timestamp
|
|
18
|
+
attr_reader :extend_music
|
|
19
|
+
# @return [Resources::GenerateArtwork] creates cover artwork for an existing music task
|
|
20
|
+
attr_reader :generate_artwork
|
|
21
|
+
# @return [Resources::CoverAudio] re-records vocals over an uploaded audio file with a new style or voice
|
|
22
|
+
attr_reader :cover_audio
|
|
23
|
+
# @return [Resources::AddInstrumental] generates and adds an instrumental backing track to uploaded audio
|
|
24
|
+
attr_reader :add_instrumental
|
|
25
|
+
# @return [Resources::AddVocals] generates and adds vocals to an uploaded instrumental track
|
|
26
|
+
attr_reader :add_vocals
|
|
27
|
+
# @return [Resources::SeparateAudioStems] splits a track into individual instrument stems
|
|
28
|
+
attr_reader :separate_audio_stems
|
|
29
|
+
# @return [Resources::GenerateMidi] extracts per-instrument MIDI note data from a generated track
|
|
30
|
+
attr_reader :generate_midi
|
|
31
|
+
# @return [Resources::ConvertAudio] converts a generated track to WAV format
|
|
32
|
+
attr_reader :convert_audio
|
|
33
|
+
# @return [Resources::VisualizeMusic] generates a music visualization video from an existing track
|
|
34
|
+
attr_reader :visualize_music
|
|
35
|
+
# @return [Resources::GenerateLyrics] produces AI-generated lyrics from a text prompt
|
|
36
|
+
attr_reader :generate_lyrics
|
|
37
|
+
# @return [Resources::GetTimestampedLyrics] retrieves word-level timing alignment for a track (synchronous)
|
|
38
|
+
attr_reader :get_timestamped_lyrics
|
|
39
|
+
# @return [Resources::ReplaceSection] re-generates a time range within an existing track
|
|
40
|
+
attr_reader :replace_section
|
|
41
|
+
# @return [Resources::CreateMashup] blends two audio tracks into a single new composition
|
|
42
|
+
attr_reader :create_mashup
|
|
43
|
+
# @return [Resources::TextToSound] generates sound effects from a text description
|
|
44
|
+
attr_reader :text_to_sound
|
|
45
|
+
# @return [Resources::VoiceToValidationPhrase] step 1 of voice cloning: extracts a validation phrase
|
|
46
|
+
attr_reader :voice_to_validation_phrase
|
|
47
|
+
# @return [Resources::RegenerateValidationPhrase] step 2 (optional) of voice cloning: requests a new phrase
|
|
48
|
+
attr_reader :regenerate_validation_phrase
|
|
49
|
+
# @return [Resources::GenerateVoice] step 3 of voice cloning: trains a custom voice
|
|
50
|
+
attr_reader :generate_voice
|
|
51
|
+
# @return [Resources::CheckVoice] step 4 of voice cloning: checks whether a custom voice is ready (synchronous)
|
|
52
|
+
attr_reader :check_voice
|
|
53
|
+
# @return [Resources::GeneratePersona] creates a reusable style or voice persona from a track's vocals (synchronous)
|
|
54
|
+
attr_reader :generate_persona
|
|
55
|
+
# @return [Resources::BoostStyle] generates style/genre tags from a text description (synchronous)
|
|
56
|
+
attr_reader :boost_style
|
|
12
57
|
|
|
13
58
|
def initialize(api_key: nil, **options)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
client_options = Core::ClientOptions.new(api_key: @api_key, **options)
|
|
17
|
-
http = client_options.http_client || Core::HttpClient.new(client_options)
|
|
59
|
+
super
|
|
18
60
|
|
|
19
61
|
@text_to_music = Resources::TextToMusic.new(http)
|
|
20
62
|
@extend_music = Resources::ExtendMusic.new(http)
|