runapi-suno 0.3.2 → 0.3.4

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: 38f1f7c4c8dfc3ae057f27b46e3a12fb9ef1dabc21f2e7326b5bbfd264c02a5a
4
- data.tar.gz: b09ce08b5734ad22f5cc68c6339e3ec68d21d7c0530228c9b25261224f9f08c8
3
+ metadata.gz: 630d71197a7fcf7095fcb931f3abc7f7850c6885529182f95e628ce656328547
4
+ data.tar.gz: 48f37a1cfcc2a1a9e84301bfb33f0456fd66b1ea05222ceb2667f5bb234cda13
5
5
  SHA512:
6
- metadata.gz: 58d85f17b750573729801b93041b729d2ba27c994cbb1d67f6066eded3624527fb0bb5aa3b2106dc06a735148849de209016b4bc577859b00592451c1d4b969c
7
- data.tar.gz: 135b5ab665b08462083d1dce9c6a35f65ec1ac10e011f132e347f7ca905cd66a859c99101babdb70be702fc1644316735653105b891058c7f4692afec3cd8ea7
6
+ metadata.gz: 2193600b0a619cd7915399d71cbc9ef709bea0ab06f5c35ebbb0d9b740c30eaf3ec45e5ec96053579ed184faa14e4f36113a66ea7cd28af8a038ae160db8c742
7
+ data.tar.gz: 3431976bfe70f5410c6e04b06b2ee6fcf09cae4fa45986eed5488b0155e7f14cf977431b0751b0dcdaef939edd38964410ba4156525a4f66f41929182afdfda0
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
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 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/api/suno/text-to-music; for SDK docs, use https://runapi.ai/docs/resources/sdks.
6
6
 
7
7
  ## Install
8
8
 
@@ -17,7 +17,7 @@ require "runapi/suno"
17
17
 
18
18
  client = RunApi::Suno::Client.new
19
19
  task = client.text_to_music.create(
20
- # Pass the Suno JSON request body from https://runapi.ai/docs#suno.
20
+ # Pass the Suno JSON request body from https://runapi.ai/docs/api/suno/text-to-music.
21
21
  )
22
22
  status = client.text_to_music.get(task.id)
