@sandstormapp/sdk 1.0.0 → 1.1.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/dist/index.js +19 -18
- package/dist/openapi.d.ts +27 -28
- package/openapi.json +42 -38
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -54,10 +54,10 @@ export class Sandstorm {
|
|
|
54
54
|
#timeoutMs;
|
|
55
55
|
#fetch;
|
|
56
56
|
constructor({ apiKey = environment('SANDSTORM_API_KEY'), baseUrl = environment('SANDSTORM_API_URL') ?? BASE_URL, brand, maxRetries = 2, timeoutMs = 60_000, fetch: fetcher = (input, init) => fetch(input, init), } = {}) {
|
|
57
|
+
this.#baseUrl = baseUrl.replace(/\/+$/, '');
|
|
57
58
|
if (apiKey === undefined || apiKey === '') {
|
|
58
|
-
throw new Error(
|
|
59
|
+
throw new Error(`Pass apiKey or set SANDSTORM_API_KEY. To make a key: curl -fsSL ${this.#baseUrl}/login.mjs -o sandstorm-login.mjs && node sandstorm-login.mjs`);
|
|
59
60
|
}
|
|
60
|
-
this.#baseUrl = baseUrl.replace(/\/+$/, '');
|
|
61
61
|
this.#headers = { authorization: `Bearer ${apiKey}`, ...(brand === undefined ? {} : { 'sandstorm-brand': brand }) };
|
|
62
62
|
this.#maxRetries = maxRetries;
|
|
63
63
|
this.#timeoutMs = timeoutMs;
|
|
@@ -144,11 +144,13 @@ export class Sandstorm {
|
|
|
144
144
|
for (let attempt = 0;; attempt++) {
|
|
145
145
|
const timeout = AbortSignal.timeout(this.#timeoutMs + (request.wait ?? 0) * 1000);
|
|
146
146
|
const answered = await send(url, { method: request.method, headers, body, signal: timeout }).catch((error) => error instanceof Error ? error : new Error(String(error)));
|
|
147
|
-
if (answered instanceof Response && answered.ok)
|
|
147
|
+
if (answered instanceof Response && answered.ok && isJson(answered))
|
|
148
148
|
return (await answered.json());
|
|
149
|
+
if (answered instanceof Response && answered.ok)
|
|
150
|
+
throw await notTheApi(answered, url.origin);
|
|
149
151
|
const retryable = answered instanceof Error || RETRYABLE.has(answered.status);
|
|
150
152
|
if (!retryable || attempt >= this.#maxRetries)
|
|
151
|
-
throw answered instanceof Error ? answered : await refusalOf(answered);
|
|
153
|
+
throw answered instanceof Error ? answered : await refusalOf(answered, url.origin);
|
|
152
154
|
await new Promise((resolve) => setTimeout(resolve, delayOf(attempt, answered instanceof Response ? answered : undefined)));
|
|
153
155
|
}
|
|
154
156
|
}
|
|
@@ -159,20 +161,19 @@ function delayOf(attempt, response) {
|
|
|
159
161
|
return after * 1000;
|
|
160
162
|
return Math.min(8_000, 500 * 2 ** attempt) * (0.75 + Math.random() / 2);
|
|
161
163
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
164
|
+
const isJson = (response) => response.headers.get('content-type')?.includes('json') === true;
|
|
165
|
+
async function notTheApi(response, origin) {
|
|
166
|
+
await response.body?.cancel();
|
|
167
|
+
return new SandstormError(response.status, {
|
|
168
|
+
type: 'api_error',
|
|
169
|
+
code: 'not_the_api',
|
|
170
|
+
message: `${origin} answered ${response.status} with ${response.headers.get('content-type') ?? 'no content type'} instead of the API's JSON. If ${origin} is not the Sandstorm API, pass baseUrl or set SANDSTORM_API_URL.`,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
async function refusalOf(response, origin) {
|
|
174
|
+
if (!isJson(response))
|
|
175
|
+
return notTheApi(response, origin);
|
|
176
|
+
return new SandstormError(response.status, (await response.json()).error);
|
|
176
177
|
}
|
|
177
178
|
const HEX = /^[0-9a-f]{64}$/;
|
|
178
179
|
export async function verifyWebhook({ secret, body, signature, toleranceSeconds = 300, now = Date.now() }) {
|
package/dist/openapi.d.ts
CHANGED
|
@@ -459,7 +459,7 @@ export interface components {
|
|
|
459
459
|
*/
|
|
460
460
|
model: "nano-banana-pro/edit";
|
|
461
461
|
input: {
|
|
462
|
-
/** @description The change to make, or how the images come together,
|
|
462
|
+
/** @description The change to make, or how the images come together, citing each image by its place in images as @image1, @image2. */
|
|
463
463
|
prompt: string;
|
|
464
464
|
/**
|
|
465
465
|
* @description Shape of the image as width:height, or auto to follow the images given; auto when left out.
|
|
@@ -479,7 +479,7 @@ export interface components {
|
|
|
479
479
|
* @enum {string}
|
|
480
480
|
*/
|
|
481
481
|
output_format?: "png" | "jpeg" | "webp";
|
|
482
|
-
/** @description The 1 to 14 images to edit or combine, in the order the prompt
|
|
482
|
+
/** @description The 1 to 14 images to edit or combine, in the order the prompt cites them, each an asset id (asset_…) or an https URL. */
|
|
483
483
|
images: string[];
|
|
484
484
|
/** @description Integer seed for a more repeatable edit; random when left out. */
|
|
485
485
|
seed?: number;
|
|
@@ -543,7 +543,7 @@ export interface components {
|
|
|
543
543
|
*/
|
|
544
544
|
model: "nano-banana-2/edit";
|
|
545
545
|
input: {
|
|
546
|
-
/** @description The change to make, or how the images come together,
|
|
546
|
+
/** @description The change to make, or how the images come together, citing each image by its place in images as @image1, @image2. */
|
|
547
547
|
prompt: string;
|
|
548
548
|
/**
|
|
549
549
|
* @description Shape of the image as width:height, or auto to follow the images given; auto when left out.
|
|
@@ -563,7 +563,7 @@ export interface components {
|
|
|
563
563
|
* @enum {string}
|
|
564
564
|
*/
|
|
565
565
|
output_format?: "png" | "jpeg" | "webp";
|
|
566
|
-
/** @description The 1 to 14 images to edit or combine, in the order the prompt
|
|
566
|
+
/** @description The 1 to 14 images to edit or combine, in the order the prompt cites them, each an asset id (asset_…) or an https URL. */
|
|
567
567
|
images: string[];
|
|
568
568
|
/** @description Integer seed for a more repeatable edit; random when left out. */
|
|
569
569
|
seed?: number;
|
|
@@ -621,7 +621,7 @@ export interface components {
|
|
|
621
621
|
*/
|
|
622
622
|
model: "nano-banana-2-lite/edit";
|
|
623
623
|
input: {
|
|
624
|
-
/** @description The change to make, or how the images come together,
|
|
624
|
+
/** @description The change to make, or how the images come together, citing each image by its place in images as @image1, @image2. */
|
|
625
625
|
prompt: string;
|
|
626
626
|
/**
|
|
627
627
|
* @description Shape of the image as width:height, or auto to follow the images given; auto when left out.
|
|
@@ -635,7 +635,7 @@ export interface components {
|
|
|
635
635
|
* @enum {string}
|
|
636
636
|
*/
|
|
637
637
|
output_format?: "png" | "jpeg" | "webp";
|
|
638
|
-
/** @description The 1 to 14 images to edit or combine, in the order the prompt
|
|
638
|
+
/** @description The 1 to 14 images to edit or combine, in the order the prompt cites them, each an asset id (asset_…) or an https URL. */
|
|
639
639
|
images: string[];
|
|
640
640
|
/** @description Integer seed for a more repeatable edit; random when left out. */
|
|
641
641
|
seed?: number;
|
|
@@ -709,7 +709,7 @@ export interface components {
|
|
|
709
709
|
*/
|
|
710
710
|
model: "gpt-image-2.5-flare/edit";
|
|
711
711
|
input: {
|
|
712
|
-
/** @description The change to make, or how the images come together,
|
|
712
|
+
/** @description The change to make, or how the images come together, citing each image by its place in images as @image1, @image2 and writing out exactly any words the image must show. */
|
|
713
713
|
prompt: string;
|
|
714
714
|
/**
|
|
715
715
|
* @description Shape of the image as width:height, or auto to let the model pick the size; auto when left out.
|
|
@@ -739,7 +739,7 @@ export interface components {
|
|
|
739
739
|
* @enum {string}
|
|
740
740
|
*/
|
|
741
741
|
output_format?: "png" | "jpeg" | "webp";
|
|
742
|
-
/** @description The 1 to 16 images to edit or combine, in the order the prompt
|
|
742
|
+
/** @description The 1 to 16 images to edit or combine, in the order the prompt cites them, each an asset id (asset_…) or an https URL. */
|
|
743
743
|
images: string[];
|
|
744
744
|
/** @description An image the size of the first of images, as an asset id (asset_…) or an https URL, with an alpha channel that is fully transparent where that image should change; the model takes it as guidance, so the rest can shift slightly. None when left out, so the prompt alone scopes the change. */
|
|
745
745
|
mask?: string;
|
|
@@ -813,7 +813,7 @@ export interface components {
|
|
|
813
813
|
*/
|
|
814
814
|
model: "gpt-image-2.5-sunburst/edit";
|
|
815
815
|
input: {
|
|
816
|
-
/** @description The change to make, or how the images come together,
|
|
816
|
+
/** @description The change to make, or how the images come together, citing each image by its place in images as @image1, @image2 and writing out exactly any words the image must show. */
|
|
817
817
|
prompt: string;
|
|
818
818
|
/**
|
|
819
819
|
* @description Shape of the image as width:height, or auto to let the model pick the size; auto when left out.
|
|
@@ -843,7 +843,7 @@ export interface components {
|
|
|
843
843
|
* @enum {string}
|
|
844
844
|
*/
|
|
845
845
|
output_format?: "png" | "jpeg" | "webp";
|
|
846
|
-
/** @description The 1 to 16 images to edit or combine, in the order the prompt
|
|
846
|
+
/** @description The 1 to 16 images to edit or combine, in the order the prompt cites them, each an asset id (asset_…) or an https URL. */
|
|
847
847
|
images: string[];
|
|
848
848
|
/** @description An image the size of the first of images, as an asset id (asset_…) or an https URL, with an alpha channel that is fully transparent where that image should change; the model takes it as guidance, so the rest can shift slightly. None when left out, so the prompt alone scopes the change. */
|
|
849
849
|
mask?: string;
|
|
@@ -907,7 +907,7 @@ export interface components {
|
|
|
907
907
|
*/
|
|
908
908
|
model: "seedream-5-pro/edit";
|
|
909
909
|
input: {
|
|
910
|
-
/** @description The change to make as one paragraph, at most 600 words,
|
|
910
|
+
/** @description The change to make as one paragraph, at most 600 words, citing each image by its place in images as @image1, @image2, with the exact words the result must show written out. */
|
|
911
911
|
prompt: string;
|
|
912
912
|
/**
|
|
913
913
|
* @description Shape of the result as width:height, or auto to keep the shape the images suggest; auto when left out.
|
|
@@ -927,7 +927,7 @@ export interface components {
|
|
|
927
927
|
* @enum {string}
|
|
928
928
|
*/
|
|
929
929
|
output_format?: "png" | "jpeg";
|
|
930
|
-
/** @description The images to edit or combine, in the order the prompt
|
|
930
|
+
/** @description The images to edit or combine, in the order the prompt cites them, at most 10, each an asset id (asset_…) or an https URL. */
|
|
931
931
|
images: string[];
|
|
932
932
|
/** @description What the output is called in your library; made from the prompt when left out. */
|
|
933
933
|
name?: string;
|
|
@@ -983,7 +983,7 @@ export interface components {
|
|
|
983
983
|
*/
|
|
984
984
|
model: "seedream-5-lite/edit";
|
|
985
985
|
input: {
|
|
986
|
-
/** @description The change to make as one paragraph, at most 600 words,
|
|
986
|
+
/** @description The change to make as one paragraph, at most 600 words, citing each image by its place in images as @image1, @image2, with the exact words the result must show written out. */
|
|
987
987
|
prompt: string;
|
|
988
988
|
/**
|
|
989
989
|
* @description Shape of the result as width:height, or auto to keep the shape the images suggest; auto when left out.
|
|
@@ -997,7 +997,7 @@ export interface components {
|
|
|
997
997
|
* @enum {string}
|
|
998
998
|
*/
|
|
999
999
|
resolution?: "2K" | "3K" | "4K";
|
|
1000
|
-
/** @description The images to edit or combine, in the order the prompt
|
|
1000
|
+
/** @description The images to edit or combine, in the order the prompt cites them, at most 14, each an asset id (asset_…) or an https URL. */
|
|
1001
1001
|
images: string[];
|
|
1002
1002
|
/** @description What the output is called in your library; made from the prompt when left out. */
|
|
1003
1003
|
name?: string;
|
|
@@ -1238,7 +1238,7 @@ export interface components {
|
|
|
1238
1238
|
*/
|
|
1239
1239
|
model: "seedance-2.5/reference-to-video";
|
|
1240
1240
|
input: {
|
|
1241
|
-
/** @description What happens in the clip, citing each image, video or audio by its place in its list as @
|
|
1241
|
+
/** @description What happens in the clip, citing each image, video or audio by its place in its list as @image1, @video1 or @audio1. */
|
|
1242
1242
|
prompt: string;
|
|
1243
1243
|
/**
|
|
1244
1244
|
* @description reference makes a new clip from the references, editing changes the first of videos, extension continues it; auto when left out, which lets the model decide.
|
|
@@ -1252,12 +1252,12 @@ export interface components {
|
|
|
1252
1252
|
*/
|
|
1253
1253
|
images?: string[];
|
|
1254
1254
|
/**
|
|
1255
|
-
* @description Up to 10 videos,
|
|
1255
|
+
* @description Up to 10 videos, each an asset id (asset_…) or an https URL; none when left out. Past 30 seconds together the longer ones are cut to their opening seconds, and beside audio their own sound is left out; editing and extension take them whole, so those must run 30 seconds or less together.
|
|
1256
1256
|
* @default []
|
|
1257
1257
|
*/
|
|
1258
1258
|
videos?: string[];
|
|
1259
1259
|
/**
|
|
1260
|
-
* @description Up to 10
|
|
1260
|
+
* @description Up to 10 audio files, each an asset id (asset_…) or an https URL; none when left out. Past 30 seconds together the longer ones are cut to their opening seconds.
|
|
1261
1261
|
* @default []
|
|
1262
1262
|
*/
|
|
1263
1263
|
audio?: string[];
|
|
@@ -1428,12 +1428,12 @@ export interface components {
|
|
|
1428
1428
|
/** @description The image the clip ends on, as an asset id (asset_…) or an https URL; none when left out, so the model picks the ending. */
|
|
1429
1429
|
end_image?: string;
|
|
1430
1430
|
/**
|
|
1431
|
-
* @description Up to 4 images whose subject or look the clip keeps, each an asset id (asset_…) or an https URL, cited in the prompt as @
|
|
1431
|
+
* @description Up to 4 images whose subject or look the clip keeps, each an asset id (asset_…) or an https URL, cited in the prompt as @image1, @image2 in this order; none when left out.
|
|
1432
1432
|
* @default []
|
|
1433
1433
|
*/
|
|
1434
1434
|
images?: string[];
|
|
1435
1435
|
/**
|
|
1436
|
-
* @description Characters or objects held to one look across the clip, cited in the prompt as @
|
|
1436
|
+
* @description Characters or objects held to one look across the clip, cited in the prompt as @element1, @element2 in this order; images and elements take 4 together at most, and none when left out.
|
|
1437
1437
|
* @default []
|
|
1438
1438
|
*/
|
|
1439
1439
|
elements?: ({
|
|
@@ -1442,7 +1442,7 @@ export interface components {
|
|
|
1442
1442
|
/** @description 1 to 3 more views of the same character or object, from other angles, each an asset id (asset_…) or an https URL. */
|
|
1443
1443
|
reference_images: string[];
|
|
1444
1444
|
} | {
|
|
1445
|
-
/** @description A clip of the character or object
|
|
1445
|
+
/** @description A clip of the character or object of at least 3 seconds, as an asset id (asset_…) or an https URL, in place of images; past 10 seconds it is cut to its opening 10, and outside 720 to 2160 px a side it is resized to fit. */
|
|
1446
1446
|
video: string;
|
|
1447
1447
|
})[];
|
|
1448
1448
|
/**
|
|
@@ -1566,7 +1566,7 @@ export interface components {
|
|
|
1566
1566
|
*/
|
|
1567
1567
|
model: "gemini-omni-flash/reference-to-video";
|
|
1568
1568
|
input: {
|
|
1569
|
-
/** @description What happens in the clip, citing each image or video
|
|
1569
|
+
/** @description What happens in the clip, citing each image or video by its place in its list as @image1 or @video1, with any spoken line in double quotes. */
|
|
1570
1570
|
prompt: string;
|
|
1571
1571
|
/**
|
|
1572
1572
|
* @description Up to 10 images of the faces, products or places to keep, each an asset id (asset_…) or an https URL; none when left out.
|
|
@@ -1574,7 +1574,7 @@ export interface components {
|
|
|
1574
1574
|
*/
|
|
1575
1575
|
images?: string[];
|
|
1576
1576
|
/**
|
|
1577
|
-
* @description Up to 3 videos
|
|
1577
|
+
* @description Up to 3 videos for a likeness or a motion to copy, whose sound is ignored, each an asset id (asset_…) or an https URL and cut to its opening 3 seconds when longer; none when left out.
|
|
1578
1578
|
* @default []
|
|
1579
1579
|
*/
|
|
1580
1580
|
videos?: string[];
|
|
@@ -1952,10 +1952,12 @@ export interface components {
|
|
|
1952
1952
|
/** @description What one rate is for: an image, a second, a minute, a character, a request or a token */
|
|
1953
1953
|
unit: string;
|
|
1954
1954
|
usd: number;
|
|
1955
|
-
/** @description The input
|
|
1955
|
+
/** @description The inputs, by their names in input, that this rate applies to; a media input is true when given and false when not; empty when it applies to all. A rate charged on the input itself carries `input`: the tokens of text or image, or true for an input file it charges for */
|
|
1956
1956
|
when: {
|
|
1957
1957
|
[key: string]: unknown;
|
|
1958
1958
|
};
|
|
1959
|
+
/** @description Whether a generation that leaves these inputs at their defaults pays this rate */
|
|
1960
|
+
default: boolean;
|
|
1959
1961
|
}[];
|
|
1960
1962
|
};
|
|
1961
1963
|
/** @description The JSON Schema of `input` */
|
|
@@ -2027,10 +2029,7 @@ export interface components {
|
|
|
2027
2029
|
Brand: {
|
|
2028
2030
|
/** @enum {string} */
|
|
2029
2031
|
object: "brand";
|
|
2030
|
-
/**
|
|
2031
|
-
* Format: uuid
|
|
2032
|
-
* @description Send it as `Sandstorm-Brand` to work on this brand with a key made on another
|
|
2033
|
-
*/
|
|
2032
|
+
/** @description Send it as `Sandstorm-Brand` to work on this brand with a key made on another */
|
|
2034
2033
|
id: string;
|
|
2035
2034
|
name: string;
|
|
2036
2035
|
summary: string | null;
|
|
@@ -2797,7 +2796,7 @@ export interface operations {
|
|
|
2797
2796
|
requestBody: {
|
|
2798
2797
|
content: {
|
|
2799
2798
|
"application/json": {
|
|
2800
|
-
/** @description A public https link to a png, jpeg, webp, mp4, mov, mp3 or
|
|
2799
|
+
/** @description A public https link to a png, jpeg, webp, mp4, mov, mp3, m4a or wav file */
|
|
2801
2800
|
url: string;
|
|
2802
2801
|
/** @description What the file is called in your library */
|
|
2803
2802
|
name?: string;
|
package/openapi.json
CHANGED
|
@@ -294,7 +294,7 @@
|
|
|
294
294
|
"type": "string",
|
|
295
295
|
"minLength": 3,
|
|
296
296
|
"maxLength": 50000,
|
|
297
|
-
"description": "The change to make, or how the images come together,
|
|
297
|
+
"description": "The change to make, or how the images come together, citing each image by its place in images as @image1, @image2."
|
|
298
298
|
},
|
|
299
299
|
"aspect_ratio": {
|
|
300
300
|
"default": "auto",
|
|
@@ -341,7 +341,7 @@
|
|
|
341
341
|
"items": {
|
|
342
342
|
"type": "string"
|
|
343
343
|
},
|
|
344
|
-
"description": "The 1 to 14 images to edit or combine, in the order the prompt
|
|
344
|
+
"description": "The 1 to 14 images to edit or combine, in the order the prompt cites them, each an asset id (asset_…) or an https URL."
|
|
345
345
|
},
|
|
346
346
|
"seed": {
|
|
347
347
|
"description": "Integer seed for a more repeatable edit; random when left out.",
|
|
@@ -475,7 +475,7 @@
|
|
|
475
475
|
"type": "string",
|
|
476
476
|
"minLength": 3,
|
|
477
477
|
"maxLength": 50000,
|
|
478
|
-
"description": "The change to make, or how the images come together,
|
|
478
|
+
"description": "The change to make, or how the images come together, citing each image by its place in images as @image1, @image2."
|
|
479
479
|
},
|
|
480
480
|
"aspect_ratio": {
|
|
481
481
|
"default": "auto",
|
|
@@ -526,7 +526,7 @@
|
|
|
526
526
|
"items": {
|
|
527
527
|
"type": "string"
|
|
528
528
|
},
|
|
529
|
-
"description": "The 1 to 14 images to edit or combine, in the order the prompt
|
|
529
|
+
"description": "The 1 to 14 images to edit or combine, in the order the prompt cites them, each an asset id (asset_…) or an https URL."
|
|
530
530
|
},
|
|
531
531
|
"seed": {
|
|
532
532
|
"description": "Integer seed for a more repeatable edit; random when left out.",
|
|
@@ -650,7 +650,7 @@
|
|
|
650
650
|
"type": "string",
|
|
651
651
|
"minLength": 3,
|
|
652
652
|
"maxLength": 50000,
|
|
653
|
-
"description": "The change to make, or how the images come together,
|
|
653
|
+
"description": "The change to make, or how the images come together, citing each image by its place in images as @image1, @image2."
|
|
654
654
|
},
|
|
655
655
|
"aspect_ratio": {
|
|
656
656
|
"default": "auto",
|
|
@@ -691,7 +691,7 @@
|
|
|
691
691
|
"items": {
|
|
692
692
|
"type": "string"
|
|
693
693
|
},
|
|
694
|
-
"description": "The 1 to 14 images to edit or combine, in the order the prompt
|
|
694
|
+
"description": "The 1 to 14 images to edit or combine, in the order the prompt cites them, each an asset id (asset_…) or an https URL."
|
|
695
695
|
},
|
|
696
696
|
"seed": {
|
|
697
697
|
"description": "Integer seed for a more repeatable edit; random when left out.",
|
|
@@ -843,7 +843,7 @@
|
|
|
843
843
|
"type": "string",
|
|
844
844
|
"minLength": 1,
|
|
845
845
|
"maxLength": 32000,
|
|
846
|
-
"description": "The change to make, or how the images come together,
|
|
846
|
+
"description": "The change to make, or how the images come together, citing each image by its place in images as @image1, @image2 and writing out exactly any words the image must show."
|
|
847
847
|
},
|
|
848
848
|
"aspect_ratio": {
|
|
849
849
|
"default": "auto",
|
|
@@ -912,7 +912,7 @@
|
|
|
912
912
|
"items": {
|
|
913
913
|
"type": "string"
|
|
914
914
|
},
|
|
915
|
-
"description": "The 1 to 16 images to edit or combine, in the order the prompt
|
|
915
|
+
"description": "The 1 to 16 images to edit or combine, in the order the prompt cites them, each an asset id (asset_…) or an https URL."
|
|
916
916
|
},
|
|
917
917
|
"mask": {
|
|
918
918
|
"type": "string",
|
|
@@ -1062,7 +1062,7 @@
|
|
|
1062
1062
|
"type": "string",
|
|
1063
1063
|
"minLength": 1,
|
|
1064
1064
|
"maxLength": 32000,
|
|
1065
|
-
"description": "The change to make, or how the images come together,
|
|
1065
|
+
"description": "The change to make, or how the images come together, citing each image by its place in images as @image1, @image2 and writing out exactly any words the image must show."
|
|
1066
1066
|
},
|
|
1067
1067
|
"aspect_ratio": {
|
|
1068
1068
|
"default": "auto",
|
|
@@ -1131,7 +1131,7 @@
|
|
|
1131
1131
|
"items": {
|
|
1132
1132
|
"type": "string"
|
|
1133
1133
|
},
|
|
1134
|
-
"description": "The 1 to 16 images to edit or combine, in the order the prompt
|
|
1134
|
+
"description": "The 1 to 16 images to edit or combine, in the order the prompt cites them, each an asset id (asset_…) or an https URL."
|
|
1135
1135
|
},
|
|
1136
1136
|
"mask": {
|
|
1137
1137
|
"type": "string",
|
|
@@ -1255,7 +1255,7 @@
|
|
|
1255
1255
|
"prompt": {
|
|
1256
1256
|
"type": "string",
|
|
1257
1257
|
"minLength": 3,
|
|
1258
|
-
"description": "The change to make as one paragraph, at most 600 words,
|
|
1258
|
+
"description": "The change to make as one paragraph, at most 600 words, citing each image by its place in images as @image1, @image2, with the exact words the result must show written out."
|
|
1259
1259
|
},
|
|
1260
1260
|
"aspect_ratio": {
|
|
1261
1261
|
"default": "auto",
|
|
@@ -1300,7 +1300,7 @@
|
|
|
1300
1300
|
"items": {
|
|
1301
1301
|
"type": "string"
|
|
1302
1302
|
},
|
|
1303
|
-
"description": "The images to edit or combine, in the order the prompt
|
|
1303
|
+
"description": "The images to edit or combine, in the order the prompt cites them, at most 10, each an asset id (asset_…) or an https URL."
|
|
1304
1304
|
},
|
|
1305
1305
|
"name": {
|
|
1306
1306
|
"type": "string",
|
|
@@ -1412,7 +1412,7 @@
|
|
|
1412
1412
|
"prompt": {
|
|
1413
1413
|
"type": "string",
|
|
1414
1414
|
"minLength": 3,
|
|
1415
|
-
"description": "The change to make as one paragraph, at most 600 words,
|
|
1415
|
+
"description": "The change to make as one paragraph, at most 600 words, citing each image by its place in images as @image1, @image2, with the exact words the result must show written out."
|
|
1416
1416
|
},
|
|
1417
1417
|
"aspect_ratio": {
|
|
1418
1418
|
"default": "auto",
|
|
@@ -1449,7 +1449,7 @@
|
|
|
1449
1449
|
"items": {
|
|
1450
1450
|
"type": "string"
|
|
1451
1451
|
},
|
|
1452
|
-
"description": "The images to edit or combine, in the order the prompt
|
|
1452
|
+
"description": "The images to edit or combine, in the order the prompt cites them, at most 14, each an asset id (asset_…) or an https URL."
|
|
1453
1453
|
},
|
|
1454
1454
|
"name": {
|
|
1455
1455
|
"type": "string",
|
|
@@ -1868,7 +1868,7 @@
|
|
|
1868
1868
|
"type": "string",
|
|
1869
1869
|
"minLength": 3,
|
|
1870
1870
|
"maxLength": 50000,
|
|
1871
|
-
"description": "What happens in the clip, citing each image, video or audio by its place in its list as @
|
|
1871
|
+
"description": "What happens in the clip, citing each image, video or audio by its place in its list as @image1, @video1 or @audio1."
|
|
1872
1872
|
},
|
|
1873
1873
|
"task": {
|
|
1874
1874
|
"default": "auto",
|
|
@@ -1892,7 +1892,7 @@
|
|
|
1892
1892
|
},
|
|
1893
1893
|
"videos": {
|
|
1894
1894
|
"default": [],
|
|
1895
|
-
"description": "Up to 10 videos,
|
|
1895
|
+
"description": "Up to 10 videos, each an asset id (asset_…) or an https URL; none when left out. Past 30 seconds together the longer ones are cut to their opening seconds, and beside audio their own sound is left out; editing and extension take them whole, so those must run 30 seconds or less together.",
|
|
1896
1896
|
"maxItems": 10,
|
|
1897
1897
|
"type": "array",
|
|
1898
1898
|
"items": {
|
|
@@ -1901,7 +1901,7 @@
|
|
|
1901
1901
|
},
|
|
1902
1902
|
"audio": {
|
|
1903
1903
|
"default": [],
|
|
1904
|
-
"description": "Up to 10
|
|
1904
|
+
"description": "Up to 10 audio files, each an asset id (asset_…) or an https URL; none when left out. Past 30 seconds together the longer ones are cut to their opening seconds.",
|
|
1905
1905
|
"maxItems": 10,
|
|
1906
1906
|
"type": "array",
|
|
1907
1907
|
"items": {
|
|
@@ -2227,7 +2227,7 @@
|
|
|
2227
2227
|
},
|
|
2228
2228
|
"images": {
|
|
2229
2229
|
"default": [],
|
|
2230
|
-
"description": "Up to 4 images whose subject or look the clip keeps, each an asset id (asset_…) or an https URL, cited in the prompt as @
|
|
2230
|
+
"description": "Up to 4 images whose subject or look the clip keeps, each an asset id (asset_…) or an https URL, cited in the prompt as @image1, @image2 in this order; none when left out.",
|
|
2231
2231
|
"maxItems": 4,
|
|
2232
2232
|
"type": "array",
|
|
2233
2233
|
"items": {
|
|
@@ -2236,7 +2236,7 @@
|
|
|
2236
2236
|
},
|
|
2237
2237
|
"elements": {
|
|
2238
2238
|
"default": [],
|
|
2239
|
-
"description": "Characters or objects held to one look across the clip, cited in the prompt as @
|
|
2239
|
+
"description": "Characters or objects held to one look across the clip, cited in the prompt as @element1, @element2 in this order; images and elements take 4 together at most, and none when left out.",
|
|
2240
2240
|
"maxItems": 4,
|
|
2241
2241
|
"type": "array",
|
|
2242
2242
|
"items": {
|
|
@@ -2269,7 +2269,7 @@
|
|
|
2269
2269
|
"properties": {
|
|
2270
2270
|
"video": {
|
|
2271
2271
|
"type": "string",
|
|
2272
|
-
"description": "A clip of the character or object
|
|
2272
|
+
"description": "A clip of the character or object of at least 3 seconds, as an asset id (asset_…) or an https URL, in place of images; past 10 seconds it is cut to its opening 10, and outside 720 to 2160 px a side it is resized to fit."
|
|
2273
2273
|
}
|
|
2274
2274
|
},
|
|
2275
2275
|
"required": [
|
|
@@ -2497,7 +2497,7 @@
|
|
|
2497
2497
|
"type": "string",
|
|
2498
2498
|
"minLength": 3,
|
|
2499
2499
|
"maxLength": 20000,
|
|
2500
|
-
"description": "What happens in the clip, citing each image or video
|
|
2500
|
+
"description": "What happens in the clip, citing each image or video by its place in its list as @image1 or @video1, with any spoken line in double quotes."
|
|
2501
2501
|
},
|
|
2502
2502
|
"images": {
|
|
2503
2503
|
"default": [],
|
|
@@ -2510,7 +2510,7 @@
|
|
|
2510
2510
|
},
|
|
2511
2511
|
"videos": {
|
|
2512
2512
|
"default": [],
|
|
2513
|
-
"description": "Up to 3 videos
|
|
2513
|
+
"description": "Up to 3 videos for a likeness or a motion to copy, whose sound is ignored, each an asset id (asset_…) or an https URL and cut to its opening 3 seconds when longer; none when left out.",
|
|
2514
2514
|
"maxItems": 3,
|
|
2515
2515
|
"type": "array",
|
|
2516
2516
|
"items": {
|
|
@@ -3180,10 +3180,10 @@
|
|
|
3180
3180
|
"type": "string"
|
|
3181
3181
|
},
|
|
3182
3182
|
"width": {
|
|
3183
|
-
"type": "
|
|
3183
|
+
"type": "integer"
|
|
3184
3184
|
},
|
|
3185
3185
|
"height": {
|
|
3186
|
-
"type": "
|
|
3186
|
+
"type": "integer"
|
|
3187
3187
|
},
|
|
3188
3188
|
"duration": {
|
|
3189
3189
|
"type": "number"
|
|
@@ -3390,13 +3390,18 @@
|
|
|
3390
3390
|
"when": {
|
|
3391
3391
|
"type": "object",
|
|
3392
3392
|
"additionalProperties": {},
|
|
3393
|
-
"description": "The input
|
|
3393
|
+
"description": "The inputs, by their names in input, that this rate applies to; a media input is true when given and false when not; empty when it applies to all. A rate charged on the input itself carries `input`: the tokens of text or image, or true for an input file it charges for"
|
|
3394
|
+
},
|
|
3395
|
+
"default": {
|
|
3396
|
+
"type": "boolean",
|
|
3397
|
+
"description": "Whether a generation that leaves these inputs at their defaults pays this rate"
|
|
3394
3398
|
}
|
|
3395
3399
|
},
|
|
3396
3400
|
"required": [
|
|
3397
3401
|
"unit",
|
|
3398
3402
|
"usd",
|
|
3399
|
-
"when"
|
|
3403
|
+
"when",
|
|
3404
|
+
"default"
|
|
3400
3405
|
]
|
|
3401
3406
|
}
|
|
3402
3407
|
}
|
|
@@ -3575,10 +3580,10 @@
|
|
|
3575
3580
|
]
|
|
3576
3581
|
},
|
|
3577
3582
|
"width": {
|
|
3578
|
-
"type": "
|
|
3583
|
+
"type": "integer"
|
|
3579
3584
|
},
|
|
3580
3585
|
"height": {
|
|
3581
|
-
"type": "
|
|
3586
|
+
"type": "integer"
|
|
3582
3587
|
},
|
|
3583
3588
|
"duration": {
|
|
3584
3589
|
"type": "number"
|
|
@@ -3657,10 +3662,10 @@
|
|
|
3657
3662
|
]
|
|
3658
3663
|
},
|
|
3659
3664
|
"width": {
|
|
3660
|
-
"type": "
|
|
3665
|
+
"type": "integer"
|
|
3661
3666
|
},
|
|
3662
3667
|
"height": {
|
|
3663
|
-
"type": "
|
|
3668
|
+
"type": "integer"
|
|
3664
3669
|
},
|
|
3665
3670
|
"duration": {
|
|
3666
3671
|
"type": "number"
|
|
@@ -3686,7 +3691,6 @@
|
|
|
3686
3691
|
},
|
|
3687
3692
|
"id": {
|
|
3688
3693
|
"type": "string",
|
|
3689
|
-
"format": "uuid",
|
|
3690
3694
|
"description": "Send it as `Sandstorm-Brand` to work on this brand with a key made on another"
|
|
3691
3695
|
},
|
|
3692
3696
|
"name": {
|
|
@@ -3953,13 +3957,13 @@
|
|
|
3953
3957
|
},
|
|
3954
3958
|
"width": {
|
|
3955
3959
|
"type": [
|
|
3956
|
-
"
|
|
3960
|
+
"integer",
|
|
3957
3961
|
"null"
|
|
3958
3962
|
]
|
|
3959
3963
|
},
|
|
3960
3964
|
"height": {
|
|
3961
3965
|
"type": [
|
|
3962
|
-
"
|
|
3966
|
+
"integer",
|
|
3963
3967
|
"null"
|
|
3964
3968
|
]
|
|
3965
3969
|
},
|
|
@@ -4169,13 +4173,13 @@
|
|
|
4169
4173
|
},
|
|
4170
4174
|
"width": {
|
|
4171
4175
|
"type": [
|
|
4172
|
-
"
|
|
4176
|
+
"integer",
|
|
4173
4177
|
"null"
|
|
4174
4178
|
]
|
|
4175
4179
|
},
|
|
4176
4180
|
"height": {
|
|
4177
4181
|
"type": [
|
|
4178
|
-
"
|
|
4182
|
+
"integer",
|
|
4179
4183
|
"null"
|
|
4180
4184
|
]
|
|
4181
4185
|
},
|
|
@@ -4243,13 +4247,13 @@
|
|
|
4243
4247
|
},
|
|
4244
4248
|
"width": {
|
|
4245
4249
|
"type": [
|
|
4246
|
-
"
|
|
4250
|
+
"integer",
|
|
4247
4251
|
"null"
|
|
4248
4252
|
]
|
|
4249
4253
|
},
|
|
4250
4254
|
"height": {
|
|
4251
4255
|
"type": [
|
|
4252
|
-
"
|
|
4256
|
+
"integer",
|
|
4253
4257
|
"null"
|
|
4254
4258
|
]
|
|
4255
4259
|
},
|
|
@@ -5792,7 +5796,7 @@
|
|
|
5792
5796
|
"properties": {
|
|
5793
5797
|
"url": {
|
|
5794
5798
|
"type": "string",
|
|
5795
|
-
"description": "A public https link to a png, jpeg, webp, mp4, mov, mp3 or
|
|
5799
|
+
"description": "A public https link to a png, jpeg, webp, mp4, mov, mp3, m4a or wav file"
|
|
5796
5800
|
},
|
|
5797
5801
|
"name": {
|
|
5798
5802
|
"type": "string",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sandstormapp/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "The ads.dev API for Node, Deno, Bun and edge runtimes: image, video and audio generation on your brand, the brand kit and library, and competitor ads",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ads.dev",
|