openai 6.13.0 → 6.14.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/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/resources/images.d.mts +70 -47
- package/resources/images.d.mts.map +1 -1
- package/resources/images.d.ts +70 -47
- package/resources/images.d.ts.map +1 -1
- package/resources/responses/responses.d.mts +2 -2
- package/resources/responses/responses.d.mts.map +1 -1
- package/resources/responses/responses.d.ts +2 -2
- package/resources/responses/responses.d.ts.map +1 -1
- package/src/resources/images.ts +73 -47
- package/src/resources/responses/responses.ts +2 -2
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 6.14.0 (2025-12-16)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v6.13.0...v6.14.0](https://github.com/openai/openai-node/compare/v6.13.0...v6.14.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** gpt-image-1.5 ([6c1ac1d](https://github.com/openai/openai-node/commit/6c1ac1d8a2947c59f38aabaf07795a244c45a688))
|
|
10
|
+
|
|
3
11
|
## 6.13.0 (2025-12-15)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v6.12.0...v6.13.0](https://github.com/openai/openai-node/compare/v6.12.0...v6.13.0)
|
package/package.json
CHANGED
package/resources/images.d.mts
CHANGED
|
@@ -51,9 +51,9 @@ export declare class Images extends APIResource {
|
|
|
51
51
|
*/
|
|
52
52
|
export interface Image {
|
|
53
53
|
/**
|
|
54
|
-
* The base64-encoded JSON of the generated image.
|
|
55
|
-
* and only present if `response_format` is set to `b64_json` for
|
|
56
|
-
* `dall-e-3`.
|
|
54
|
+
* The base64-encoded JSON of the generated image. Returned by default for the GPT
|
|
55
|
+
* image models, and only present if `response_format` is set to `b64_json` for
|
|
56
|
+
* `dall-e-2` and `dall-e-3`.
|
|
57
57
|
*/
|
|
58
58
|
b64_json?: string;
|
|
59
59
|
/**
|
|
@@ -62,8 +62,8 @@ export interface Image {
|
|
|
62
62
|
revised_prompt?: string;
|
|
63
63
|
/**
|
|
64
64
|
* When using `dall-e-2` or `dall-e-3`, the URL of the generated image if
|
|
65
|
-
* `response_format` is set to `url` (default value). Unsupported for
|
|
66
|
-
*
|
|
65
|
+
* `response_format` is set to `url` (default value). Unsupported for the GPT image
|
|
66
|
+
* models.
|
|
67
67
|
*/
|
|
68
68
|
url?: string;
|
|
69
69
|
}
|
|
@@ -100,13 +100,15 @@ export interface ImageEditCompletedEvent {
|
|
|
100
100
|
*/
|
|
101
101
|
type: 'image_edit.completed';
|
|
102
102
|
/**
|
|
103
|
-
* For
|
|
103
|
+
* For the GPT image models only, the token usage information for the image
|
|
104
|
+
* generation.
|
|
104
105
|
*/
|
|
105
106
|
usage: ImageEditCompletedEvent.Usage;
|
|
106
107
|
}
|
|
107
108
|
export declare namespace ImageEditCompletedEvent {
|
|
108
109
|
/**
|
|
109
|
-
* For
|
|
110
|
+
* For the GPT image models only, the token usage information for the image
|
|
111
|
+
* generation.
|
|
110
112
|
*/
|
|
111
113
|
interface Usage {
|
|
112
114
|
/**
|
|
@@ -216,13 +218,15 @@ export interface ImageGenCompletedEvent {
|
|
|
216
218
|
*/
|
|
217
219
|
type: 'image_generation.completed';
|
|
218
220
|
/**
|
|
219
|
-
* For
|
|
221
|
+
* For the GPT image models only, the token usage information for the image
|
|
222
|
+
* generation.
|
|
220
223
|
*/
|
|
221
224
|
usage: ImageGenCompletedEvent.Usage;
|
|
222
225
|
}
|
|
223
226
|
export declare namespace ImageGenCompletedEvent {
|
|
224
227
|
/**
|
|
225
|
-
* For
|
|
228
|
+
* For the GPT image models only, the token usage information for the image
|
|
229
|
+
* generation.
|
|
226
230
|
*/
|
|
227
231
|
interface Usage {
|
|
228
232
|
/**
|
|
@@ -299,7 +303,7 @@ export interface ImageGenPartialImageEvent {
|
|
|
299
303
|
* Emitted when a partial image is available during image generation streaming.
|
|
300
304
|
*/
|
|
301
305
|
export type ImageGenStreamEvent = ImageGenPartialImageEvent | ImageGenCompletedEvent;
|
|
302
|
-
export type ImageModel = 'dall-e-2' | 'dall-e-3' | 'gpt-image-1' | 'gpt-image-1-mini';
|
|
306
|
+
export type ImageModel = 'gpt-image-1.5' | 'dall-e-2' | 'dall-e-3' | 'gpt-image-1' | 'gpt-image-1-mini';
|
|
303
307
|
/**
|
|
304
308
|
* The response from the image generation endpoint.
|
|
305
309
|
*/
|
|
@@ -356,6 +360,10 @@ export declare namespace ImagesResponse {
|
|
|
356
360
|
* The total number of tokens (images and text) used for the image generation.
|
|
357
361
|
*/
|
|
358
362
|
total_tokens: number;
|
|
363
|
+
/**
|
|
364
|
+
* The output token details for the image generation.
|
|
365
|
+
*/
|
|
366
|
+
output_tokens_details?: Usage.OutputTokensDetails;
|
|
359
367
|
}
|
|
360
368
|
namespace Usage {
|
|
361
369
|
/**
|
|
@@ -371,6 +379,19 @@ export declare namespace ImagesResponse {
|
|
|
371
379
|
*/
|
|
372
380
|
text_tokens: number;
|
|
373
381
|
}
|
|
382
|
+
/**
|
|
383
|
+
* The output token details for the image generation.
|
|
384
|
+
*/
|
|
385
|
+
interface OutputTokensDetails {
|
|
386
|
+
/**
|
|
387
|
+
* The number of image output tokens generated by the model.
|
|
388
|
+
*/
|
|
389
|
+
image_tokens: number;
|
|
390
|
+
/**
|
|
391
|
+
* The number of text output tokens generated by the model.
|
|
392
|
+
*/
|
|
393
|
+
text_tokens: number;
|
|
394
|
+
}
|
|
374
395
|
}
|
|
375
396
|
}
|
|
376
397
|
export interface ImageCreateVariationParams {
|
|
@@ -411,7 +432,8 @@ export interface ImageEditParamsBase {
|
|
|
411
432
|
/**
|
|
412
433
|
* The image(s) to edit. Must be a supported image file or an array of images.
|
|
413
434
|
*
|
|
414
|
-
* For `gpt-image-1`,
|
|
435
|
+
* For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and
|
|
436
|
+
* `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg` file less than
|
|
415
437
|
* 50MB. You can provide up to 16 images.
|
|
416
438
|
*
|
|
417
439
|
* For `dall-e-2`, you can only provide one image, and it should be a square `png`
|
|
@@ -420,14 +442,14 @@ export interface ImageEditParamsBase {
|
|
|
420
442
|
image: Uploadable | Array<Uploadable>;
|
|
421
443
|
/**
|
|
422
444
|
* A text description of the desired image(s). The maximum length is 1000
|
|
423
|
-
* characters for `dall-e-2`, and 32000 characters for
|
|
445
|
+
* characters for `dall-e-2`, and 32000 characters for the GPT image models.
|
|
424
446
|
*/
|
|
425
447
|
prompt: string;
|
|
426
448
|
/**
|
|
427
449
|
* Allows to set transparency for the background of the generated image(s). This
|
|
428
|
-
* parameter is only supported for
|
|
429
|
-
* `opaque` or `auto` (default value). When `auto` is used, the
|
|
430
|
-
* automatically determine the best background for the image.
|
|
450
|
+
* parameter is only supported for the GPT image models. Must be one of
|
|
451
|
+
* `transparent`, `opaque` or `auto` (default value). When `auto` is used, the
|
|
452
|
+
* model will automatically determine the best background for the image.
|
|
431
453
|
*
|
|
432
454
|
* If `transparent`, the output format needs to support transparency, so it should
|
|
433
455
|
* be set to either `png` (default value) or `webp`.
|
|
@@ -448,9 +470,9 @@ export interface ImageEditParamsBase {
|
|
|
448
470
|
*/
|
|
449
471
|
mask?: Uploadable;
|
|
450
472
|
/**
|
|
451
|
-
* The model to use for image generation. Only `dall-e-2` and
|
|
452
|
-
* supported. Defaults to `dall-e-2` unless a parameter specific to
|
|
453
|
-
* is used.
|
|
473
|
+
* The model to use for image generation. Only `dall-e-2` and the GPT image models
|
|
474
|
+
* are supported. Defaults to `dall-e-2` unless a parameter specific to the GPT
|
|
475
|
+
* image models is used.
|
|
454
476
|
*/
|
|
455
477
|
model?: (string & {}) | ImageModel | null;
|
|
456
478
|
/**
|
|
@@ -459,13 +481,13 @@ export interface ImageEditParamsBase {
|
|
|
459
481
|
n?: number | null;
|
|
460
482
|
/**
|
|
461
483
|
* The compression level (0-100%) for the generated images. This parameter is only
|
|
462
|
-
* supported for
|
|
484
|
+
* supported for the GPT image models with the `webp` or `jpeg` output formats, and
|
|
463
485
|
* defaults to 100.
|
|
464
486
|
*/
|
|
465
487
|
output_compression?: number | null;
|
|
466
488
|
/**
|
|
467
489
|
* The format in which the generated images are returned. This parameter is only
|
|
468
|
-
* supported for
|
|
490
|
+
* supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The
|
|
469
491
|
* default value is `png`.
|
|
470
492
|
*/
|
|
471
493
|
output_format?: 'png' | 'jpeg' | 'webp' | null;
|
|
@@ -480,21 +502,21 @@ export interface ImageEditParamsBase {
|
|
|
480
502
|
partial_images?: number | null;
|
|
481
503
|
/**
|
|
482
504
|
* The quality of the image that will be generated. `high`, `medium` and `low` are
|
|
483
|
-
* only supported for
|
|
484
|
-
* Defaults to `auto`.
|
|
505
|
+
* only supported for the GPT image models. `dall-e-2` only supports `standard`
|
|
506
|
+
* quality. Defaults to `auto`.
|
|
485
507
|
*/
|
|
486
508
|
quality?: 'standard' | 'low' | 'medium' | 'high' | 'auto' | null;
|
|
487
509
|
/**
|
|
488
510
|
* The format in which the generated images are returned. Must be one of `url` or
|
|
489
511
|
* `b64_json`. URLs are only valid for 60 minutes after the image has been
|
|
490
|
-
* generated. This parameter is only supported for `dall-e-2`, as
|
|
491
|
-
*
|
|
512
|
+
* generated. This parameter is only supported for `dall-e-2`, as the GPT image
|
|
513
|
+
* models always return base64-encoded images.
|
|
492
514
|
*/
|
|
493
515
|
response_format?: 'url' | 'b64_json' | null;
|
|
494
516
|
/**
|
|
495
517
|
* The size of the generated images. Must be one of `1024x1024`, `1536x1024`
|
|
496
|
-
* (landscape), `1024x1536` (portrait), or `auto` (default value) for
|
|
497
|
-
*
|
|
518
|
+
* (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image
|
|
519
|
+
* models, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`.
|
|
498
520
|
*/
|
|
499
521
|
size?: '256x256' | '512x512' | '1024x1024' | '1536x1024' | '1024x1536' | 'auto' | null;
|
|
500
522
|
/**
|
|
@@ -534,29 +556,30 @@ export type ImageGenerateParams = ImageGenerateParamsNonStreaming | ImageGenerat
|
|
|
534
556
|
export interface ImageGenerateParamsBase {
|
|
535
557
|
/**
|
|
536
558
|
* A text description of the desired image(s). The maximum length is 32000
|
|
537
|
-
* characters for
|
|
538
|
-
* for `dall-e-3`.
|
|
559
|
+
* characters for the GPT image models, 1000 characters for `dall-e-2` and 4000
|
|
560
|
+
* characters for `dall-e-3`.
|
|
539
561
|
*/
|
|
540
562
|
prompt: string;
|
|
541
563
|
/**
|
|
542
564
|
* Allows to set transparency for the background of the generated image(s). This
|
|
543
|
-
* parameter is only supported for
|
|
544
|
-
* `opaque` or `auto` (default value). When `auto` is used, the
|
|
545
|
-
* automatically determine the best background for the image.
|
|
565
|
+
* parameter is only supported for the GPT image models. Must be one of
|
|
566
|
+
* `transparent`, `opaque` or `auto` (default value). When `auto` is used, the
|
|
567
|
+
* model will automatically determine the best background for the image.
|
|
546
568
|
*
|
|
547
569
|
* If `transparent`, the output format needs to support transparency, so it should
|
|
548
570
|
* be set to either `png` (default value) or `webp`.
|
|
549
571
|
*/
|
|
550
572
|
background?: 'transparent' | 'opaque' | 'auto' | null;
|
|
551
573
|
/**
|
|
552
|
-
* The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or
|
|
553
|
-
* `gpt-image-1
|
|
554
|
-
* `
|
|
574
|
+
* The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT
|
|
575
|
+
* image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to
|
|
576
|
+
* `dall-e-2` unless a parameter specific to the GPT image models is used.
|
|
555
577
|
*/
|
|
556
578
|
model?: (string & {}) | ImageModel | null;
|
|
557
579
|
/**
|
|
558
|
-
* Control the content-moderation level for images generated by
|
|
559
|
-
* be either `low` for less restrictive filtering or `auto` (default
|
|
580
|
+
* Control the content-moderation level for images generated by the GPT image
|
|
581
|
+
* models. Must be either `low` for less restrictive filtering or `auto` (default
|
|
582
|
+
* value).
|
|
560
583
|
*/
|
|
561
584
|
moderation?: 'low' | 'auto' | null;
|
|
562
585
|
/**
|
|
@@ -566,13 +589,13 @@ export interface ImageGenerateParamsBase {
|
|
|
566
589
|
n?: number | null;
|
|
567
590
|
/**
|
|
568
591
|
* The compression level (0-100%) for the generated images. This parameter is only
|
|
569
|
-
* supported for
|
|
592
|
+
* supported for the GPT image models with the `webp` or `jpeg` output formats, and
|
|
570
593
|
* defaults to 100.
|
|
571
594
|
*/
|
|
572
595
|
output_compression?: number | null;
|
|
573
596
|
/**
|
|
574
597
|
* The format in which the generated images are returned. This parameter is only
|
|
575
|
-
* supported for
|
|
598
|
+
* supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
|
|
576
599
|
*/
|
|
577
600
|
output_format?: 'png' | 'jpeg' | 'webp' | null;
|
|
578
601
|
/**
|
|
@@ -589,7 +612,7 @@ export interface ImageGenerateParamsBase {
|
|
|
589
612
|
*
|
|
590
613
|
* - `auto` (default value) will automatically select the best quality for the
|
|
591
614
|
* given model.
|
|
592
|
-
* - `high`, `medium` and `low` are supported for
|
|
615
|
+
* - `high`, `medium` and `low` are supported for the GPT image models.
|
|
593
616
|
* - `hd` and `standard` are supported for `dall-e-3`.
|
|
594
617
|
* - `standard` is the only option for `dall-e-2`.
|
|
595
618
|
*/
|
|
@@ -597,21 +620,21 @@ export interface ImageGenerateParamsBase {
|
|
|
597
620
|
/**
|
|
598
621
|
* The format in which generated images with `dall-e-2` and `dall-e-3` are
|
|
599
622
|
* returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes
|
|
600
|
-
* after the image has been generated. This parameter isn't supported for
|
|
601
|
-
*
|
|
623
|
+
* after the image has been generated. This parameter isn't supported for the GPT
|
|
624
|
+
* image models, which always return base64-encoded images.
|
|
602
625
|
*/
|
|
603
626
|
response_format?: 'url' | 'b64_json' | null;
|
|
604
627
|
/**
|
|
605
628
|
* The size of the generated images. Must be one of `1024x1024`, `1536x1024`
|
|
606
|
-
* (landscape), `1024x1536` (portrait), or `auto` (default value) for
|
|
607
|
-
*
|
|
608
|
-
*
|
|
629
|
+
* (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image
|
|
630
|
+
* models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of
|
|
631
|
+
* `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`.
|
|
609
632
|
*/
|
|
610
633
|
size?: 'auto' | '1024x1024' | '1536x1024' | '1024x1536' | '256x256' | '512x512' | '1792x1024' | '1024x1792' | null;
|
|
611
634
|
/**
|
|
612
635
|
* Generate the image in streaming mode. Defaults to `false`. See the
|
|
613
636
|
* [Image generation guide](https://platform.openai.com/docs/guides/image-generation)
|
|
614
|
-
* for more information. This parameter is only supported for
|
|
637
|
+
* for more information. This parameter is only supported for the GPT image models.
|
|
615
638
|
*/
|
|
616
639
|
stream?: boolean | null;
|
|
617
640
|
/**
|
|
@@ -636,7 +659,7 @@ export interface ImageGenerateParamsNonStreaming extends ImageGenerateParamsBase
|
|
|
636
659
|
/**
|
|
637
660
|
* Generate the image in streaming mode. Defaults to `false`. See the
|
|
638
661
|
* [Image generation guide](https://platform.openai.com/docs/guides/image-generation)
|
|
639
|
-
* for more information. This parameter is only supported for
|
|
662
|
+
* for more information. This parameter is only supported for the GPT image models.
|
|
640
663
|
*/
|
|
641
664
|
stream?: false | null;
|
|
642
665
|
}
|
|
@@ -644,7 +667,7 @@ export interface ImageGenerateParamsStreaming extends ImageGenerateParamsBase {
|
|
|
644
667
|
/**
|
|
645
668
|
* Generate the image in streaming mode. Defaults to `false`. See the
|
|
646
669
|
* [Image generation guide](https://platform.openai.com/docs/guides/image-generation)
|
|
647
|
-
* for more information. This parameter is only supported for
|
|
670
|
+
* for more information. This parameter is only supported for the GPT image models.
|
|
648
671
|
*/
|
|
649
672
|
stream: true;
|
|
650
673
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"images.d.mts","sourceRoot":"","sources":["../src/resources/images.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,SAAS;OACd,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE;OACV,EAAE,KAAK,UAAU,EAAE;OACnB,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;OASG;IACH,eAAe,CAAC,IAAI,EAAE,0BAA0B,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;IAOvG;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,IAAI,EAAE,2BAA2B,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;IAC7F,IAAI,CAAC,IAAI,EAAE,wBAAwB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;IACxG,IAAI,CACF,IAAI,EAAE,mBAAmB,EACzB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC,oBAAoB,CAAC,GAAG,cAAc,CAAC;IAW5D;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,IAAI,EAAE,+BAA+B,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;IACrG,QAAQ,CACN,IAAI,EAAE,4BAA4B,EAClC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAC1C,QAAQ,CACN,IAAI,EAAE,uBAAuB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC,mBAAmB,CAAC,GAAG,cAAc,CAAC;CAS5D;AAED;;GAEG;AACH,MA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L,KAAK,KAAK,IAAI,KAAK,EACnB,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,4BAA4B,IAAI,4BAA4B,GAClE,CAAC;CACH"}
|
package/resources/images.d.ts
CHANGED
|
@@ -51,9 +51,9 @@ export declare class Images extends APIResource {
|
|
|
51
51
|
*/
|
|
52
52
|
export interface Image {
|
|
53
53
|
/**
|
|
54
|
-
* The base64-encoded JSON of the generated image.
|
|
55
|
-
* and only present if `response_format` is set to `b64_json` for
|
|
56
|
-
* `dall-e-3`.
|
|
54
|
+
* The base64-encoded JSON of the generated image. Returned by default for the GPT
|
|
55
|
+
* image models, and only present if `response_format` is set to `b64_json` for
|
|
56
|
+
* `dall-e-2` and `dall-e-3`.
|
|
57
57
|
*/
|
|
58
58
|
b64_json?: string;
|
|
59
59
|
/**
|
|
@@ -62,8 +62,8 @@ export interface Image {
|
|
|
62
62
|
revised_prompt?: string;
|
|
63
63
|
/**
|
|
64
64
|
* When using `dall-e-2` or `dall-e-3`, the URL of the generated image if
|
|
65
|
-
* `response_format` is set to `url` (default value). Unsupported for
|
|
66
|
-
*
|
|
65
|
+
* `response_format` is set to `url` (default value). Unsupported for the GPT image
|
|
66
|
+
* models.
|
|
67
67
|
*/
|
|
68
68
|
url?: string;
|
|
69
69
|
}
|
|
@@ -100,13 +100,15 @@ export interface ImageEditCompletedEvent {
|
|
|
100
100
|
*/
|
|
101
101
|
type: 'image_edit.completed';
|
|
102
102
|
/**
|
|
103
|
-
* For
|
|
103
|
+
* For the GPT image models only, the token usage information for the image
|
|
104
|
+
* generation.
|
|
104
105
|
*/
|
|
105
106
|
usage: ImageEditCompletedEvent.Usage;
|
|
106
107
|
}
|
|
107
108
|
export declare namespace ImageEditCompletedEvent {
|
|
108
109
|
/**
|
|
109
|
-
* For
|
|
110
|
+
* For the GPT image models only, the token usage information for the image
|
|
111
|
+
* generation.
|
|
110
112
|
*/
|
|
111
113
|
interface Usage {
|
|
112
114
|
/**
|
|
@@ -216,13 +218,15 @@ export interface ImageGenCompletedEvent {
|
|
|
216
218
|
*/
|
|
217
219
|
type: 'image_generation.completed';
|
|
218
220
|
/**
|
|
219
|
-
* For
|
|
221
|
+
* For the GPT image models only, the token usage information for the image
|
|
222
|
+
* generation.
|
|
220
223
|
*/
|
|
221
224
|
usage: ImageGenCompletedEvent.Usage;
|
|
222
225
|
}
|
|
223
226
|
export declare namespace ImageGenCompletedEvent {
|
|
224
227
|
/**
|
|
225
|
-
* For
|
|
228
|
+
* For the GPT image models only, the token usage information for the image
|
|
229
|
+
* generation.
|
|
226
230
|
*/
|
|
227
231
|
interface Usage {
|
|
228
232
|
/**
|
|
@@ -299,7 +303,7 @@ export interface ImageGenPartialImageEvent {
|
|
|
299
303
|
* Emitted when a partial image is available during image generation streaming.
|
|
300
304
|
*/
|
|
301
305
|
export type ImageGenStreamEvent = ImageGenPartialImageEvent | ImageGenCompletedEvent;
|
|
302
|
-
export type ImageModel = 'dall-e-2' | 'dall-e-3' | 'gpt-image-1' | 'gpt-image-1-mini';
|
|
306
|
+
export type ImageModel = 'gpt-image-1.5' | 'dall-e-2' | 'dall-e-3' | 'gpt-image-1' | 'gpt-image-1-mini';
|
|
303
307
|
/**
|
|
304
308
|
* The response from the image generation endpoint.
|
|
305
309
|
*/
|
|
@@ -356,6 +360,10 @@ export declare namespace ImagesResponse {
|
|
|
356
360
|
* The total number of tokens (images and text) used for the image generation.
|
|
357
361
|
*/
|
|
358
362
|
total_tokens: number;
|
|
363
|
+
/**
|
|
364
|
+
* The output token details for the image generation.
|
|
365
|
+
*/
|
|
366
|
+
output_tokens_details?: Usage.OutputTokensDetails;
|
|
359
367
|
}
|
|
360
368
|
namespace Usage {
|
|
361
369
|
/**
|
|
@@ -371,6 +379,19 @@ export declare namespace ImagesResponse {
|
|
|
371
379
|
*/
|
|
372
380
|
text_tokens: number;
|
|
373
381
|
}
|
|
382
|
+
/**
|
|
383
|
+
* The output token details for the image generation.
|
|
384
|
+
*/
|
|
385
|
+
interface OutputTokensDetails {
|
|
386
|
+
/**
|
|
387
|
+
* The number of image output tokens generated by the model.
|
|
388
|
+
*/
|
|
389
|
+
image_tokens: number;
|
|
390
|
+
/**
|
|
391
|
+
* The number of text output tokens generated by the model.
|
|
392
|
+
*/
|
|
393
|
+
text_tokens: number;
|
|
394
|
+
}
|
|
374
395
|
}
|
|
375
396
|
}
|
|
376
397
|
export interface ImageCreateVariationParams {
|
|
@@ -411,7 +432,8 @@ export interface ImageEditParamsBase {
|
|
|
411
432
|
/**
|
|
412
433
|
* The image(s) to edit. Must be a supported image file or an array of images.
|
|
413
434
|
*
|
|
414
|
-
* For `gpt-image-1`,
|
|
435
|
+
* For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and
|
|
436
|
+
* `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg` file less than
|
|
415
437
|
* 50MB. You can provide up to 16 images.
|
|
416
438
|
*
|
|
417
439
|
* For `dall-e-2`, you can only provide one image, and it should be a square `png`
|
|
@@ -420,14 +442,14 @@ export interface ImageEditParamsBase {
|
|
|
420
442
|
image: Uploadable | Array<Uploadable>;
|
|
421
443
|
/**
|
|
422
444
|
* A text description of the desired image(s). The maximum length is 1000
|
|
423
|
-
* characters for `dall-e-2`, and 32000 characters for
|
|
445
|
+
* characters for `dall-e-2`, and 32000 characters for the GPT image models.
|
|
424
446
|
*/
|
|
425
447
|
prompt: string;
|
|
426
448
|
/**
|
|
427
449
|
* Allows to set transparency for the background of the generated image(s). This
|
|
428
|
-
* parameter is only supported for
|
|
429
|
-
* `opaque` or `auto` (default value). When `auto` is used, the
|
|
430
|
-
* automatically determine the best background for the image.
|
|
450
|
+
* parameter is only supported for the GPT image models. Must be one of
|
|
451
|
+
* `transparent`, `opaque` or `auto` (default value). When `auto` is used, the
|
|
452
|
+
* model will automatically determine the best background for the image.
|
|
431
453
|
*
|
|
432
454
|
* If `transparent`, the output format needs to support transparency, so it should
|
|
433
455
|
* be set to either `png` (default value) or `webp`.
|
|
@@ -448,9 +470,9 @@ export interface ImageEditParamsBase {
|
|
|
448
470
|
*/
|
|
449
471
|
mask?: Uploadable;
|
|
450
472
|
/**
|
|
451
|
-
* The model to use for image generation. Only `dall-e-2` and
|
|
452
|
-
* supported. Defaults to `dall-e-2` unless a parameter specific to
|
|
453
|
-
* is used.
|
|
473
|
+
* The model to use for image generation. Only `dall-e-2` and the GPT image models
|
|
474
|
+
* are supported. Defaults to `dall-e-2` unless a parameter specific to the GPT
|
|
475
|
+
* image models is used.
|
|
454
476
|
*/
|
|
455
477
|
model?: (string & {}) | ImageModel | null;
|
|
456
478
|
/**
|
|
@@ -459,13 +481,13 @@ export interface ImageEditParamsBase {
|
|
|
459
481
|
n?: number | null;
|
|
460
482
|
/**
|
|
461
483
|
* The compression level (0-100%) for the generated images. This parameter is only
|
|
462
|
-
* supported for
|
|
484
|
+
* supported for the GPT image models with the `webp` or `jpeg` output formats, and
|
|
463
485
|
* defaults to 100.
|
|
464
486
|
*/
|
|
465
487
|
output_compression?: number | null;
|
|
466
488
|
/**
|
|
467
489
|
* The format in which the generated images are returned. This parameter is only
|
|
468
|
-
* supported for
|
|
490
|
+
* supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The
|
|
469
491
|
* default value is `png`.
|
|
470
492
|
*/
|
|
471
493
|
output_format?: 'png' | 'jpeg' | 'webp' | null;
|
|
@@ -480,21 +502,21 @@ export interface ImageEditParamsBase {
|
|
|
480
502
|
partial_images?: number | null;
|
|
481
503
|
/**
|
|
482
504
|
* The quality of the image that will be generated. `high`, `medium` and `low` are
|
|
483
|
-
* only supported for
|
|
484
|
-
* Defaults to `auto`.
|
|
505
|
+
* only supported for the GPT image models. `dall-e-2` only supports `standard`
|
|
506
|
+
* quality. Defaults to `auto`.
|
|
485
507
|
*/
|
|
486
508
|
quality?: 'standard' | 'low' | 'medium' | 'high' | 'auto' | null;
|
|
487
509
|
/**
|
|
488
510
|
* The format in which the generated images are returned. Must be one of `url` or
|
|
489
511
|
* `b64_json`. URLs are only valid for 60 minutes after the image has been
|
|
490
|
-
* generated. This parameter is only supported for `dall-e-2`, as
|
|
491
|
-
*
|
|
512
|
+
* generated. This parameter is only supported for `dall-e-2`, as the GPT image
|
|
513
|
+
* models always return base64-encoded images.
|
|
492
514
|
*/
|
|
493
515
|
response_format?: 'url' | 'b64_json' | null;
|
|
494
516
|
/**
|
|
495
517
|
* The size of the generated images. Must be one of `1024x1024`, `1536x1024`
|
|
496
|
-
* (landscape), `1024x1536` (portrait), or `auto` (default value) for
|
|
497
|
-
*
|
|
518
|
+
* (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image
|
|
519
|
+
* models, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`.
|
|
498
520
|
*/
|
|
499
521
|
size?: '256x256' | '512x512' | '1024x1024' | '1536x1024' | '1024x1536' | 'auto' | null;
|
|
500
522
|
/**
|
|
@@ -534,29 +556,30 @@ export type ImageGenerateParams = ImageGenerateParamsNonStreaming | ImageGenerat
|
|
|
534
556
|
export interface ImageGenerateParamsBase {
|
|
535
557
|
/**
|
|
536
558
|
* A text description of the desired image(s). The maximum length is 32000
|
|
537
|
-
* characters for
|
|
538
|
-
* for `dall-e-3`.
|
|
559
|
+
* characters for the GPT image models, 1000 characters for `dall-e-2` and 4000
|
|
560
|
+
* characters for `dall-e-3`.
|
|
539
561
|
*/
|
|
540
562
|
prompt: string;
|
|
541
563
|
/**
|
|
542
564
|
* Allows to set transparency for the background of the generated image(s). This
|
|
543
|
-
* parameter is only supported for
|
|
544
|
-
* `opaque` or `auto` (default value). When `auto` is used, the
|
|
545
|
-
* automatically determine the best background for the image.
|
|
565
|
+
* parameter is only supported for the GPT image models. Must be one of
|
|
566
|
+
* `transparent`, `opaque` or `auto` (default value). When `auto` is used, the
|
|
567
|
+
* model will automatically determine the best background for the image.
|
|
546
568
|
*
|
|
547
569
|
* If `transparent`, the output format needs to support transparency, so it should
|
|
548
570
|
* be set to either `png` (default value) or `webp`.
|
|
549
571
|
*/
|
|
550
572
|
background?: 'transparent' | 'opaque' | 'auto' | null;
|
|
551
573
|
/**
|
|
552
|
-
* The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or
|
|
553
|
-
* `gpt-image-1
|
|
554
|
-
* `
|
|
574
|
+
* The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT
|
|
575
|
+
* image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to
|
|
576
|
+
* `dall-e-2` unless a parameter specific to the GPT image models is used.
|
|
555
577
|
*/
|
|
556
578
|
model?: (string & {}) | ImageModel | null;
|
|
557
579
|
/**
|
|
558
|
-
* Control the content-moderation level for images generated by
|
|
559
|
-
* be either `low` for less restrictive filtering or `auto` (default
|
|
580
|
+
* Control the content-moderation level for images generated by the GPT image
|
|
581
|
+
* models. Must be either `low` for less restrictive filtering or `auto` (default
|
|
582
|
+
* value).
|
|
560
583
|
*/
|
|
561
584
|
moderation?: 'low' | 'auto' | null;
|
|
562
585
|
/**
|
|
@@ -566,13 +589,13 @@ export interface ImageGenerateParamsBase {
|
|
|
566
589
|
n?: number | null;
|
|
567
590
|
/**
|
|
568
591
|
* The compression level (0-100%) for the generated images. This parameter is only
|
|
569
|
-
* supported for
|
|
592
|
+
* supported for the GPT image models with the `webp` or `jpeg` output formats, and
|
|
570
593
|
* defaults to 100.
|
|
571
594
|
*/
|
|
572
595
|
output_compression?: number | null;
|
|
573
596
|
/**
|
|
574
597
|
* The format in which the generated images are returned. This parameter is only
|
|
575
|
-
* supported for
|
|
598
|
+
* supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
|
|
576
599
|
*/
|
|
577
600
|
output_format?: 'png' | 'jpeg' | 'webp' | null;
|
|
578
601
|
/**
|
|
@@ -589,7 +612,7 @@ export interface ImageGenerateParamsBase {
|
|
|
589
612
|
*
|
|
590
613
|
* - `auto` (default value) will automatically select the best quality for the
|
|
591
614
|
* given model.
|
|
592
|
-
* - `high`, `medium` and `low` are supported for
|
|
615
|
+
* - `high`, `medium` and `low` are supported for the GPT image models.
|
|
593
616
|
* - `hd` and `standard` are supported for `dall-e-3`.
|
|
594
617
|
* - `standard` is the only option for `dall-e-2`.
|
|
595
618
|
*/
|
|
@@ -597,21 +620,21 @@ export interface ImageGenerateParamsBase {
|
|
|
597
620
|
/**
|
|
598
621
|
* The format in which generated images with `dall-e-2` and `dall-e-3` are
|
|
599
622
|
* returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes
|
|
600
|
-
* after the image has been generated. This parameter isn't supported for
|
|
601
|
-
*
|
|
623
|
+
* after the image has been generated. This parameter isn't supported for the GPT
|
|
624
|
+
* image models, which always return base64-encoded images.
|
|
602
625
|
*/
|
|
603
626
|
response_format?: 'url' | 'b64_json' | null;
|
|
604
627
|
/**
|
|
605
628
|
* The size of the generated images. Must be one of `1024x1024`, `1536x1024`
|
|
606
|
-
* (landscape), `1024x1536` (portrait), or `auto` (default value) for
|
|
607
|
-
*
|
|
608
|
-
*
|
|
629
|
+
* (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image
|
|
630
|
+
* models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of
|
|
631
|
+
* `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`.
|
|
609
632
|
*/
|
|
610
633
|
size?: 'auto' | '1024x1024' | '1536x1024' | '1024x1536' | '256x256' | '512x512' | '1792x1024' | '1024x1792' | null;
|
|
611
634
|
/**
|
|
612
635
|
* Generate the image in streaming mode. Defaults to `false`. See the
|
|
613
636
|
* [Image generation guide](https://platform.openai.com/docs/guides/image-generation)
|
|
614
|
-
* for more information. This parameter is only supported for
|
|
637
|
+
* for more information. This parameter is only supported for the GPT image models.
|
|
615
638
|
*/
|
|
616
639
|
stream?: boolean | null;
|
|
617
640
|
/**
|
|
@@ -636,7 +659,7 @@ export interface ImageGenerateParamsNonStreaming extends ImageGenerateParamsBase
|
|
|
636
659
|
/**
|
|
637
660
|
* Generate the image in streaming mode. Defaults to `false`. See the
|
|
638
661
|
* [Image generation guide](https://platform.openai.com/docs/guides/image-generation)
|
|
639
|
-
* for more information. This parameter is only supported for
|
|
662
|
+
* for more information. This parameter is only supported for the GPT image models.
|
|
640
663
|
*/
|
|
641
664
|
stream?: false | null;
|
|
642
665
|
}
|
|
@@ -644,7 +667,7 @@ export interface ImageGenerateParamsStreaming extends ImageGenerateParamsBase {
|
|
|
644
667
|
/**
|
|
645
668
|
* Generate the image in streaming mode. Defaults to `false`. See the
|
|
646
669
|
* [Image generation guide](https://platform.openai.com/docs/guides/image-generation)
|
|
647
|
-
* for more information. This parameter is only supported for
|
|
670
|
+
* for more information. This parameter is only supported for the GPT image models.
|
|
648
671
|
*/
|
|
649
672
|
stream: true;
|
|
650
673
|
}
|