@picsart/ai-sdk 3.35.6 → 4.0.0

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.
Files changed (4) hide show
  1. package/README.md +28 -0
  2. package/index.d.ts +292 -163
  3. package/index.js +263 -615
  4. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -58,7 +58,7 @@ type WorkflowSubscribeOptions = WorkflowPollOptions;
58
58
  type ModelInputById = {
59
59
  "async-flash-v1": {
60
60
  prompt: string;
61
- voiceId?: "cca0e076-94b9-4c6d-86b7-546168f11174" | "f493c663-b272-493e-8b78-72d2262a2a8d" | "317bf805-4b42-417b-9474-10807e2f67c9" | "3950360d-4810-4c65-a0b8-eb5b4b3b4231" | "a6268eaf-976d-4d44-871d-57e1d58002c7" | "84905ece-2420-47b5-b3d6-964e62200c73" | "a44e2f09-6897-4e1e-8573-631207c53f6d" | "8f7ad606-26df-400a-8336-e7162a977be7" | "c8dab279-6c67-468c-977d-ce4081fa3936" | "054c9aed-4786-4fa5-a317-09abd199e21f" | "ef932845-cfe9-4748-a123-454664076938" | "cfc8833a-dc45-40e9-9279-57cad23e3c09" | "5d20dd0a-a781-43ea-b06c-56892a691715" | "46ffc709-542b-409c-a8a9-aa5d3e0e1cfc" | "e5a67eaf-6e5a-4488-9fb9-4806bd7fea54" | "c01e9ac9-dc1b-4263-9b70-091f919c05f4" | "d7eb91fb-c2a7-45fd-b65a-80b8b499be7f" | "3f1e185f-6e91-4253-b94a-d8b53f6214be" | "8288f28a-a3f4-4792-a26e-d762fc2263b9" | "854eef1c-9aae-41ae-8849-2a32b9b349bb" | "a5e830d5-e543-4250-9724-a24c452fa248" | "15a92057-54a7-4bb8-979c-38f44581fb8c" | "f57e9942-4d9e-4b05-8a0c-585359eef0dd" | "965d9bd7-9e95-4cdd-a798-80a5233705bd" | "66254e55-d74a-4b23-a12a-cccdd14a25a0" | "8bab777e-1a1e-43d8-915d-eaafcb446e9d" | "2d83227c-1abf-47c0-902d-f82448bdc598" | "4a7876f0-5fb4-4ed8-a104-890bc30d9832" | "f7f4fee8-845b-49d2-be7e-6ff7c8706b55" | "b355a1d2-f989-4e62-a997-5de0bb2aa841" | "ee89b03c-5275-488a-b5d2-ca5ca364e857" | "fb9cc041-75e5-4ac5-ae7f-c763f1e54797" | "c81384a9-3dce-48d2-bb5b-b0875f2db37e" | "9e5001fa-5367-4f6d-a079-6bfc0ddbff69" | "17486b3b-2ffb-43e7-9d81-3ed3d147a497" | "44523faf-3c13-469e-961e-eb7c5496cb90" | "350bf05c-7858-49c1-859e-ef1e657d43f2" | "8788ac4f-2156-40ce-8030-7a9a0a9b9161" | "348aff4f-dff7-4871-81d5-fc31c3d90ef6" | "b976d8b2-e1f8-4c22-b6ba-87ce392f0f01" | "0aef6559-9098-4860-8224-13e038ab3aef" | "1e5d72bd-4a36-4abe-9b57-15dfc2b3841c" | "20180bd3-4f7a-4d83-9599-9a40c282ef04" | "66318ebc-62a9-437a-989a-9bd148ec829a" | "dfa6d420-4742-452f-b2fb-5d7ba0c3852e" | "9e9a769b-a283-4b03-93a5-bee4a5bd62bc" | "2808aed4-85d9-4b61-87d9-daefdaad29af" | "d8acc796-5d2c-475c-ae8e-2f1c8158490c" | "059fee9c-51a5-4db9-8c8c-1ff1ede29cf1" | "6d891f84-452e-4412-a72a-f00eea0f1fd7" | "6112718a-871e-46f6-abb3-d0cdd1f4368a" | "544ba1a4-4a04-4b93-9aaf-fadb09fed104" | "9f5d9d57-b7bb-4ee3-b627-d7402ed00d15" | "721d6b30-7601-4643-9447-6de1be2bd92e" | "f161bd60-c617-44b0-8275-7f879c96e86c" | "610df5e1-2fa1-42e8-8dcd-988d2ec2d8f3" | "3f38104f-9327-4554-873d-7f092caf1256" | "07c10ae2-0007-4551-841d-f8dcbee53433" | "5f41badd-5f53-4460-a5b2-63dda5503490" | "a8915cb1-a587-4313-841a-ddc74ff17050" | "3010fa3f-897a-41e7-a426-a06f29f61f78" | "8abd608c-b8d3-4193-8d54-9976911a337c" | "43064fb0-6723-4f2c-a311-eaf6a5d2f0e5" | "adf91049-3cab-4e62-b40c-be00fe34e0e6" | "04da033a-8919-4553-8fc5-eb6869e0c0e1" | "9f2e03d7-714d-48a5-a0e7-58c2b7efad23" | "c1820aa0-467e-4b13-8f73-418f950dba51" | "befbed31-f461-4bdc-8900-fe786fbeffc3" | "d7979182-36b7-4ae5-8284-1962050da404" | "0e8463d7-5e80-47bf-b900-3bbf4e3e564a" | "b0641d1a-e342-41d0-8a56-63781d487ca3" | "34123cc6-9377-4a13-8b4c-ed274cbe317a" | "4c71b60f-357f-4569-9867-cd1ce4ff58c8" | "d1a08ee2-2706-4743-898c-882238036c81" | "c6db469b-929f-4066-896c-165f60d09162" | "be6bbe5d-5f45-4ad8-bec9-ed6a7cdf5311" | "aa40e5b8-af38-4f88-ab43-1fd5ca9749c6" | "7cd2e6c8-a8f8-4115-a757-9397c0127e50" | "7a3ef29d-8962-4722-adfb-fda21e0d821e" | "13616e5f-6fda-4247-b548-8821cb71fb54" | "041937f9-3a23-4eef-a206-7c1656243825" | "fb8c1498-1d6b-446c-891e-163a79e6d817" | "f912f511-6b44-46dd-bd40-be3031201561" | "f5b7eb43-2365-410a-95e0-beb92768809c" | "f26d400a-a7ff-4522-b098-485b2f34b123" | "f26c8c45-049e-46c7-a6bd-b217d9255d3e" | "ec82ea24-3249-4981-a28f-65a78d2a2cd0" | "ec4f77d4-60fa-4707-a094-ad18fdfbaa97" | "e8490197-0f00-4089-8b7f-e32f331a6edf" | "e7e88155-71c0-4e51-a3b4-8022468f7eca" | "e590a00d-1925-4759-aea8-21e3beabafac" | "e4db0c1b-f72d-494c-baa8-43c44d5765b6" | "e486f733-9769-4f8a-a8e2-d39e4e3eab81" | "e0f39dc4-f691-4e78-bba5-5c636692cc04" | "e098922a-9410-4d96-8e3c-402e26f7160b" | "df05515b-b647-4b60-9387-b0642c51b235" | "dd063dd5-c566-437e-b82a-a4f98eae1f38" | "dbf08c3e-d33a-4afb-bdb3-0f024a687d19" | "db21e50c-9c85-4177-9bb2-9bf177890e44" | "d7114790-534e-4007-b80d-6d176230553c";
61
+ voiceId?: string;
62
62
  container?: "mp3" | "wav" | "raw";
63
63
  sampleRate?: number;
64
64
  encoding?: "pcm_s16le" | "pcm_f32le";
@@ -107,7 +107,7 @@ type ModelInputById = {
107
107
  };
108
108
  "eleven-multilingual-sts-v2": {
109
109
  audioUrl: string;
110
- voiceId?: "JBFqnCBsd6RMkjVDRZzb" | "EkK5I93UQWFDigLMpZcX" | "RILOU7YmBhvwJGDGjNmP" | "Z3R5wn05IrDiVCyEkUrK" | "NNl6r8mD7vthiJatiJt1" | "Bj9UqZbhQsanLzgalpEG" | "exsUS4vynmxd379XN4yO" | "BpjGufoPiobT79j2vtj4" | "kdmDKE6EkgrWrrykO9Qt" | "1SM7GgM6IMuvQlz2BwM3" | "ouL9IsyrSnUkCmfnD02u" | "5l5f8iK3YPeGga21rQIX" | "scOwDtmlUjD3prqpp97I" | "19STyYD15bswVz51nqLf" | "BZgkqPqms7Kj9ulSkVzn" | "wo6udizrrtpIxWGp2qJk" | "yjJ45q8TVCrtMhEKurxY" | "gU0LNdkMOQCOrPrwtbee" | "DGzg6RaUqxGRTHSBjfgF" | "x70vRnQBMBu4FAYhjJbO";
110
+ voiceId?: string;
111
111
  language?: string;
112
112
  accent?: string;
113
113
  removeBackgroundNoise?: boolean;
@@ -116,18 +116,18 @@ type ModelInputById = {
116
116
  language?: string;
117
117
  accent?: string;
118
118
  prompt: string;
119
- voiceId?: "JBFqnCBsd6RMkjVDRZzb" | "EkK5I93UQWFDigLMpZcX" | "RILOU7YmBhvwJGDGjNmP" | "Z3R5wn05IrDiVCyEkUrK" | "NNl6r8mD7vthiJatiJt1" | "Bj9UqZbhQsanLzgalpEG" | "exsUS4vynmxd379XN4yO" | "BpjGufoPiobT79j2vtj4" | "kdmDKE6EkgrWrrykO9Qt" | "1SM7GgM6IMuvQlz2BwM3" | "ouL9IsyrSnUkCmfnD02u" | "5l5f8iK3YPeGga21rQIX" | "scOwDtmlUjD3prqpp97I" | "19STyYD15bswVz51nqLf" | "BZgkqPqms7Kj9ulSkVzn" | "wo6udizrrtpIxWGp2qJk" | "yjJ45q8TVCrtMhEKurxY" | "gU0LNdkMOQCOrPrwtbee" | "DGzg6RaUqxGRTHSBjfgF" | "x70vRnQBMBu4FAYhjJbO";
119
+ voiceId?: string;
120
120
  };
121
121
  "eleven-sts-v2": {
122
122
  audioUrl: string;
123
- voiceId?: "JBFqnCBsd6RMkjVDRZzb" | "EkK5I93UQWFDigLMpZcX" | "RILOU7YmBhvwJGDGjNmP" | "Z3R5wn05IrDiVCyEkUrK" | "NNl6r8mD7vthiJatiJt1" | "Bj9UqZbhQsanLzgalpEG" | "exsUS4vynmxd379XN4yO" | "BpjGufoPiobT79j2vtj4" | "kdmDKE6EkgrWrrykO9Qt" | "1SM7GgM6IMuvQlz2BwM3" | "ouL9IsyrSnUkCmfnD02u" | "5l5f8iK3YPeGga21rQIX" | "scOwDtmlUjD3prqpp97I" | "19STyYD15bswVz51nqLf" | "BZgkqPqms7Kj9ulSkVzn" | "wo6udizrrtpIxWGp2qJk" | "yjJ45q8TVCrtMhEKurxY" | "gU0LNdkMOQCOrPrwtbee" | "DGzg6RaUqxGRTHSBjfgF" | "x70vRnQBMBu4FAYhjJbO";
123
+ voiceId?: string;
124
124
  removeBackgroundNoise?: boolean;
125
125
  };
126
126
  "eleven-v3": {
127
127
  language?: string;
128
128
  accent?: string;
129
129
  prompt: string;
130
- voiceId?: "JBFqnCBsd6RMkjVDRZzb" | "EkK5I93UQWFDigLMpZcX" | "RILOU7YmBhvwJGDGjNmP" | "Z3R5wn05IrDiVCyEkUrK" | "NNl6r8mD7vthiJatiJt1" | "Bj9UqZbhQsanLzgalpEG" | "exsUS4vynmxd379XN4yO" | "BpjGufoPiobT79j2vtj4" | "kdmDKE6EkgrWrrykO9Qt" | "1SM7GgM6IMuvQlz2BwM3" | "ouL9IsyrSnUkCmfnD02u" | "5l5f8iK3YPeGga21rQIX" | "scOwDtmlUjD3prqpp97I" | "19STyYD15bswVz51nqLf" | "BZgkqPqms7Kj9ulSkVzn" | "wo6udizrrtpIxWGp2qJk" | "yjJ45q8TVCrtMhEKurxY" | "gU0LNdkMOQCOrPrwtbee" | "DGzg6RaUqxGRTHSBjfgF" | "x70vRnQBMBu4FAYhjJbO";
130
+ voiceId?: string;
131
131
  };
132
132
  "eleven-voice-create": {
133
133
  prompt: string;
@@ -139,7 +139,7 @@ type ModelInputById = {
139
139
  prompt: string;
140
140
  };
141
141
  "eleven-voice-remix": {
142
- voiceId?: "JBFqnCBsd6RMkjVDRZzb" | "EkK5I93UQWFDigLMpZcX" | "RILOU7YmBhvwJGDGjNmP" | "Z3R5wn05IrDiVCyEkUrK" | "NNl6r8mD7vthiJatiJt1" | "Bj9UqZbhQsanLzgalpEG" | "exsUS4vynmxd379XN4yO" | "BpjGufoPiobT79j2vtj4" | "kdmDKE6EkgrWrrykO9Qt" | "1SM7GgM6IMuvQlz2BwM3" | "ouL9IsyrSnUkCmfnD02u" | "5l5f8iK3YPeGga21rQIX" | "scOwDtmlUjD3prqpp97I" | "19STyYD15bswVz51nqLf" | "BZgkqPqms7Kj9ulSkVzn" | "wo6udizrrtpIxWGp2qJk" | "yjJ45q8TVCrtMhEKurxY" | "gU0LNdkMOQCOrPrwtbee" | "DGzg6RaUqxGRTHSBjfgF" | "x70vRnQBMBu4FAYhjJbO";
142
+ voiceId?: string;
143
143
  prompt: string;
144
144
  };
145
145
  "elevenlabs-music-v2": {
@@ -202,13 +202,13 @@ type ModelInputById = {
202
202
  language?: string;
203
203
  accent?: string;
204
204
  prompt: string;
205
- voiceId?: "Aoede" | "Charon" | "Fenrir" | "Kore" | "Leda" | "Orus" | "Puck" | "Zephyr" | "Achernar" | "Achird" | "Algenib" | "Algieba" | "Alnilam" | "Autonoe" | "Despina" | "Enceladus" | "Erinome" | "Gacrux" | "Iapetus" | "Laomedeia" | "Pulcherrima" | "Rasalgethi" | "Sadachbia" | "Sadaltager" | "Schedar" | "Sulafat" | "Umbriel" | "Vindemiatrix" | "Zubenelgenubi";
205
+ voiceId?: string;
206
206
  };
207
207
  "gemini-2.5-pro-tts": {
208
208
  language?: string;
209
209
  accent?: string;
210
210
  prompt: string;
211
- voiceId?: "Aoede" | "Charon" | "Fenrir" | "Kore" | "Leda" | "Orus" | "Puck" | "Zephyr" | "Achernar" | "Achird" | "Algenib" | "Algieba" | "Alnilam" | "Autonoe" | "Despina" | "Enceladus" | "Erinome" | "Gacrux" | "Iapetus" | "Laomedeia" | "Pulcherrima" | "Rasalgethi" | "Sadachbia" | "Sadaltager" | "Schedar" | "Sulafat" | "Umbriel" | "Vindemiatrix" | "Zubenelgenubi";
211
+ voiceId?: string;
212
212
  };
213
213
  "gemini-3-pro": {
214
214
  prompt: string;
@@ -327,7 +327,7 @@ type ModelInputById = {
327
327
  language?: string;
328
328
  accent?: string;
329
329
  prompt: string;
330
- voiceId?: "eve" | "ara" | "rex" | "sal" | "leo";
330
+ voiceId?: string;
331
331
  };
332
332
  "hailuo-03": {
333
333
  prompt: string;
@@ -793,14 +793,6 @@ type ModelInputById = {
793
793
  isInstrumental?: boolean;
794
794
  outputFormat?: "url" | "hex";
795
795
  };
796
- "openai-tts-1": {
797
- prompt: string;
798
- voiceId?: "alloy" | "ash" | "ballad" | "coral" | "echo" | "fable" | "nova" | "onyx" | "sage" | "shimmer" | "verse";
799
- };
800
- "openai-tts-1-hd": {
801
- prompt: string;
802
- voiceId?: "alloy" | "ash" | "ballad" | "coral" | "echo" | "fable" | "nova" | "onyx" | "sage" | "shimmer" | "verse";
803
- };
804
796
  "ovi": {
805
797
  prompt: string;
806
798
  size?: "9:16" | "16:9" | "1:1" | "9:16+" | "16:9+" | "2:5" | "5:2";
@@ -1099,7 +1091,7 @@ type ModelInputById = {
1099
1091
  };
1100
1092
  "runway-avatar-video": {
1101
1093
  style?: "game-character" | "music-superstar" | "game-character-man" | "cat-character" | "influencer" | "tennis-coach" | "human-resource" | "fashion-designer" | "cooking-teacher";
1102
- voiceId?: "victoria" | "vincent" | "clara" | "drew" | "skye" | "max" | "morgan" | "felix" | "mia" | "marcus" | "summer" | "ruby" | "aurora" | "jasper" | "leo" | "adrian" | "nina" | "emma" | "blake" | "david" | "maya" | "nathan" | "sam" | "georgia" | "petra" | "adam" | "zach" | "violet" | "roman" | "luna";
1094
+ voiceId?: string;
1103
1095
  prompt?: string;
1104
1096
  audioUrl?: string;
1105
1097
  };
@@ -1127,7 +1119,7 @@ type ModelInputById = {
1127
1119
  };
1128
1120
  "seed-audio-1.0": {
1129
1121
  prompt: string;
1130
- voiceId?: "zh_female_vv_uranus_bigtts" | "zh_female_xiaohe_uranus_bigtts" | "en_female_stokie_uranus_bigtts" | "en_female_dacey_uranus_bigtts" | "en_male_tim_uranus_bigtts" | "zh_male_m191_uranus_bigtts" | "zh_male_taocheng_uranus_bigtts" | "zh_male_sophie_uranus_bigtts" | "zh_female_yingyujiaoxue_uranus_bigtts" | "zh_male_dayi_uranus_bigtts" | "zh_female_mizai_uranus_bigtts" | "zh_female_jitangnv_uranus_bigtts" | "zh_female_meilinvyou_uranus_bigtts" | "zh_female_liuchangnv_uranus_bigtts" | "zh_male_ruyayichen_uranus_bigtts" | "zh_female_cancan_uranus_bigtts" | "zh_female_tianmeixiaoyuan_uranus_bigtts" | "zh_female_tianmeitaozi_uranus_bigtts" | "zh_female_shuangkuaisisi_uranus_bigtts" | "zh_female_peiqi_uranus_bigtts" | "zh_female_xiaoxue_uranus_bigtts" | "zh_female_yuanqi_uranus_bigtts" | "zh_female_kefunvsheng_uranus_bigtts" | "zh_male_shaonianzixin_uranus_bigtts" | "zh_female_linjianvhai_uranus_bigtts" | "zh_female_kiwi_uranus_bigtts" | "zh_female_sajiaoxuemei_uranus_bigtts" | "zh_male_liufei_uranus_bigtts" | "zh_female_qingxinnvsheng_uranus_bigtts" | "zh_male_sunwukong_uranus_bigtts" | "en_male_adam-imitation_uranus_bigtts" | "en_male_alberto_uranus_bigtts" | "en_male_alex_uranus_bigtts" | "en_female_allison_uranus_bigtts" | "en_female_authoritative-british_uranus_bigtts" | "en_female_authoritative-informative_uranus_bigtts" | "en_male_bill-jones_uranus_bigtts" | "en_male_bill_jones_corey_uranus_bigtts" | "en_male_brad_pitt_p1_uranus_bigtts" | "en_female_brittney_uranus_bigtts" | "en_female_brittney_pimintel_uranus_bigtts" | "en_male_bruce_uranus_bigtts" | "en_male_chandler_p1_uranus_bigtts" | "en_male_cowboy-bob_uranus_bigtts" | "en_male_cowboy_john_b_uranus_bigtts" | "en_male_david_uranus_bigtts" | "en_male_deep-voice_uranus_bigtts" | "en_male_diyuwenrounan_uranus_bigtts" | "en_male_evil-guy-oxley_uranus_bigtts" | "en_male_excited-male-voice_uranus_bigtts" | "en_male_father-christmas_uranus_bigtts" | "en_female_female_tutor_ms-jenny_uranus_bigtts" | "en_male_fernando-martinez_uranus_bigtts" | "en_male_godfather_uranus_bigtts" | "en_male_gollum_uranus_bigtts" | "en_male_hades_uranus_bigtts" | "en_female_hayley_uranus_bigtts" | "en_male_jamie_uranus_bigtts" | "en_female_jane_uranus_bigtts" | "en_female_jenny_uranus_bigtts" | "en_male_jidongchuanjiaoshi_uranus_bigtts" | "en_male_jimmy_uranus_bigtts" | "en_female_joanne_uranus_bigtts" | "en_male_joker_uranus_bigtts" | "en_male_josh_uranus_bigtts" | "en_male_josh_coery_uranus_bigtts" | "en_male_kevin_uranus_bigtts" | "en_male_knightley_uranus_bigtts" | "en_female_lana_del_rey_kelley_d_p1_uranus_bigtts" | "en_female_lana_del_rey_parky_s_p1_uranus_bigtts" | "en_male_marcus_uranus_bigtts" | "en_female_mel_uranus_bigtts" | "en_male_michael_uranus_bigtts" | "en_male_michael-mouse_uranus_bigtts" | "en_male_michael_kevin_uranus_bigtts" | "en_male_motivational-coach_uranus_bigtts" | "en_female_myra_uranus_bigtts" | "en_female_myra_cmb_uranus_bigtts" | "en_female_nadia_uranus_bigtts" | "en_female_natasha_uranus_bigtts" | "en_female_pleasant-female_uranus_bigtts" | "en_female_rachel_p1_uranus_bigtts" | "en_male_ronald_uranus_bigtts" | "en_male_russell_uranus_bigtts" | "en_female_scarlet_p1_uranus_bigtts" | "en_female_sharron_uranus_bigtts" | "en_male_simba_p1_uranus_bigtts" | "en_female_skye_uranus_bigtts" | "en_male_tom_hiddleston_p1_uranus_bigtts" | "en_male_valentino_uranus_bigtts" | "en_male_valentino_corey_uranus_bigtts" | "en_female_wenrouzhishijieshuonv_uranus_bigtts" | "en_female_xinwenjieshuonv_uranus_bigtts" | "en_male_yangguangjieshuonan_uranus_bigtts" | "en_female_zendaya_p1_uranus_bigtts";
1122
+ voiceId?: string;
1131
1123
  audioUrls?: string[];
1132
1124
  imageUrls?: string[];
1133
1125
  format?: "wav" | "mp3" | "pcm" | "ogg_opus";
@@ -1139,7 +1131,7 @@ type ModelInputById = {
1139
1131
  };
1140
1132
  "seed-audio-1.0-multilingual": {
1141
1133
  prompt: string;
1142
- voiceId?: "zh_female_vv_uranus_bigtts" | "zh_female_xiaohe_uranus_bigtts" | "en_female_stokie_uranus_bigtts" | "en_female_dacey_uranus_bigtts" | "en_male_tim_uranus_bigtts" | "zh_male_m191_uranus_bigtts" | "zh_male_taocheng_uranus_bigtts" | "zh_male_sophie_uranus_bigtts" | "zh_female_yingyujiaoxue_uranus_bigtts" | "zh_male_dayi_uranus_bigtts" | "zh_female_mizai_uranus_bigtts" | "zh_female_jitangnv_uranus_bigtts" | "zh_female_meilinvyou_uranus_bigtts" | "zh_female_liuchangnv_uranus_bigtts" | "zh_male_ruyayichen_uranus_bigtts" | "zh_female_cancan_uranus_bigtts" | "zh_female_tianmeixiaoyuan_uranus_bigtts" | "zh_female_tianmeitaozi_uranus_bigtts" | "zh_female_shuangkuaisisi_uranus_bigtts" | "zh_female_peiqi_uranus_bigtts" | "zh_female_xiaoxue_uranus_bigtts" | "zh_female_yuanqi_uranus_bigtts" | "zh_female_kefunvsheng_uranus_bigtts" | "zh_male_shaonianzixin_uranus_bigtts" | "zh_female_linjianvhai_uranus_bigtts" | "zh_female_kiwi_uranus_bigtts" | "zh_female_sajiaoxuemei_uranus_bigtts" | "zh_male_liufei_uranus_bigtts" | "zh_female_qingxinnvsheng_uranus_bigtts" | "zh_male_sunwukong_uranus_bigtts" | "en_male_adam-imitation_uranus_bigtts" | "en_male_alberto_uranus_bigtts" | "en_male_alex_uranus_bigtts" | "en_female_allison_uranus_bigtts" | "en_female_authoritative-british_uranus_bigtts" | "en_female_authoritative-informative_uranus_bigtts" | "en_male_bill-jones_uranus_bigtts" | "en_male_bill_jones_corey_uranus_bigtts" | "en_male_brad_pitt_p1_uranus_bigtts" | "en_female_brittney_uranus_bigtts" | "en_female_brittney_pimintel_uranus_bigtts" | "en_male_bruce_uranus_bigtts" | "en_male_chandler_p1_uranus_bigtts" | "en_male_cowboy-bob_uranus_bigtts" | "en_male_cowboy_john_b_uranus_bigtts" | "en_male_david_uranus_bigtts" | "en_male_deep-voice_uranus_bigtts" | "en_male_diyuwenrounan_uranus_bigtts" | "en_male_evil-guy-oxley_uranus_bigtts" | "en_male_excited-male-voice_uranus_bigtts" | "en_male_father-christmas_uranus_bigtts" | "en_female_female_tutor_ms-jenny_uranus_bigtts" | "en_male_fernando-martinez_uranus_bigtts" | "en_male_godfather_uranus_bigtts" | "en_male_gollum_uranus_bigtts" | "en_male_hades_uranus_bigtts" | "en_female_hayley_uranus_bigtts" | "en_male_jamie_uranus_bigtts" | "en_female_jane_uranus_bigtts" | "en_female_jenny_uranus_bigtts" | "en_male_jidongchuanjiaoshi_uranus_bigtts" | "en_male_jimmy_uranus_bigtts" | "en_female_joanne_uranus_bigtts" | "en_male_joker_uranus_bigtts" | "en_male_josh_uranus_bigtts" | "en_male_josh_coery_uranus_bigtts" | "en_male_kevin_uranus_bigtts" | "en_male_knightley_uranus_bigtts" | "en_female_lana_del_rey_kelley_d_p1_uranus_bigtts" | "en_female_lana_del_rey_parky_s_p1_uranus_bigtts" | "en_male_marcus_uranus_bigtts" | "en_female_mel_uranus_bigtts" | "en_male_michael_uranus_bigtts" | "en_male_michael-mouse_uranus_bigtts" | "en_male_michael_kevin_uranus_bigtts" | "en_male_motivational-coach_uranus_bigtts" | "en_female_myra_uranus_bigtts" | "en_female_myra_cmb_uranus_bigtts" | "en_female_nadia_uranus_bigtts" | "en_female_natasha_uranus_bigtts" | "en_female_pleasant-female_uranus_bigtts" | "en_female_rachel_p1_uranus_bigtts" | "en_male_ronald_uranus_bigtts" | "en_male_russell_uranus_bigtts" | "en_female_scarlet_p1_uranus_bigtts" | "en_female_sharron_uranus_bigtts" | "en_male_simba_p1_uranus_bigtts" | "en_female_skye_uranus_bigtts" | "en_male_tom_hiddleston_p1_uranus_bigtts" | "en_male_valentino_uranus_bigtts" | "en_male_valentino_corey_uranus_bigtts" | "en_female_wenrouzhishijieshuonv_uranus_bigtts" | "en_female_xinwenjieshuonv_uranus_bigtts" | "en_male_yangguangjieshuonan_uranus_bigtts" | "en_female_zendaya_p1_uranus_bigtts" | "de_male_seven_uranus_bigtts" | "jp_female_minimi_uranus_bigtts" | "fr_male_usseau_uranus_bigtts" | "es_male_felipe_uranus_bigtts" | "id_male_han_uranus_bigtts" | "pt_male_martins_uranus_bigtts" | "it_male_enzo_uranus_bigtts" | "kr_male_shane_uranus_bigtts" | "ja_female_bv024_uranus_bigtts" | "ja_female_bv520_uranus_bigtts" | "ja_female_bv521_uranus_bigtts" | "ja_female_bv522_uranus_bigtts" | "ja_female_bv523_uranus_bigtts" | "ja_male_bv524_uranus_bigtts" | "ja_female_minimi_uranus_bigtts" | "ja_female_shirou_uranus_bigtts" | "de_female_bv081_uranus_bigtts" | "de_male_sven_uranus_bigtts" | "es_female_bv084_uranus_bigtts" | "es_male_dani_uranus_bigtts" | "es_male_guillem_uranus_bigtts" | "es_female_ht_mx_f6_uranus_bigtts" | "mx_female_bv065_uranus_bigtts" | "mx_male_bv165dialogue_uranus_bigtts" | "mx_male_bv165narrator_uranus_bigtts" | "mx_female_bv166dialogue_uranus_bigtts" | "mx_female_bv166emotion_uranus_bigtts" | "mx_female_bv166narrator_uranus_bigtts" | "mx_male_felipe_uranus_bigtts" | "mx_male_ht_mx_m012_uranus_bigtts" | "mx_female_leslie_uranus_bigtts" | "mx_male_marcelo_uranus_bigtts" | "fr_female_fr_bv078_uranus_bigtts" | "fr_female_fr_f47_uranus_bigtts" | "fr_male_fr_m29_uranus_bigtts" | "id_male_bv160_uranus_bigtts" | "id_male_bv160dialogue_uranus_bigtts" | "id_male_bv160narration_uranus_bigtts" | "id_female_bv161_uranus_bigtts" | "id_female_bv161dialogue_uranus_bigtts" | "id_female_bv161narration_uranus_bigtts" | "id_female_bv164_uranus_bigtts" | "id_male_bv164dialogue_uranus_bigtts" | "id_male_bv164narration_uranus_bigtts" | "id_female_f20_uranus_bigtts" | "id_male_m08_uranus_bigtts" | "id_female_phulia_uranus_bigtts" | "pt_male_bv172_uranus_bigtts" | "pt_male_bv172dialogue_uranus_bigtts" | "pt_male_bv172emotion_uranus_bigtts" | "pt_male_bv172narrator_uranus_bigtts" | "pt_female_bv173_uranus_bigtts" | "pt_female_bv173dialogue_uranus_bigtts" | "pt_female_bv173emotion_uranus_bigtts" | "pt_female_bv173narrator_uranus_bigtts" | "pt_female_bv530_uranus_bigtts" | "pt_male_bv531_uranus_bigtts" | "pt_female_mari_uranus_bigtts" | "pt_male_rael_uranus_bigtts" | "ar_female_dina_uranus_bigtts" | "ar_female_fatma_uranus_bigtts" | "ar_male_youssef_uranus_bigtts" | "tl_female_annika_uranus_bigtts" | "tl_male_ed_uranus_bigtts" | "tl_female_hervie_uranus_bigtts" | "ko_male_bv545_uranus_bigtts" | "ko_female_bv546_uranus_bigtts" | "ko_male_m03_uranus_bigtts" | "ko_male_shane_uranus_bigtts" | "ms_male_ham_uranus_bigtts" | "ms_male_naim_uranus_bigtts" | "ru_female_af07_uranus_bigtts" | "ru_female_irinae_uranus_bigtts" | "ru_male_pavel_uranus_bigtts" | "ru_female_sophie_uranus_bigtts" | "ru_male_vlad_uranus_bigtts" | "th_female_bv568_angry_uranus_bigtts" | "th_female_bv568_fear_uranus_bigtts" | "th_female_bv568_happy_uranus_bigtts" | "th_female_bv568_hate_uranus_bigtts" | "th_female_bv568_neutral_uranus_bigtts" | "th_female_bv568_sad_uranus_bigtts" | "th_female_bv568_suprise_uranus_bigtts" | "vi_female_hong_uranus_bigtts" | "vi_female_ling_uranus_bigtts" | "vi_female_linh_uranus_bigtts" | "vi_female_partner_uranus_bigtts" | "vi_female_ruan_uranus_bigtts" | "vi_female_wu_uranus_bigtts" | "vi_male_wumg_uranus_bigtts";
1134
+ voiceId?: string;
1143
1135
  audioUrls?: string[];
1144
1136
  imageUrls?: string[];
1145
1137
  format?: "wav" | "mp3" | "pcm" | "ogg_opus";
@@ -1641,144 +1633,6 @@ interface ApisClient {
1641
1633
  run<W extends string = string>(api: W, payload: W extends keyof ApiSchemas ? ApiSchemas[W]['params'] : Record<string, unknown>, options?: ApiRunOptions): Promise<ApiResponse<W extends keyof ApiSchemas ? ApiSchemas[W]['result'] : unknown>>;
1642
1634
  }
1643
1635
 
1644
- /** A fetch-like function that handles authentication (headers, cookies, etc.). */
1645
- type AuthenticatedFetch = (url: string, init?: RequestInit) => Promise<Response>;
1646
- /** Drive configuration — enables auto-saving generations to Picsart Drive. */
1647
- interface DriveConfig {
1648
- /** Root folder name in Drive. All generations save here. */
1649
- folder: string;
1650
- }
1651
- /**
1652
- * Whether the embedding app is a native client or a miniapp. Set backend-side
1653
- * during save; surfaced read-only via `getGeneration`.
1654
- */
1655
- type AppType = 'native' | 'miniapp';
1656
- /**
1657
- * App identity (appId + appType).
1658
- * TODO(backend-autosave): temporary — the backend will stamp appId/appType on
1659
- * save. Until then apps may pass this so it's persisted client-side.
1660
- */
1661
- interface AppIdentity {
1662
- id: string;
1663
- type: AppType;
1664
- }
1665
- /**
1666
- * Simple client config — pass the API base URL plus one auth source, and the
1667
- * SDK handles the rest. The SDK knows the Picsart API endpoints and response
1668
- * shapes internally.
1669
- *
1670
- * Provide exactly one of:
1671
- * - `fetch` — your own authenticated fetch (you add headers/cookies), or
1672
- * - `apiKey` — the SDK builds a fetch that sends `Authorization: Bearer <apiKey>`.
1673
- */
1674
- interface ClientConfig {
1675
- /**
1676
- * Authenticated fetch function. The SDK calls this for all HTTP requests.
1677
- * Provide this or `apiKey`. Takes precedence over `apiKey` when both are set.
1678
- */
1679
- fetch?: AuthenticatedFetch;
1680
- /**
1681
- * Picsart API key. When `fetch` is not provided, the SDK builds an
1682
- * authenticated fetch that sends `Authorization: Bearer <apiKey>` on every
1683
- * request (a leading `Bearer ` is stripped if present).
1684
- */
1685
- apiKey?: string;
1686
- /** API base URL (e.g. 'https://api.picsart.com'). */
1687
- apiUrl: string;
1688
- /** Enable Drive integration — auto-save generations to a Drive folder. */
1689
- drive?: DriveConfig;
1690
- }
1691
- interface GenerateResultItem {
1692
- url: string;
1693
- metadata?: Record<string, unknown>;
1694
- }
1695
- interface GenerateResult {
1696
- /** Primary result URL (convenience shortcut for results[0].url). */
1697
- url: string;
1698
- /** All result items — single item for normal models, multiple for explore/multi-result models. */
1699
- results: GenerateResultItem[];
1700
- /** Model ID that produced this result. */
1701
- model: string;
1702
- /** Job handle for status tracking. */
1703
- handle: WorkflowJobHandle;
1704
- /** Raw parsed output for advanced consumers. */
1705
- raw: unknown;
1706
- /** Present when Drive is enabled and the file was saved. */
1707
- drive?: DriveSaveResult;
1708
- }
1709
- /** Result of a text-generation (LLM) model. */
1710
- interface GenerateTextResult {
1711
- /** Generated text. */
1712
- text: string;
1713
- /** Model ID that produced this result. */
1714
- model: string;
1715
- /** Job handle for status tracking. */
1716
- handle: WorkflowJobHandle;
1717
- /** Raw parsed output — carries usage, finish reason, thinking trace, etc. */
1718
- raw: unknown;
1719
- }
1720
- /** Options for individual generate() / submit() calls. */
1721
- interface GenerateOptions {
1722
- signal?: AbortSignal;
1723
- /** Save to a specific subfolder instead of the root (legacy — used by SDK DriveConfig). */
1724
- folder?: DriveFolder;
1725
- /** Save result to Picsart Drive via backend. Injected into the workflow payload. */
1726
- drive?: PayloadDriveOptions;
1727
- /**
1728
- * App identity stamped onto the saved generation (appId/appType).
1729
- * TODO(backend-autosave): temporary — remove once the backend stamps these.
1730
- */
1731
- app?: AppIdentity;
1732
- }
1733
- /** Non-text (image/video/audio) model IDs — the media generation surface. */
1734
- type MediaModelId = Exclude<TypedModelId, TextModelId>;
1735
- /** AI SDK client with type-safe, model-aware method signatures. */
1736
- interface AiClient {
1737
- /** Generate content using a media model. Text/LLM models use generateText(). */
1738
- generate<M extends MediaModelId>(model: M, params: ModelInputById[M], options?: GenerateOptions): Promise<GenerateResult>;
1739
- /** Generate text using an LLM model. Returns the generated text plus the raw response. */
1740
- generateText<M extends TextModelId>(model: M, params: TextModelInputById[M], options?: GenerateOptions): Promise<GenerateTextResult>;
1741
- /** Get exact credit cost for a model with specific parameters. */
1742
- getCredits<M extends TypedModelId>(model: M, params: ModelInputById[M]): Promise<number | null>;
1743
- /** Submit a generation job and get a handle back. Media models only. */
1744
- submit<M extends MediaModelId>(model: M, params: ModelInputById[M], options?: GenerateOptions): Promise<WorkflowJobHandle>;
1745
- /** Check the current status of a submitted job. */
1746
- status(handle: WorkflowJobHandle, signal?: AbortSignal): Promise<WorkflowStatusResult<unknown>>;
1747
- /** Poll a submitted job until it completes and return the parsed result. Media models only. */
1748
- result(handle: WorkflowJobHandle, model: MediaModelId, options?: WorkflowPollOptions): Promise<GenerateResult>;
1749
- /** Subscribe to live status updates for a submitted job. */
1750
- subscribe(handle: WorkflowJobHandle, options?: WorkflowSubscribeOptions): AsyncGenerator<WorkflowStatusResult<unknown>, WorkflowStatusResult<unknown>, void>;
1751
- /** Build the vendor-specific payload for a model without submitting. */
1752
- buildPayload<M extends TypedModelId>(model: M, params: ModelInputById[M]): Record<string, unknown>;
1753
- /** @deprecated Use `apis.run()` instead. Run a raw workflow (not tied to a model). */
1754
- runWorkflow<TResult = unknown>(workflow: string, payload: Record<string, unknown>, options?: WorkflowRunOptions): Promise<TResult>;
1755
- /**
1756
- * Direct, low-level access to the Picsart model APIs — run any API by name.
1757
- * See {@link ApisClient}.
1758
- */
1759
- apis: ApisClient;
1760
- /** Drive operations. Only available when drive config is provided. */
1761
- drive: DriveClient | undefined;
1762
- }
1763
-
1764
- /**
1765
- * Create an AI SDK client.
1766
- *
1767
- * @example Simple — pass an authenticated fetch:
1768
- * ```ts
1769
- * const ai = createClient({ fetch: myAuthenticatedFetch });
1770
- * ```
1771
- *
1772
- * @example With Drive — auto-save generations:
1773
- * ```ts
1774
- * const ai = createClient({
1775
- * fetch: myAuthenticatedFetch,
1776
- * drive: { folder: 'AI Playground' },
1777
- * });
1778
- * ```
1779
- */
1780
- declare function createClient(config: ClientConfig | SdkTransport): AiClient;
1781
-
1782
1636
  interface ParamSchema {
1783
1637
  type: 'string' | 'number' | 'boolean' | 'file';
1784
1638
  enum?: (string | number)[];
@@ -1810,6 +1664,19 @@ interface EnumDescriptor<T extends string | number = string> {
1810
1664
  options: Array<EnumOption<T>>;
1811
1665
  default: T;
1812
1666
  }
1667
+ /**
1668
+ * Free-string id served by a platform catalog task (voices/avatars). The id
1669
+ * space is open-ended — the live catalog is the source of truth — so the value
1670
+ * is validated only by type, never by membership. `source` says which task
1671
+ * serves the options; the entry's `catalogOptions` carries the seed (and,
1672
+ * after `ai.catalogs.voices/avatars`, the live list).
1673
+ */
1674
+ interface CatalogDescriptor {
1675
+ kind: 'catalog';
1676
+ /** Platform catalog task that serves this param's live options. */
1677
+ source: CatalogSource;
1678
+ default: string;
1679
+ }
1813
1680
  interface RangeDescriptor {
1814
1681
  kind: 'range';
1815
1682
  min: number;
@@ -1867,7 +1734,7 @@ interface ObjectDescriptor {
1867
1734
  max?: number;
1868
1735
  };
1869
1736
  }
1870
- type ParamDescriptor = EnumDescriptor<string> | EnumDescriptor<number> | RangeDescriptor | BooleanDescriptor | TextDescriptor | FileDescriptor | ObjectDescriptor;
1737
+ type ParamDescriptor = EnumDescriptor<string> | EnumDescriptor<number> | CatalogDescriptor | RangeDescriptor | BooleanDescriptor | TextDescriptor | FileDescriptor | ObjectDescriptor;
1871
1738
  interface ParamEntry {
1872
1739
  label?: string;
1873
1740
  required?: boolean;
@@ -1894,6 +1761,7 @@ interface EntryMeta {
1894
1761
  disabledReason?: string;
1895
1762
  }
1896
1763
  type EnumEntry = EntryMeta & EnumDescriptor<string | number>;
1764
+ type CatalogEntry = EntryMeta & CatalogDescriptor;
1897
1765
  type RangeEntry = EntryMeta & RangeDescriptor;
1898
1766
  type BooleanEntry = EntryMeta & BooleanDescriptor;
1899
1767
  type TextEntry = EntryMeta & TextDescriptor;
@@ -1928,6 +1796,8 @@ interface ModelParamsAccessor {
1928
1796
  hasParam(key: string): boolean;
1929
1797
  all(): FlatParamEntry[];
1930
1798
  enum(key: string): EnumEntry | undefined;
1799
+ /** Catalog params (`kind: 'catalog'`) — free-string ids; options live in `catalogOptions`. */
1800
+ catalog(key: string): CatalogEntry | undefined;
1931
1801
  range(key: string): RangeEntry | undefined;
1932
1802
  boolean(key: string): BooleanEntry | undefined;
1933
1803
  text(key: string): TextEntry | undefined;
@@ -2194,6 +2064,259 @@ interface ModelDefinition {
2194
2064
  testTimeout?: number;
2195
2065
  }
2196
2066
 
2067
+ /**
2068
+ * Voice/avatar catalogs — the standard format served by the platform
2069
+ * `<vendor>/v1/catalog/<voices|avatars>` tasks, plus the in-memory hydration
2070
+ * registry that lets runtime-fetched catalogs back the descriptor system.
2071
+ *
2072
+ * The wire types mirror the shared backend contract (`@picsart/pa-genai-common`);
2073
+ * the SDK owns its own copy so it carries no backend dependency.
2074
+ */
2075
+
2076
+ interface CatalogPreview {
2077
+ imageUrl?: string;
2078
+ videoUrl?: string;
2079
+ audioUrl?: string;
2080
+ }
2081
+ interface CatalogItem {
2082
+ /** Vendor-native id, sent back verbatim on generate (voiceId / videoId). */
2083
+ id: string;
2084
+ name: string;
2085
+ description?: string;
2086
+ /** Facets for filtering: gender, language, age, accent, tone, … */
2087
+ tags: string[];
2088
+ preview?: CatalogPreview;
2089
+ /** Vendor extras, e.g. `defaultVoiceId` on HeyGen avatars. */
2090
+ meta?: Record<string, unknown>;
2091
+ }
2092
+ interface CatalogQuery {
2093
+ /** Worker-side filter (e.g. the seed-audio model variant on bytedance). */
2094
+ modelId?: string;
2095
+ /** Opaque cursor from a previous page. */
2096
+ cursor?: string;
2097
+ /** Page size. Every catalog task accepts up to 100. */
2098
+ limit?: number;
2099
+ }
2100
+ interface CatalogResult {
2101
+ items: CatalogItem[];
2102
+ /** Crawl date or curation stamp identifying the snapshot. */
2103
+ version: string;
2104
+ /** How long the caller may cache this response. */
2105
+ ttlSeconds: number;
2106
+ /** `null` when the list is complete. */
2107
+ nextCursor: string | null;
2108
+ }
2109
+ type CatalogKind = 'voices' | 'avatars';
2110
+ /** Binds a param's options to a platform catalog task. */
2111
+ interface CatalogSource {
2112
+ /** Catalog workflow name, e.g. `heygen/v1/catalog/voices`. */
2113
+ workflow: string;
2114
+ /** Worker-side filter passed on fetch. */
2115
+ modelId?: string;
2116
+ }
2117
+ declare function toVoiceOption(item: CatalogItem, provider: Provider): VoiceOption;
2118
+ declare function toAvatarOption(item: CatalogItem, provider: Provider): AvatarOption;
2119
+
2120
+ /**
2121
+ * ai.catalogs — runtime access to the platform voice/avatar catalog tasks
2122
+ * (`<vendor>/v1/catalog/<voices|avatars>`).
2123
+ *
2124
+ * Loading is page-by-page: each call fetches ONE page (UI loads more on
2125
+ * scroll/pagination via `nextCursor`). Pages are cached per the `ttlSeconds`
2126
+ * the platform returns, concurrent fetches of the same page collapse, and
2127
+ * every fetched page is appended to the options installed on the model so
2128
+ * `Model(id).params()` (and every picker built on it) sees what has been
2129
+ * loaded so far. With `createClient({ catalogs: { preload: true } })` the
2130
+ * first page of every bound catalog loads in the background at client
2131
+ * creation.
2132
+ */
2133
+
2134
+ /** Model id with autocomplete that still accepts arbitrary strings. */
2135
+ type ModelId = TypedModelId | (string & {});
2136
+ /** One fetched page. Pass `nextCursor` back to load the next one. */
2137
+ interface CatalogPage {
2138
+ items: CatalogItem[];
2139
+ /** `null` when the list is complete. */
2140
+ nextCursor: string | null;
2141
+ }
2142
+ interface CatalogPageOptions {
2143
+ /** Cursor from the previous page's `nextCursor`; omit for the first page. */
2144
+ cursor?: string;
2145
+ /** Page size, 1..100. Defaults to 100. */
2146
+ limit?: number;
2147
+ /** Drop everything cached for this catalog and refetch from the first page. */
2148
+ forceRefresh?: boolean;
2149
+ /**
2150
+ * Cancels this caller's wait only. A fetch shared with other callers keeps
2151
+ * running so its result can still be cached for them.
2152
+ */
2153
+ signal?: AbortSignal;
2154
+ }
2155
+ interface CatalogsClient {
2156
+ /**
2157
+ * One page of the model's voice catalog. Fetched pages accumulate into the
2158
+ * model's `voiceId` options, so pickers see everything loaded so far.
2159
+ */
2160
+ voices(model: ModelId, options?: CatalogPageOptions): Promise<CatalogPage>;
2161
+ /** One page of the model's avatar catalog — same semantics, for `videoId`. */
2162
+ avatars(model: ModelId, options?: CatalogPageOptions): Promise<CatalogPage>;
2163
+ }
2164
+ interface CatalogsOptions {
2165
+ /**
2166
+ * Load the first page of every catalog-bound param in the background at
2167
+ * client creation, so pickers open with data before any explicit call.
2168
+ */
2169
+ preload?: boolean;
2170
+ }
2171
+
2172
+ /** A fetch-like function that handles authentication (headers, cookies, etc.). */
2173
+ type AuthenticatedFetch = (url: string, init?: RequestInit) => Promise<Response>;
2174
+ /** Drive configuration — enables auto-saving generations to Picsart Drive. */
2175
+ interface DriveConfig {
2176
+ /** Root folder name in Drive. All generations save here. */
2177
+ folder: string;
2178
+ }
2179
+ /**
2180
+ * Whether the embedding app is a native client or a miniapp. Set backend-side
2181
+ * during save; surfaced read-only via `getGeneration`.
2182
+ */
2183
+ type AppType = 'native' | 'miniapp';
2184
+ /**
2185
+ * App identity (appId + appType).
2186
+ * TODO(backend-autosave): temporary — the backend will stamp appId/appType on
2187
+ * save. Until then apps may pass this so it's persisted client-side.
2188
+ */
2189
+ interface AppIdentity {
2190
+ id: string;
2191
+ type: AppType;
2192
+ }
2193
+ /**
2194
+ * Simple client config — pass the API base URL plus one auth source, and the
2195
+ * SDK handles the rest. The SDK knows the Picsart API endpoints and response
2196
+ * shapes internally.
2197
+ *
2198
+ * Provide exactly one of:
2199
+ * - `fetch` — your own authenticated fetch (you add headers/cookies), or
2200
+ * - `apiKey` — the SDK builds a fetch that sends `Authorization: Bearer <apiKey>`.
2201
+ */
2202
+ interface ClientConfig {
2203
+ /**
2204
+ * Authenticated fetch function. The SDK calls this for all HTTP requests.
2205
+ * Provide this or `apiKey`. Takes precedence over `apiKey` when both are set.
2206
+ */
2207
+ fetch?: AuthenticatedFetch;
2208
+ /**
2209
+ * Picsart API key. When `fetch` is not provided, the SDK builds an
2210
+ * authenticated fetch that sends `Authorization: Bearer <apiKey>` on every
2211
+ * request (a leading `Bearer ` is stripped if present).
2212
+ */
2213
+ apiKey?: string;
2214
+ /** API base URL (e.g. 'https://api.picsart.com'). */
2215
+ apiUrl: string;
2216
+ /** Enable Drive integration — auto-save generations to a Drive folder. */
2217
+ drive?: DriveConfig;
2218
+ /**
2219
+ * Voice/avatar catalog behavior. `{ preload: true }` loads the first page
2220
+ * of every catalog-bound param in the background at client creation.
2221
+ */
2222
+ catalogs?: CatalogsOptions;
2223
+ }
2224
+ interface GenerateResultItem {
2225
+ url: string;
2226
+ metadata?: Record<string, unknown>;
2227
+ }
2228
+ interface GenerateResult {
2229
+ /** Primary result URL (convenience shortcut for results[0].url). */
2230
+ url: string;
2231
+ /** All result items — single item for normal models, multiple for explore/multi-result models. */
2232
+ results: GenerateResultItem[];
2233
+ /** Model ID that produced this result. */
2234
+ model: string;
2235
+ /** Job handle for status tracking. */
2236
+ handle: WorkflowJobHandle;
2237
+ /** Raw parsed output for advanced consumers. */
2238
+ raw: unknown;
2239
+ /** Present when Drive is enabled and the file was saved. */
2240
+ drive?: DriveSaveResult;
2241
+ }
2242
+ /** Result of a text-generation (LLM) model. */
2243
+ interface GenerateTextResult {
2244
+ /** Generated text. */
2245
+ text: string;
2246
+ /** Model ID that produced this result. */
2247
+ model: string;
2248
+ /** Job handle for status tracking. */
2249
+ handle: WorkflowJobHandle;
2250
+ /** Raw parsed output — carries usage, finish reason, thinking trace, etc. */
2251
+ raw: unknown;
2252
+ }
2253
+ /** Options for individual generate() / submit() calls. */
2254
+ interface GenerateOptions {
2255
+ signal?: AbortSignal;
2256
+ /** Save to a specific subfolder instead of the root (legacy — used by SDK DriveConfig). */
2257
+ folder?: DriveFolder;
2258
+ /** Save result to Picsart Drive via backend. Injected into the workflow payload. */
2259
+ drive?: PayloadDriveOptions;
2260
+ /**
2261
+ * App identity stamped onto the saved generation (appId/appType).
2262
+ * TODO(backend-autosave): temporary — remove once the backend stamps these.
2263
+ */
2264
+ app?: AppIdentity;
2265
+ }
2266
+ /** Non-text (image/video/audio) model IDs — the media generation surface. */
2267
+ type MediaModelId = Exclude<TypedModelId, TextModelId>;
2268
+ /** AI SDK client with type-safe, model-aware method signatures. */
2269
+ interface AiClient {
2270
+ /** Generate content using a media model. Text/LLM models use generateText(). */
2271
+ generate<M extends MediaModelId>(model: M, params: ModelInputById[M], options?: GenerateOptions): Promise<GenerateResult>;
2272
+ /** Generate text using an LLM model. Returns the generated text plus the raw response. */
2273
+ generateText<M extends TextModelId>(model: M, params: TextModelInputById[M], options?: GenerateOptions): Promise<GenerateTextResult>;
2274
+ /** Get exact credit cost for a model with specific parameters. */
2275
+ getCredits<M extends TypedModelId>(model: M, params: ModelInputById[M]): Promise<number | null>;
2276
+ /** Submit a generation job and get a handle back. Media models only. */
2277
+ submit<M extends MediaModelId>(model: M, params: ModelInputById[M], options?: GenerateOptions): Promise<WorkflowJobHandle>;
2278
+ /** Check the current status of a submitted job. */
2279
+ status(handle: WorkflowJobHandle, signal?: AbortSignal): Promise<WorkflowStatusResult<unknown>>;
2280
+ /** Poll a submitted job until it completes and return the parsed result. Media models only. */
2281
+ result(handle: WorkflowJobHandle, model: MediaModelId, options?: WorkflowPollOptions): Promise<GenerateResult>;
2282
+ /** Subscribe to live status updates for a submitted job. */
2283
+ subscribe(handle: WorkflowJobHandle, options?: WorkflowSubscribeOptions): AsyncGenerator<WorkflowStatusResult<unknown>, WorkflowStatusResult<unknown>, void>;
2284
+ /** Build the vendor-specific payload for a model without submitting. */
2285
+ buildPayload<M extends TypedModelId>(model: M, params: ModelInputById[M]): Record<string, unknown>;
2286
+ /** @deprecated Use `apis.run()` instead. Run a raw workflow (not tied to a model). */
2287
+ runWorkflow<TResult = unknown>(workflow: string, payload: Record<string, unknown>, options?: WorkflowRunOptions): Promise<TResult>;
2288
+ /**
2289
+ * Direct, low-level access to the Picsart model APIs — run any API by name.
2290
+ * See {@link ApisClient}.
2291
+ */
2292
+ apis: ApisClient;
2293
+ /**
2294
+ * Voice/avatar catalogs served by the platform catalog tasks — fetch,
2295
+ * ttl-cache, and hydrate model params. See {@link CatalogsClient}.
2296
+ */
2297
+ catalogs: CatalogsClient;
2298
+ /** Drive operations. Only available when drive config is provided. */
2299
+ drive: DriveClient | undefined;
2300
+ }
2301
+
2302
+ /**
2303
+ * Create an AI SDK client.
2304
+ *
2305
+ * @example Simple — pass an authenticated fetch:
2306
+ * ```ts
2307
+ * const ai = createClient({ fetch: myAuthenticatedFetch });
2308
+ * ```
2309
+ *
2310
+ * @example With Drive — auto-save generations:
2311
+ * ```ts
2312
+ * const ai = createClient({
2313
+ * fetch: myAuthenticatedFetch,
2314
+ * drive: { folder: 'AI Playground' },
2315
+ * });
2316
+ * ```
2317
+ */
2318
+ declare function createClient(config: ClientConfig | SdkTransport): AiClient;
2319
+
2197
2320
  /**
2198
2321
  * Typed Models constants and namespace.
2199
2322
  * Regenerate with: npm run build:model-constants
@@ -2316,8 +2439,6 @@ declare const Models: {
2316
2439
  readonly Lyria3Pro: "lyria-3-pro";
2317
2440
  readonly Minimax02Hd: "minimax-02-hd";
2318
2441
  readonly MinimaxMusicV2: "minimax-music-v2";
2319
- readonly OpenaiTts1: "openai-tts-1";
2320
- readonly OpenaiTts1Hd: "openai-tts-1-hd";
2321
2442
  readonly Ovi: "ovi";
2322
2443
  readonly PicsartChangeBg: "picsart-change-bg";
2323
2444
  readonly PicsartEnhance: "picsart-enhance";
@@ -2428,7 +2549,15 @@ declare const Models: {
2428
2549
  readonly hasParam: (id: string, key: string) => boolean;
2429
2550
  };
2430
2551
 
2431
- declare function getVoiceById(id: string, extra?: VoiceOption[]): VoiceOption | undefined;
2552
+ /**
2553
+ * Default voice ids for the catalog-bound TTS params. The voice LISTS are not
2554
+ * bundled: options come from the platform catalog tasks at runtime
2555
+ * (`ai.catalogs.voices`) — the workers cache them and answer fast.
2556
+ */
2557
+
2558
+ declare function getVoiceById(id: string): VoiceOption | undefined;
2559
+ /** @deprecated Load the model's catalog instead (`ai.catalogs.voices(modelId)`) — loaded voices are searched automatically. */
2560
+ declare function getVoiceById(id: string, extra: VoiceOption[] | undefined): VoiceOption | undefined;
2432
2561
 
2433
2562
  /**
2434
2563
  * Pricing internals — owns the ModelPricingClient, the per-model cache, and
@@ -2553,4 +2682,4 @@ declare const findModel: (ref: string) => ModelDefinition | undefined;
2553
2682
  /** Effect scenes that require two input images (e.g. hugs, kisses, swaps). */
2554
2683
  declare const KLING_DUAL_IMAGE_EFFECTS: ReadonlySet<string>;
2555
2684
 
2556
- export { ALL_MODELS, type AiClient, type ApiResponse, type ApiRunOptions, type ApiSchemas, type ApisClient, type AppIdentity, type AppType, type AuthenticatedFetch, type AvatarOption, type BooleanDescriptor, type BooleanEntry, type ClientConfig, type CreditRange, type CreditRangeContext, DEFAULT_VISIBLE_RELEASES, type DeepLinkResult, type DriveAttributes, type DriveClient, type DriveConfig, type DriveFile, type DriveFileDetails, type DriveFolder, type DriveMediaItem, type DriveSaveResult, type EntryMeta, type EnumDescriptor, type EnumEntry, type EnumOption, type FileDescriptor, type FileEntry, type FlatParamEntry, type GenerateOptions, type GenerateResult, type GenerateResultItem, type GenerateTextResult, type GenerationContext, type GenerationFile, type GenerationMode, KLING_DUAL_IMAGE_EFFECTS, type ListOptions, type MediaModelId, type MediaTypeFilter, Model, type ModelDefinition, type ModelDescriptor, type ModelFilter$1 as ModelFilter, type ModelInput, type ModelInputById, type ModelMeta, type ModelParams, type ModelParamsAccessor, Models, type ObjectDescriptor, type ObjectEntry, type ParamDescriptor, type ParamEntry, type ParamOption, type PayloadDriveFolderOptions, type PayloadDriveOptions, type PricingOptions, type ProviderInfo, type RangeDescriptor, type RangeEntry, type ReleaseTag, type SaveParams, type SdkPayload, type SdkTransport, type TextDescriptor, type TextEntry, type TextModelId, type TextModelInputById, type TypedModelId, type UserReaction, type ValidationResult$1 as ValidationResult, type VoiceOption, type WorkflowJobHandle, buildFilename, buildGenerationAttributes, catalog, createClient, decodeDeepLinkPayload, encodeDeepLinkPayload, findModel, getModel, getModelsByMode, getVoiceById, inferResourceType, isVisibleForReleases, parseGeneration, releaseOf };
2685
+ export { ALL_MODELS, type AiClient, type ApiResponse, type ApiRunOptions, type ApiSchemas, type ApisClient, type AppIdentity, type AppType, type AuthenticatedFetch, type AvatarOption, type BooleanDescriptor, type BooleanEntry, type CatalogDescriptor, type CatalogEntry, type CatalogItem, type CatalogKind, type CatalogPage, type CatalogPageOptions, type CatalogPreview, type CatalogQuery, type CatalogResult, type CatalogSource, type CatalogsClient, type CatalogsOptions, type ClientConfig, type CreditRange, type CreditRangeContext, DEFAULT_VISIBLE_RELEASES, type DeepLinkResult, type DriveAttributes, type DriveClient, type DriveConfig, type DriveFile, type DriveFileDetails, type DriveFolder, type DriveMediaItem, type DriveSaveResult, type EntryMeta, type EnumDescriptor, type EnumEntry, type EnumOption, type FileDescriptor, type FileEntry, type FlatParamEntry, type GenerateOptions, type GenerateResult, type GenerateResultItem, type GenerateTextResult, type GenerationContext, type GenerationFile, type GenerationMode, KLING_DUAL_IMAGE_EFFECTS, type ListOptions, type MediaModelId, type MediaTypeFilter, Model, type ModelDefinition, type ModelDescriptor, type ModelFilter$1 as ModelFilter, type ModelInput, type ModelInputById, type ModelMeta, type ModelParams, type ModelParamsAccessor, Models, type ObjectDescriptor, type ObjectEntry, type ParamDescriptor, type ParamEntry, type ParamOption, type PayloadDriveFolderOptions, type PayloadDriveOptions, type PricingOptions, type ProviderInfo, type RangeDescriptor, type RangeEntry, type ReleaseTag, type SaveParams, type SdkPayload, type SdkTransport, type TextDescriptor, type TextEntry, type TextModelId, type TextModelInputById, type TypedModelId, type UserReaction, type ValidationResult$1 as ValidationResult, type VoiceOption, type WorkflowJobHandle, buildFilename, buildGenerationAttributes, catalog, createClient, decodeDeepLinkPayload, encodeDeepLinkPayload, findModel, getModel, getModelsByMode, getVoiceById, inferResourceType, isVisibleForReleases, parseGeneration, releaseOf, toAvatarOption, toVoiceOption };