23
23
  ```
@@ -33,8 +33,8 @@ Use Ruby keyword arguments and the `RunApi::Suno` error classes when building mu
33
33
  ## Links
34
34
 
35
35
  - Model page: https://runapi.ai/models/suno
36
- - SDK docs: https://runapi.ai/docs#sdk-suno
37
- - Product docs: https://runapi.ai/docs#suno
36
+ - SDK docs: https://runapi.ai/docs/resources/sdks
37
+ - Product docs: https://runapi.ai/docs/api/suno/text-to-music
38
38
  - Pricing and rate limits: https://runapi.ai/models/suno/v4
39
39
  - Provider comparison: https://runapi.ai/providers/suno
40
40
  - Full catalog: https://runapi.ai/models
@@ -16,6 +16,7 @@ module RunApi
16
16
  attr_reader :text_to_music
17
17
  # @return [Resources::ExtendMusic] continues an existing track from a specified timestamp
18
18
  attr_reader :extend_music
19
+ attr_reader :stitch_audio, :remaster_audio, :add_samples
19
20
  # @return [Resources::GenerateArtwork] creates cover artwork for an existing music task
20
21
  attr_reader :generate_artwork
21
22
  # @return [Resources::CoverAudio] re-records vocals over an uploaded audio file with a new style or voice
@@ -62,6 +63,9 @@ module RunApi
62
63
 
63
64
  @text_to_music = Resources::TextToMusic.new(http)
64
65
  @extend_music = Resources::ExtendMusic.new(http)
66
+ @stitch_audio = Resources::StitchAudio.new(http)
67
+ @remaster_audio = Resources::RemasterAudio.new(http)
68
+ @add_samples = Resources::AddSamples.new(http)
65
69
  @generate_artwork = Resources::GenerateArtwork.new(http)
66
70
  @cover_audio = Resources::CoverAudio.new(http)
67
71
  @add_instrumental = Resources::AddInstrumental.new(http)
@@ -68,6 +68,91 @@ module RunApi
68
68
  }
69
69
  }
70
70
  },
71
+ "add-samples" => {
72
+ "models" => ["suno-v4", "suno-v4.5", "suno-v4.5-plus", "suno-v5", "suno-v5.5"],
73
+ "fields_by_model" => {
74
+ "suno-v4" => {
75
+ "audio_url" => {
76
+ "required" => true
77
+ },
78
+ "end_seconds" => {
79
+ "required" => true,
80
+ "min" => 0
81
+ },
82
+ "model" => {
83
+ "required" => true
84
+ },
85
+ "start_seconds" => {
86
+ "required" => true,
87
+ "min" => 0
88
+ }
89
+ },
90
+ "suno-v4.5" => {
91
+ "audio_url" => {
92
+ "required" => true
93
+ },
94
+ "end_seconds" => {
95
+ "required" => true,
96
+ "min" => 0
97
+ },
98
+ "model" => {
99
+ "required" => true
100
+ },
101
+ "start_seconds" => {
102
+ "required" => true,
103
+ "min" => 0
104
+ }
105
+ },
106
+ "suno-v4.5-plus" => {
107
+ "audio_url" => {
108
+ "required" => true
109
+ },
110
+ "end_seconds" => {
111
+ "required" => true,
112
+ "min" => 0
113
+ },
114
+ "model" => {
115
+ "required" => true
116
+ },
117
+ "start_seconds" => {
118
+ "required" => true,
119
+ "min" => 0
120
+ }
121
+ },
122
+ "suno-v5" => {
123
+ "audio_url" => {
124
+ "required" => true
125
+ },
126
+ "end_seconds" => {
127
+ "required" => true,
128
+ "min" => 0
129
+ },
130
+ "model" => {
131
+ "required" => true
132
+ },
133
+ "start_seconds" => {
134
+ "required" => true,
135
+ "min" => 0
136
+ }
137
+ },
138
+ "suno-v5.5" => {
139
+ "audio_url" => {
140
+ "required" => true
141
+ },
142
+ "end_seconds" => {
143
+ "required" => true,
144
+ "min" => 0
145
+ },
146
+ "model" => {
147
+ "required" => true
148
+ },
149
+ "start_seconds" => {
150
+ "required" => true,
151
+ "min" => 0
152
+ }
153
+ }
154
+ }
155
+ },
71
156
  "add-vocals" => {
72
157
  "models" => ["suno-v4.5-plus", "suno-v5"],
73
158
  "fields_by_model" => {
@@ -624,6 +709,66 @@ module RunApi
624
709
  }
625
710
  }
626
711
  },
712
+ "remaster-audio" => {
713
+ "models" => ["suno-v4", "suno-v4.5", "suno-v4.5-plus", "suno-v5", "suno-v5.5"],
714
+ "fields_by_model" => {
715
+ "suno-v4" => {
716
+ "audio_id" => {
717
+ "required" => true
718
+ },
719
+ "model" => {
720
+ "required" => true
721
+ },
722
+ "source_task_id" => {
723
+ "required" => true
724
+ }
725
+ },
726
+ "suno-v4.5" => {
727
+ "audio_id" => {
728
+ "required" => true
729
+ },
730
+ "model" => {
731
+ "required" => true
732
+ },
733
+ "source_task_id" => {
734
+ "required" => true
735
+ }
736
+ },
737
+ "suno-v4.5-plus" => {
738
+ "audio_id" => {
739
+ "required" => true
740
+ },
741
+ "model" => {
742
+ "required" => true
743
+ },
744
+ "source_task_id" => {
745
+ "required" => true
746
+ }
747
+ },
748
+ "suno-v5" => {
749
+ "audio_id" => {
750
+ "required" => true
751
+ },
752
+ "model" => {
753
+ "required" => true
754
+ },
755
+ "source_task_id" => {
756
+ "required" => true
757
+ }
758
+ },
759
+ "suno-v5.5" => {
760
+ "audio_id" => {
761
+ "required" => true
762
+ },
763
+ "model" => {
764
+ "required" => true
765
+ },
766
+ "source_task_id" => {
767
+ "required" => true
768
+ }
769
+ }
770
+ }
771
+ },
627
772
  "replace-section" => {
628
773
  "models" => [],
629
774
  "fields_by_model" => {
@@ -677,11 +822,73 @@ module RunApi
677
822
  "required" => ["stem_name"]
678
823
  }]
679
824
  },
825
+ "stitch-audio" => {
826
+ "models" => ["suno-v4", "suno-v4.5", "suno-v4.5-plus", "suno-v5", "suno-v5.5"],
827
+ "fields_by_model" => {
828
+ "suno-v4" => {
829
+ "audio_id" => {
830
+ "required" => true
831
+ },
832
+ "model" => {
833
+ "required" => true
834
+ },
835
+ "source_task_id" => {
836
+ "required" => true
837
+ }
838
+ },
839
+ "suno-v4.5" => {
840
+ "audio_id" => {
841
+ "required" => true
842
+ },
843
+ "model" => {
844
+ "required" => true
845
+ },
846
+ "source_task_id" => {
847
+ "required" => true
848
+ }
849
+ },
850
+ "suno-v4.5-plus" => {
851
+ "audio_id" => {
852
+ "required" => true
853
+ },
854
+ "model" => {
855
+ "required" => true
856
+ },
857
+ "source_task_id" => {
858
+ "required" => true
859
+ }
860
+ },
861
+ "suno-v5" => {
862
+ "audio_id" => {
863
+ "required" => true
864
+ },
865
+ "model" => {
866
+ "required" => true
867
+ },
868
+ "source_task_id" => {
869
+ "required" => true
870
+ }
871
+ },
872
+ "suno-v5.5" => {
873
+ "audio_id" => {
874
+ "required" => true
875
+ },
876
+ "model" => {
877
+ "required" => true
878
+ },
879
+ "source_task_id" => {
880
+ "required" => true
881
+ }
882
+ }
883
+ }
884
+ },
680
885
  "text-to-music" => {
681
886
  "models" => ["suno-v4", "suno-v4.5", "suno-v4.5-all", "suno-v4.5-plus", "suno-v5", "suno-v5.5"],
682
887
  "fields_by_model" => {
683
888
  "suno-v4" => {
684
889
  "duration_seconds" => {
890
+ "min" => 10,
891
+ "max" => 360,
685
892
  "type" => "integer"
686
893
  },
687
894
  "model" => {
@@ -700,6 +907,8 @@ module RunApi
700
907
  },
701
908
  "suno-v4.5" => {
702
909
  "duration_seconds" => {
910
+ "min" => 10,
911
+ "max" => 360,
703
912
  "type" => "integer"
704
913
  },
705
914
  "model" => {
@@ -718,6 +927,8 @@ module RunApi
718
927
  },
719
928
  "suno-v4.5-all" => {
720
929
  "duration_seconds" => {
930
+ "min" => 10,
931
+ "max" => 360,
721
932
  "type" => "integer"
722
933
  },
723
934
  "model" => {
@@ -736,6 +947,8 @@ module RunApi
736
947
  },
737
948
  "suno-v4.5-plus" => {
738
949
  "duration_seconds" => {
950
+ "min" => 10,
951
+ "max" => 360,
739
952
  "type" => "integer"
740
953
  },
741
954
  "model" => {
@@ -754,6 +967,8 @@ module RunApi
754
967
  },
755
968
  "suno-v5" => {
756
969
  "duration_seconds" => {
970
+ "min" => 10,
971
+ "max" => 360,
757
972
  "type" => "integer"
758
973
  },
759
974
  "model" => {
@@ -772,6 +987,8 @@ module RunApi
772
987
  },
773
988
  "suno-v5.5" => {
774
989
  "duration_seconds" => {
990
+ "min" => 10,
991
+ "max" => 360,
775
992
  "type" => "integer"
776
993
  },
777
994
  "model" => {
@@ -794,7 +1011,7 @@ module RunApi
794
1011
  "vocal_mode" => "auto_lyrics"
795
1012
  },
796
1013
  "required" => ["prompt"],
797
- "forbidden" => ["lyrics", "style", "title"]
1014
+ "forbidden" => ["lyrics", "style", "title", "negative_tags", "vocal_gender", "duration_seconds"]
798
1015
  }, {
799
1016
  "when" => {
800
1017
  "vocal_mode" => "exact_lyrics"
@@ -806,7 +1023,32 @@ module RunApi
806
1023
  "vocal_mode" => "instrumental"
807
1024
  },
808
1025
  "required" => ["style", "title"],
809
- "forbidden" => ["prompt", "lyrics"]
1026
+ "forbidden" => ["prompt", "lyrics", "vocal_gender"]
1027
+ }, {
1028
+ "when" => {
1029
+ "model" => "suno-v4"
1030
+ },
1031
+ "forbidden" => ["duration_seconds"]
1032
+ }, {
1033
+ "when" => {
1034
+ "model" => "suno-v4.5"
1035
+ },
1036
+ "forbidden" => ["duration_seconds"]
1037
+ }, {
1038
+ "when" => {
1039
+ "model" => "suno-v4.5-all"
1040
+ },
1041
+ "forbidden" => ["duration_seconds"]
1042
+ }, {
1043
+ "when" => {
1044
+ "model" => "suno-v4.5-plus"
1045
+ },
1046
+ "forbidden" => ["duration_seconds"]
1047
+ }, {
1048
+ "when" => {
1049
+ "model" => "suno-v5"
1050
+ },
1051
+ "forbidden" => ["duration_seconds"]
810
1052
  }]
811
1053
  },
812
1054
  "text-to-sound" => {
@@ -0,0 +1,18 @@
1
+ module RunApi
2
+ module Suno
3
+ module Resources
4
+ class AddSamples < AudioAction
5
+ ENDPOINT = "/api/v1/suno/add_samples"
6
+ ACTION = "add-samples"
7
+
8
+ def create(options: nil, **params)
9
+ if params[:end_seconds].to_f <= params[:start_seconds].to_f
10
+ raise RunApi::Core::ValidationError, "end_seconds must be greater than start_seconds"
11
+ end
12
+
13
+ super
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RunApi
4
+ module Suno
5
+ module Resources
6
+ class AudioAction
7
+ include RunApi::Core::ResourceHelpers
8
+
9
+ def initialize(http) = @http = http
10
+
11
+ def create(options: nil, **params)
12
+ params = compact_params(params)
13
+ validate_contract!(CONTRACT.fetch(self.class::ACTION), params)
14
+ request(:post, self.class::ENDPOINT, body: params, options: options)
15
+ end
16
+
17
+ def get(id, options: nil) = request(:get, "#{self.class::ENDPOINT}/#{id}", options: options)
18
+
19
+ def run(options: nil, **params)
20
+ task = create(options: options, **params)
21
+ poll_until_complete { get(task.id, options: options) }
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,11 @@
1
+ module RunApi
2
+ module Suno
3
+ module Resources
4
+ class RemasterAudio < AudioAction
5
+ ENDPOINT = "/api/v1/suno/remaster_audio"
6
+ ACTION = "remaster-audio"
7
+ def create(options: nil, **params) = super
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module RunApi
2
+ module Suno
3
+ module Resources
4
+ class StitchAudio < AudioAction
5
+ ENDPOINT = "/api/v1/suno/stitch_audio"
6
+ ACTION = "stitch-audio"
7
+ def create(options: nil, **params) = super
8
+ end
9
+ end
10
+ end
11
+ end
data/lib/runapi/suno.rb CHANGED
@@ -6,6 +6,10 @@ require_relative "suno/contract_gen"
6
6
  require_relative "suno/validators"
7
7
  require_relative "suno/resources/text_to_music"
8
8
  require_relative "suno/resources/extend_music"
9
+ require_relative "suno/resources/audio_action"
10
+ require_relative "suno/resources/stitch_audio"
11
+ require_relative "suno/resources/remaster_audio"
12
+ require_relative "suno/resources/add_samples"
9
13
  require_relative "suno/resources/generate_artwork"
10
14
  require_relative "suno/resources/cover_audio"
11
15
  require_relative "suno/resources/add_instrumental"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-suno
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - RunAPI
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 0.3.0
18
+ version: 0.3.3
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 0.3.0
25
+ version: 0.3.3
26
26
  description: The Suno Ruby SDK is the language-specific package for Suno on RunAPI.
27
27
  Use this package for song generation, lyrics, vocals, extension, and audio transformation
28
28
  workflows when your application needs request bodies, task status lookup, and consistent
@@ -41,7 +41,9 @@ files:
41
41
  - lib/runapi/suno/client.rb
42
42
  - lib/runapi/suno/contract_gen.rb
43
43
  - lib/runapi/suno/resources/add_instrumental.rb
44
+ - lib/runapi/suno/resources/add_samples.rb
44
45
  - lib/runapi/suno/resources/add_vocals.rb
46
+ - lib/runapi/suno/resources/audio_action.rb
45
47
  - lib/runapi/suno/resources/blend_lyrics.rb
46
48
  - lib/runapi/suno/resources/boost_style.rb
47
49
  - lib/runapi/suno/resources/check_voice.rb
@@ -56,8 +58,10 @@ files:
56
58
  - lib/runapi/suno/resources/generate_voice.rb
57
59
  - lib/runapi/suno/resources/get_timestamped_lyrics.rb
58
60
  - lib/runapi/suno/resources/regenerate_validation_phrase.rb
61
+ - lib/runapi/suno/resources/remaster_audio.rb
59
62
  - lib/runapi/suno/resources/replace_section.rb
60
63
  - lib/runapi/suno/resources/separate_audio_stems.rb
64
+ - lib/runapi/suno/resources/stitch_audio.rb
61
65
  - lib/runapi/suno/resources/text_to_music.rb
62
66
  - lib/runapi/suno/resources/text_to_sound.rb
63
67
  - lib/runapi/suno/resources/visualize_music.rb