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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f676e53a763fe863f61cd2fbd16f0702c93f2d189f7369d1471e819dd01bfa79
4
- data.tar.gz: 76e18fcc6c46fe6b0f97be04949db28868d9f4ea3bfe7efcf5aa5296ca9a6ff7
3
+ metadata.gz: 124108c4cd23a7de517f3ab0f0eac3b38b898c43774965bb4819c946e8f62a28
4
+ data.tar.gz: 35d6431cf52fb7159d390a45adfd5899220b72862e5282e2f56053ad64870997
5
5
  SHA512:
6
- metadata.gz: 83832d65fe97b8d8bfa5eae30c1f095fe8ea13368f06242588d89e67aa31013e2cd9ef3b5b7ba14e760430b13d76cc83a942dafd7878b654f58d6a3ff0736b5a
7
- data.tar.gz: 5973d5187e4c761c056f1cde61a2e68f6fab5be8d42988e66194989eaddaafda9e77b6b481d89ee5eea5d84997f86def8a6c57ac8ceebd34bd570701dbcb1866
6
+ metadata.gz: 93841c24e1ba681727532961006a2ea959dece477c1b7419d09acfc322893e25eab178efe282bc1c250363c7e001fcd8af337ec0ce36b7a106be459b48c498bd
7
+ data.tar.gz: 1aeb7d43eea7c6d2aac1e08a28ac2cc6aacc6f82c6cd57929c240a4880f3ae4fd25cd2b87eef65dc51169949858c5696926b2d71d698db44952946e141ae4ac6
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # Suno AI API Ruby SDK for RunAPI
1
+ # Suno API Ruby SDK for RunAPI
2
2
 
3
- The suno ai api Ruby SDK is the language-specific package for Suno on RunAPI. Use this suno ai api package for song generation, lyrics, vocal, extension, and audio transformation flows when your application needs JSON request bodies, task status lookup, and consistent RunAPI errors in Ruby.
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 suno ai api 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.
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-suno"
16
+ require "runapi/suno"
17
17
 
18
18
  client = RunApi::Suno::Client.new
19
- task = client.generations.create(
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.generations.get(task.id)
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 include generations, extensions, upload and extensions, covers, upload and covers, instrumentals, vocals, vocal removals, midi, wav conversions, music videos, lyrics, timestamped lyrics, section replacements, mashups, sounds, personas, and styles. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.
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/v3.5
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
@@ -2,19 +2,61 @@
2
2
 
3
3
  module RunApi
4
4
  module Suno
5
- class Client
6
- attr_reader :text_to_music, :extend_music, :generate_artwork, :cover_audio,
7
- :add_instrumental, :add_vocals, :separate_audio_stems, :generate_midi,
8
- :convert_audio, :visualize_music, :generate_lyrics, :get_timestamped_lyrics,
9
- :replace_section, :create_mashup, :text_to_sound, :voice_to_validation_phrase,
10
- :regenerate_validation_phrase, :generate_voice, :check_voice, :generate_persona,
11
- :boost_style
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
- @api_key = Core::Auth.resolve_api_key(api_key)
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)