@brotu/ai 0.4.0 → 0.6.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.
- package/CATALOG.md +298 -4
- package/README.md +47 -8
- package/dist/adapters/brotu.adapter.d.ts.map +1 -1
- package/dist/adapters/topaz.adapter.d.ts +71 -0
- package/dist/adapters/topaz.adapter.d.ts.map +1 -0
- package/dist/catalog.cjs +143 -8
- package/dist/catalog.d.ts +22 -1
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +5 -1
- package/dist/{chunk-QOWHHKSI.js → chunk-QQIHMDJC.js} +146 -9
- package/dist/client.d.ts +25 -4
- package/dist/client.d.ts.map +1 -1
- package/dist/index.cjs +805 -75
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +610 -12
- package/dist/lib/hooks.d.ts +32 -0
- package/dist/lib/hooks.d.ts.map +1 -0
- package/dist/ports/content-generator.port.d.ts +12 -0
- package/dist/ports/content-generator.port.d.ts.map +1 -1
- package/dist/providers/topaz.models.d.ts +24 -0
- package/dist/providers/topaz.models.d.ts.map +1 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/CATALOG.md
CHANGED
|
@@ -1,18 +1,102 @@
|
|
|
1
1
|
<!-- Generated by scripts/generate-catalog-doc.ts. Do not edit by hand. -->
|
|
2
2
|
# Supported catalog
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
146 models: 74 video, 41 image, 12 speech, 19 text.
|
|
5
5
|
|
|
6
6
|
Every model is served by its vendor's own API — no aggregator sits in between, so
|
|
7
7
|
the key you configure is the account that runs the work and bills it.
|
|
8
8
|
|
|
9
|
-
Providers: byteplus, elevenlabs, google, kling, openai, qwen.
|
|
9
|
+
Providers: byteplus, elevenlabs, google, kling, openai, qwen, topaz.
|
|
10
10
|
|
|
11
11
|
Every model here is reachable through one `ai.image`/`ai.video` call with the same
|
|
12
12
|
params. What differs between them is only what this table records: durations,
|
|
13
13
|
resolutions, aspect ratios and capabilities.
|
|
14
14
|
|
|
15
|
-
## Video (
|
|
15
|
+
## Video (74)
|
|
16
|
+
|
|
17
|
+
### aaa-9
|
|
18
|
+
|
|
19
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
20
|
+
|---|---|---|---|---|---|
|
|
21
|
+
| `aaa-9` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
22
|
+
|
|
23
|
+
### ahq-12
|
|
24
|
+
|
|
25
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
26
|
+
|---|---|---|---|---|---|
|
|
27
|
+
| `ahq-12` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
28
|
+
|
|
29
|
+
### aion-1
|
|
30
|
+
|
|
31
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
32
|
+
|---|---|---|---|---|---|
|
|
33
|
+
| `aion-1` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
34
|
+
|
|
35
|
+
### alq-13
|
|
36
|
+
|
|
37
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
38
|
+
|---|---|---|---|---|---|
|
|
39
|
+
| `alq-13` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
40
|
+
|
|
41
|
+
### alqs-2
|
|
42
|
+
|
|
43
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
44
|
+
|---|---|---|---|---|---|
|
|
45
|
+
| `alqs-2` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
46
|
+
|
|
47
|
+
### amq-13
|
|
48
|
+
|
|
49
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
50
|
+
|---|---|---|---|---|---|
|
|
51
|
+
| `amq-13` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
52
|
+
|
|
53
|
+
### amqs-2
|
|
54
|
+
|
|
55
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
56
|
+
|---|---|---|---|---|---|
|
|
57
|
+
| `amqs-2` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
58
|
+
|
|
59
|
+
### apf-2
|
|
60
|
+
|
|
61
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
62
|
+
|---|---|---|---|---|---|
|
|
63
|
+
| `apf-2` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
64
|
+
|
|
65
|
+
### apo-8
|
|
66
|
+
|
|
67
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
68
|
+
|---|---|---|---|---|---|
|
|
69
|
+
| `apo-8` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
70
|
+
|
|
71
|
+
### ast-2
|
|
72
|
+
|
|
73
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
74
|
+
|---|---|---|---|---|---|
|
|
75
|
+
| `ast-2` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
76
|
+
|
|
77
|
+
### chf-3
|
|
78
|
+
|
|
79
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
80
|
+
|---|---|---|---|---|---|
|
|
81
|
+
| `chf-3` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
82
|
+
|
|
83
|
+
### chr-2
|
|
84
|
+
|
|
85
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
86
|
+
|---|---|---|---|---|---|
|
|
87
|
+
| `chr-2` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
88
|
+
|
|
89
|
+
### color-1
|
|
90
|
+
|
|
91
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
92
|
+
|---|---|---|---|---|---|
|
|
93
|
+
| `color-1` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
94
|
+
|
|
95
|
+
### ddv-3
|
|
96
|
+
|
|
97
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
98
|
+
|---|---|---|---|---|---|
|
|
99
|
+
| `ddv-3` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
16
100
|
|
|
17
101
|
### dreamina-seedance-2-0-260128
|
|
18
102
|
|
|
@@ -38,12 +122,48 @@ resolutions, aspect ratios and capabilities.
|
|
|
38
122
|
|---|---|---|---|---|---|
|
|
39
123
|
| `dreamina-seedance-2-5-260628` | 4–30s | 480p, 720p | 16:9, 4:3, 1:1, 3:4, 9:16, 21:9 | — | byteplus |
|
|
40
124
|
|
|
125
|
+
### dtd-4
|
|
126
|
+
|
|
127
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
128
|
+
|---|---|---|---|---|---|
|
|
129
|
+
| `dtd-4` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
130
|
+
|
|
131
|
+
### dtds-2
|
|
132
|
+
|
|
133
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
134
|
+
|---|---|---|---|---|---|
|
|
135
|
+
| `dtds-2` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
136
|
+
|
|
137
|
+
### dtv-4
|
|
138
|
+
|
|
139
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
140
|
+
|---|---|---|---|---|---|
|
|
141
|
+
| `dtv-4` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
142
|
+
|
|
143
|
+
### dtvs-2
|
|
144
|
+
|
|
145
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
146
|
+
|---|---|---|---|---|---|
|
|
147
|
+
| `dtvs-2` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
148
|
+
|
|
149
|
+
### gcg-5
|
|
150
|
+
|
|
151
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
152
|
+
|---|---|---|---|---|---|
|
|
153
|
+
| `gcg-5` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
154
|
+
|
|
41
155
|
### gemini-omni-flash-preview
|
|
42
156
|
|
|
43
157
|
| id | duration | resolutions | aspect | capabilities | served by |
|
|
44
158
|
|---|---|---|---|---|---|
|
|
45
159
|
| `gemini-omni-flash-preview` | 10s | 720p | 16:9, 9:16 | — | google |
|
|
46
160
|
|
|
161
|
+
### ghq-5
|
|
162
|
+
|
|
163
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
164
|
+
|---|---|---|---|---|---|
|
|
165
|
+
| `ghq-5` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
166
|
+
|
|
47
167
|
### happyhorse-1.0-i2v
|
|
48
168
|
|
|
49
169
|
| id | duration | resolutions | aspect | capabilities | served by |
|
|
@@ -86,6 +206,18 @@ resolutions, aspect ratios and capabilities.
|
|
|
86
206
|
|---|---|---|---|---|---|
|
|
87
207
|
| `happyhorse-1.1-t2v` | 3–15s | 480P, 720P, 1080P | — | — | qwen |
|
|
88
208
|
|
|
209
|
+
### iris-2
|
|
210
|
+
|
|
211
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
212
|
+
|---|---|---|---|---|---|
|
|
213
|
+
| `iris-2` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
214
|
+
|
|
215
|
+
### iris-3
|
|
216
|
+
|
|
217
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
218
|
+
|---|---|---|---|---|---|
|
|
219
|
+
| `iris-3` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
220
|
+
|
|
89
221
|
### kling
|
|
90
222
|
|
|
91
223
|
| id | duration | resolutions | aspect | capabilities | served by |
|
|
@@ -101,6 +233,48 @@ resolutions, aspect ratios and capabilities.
|
|
|
101
233
|
| `kling/v3` | 3, 4, 5, 6, 7, 8, 10, 12, 15s | 720p, 1080p, 4k | 16:9, 9:16, 1:1 | — | kling |
|
|
102
234
|
| `kling/v3-turbo` | 3, 4, 5, 6, 7, 8, 10, 12, 15s | 720p, 1080p | 16:9, 9:16, 1:1 | — | kling |
|
|
103
235
|
|
|
236
|
+
### nxf-1
|
|
237
|
+
|
|
238
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
239
|
+
|---|---|---|---|---|---|
|
|
240
|
+
| `nxf-1` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
241
|
+
|
|
242
|
+
### nxhf-1
|
|
243
|
+
|
|
244
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
245
|
+
|---|---|---|---|---|---|
|
|
246
|
+
| `nxhf-1` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
247
|
+
|
|
248
|
+
### nxl-1
|
|
249
|
+
|
|
250
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
251
|
+
|---|---|---|---|---|---|
|
|
252
|
+
| `nxl-1` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
253
|
+
|
|
254
|
+
### nyx-3
|
|
255
|
+
|
|
256
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
257
|
+
|---|---|---|---|---|---|
|
|
258
|
+
| `nyx-3` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
259
|
+
|
|
260
|
+
### pnat-1
|
|
261
|
+
|
|
262
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
263
|
+
|---|---|---|---|---|---|
|
|
264
|
+
| `pnat-1` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
265
|
+
|
|
266
|
+
### prob-4
|
|
267
|
+
|
|
268
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
269
|
+
|---|---|---|---|---|---|
|
|
270
|
+
| `prob-4` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
271
|
+
|
|
272
|
+
### rhea-1
|
|
273
|
+
|
|
274
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
275
|
+
|---|---|---|---|---|---|
|
|
276
|
+
| `rhea-1` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
277
|
+
|
|
104
278
|
### seedance-1-0-lite-i2v-250428
|
|
105
279
|
|
|
106
280
|
| id | duration | resolutions | aspect | capabilities | served by |
|
|
@@ -131,6 +305,48 @@ resolutions, aspect ratios and capabilities.
|
|
|
131
305
|
|---|---|---|---|---|---|
|
|
132
306
|
| `seedance-1-5-pro-251215` | 4–12s | 480p, 720p, 1080p | 16:9, 4:3, 1:1, 3:4, 9:16, 21:9 | — | byteplus |
|
|
133
307
|
|
|
308
|
+
### slf-2
|
|
309
|
+
|
|
310
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
311
|
+
|---|---|---|---|---|---|
|
|
312
|
+
| `slf-2` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
313
|
+
|
|
314
|
+
### slhq-1
|
|
315
|
+
|
|
316
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
317
|
+
|---|---|---|---|---|---|
|
|
318
|
+
| `slhq-1` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
319
|
+
|
|
320
|
+
### slm-1
|
|
321
|
+
|
|
322
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
323
|
+
|---|---|---|---|---|---|
|
|
324
|
+
| `slm-1` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
325
|
+
|
|
326
|
+
### slp-2.6
|
|
327
|
+
|
|
328
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
329
|
+
|---|---|---|---|---|---|
|
|
330
|
+
| `slp-2.6` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
331
|
+
|
|
332
|
+
### thd-3
|
|
333
|
+
|
|
334
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
335
|
+
|---|---|---|---|---|---|
|
|
336
|
+
| `thd-3` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
337
|
+
|
|
338
|
+
### thf-4
|
|
339
|
+
|
|
340
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
341
|
+
|---|---|---|---|---|---|
|
|
342
|
+
| `thf-4` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
343
|
+
|
|
344
|
+
### thm-2
|
|
345
|
+
|
|
346
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
347
|
+
|---|---|---|---|---|---|
|
|
348
|
+
| `thm-2` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
349
|
+
|
|
134
350
|
### veo-3.1-fast-generate-preview
|
|
135
351
|
|
|
136
352
|
| id | duration | resolutions | aspect | capabilities | served by |
|
|
@@ -191,7 +407,31 @@ resolutions, aspect ratios and capabilities.
|
|
|
191
407
|
|---|---|---|---|---|---|
|
|
192
408
|
| `wan2.7-t2v` | 2–15s | 720P, 1080P | — | — | qwen |
|
|
193
409
|
|
|
194
|
-
|
|
410
|
+
### wonder-1
|
|
411
|
+
|
|
412
|
+
| id | duration | resolutions | aspect | capabilities | served by |
|
|
413
|
+
|---|---|---|---|---|---|
|
|
414
|
+
| `wonder-1` | — | 720p, 1080p, 4k | — | — | topaz |
|
|
415
|
+
|
|
416
|
+
## Image (41)
|
|
417
|
+
|
|
418
|
+
### bloom-2
|
|
419
|
+
|
|
420
|
+
| id | resolutions | aspect | input | served by |
|
|
421
|
+
|---|---|---|---|---|
|
|
422
|
+
| `bloom-2` | — | — | image_required | topaz |
|
|
423
|
+
|
|
424
|
+
### cgi
|
|
425
|
+
|
|
426
|
+
| id | resolutions | aspect | input | served by |
|
|
427
|
+
|---|---|---|---|---|
|
|
428
|
+
| `cgi` | — | — | image_required | topaz |
|
|
429
|
+
|
|
430
|
+
### denoise-max
|
|
431
|
+
|
|
432
|
+
| id | resolutions | aspect | input | served by |
|
|
433
|
+
|---|---|---|---|---|
|
|
434
|
+
| `denoise-max` | — | — | image_required | topaz |
|
|
195
435
|
|
|
196
436
|
### dola-seedream-5-0-pro-260628
|
|
197
437
|
|
|
@@ -241,6 +481,12 @@ resolutions, aspect ratios and capabilities.
|
|
|
241
481
|
|---|---|---|---|---|
|
|
242
482
|
| `gpt-image-2` | — | — | image_optional | openai |
|
|
243
483
|
|
|
484
|
+
### high-fidelity-v2
|
|
485
|
+
|
|
486
|
+
| id | resolutions | aspect | input | served by |
|
|
487
|
+
|---|---|---|---|---|
|
|
488
|
+
| `high-fidelity-v2` | — | — | image_required | topaz |
|
|
489
|
+
|
|
244
490
|
### kling
|
|
245
491
|
|
|
246
492
|
| id | resolutions | aspect | input | served by |
|
|
@@ -251,6 +497,12 @@ resolutions, aspect ratios and capabilities.
|
|
|
251
497
|
| `kling/image-v2-1` | — | 16:9, 9:16, 1:1 | text_only | kling |
|
|
252
498
|
| `kling/image-v2-new` | — | 16:9, 9:16, 1:1 | text_only | kling |
|
|
253
499
|
|
|
500
|
+
### low-resolution-v2
|
|
501
|
+
|
|
502
|
+
| id | resolutions | aspect | input | served by |
|
|
503
|
+
|---|---|---|---|---|
|
|
504
|
+
| `low-resolution-v2` | — | — | image_required | topaz |
|
|
505
|
+
|
|
254
506
|
### qwen-image-2.0
|
|
255
507
|
|
|
256
508
|
| id | resolutions | aspect | input | served by |
|
|
@@ -281,6 +533,18 @@ resolutions, aspect ratios and capabilities.
|
|
|
281
533
|
|---|---|---|---|---|
|
|
282
534
|
| `qwen-image-max` | — | — | image_optional | qwen |
|
|
283
535
|
|
|
536
|
+
### recovery-v2
|
|
537
|
+
|
|
538
|
+
| id | resolutions | aspect | input | served by |
|
|
539
|
+
|---|---|---|---|---|
|
|
540
|
+
| `recovery-v2` | — | — | image_required | topaz |
|
|
541
|
+
|
|
542
|
+
### redefine
|
|
543
|
+
|
|
544
|
+
| id | resolutions | aspect | input | served by |
|
|
545
|
+
|---|---|---|---|---|
|
|
546
|
+
| `redefine` | — | — | image_required | topaz |
|
|
547
|
+
|
|
284
548
|
### seededit-3-0-i2i-250628
|
|
285
549
|
|
|
286
550
|
| id | resolutions | aspect | input | served by |
|
|
@@ -317,6 +581,24 @@ resolutions, aspect ratios and capabilities.
|
|
|
317
581
|
|---|---|---|---|---|
|
|
318
582
|
| `seedream-5-0-260128` | 1K, 2K, 4K | 16:9, 4:3, 1:1, 3:4, 9:16, 21:9 | image_optional | byteplus |
|
|
319
583
|
|
|
584
|
+
### standard-max
|
|
585
|
+
|
|
586
|
+
| id | resolutions | aspect | input | served by |
|
|
587
|
+
|---|---|---|---|---|
|
|
588
|
+
| `standard-max` | — | — | image_required | topaz |
|
|
589
|
+
|
|
590
|
+
### standard-v2
|
|
591
|
+
|
|
592
|
+
| id | resolutions | aspect | input | served by |
|
|
593
|
+
|---|---|---|---|---|
|
|
594
|
+
| `standard-v2` | — | — | image_required | topaz |
|
|
595
|
+
|
|
596
|
+
### text-refine
|
|
597
|
+
|
|
598
|
+
| id | resolutions | aspect | input | served by |
|
|
599
|
+
|---|---|---|---|---|
|
|
600
|
+
| `text-refine` | — | — | image_required | topaz |
|
|
601
|
+
|
|
320
602
|
### wan2.6-image
|
|
321
603
|
|
|
322
604
|
| id | resolutions | aspect | input | served by |
|
|
@@ -341,6 +623,18 @@ resolutions, aspect ratios and capabilities.
|
|
|
341
623
|
|---|---|---|---|---|
|
|
342
624
|
| `wan2.7-image-pro` | 1K, 2K, 4K | — | image_optional | qwen |
|
|
343
625
|
|
|
626
|
+
### wonder
|
|
627
|
+
|
|
628
|
+
| id | resolutions | aspect | input | served by |
|
|
629
|
+
|---|---|---|---|---|
|
|
630
|
+
| `wonder` | — | — | image_required | topaz |
|
|
631
|
+
|
|
632
|
+
### wonder-3.5
|
|
633
|
+
|
|
634
|
+
| id | resolutions | aspect | input | served by |
|
|
635
|
+
|---|---|---|---|---|
|
|
636
|
+
| `wonder-3.5` | — | — | image_required | topaz |
|
|
637
|
+
|
|
344
638
|
### z-image-turbo
|
|
345
639
|
|
|
346
640
|
| id | resolutions | aspect | input | served by |
|
package/README.md
CHANGED
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
<a href="https://x.com/brotuApp">@brotuApp</a>
|
|
24
24
|
</p>
|
|
25
25
|
|
|
26
|
-
Kling, Seedance, Wan, Veo, Gemini, gpt-image and ElevenLabs all speak different HTTP. This package is one `
|
|
26
|
+
Kling, Seedance, Wan, Veo, Gemini, gpt-image and ElevenLabs all speak different HTTP. This package is one `brotu` in front of them.
|
|
27
27
|
|
|
28
28
|
Get your key (`brotu_sk_…`) at [brotu.app](https://brotu.app). Pass a vendor key you already have and that model hits the vendor. Everything else generates on Brotu.
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
146 models: 74 video, 41 image, 12 speech, 19 text. Full table in [CATALOG.md](./CATALOG.md). That file is generated from the catalog, so it cannot drift from what the code supports.
|
|
31
31
|
|
|
32
32
|
## Install
|
|
33
33
|
|
|
@@ -46,9 +46,9 @@ pnpm add @brotu/ai
|
|
|
46
46
|
## Client
|
|
47
47
|
|
|
48
48
|
```ts
|
|
49
|
-
import {
|
|
49
|
+
import { brotu } from "@brotu/ai";
|
|
50
50
|
|
|
51
|
-
const ai =
|
|
51
|
+
const ai = brotu({
|
|
52
52
|
apiKey: process.env.BROTU_API_KEY!, // brotu_sk_… from https://brotu.app
|
|
53
53
|
providers: {
|
|
54
54
|
kling: { apiKey: process.env.KLING_API_KEY! },
|
|
@@ -57,6 +57,7 @@ const ai = brotuClient({
|
|
|
57
57
|
openai: { apiKey: process.env.OPENAI_API_KEY! },
|
|
58
58
|
qwen: { apiKey: process.env.QWEN_API_KEY! },
|
|
59
59
|
elevenlabs: { apiKey: process.env.ELEVENLABS_API_KEY! },
|
|
60
|
+
topaz: { apiKey: process.env.TOPAZ_API_KEY! },
|
|
60
61
|
},
|
|
61
62
|
webhook: {
|
|
62
63
|
url: "https://my.app/hooks/brotu",
|
|
@@ -71,18 +72,36 @@ Every public call returns `{ data, error }`. `data` is unusable until you narrow
|
|
|
71
72
|
|
|
72
73
|
| Surface | Methods |
|
|
73
74
|
|---|---|
|
|
74
|
-
| `ai.video` | `submit` / `generate` |
|
|
75
|
-
| `ai.image` | `submit` / `generate` |
|
|
76
|
-
| `ai.text` | `submit` / `generate` |
|
|
77
|
-
| `ai.audio` | `submit` / `generate` |
|
|
75
|
+
| `ai.video` | `submit` / `generate` / `list` / `upscale` |
|
|
76
|
+
| `ai.image` | `submit` / `generate` / `list` / `upscale` |
|
|
77
|
+
| `ai.text` | `submit` / `generate` / `list` |
|
|
78
|
+
| `ai.audio` | `submit` / `generate` / `list` |
|
|
78
79
|
| `ai.jobs` | `poll` / `wait` |
|
|
79
80
|
| `ai.webhook` | `set` / `clear` / `get` |
|
|
81
|
+
| `hooks` | constructor option: your own code on start, success and failure |
|
|
80
82
|
| `ai.estimateCost` | units, and USD when verified |
|
|
81
83
|
| `ai.kling` | `motionControl`, `omniVideo`, `avatar`, `outpainting`, `imageOmni` |
|
|
82
84
|
| `ai.google` | `omniVideo` (conversational refine) |
|
|
83
85
|
|
|
84
86
|
`ai.kling` and `ai.google` exist only when that key is set.
|
|
85
87
|
|
|
88
|
+
## What your keys reach
|
|
89
|
+
|
|
90
|
+
The platform generates image and video. Speech and text are the vendor's work, so those need that vendor's key. `list` says which is which, per model:
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
const ai = brotu({ apiKey: process.env.BROTU_API_KEY! });
|
|
94
|
+
|
|
95
|
+
ai.image.list();
|
|
96
|
+
// [{ model: { id: "gpt-image-2", … }, runsOn: "brotu", runnable: true }, …]
|
|
97
|
+
|
|
98
|
+
ai.audio.list();
|
|
99
|
+
// [{ model: { id: "kling/tts", … }, runsOn: "kling", runnable: false,
|
|
100
|
+
// reason: "Brotu generates image and video only. Pass providers.kling to run this one." }, …]
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
With a Brotu key alone that is 41 image and 74 video models, and the 31 speech and text models listed with the key they are waiting on. Models you cannot reach stay in the list on purpose: hiding them would hide the gap. `ai.models()` is the filtered view, only what runs.
|
|
104
|
+
|
|
86
105
|
## Video
|
|
87
106
|
|
|
88
107
|
`submit` returns a job handle. `generate` waits. Video takes minutes, so do not `generate` inside a request handler.
|
|
@@ -205,6 +224,26 @@ The POST is JSON. Check `x-brotu-event` and, if you set a secret, `x-brotu-webho
|
|
|
205
224
|
|
|
206
225
|
Error codes: `unknown_model`, `missing_key`, `unsupported_provider`, `invalid_request`, `provider_error`, `timeout`.
|
|
207
226
|
|
|
227
|
+
## Hooks
|
|
228
|
+
|
|
229
|
+
Same moments as the webhook, but a function instead of an endpoint — so it runs in your process, with your imports.
|
|
230
|
+
|
|
231
|
+
```ts
|
|
232
|
+
const ai = brotu({
|
|
233
|
+
apiKey: process.env.BROTU_API_KEY!,
|
|
234
|
+
providers: { kling: { apiKey: process.env.KLING_API_KEY! } },
|
|
235
|
+
hooks: {
|
|
236
|
+
onVideoLoading: (e) => console.log("generating", e.model),
|
|
237
|
+
onVideoSuccess: (e) => sendEmail("your video is ready", e.outputs?.[0]?.url),
|
|
238
|
+
onVideoError: (e) => sendEmail("your video failed", e.error?.message),
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
One optional callback per kind and stage — `on{Image,Video,Audio,Text}{Loading,Success,Error}`, twelve typed names. `Loading` fires once the model is routed, before the provider is called; `Success` and `Error` fire wherever the webhook fires, deduped by job id. A hook that throws never fails the generation.
|
|
244
|
+
|
|
245
|
+
The event is `HookEvent`: `kind`, `stage`, `provider`, `model`, `jobId`, `outputs`, `error`, `metadata`, `processingTimeMs`, `at`.
|
|
246
|
+
|
|
208
247
|
## Motion control, avatars, omni
|
|
209
248
|
|
|
210
249
|
Not on `ai.video`. A shared signature would be a lie.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brotu.adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/brotu.adapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"brotu.adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/brotu.adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,KAAK,GAAG,EACR,KAAK,WAAW,EAEhB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,YAAY,EAEjB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,MAAM,iCAAiC,CAAC;AAGzC,MAAM,WAAW,mBAAmB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAA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,EAAE,cAAc,CAAA;KAAE,EAAE,CAEzE;CACD;AA2BD,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type Job, type JobSnapshot } from "../lib/jobs";
|
|
2
|
+
import { type AudioGenerationParams, type ContentGeneratorPort, type CostEstimate, type GenerationOutput, type GenerationParams, type GenerationResult, type GenerationType, type ImageGenerationParams, type TextGenerationParams, type VideoGenerationParams } from "../ports/content-generator.port";
|
|
3
|
+
import { type TopazBinding } from "../providers/topaz.models";
|
|
4
|
+
export interface TopazAdapterOptions {
|
|
5
|
+
apiKey: string;
|
|
6
|
+
baseUrl?: string;
|
|
7
|
+
maxPollAttempts?: number;
|
|
8
|
+
}
|
|
9
|
+
interface StatusResponse {
|
|
10
|
+
status?: string;
|
|
11
|
+
progress?: number;
|
|
12
|
+
message?: string;
|
|
13
|
+
outputSize?: string;
|
|
14
|
+
estimates?: {
|
|
15
|
+
cost?: number[];
|
|
16
|
+
time?: number[];
|
|
17
|
+
};
|
|
18
|
+
download?: {
|
|
19
|
+
url?: string;
|
|
20
|
+
expiresIn?: number;
|
|
21
|
+
expiresAt?: number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Topaz Labs video API.
|
|
26
|
+
*
|
|
27
|
+
* The express endpoint skips source probing and multi-part accept/complete:
|
|
28
|
+
* create the request, PUT the file at the signed URL, then poll /status.
|
|
29
|
+
* Auth is `X-API-Key`, not Bearer.
|
|
30
|
+
*/
|
|
31
|
+
export declare class TopazAdapter implements ContentGeneratorPort {
|
|
32
|
+
readonly providerName = "topaz";
|
|
33
|
+
readonly supportedTypes: GenerationType[];
|
|
34
|
+
private readonly opts;
|
|
35
|
+
constructor(opts: TopazAdapterOptions);
|
|
36
|
+
private get baseUrl();
|
|
37
|
+
private get headers();
|
|
38
|
+
private binding;
|
|
39
|
+
/** 720p / 1080p / 4k, or an explicit "1920x1080" / "1920*1080" pair. */
|
|
40
|
+
resolutionOf(resolution: string | undefined): {
|
|
41
|
+
width: number;
|
|
42
|
+
height: number;
|
|
43
|
+
};
|
|
44
|
+
containerOf(url: string): "mp4" | "mov" | "mkv";
|
|
45
|
+
filterOf(binding: TopazBinding, params: VideoGenerationParams): Record<string, unknown>;
|
|
46
|
+
requestBody(binding: TopazBinding, params: VideoGenerationParams, sourceUrl: string): Record<string, unknown>;
|
|
47
|
+
private request;
|
|
48
|
+
private downloadSource;
|
|
49
|
+
private submitTask;
|
|
50
|
+
outputsFrom(payload: StatusResponse, job: Job): GenerationOutput[];
|
|
51
|
+
private snapshot;
|
|
52
|
+
private run;
|
|
53
|
+
completeJob(job: Job): Promise<JobSnapshot>;
|
|
54
|
+
generateVideo(params: VideoGenerationParams): Promise<GenerationResult>;
|
|
55
|
+
imageBody(binding: TopazBinding, params: ImageGenerationParams, sourceUrl: string): Record<string, string>;
|
|
56
|
+
private submitImage;
|
|
57
|
+
private imageSnapshot;
|
|
58
|
+
private runImage;
|
|
59
|
+
generateImage(params: ImageGenerationParams): Promise<GenerationResult>;
|
|
60
|
+
generateText(params: TextGenerationParams): Promise<GenerationResult>;
|
|
61
|
+
generateAudio(params: AudioGenerationParams): Promise<GenerationResult>;
|
|
62
|
+
estimateCost(type: GenerationType, params: GenerationParams): Promise<CostEstimate>;
|
|
63
|
+
supportsModel(model: string): boolean;
|
|
64
|
+
getAvailableModels(): {
|
|
65
|
+
id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
type: GenerationType;
|
|
68
|
+
}[];
|
|
69
|
+
}
|
|
70
|
+
export {};
|
|
71
|
+
//# sourceMappingURL=topaz.adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topaz.adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/topaz.adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,KAAK,GAAG,EACR,KAAK,WAAW,EAEhB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK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