openai 7.1.0 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/README.md +5 -10
  3. package/client.d.mts +3 -0
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +3 -0
  6. package/client.d.ts.map +1 -1
  7. package/client.js +3 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +3 -0
  10. package/client.mjs.map +1 -1
  11. package/internal/uploads.d.mts.map +1 -1
  12. package/internal/uploads.d.ts.map +1 -1
  13. package/internal/uploads.js +9 -3
  14. package/internal/uploads.js.map +1 -1
  15. package/internal/uploads.mjs +9 -3
  16. package/internal/uploads.mjs.map +1 -1
  17. package/package.json +4 -1
  18. package/resources/beta/responses/responses.d.mts +41 -15
  19. package/resources/beta/responses/responses.d.mts.map +1 -1
  20. package/resources/beta/responses/responses.d.ts +41 -15
  21. package/resources/beta/responses/responses.d.ts.map +1 -1
  22. package/resources/beta/responses/responses.js.map +1 -1
  23. package/resources/beta/responses/responses.mjs.map +1 -1
  24. package/resources/chat/completions/completions.d.mts +24 -12
  25. package/resources/chat/completions/completions.d.mts.map +1 -1
  26. package/resources/chat/completions/completions.d.ts +24 -12
  27. package/resources/chat/completions/completions.d.ts.map +1 -1
  28. package/resources/chat/completions/completions.js.map +1 -1
  29. package/resources/chat/completions/completions.mjs.map +1 -1
  30. package/resources/content-provenance-checks.d.mts +103 -0
  31. package/resources/content-provenance-checks.d.mts.map +1 -0
  32. package/resources/content-provenance-checks.d.ts +103 -0
  33. package/resources/content-provenance-checks.d.ts.map +1 -0
  34. package/resources/content-provenance-checks.js +24 -0
  35. package/resources/content-provenance-checks.js.map +1 -0
  36. package/resources/content-provenance-checks.mjs +20 -0
  37. package/resources/content-provenance-checks.mjs.map +1 -0
  38. package/resources/index.d.mts +1 -0
  39. package/resources/index.d.mts.map +1 -1
  40. package/resources/index.d.ts +1 -0
  41. package/resources/index.d.ts.map +1 -1
  42. package/resources/index.js +3 -1
  43. package/resources/index.js.map +1 -1
  44. package/resources/index.mjs +1 -0
  45. package/resources/index.mjs.map +1 -1
  46. package/resources/responses/responses.d.mts +41 -15
  47. package/resources/responses/responses.d.mts.map +1 -1
  48. package/resources/responses/responses.d.ts +41 -15
  49. package/resources/responses/responses.d.ts.map +1 -1
  50. package/resources/responses/responses.js.map +1 -1
  51. package/resources/responses/responses.mjs.map +1 -1
  52. package/src/client.ts +13 -0
  53. package/src/internal/uploads.ts +8 -4
  54. package/src/resources/beta/responses/responses.ts +41 -15
  55. package/src/resources/chat/completions/completions.ts +24 -12
  56. package/src/resources/content-provenance-checks.ts +132 -0
  57. package/src/resources/index.ts +5 -0
  58. package/src/resources/responses/responses.ts +41 -15
  59. package/src/version.ts +1 -1
  60. package/version.d.mts +1 -1
  61. package/version.d.ts +1 -1
  62. package/version.js +1 -1
  63. package/version.mjs +1 -1
@@ -366,9 +366,13 @@ export interface ChatCompletion {
366
366
  * will use 'default'.
367
367
  * - If set to 'default', then the request will be processed with the standard
368
368
  * pricing and performance for the selected model.
369
- * - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
370
- * '[priority](https://openai.com/api-priority-processing/)', then the request
371
- * will be processed with the corresponding service tier.
369
+ * - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
370
+ * then the request will be processed with the Flex Processing service tier.
371
+ * - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
372
+ * include the `service_tier=fast` or `service_tier=priority` parameter for
373
+ * Responses or Chat Completions. The response will show `service_tier=priority`
374
+ * regardless of if you specify `service_tier=fast` or `priority` in your
375
+ * request.
372
376
  * - When not set, the default behavior is 'auto'.
373
377
  *
374
378
  * When the `service_tier` parameter is set, the response body will include the
@@ -376,7 +380,7 @@ export interface ChatCompletion {
376
380
  * request. This response value may be different from the value set in the
377
381
  * parameter.
378
382
  */
379
- service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | null;
383
+ service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | 'fast' | null;
380
384
 
381
385
  /**
382
386
  * @deprecated This fingerprint represents the backend configuration that the model
@@ -829,9 +833,13 @@ export interface ChatCompletionChunk {
829
833
  * will use 'default'.
830
834
  * - If set to 'default', then the request will be processed with the standard
831
835
  * pricing and performance for the selected model.
832
- * - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
833
- * '[priority](https://openai.com/api-priority-processing/)', then the request
834
- * will be processed with the corresponding service tier.
836
+ * - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
837
+ * then the request will be processed with the Flex Processing service tier.
838
+ * - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
839
+ * include the `service_tier=fast` or `service_tier=priority` parameter for
840
+ * Responses or Chat Completions. The response will show `service_tier=priority`
841
+ * regardless of if you specify `service_tier=fast` or `priority` in your
842
+ * request.
835
843
  * - When not set, the default behavior is 'auto'.
836
844
  *
837
845
  * When the `service_tier` parameter is set, the response body will include the
@@ -839,7 +847,7 @@ export interface ChatCompletionChunk {
839
847
  * request. This response value may be different from the value set in the
840
848
  * parameter.
841
849
  */
842
- service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | null;
850
+ service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | 'fast' | null;
843
851
 
844
852
  /**
845
853
  * @deprecated This fingerprint represents the backend configuration that the model
@@ -2268,9 +2276,13 @@ export interface ChatCompletionCreateParamsBase {
2268
2276
  * will use 'default'.
2269
2277
  * - If set to 'default', then the request will be processed with the standard
2270
2278
  * pricing and performance for the selected model.
2271
- * - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
2272
- * '[priority](https://openai.com/api-priority-processing/)', then the request
2273
- * will be processed with the corresponding service tier.
2279
+ * - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
2280
+ * then the request will be processed with the Flex Processing service tier.
2281
+ * - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
2282
+ * include the `service_tier=fast` or `service_tier=priority` parameter for
2283
+ * Responses or Chat Completions. The response will show `service_tier=priority`
2284
+ * regardless of if you specify `service_tier=fast` or `priority` in your
2285
+ * request.
2274
2286
  * - When not set, the default behavior is 'auto'.
2275
2287
  *
2276
2288
  * When the `service_tier` parameter is set, the response body will include the
@@ -2278,7 +2290,7 @@ export interface ChatCompletionCreateParamsBase {
2278
2290
  * request. This response value may be different from the value set in the
2279
2291
  * parameter.
2280
2292
  */
2281
- service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | null;
2293
+ service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | 'fast' | null;
2282
2294
 
2283
2295
  /**
2284
2296
  * Not supported with latest reasoning models `o3` and `o4-mini`.
@@ -0,0 +1,132 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { type Uploadable } from '../core/uploads';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { multipartFormRequestOptions } from '../internal/uploads';
8
+
9
+ export class ContentProvenanceChecks extends APIResource {
10
+ /**
11
+ * Check whether an image or audio file contains known OpenAI provenance signals.
12
+ * [Learn more about content provenance](/api/docs/guides/content-provenance).
13
+ *
14
+ * If `not_detected`, it means the tool did not find supported signals in the
15
+ * uploaded file. The content could still have been generated by OpenAI if the
16
+ * metadata was stripped or has evidence of tampering, the watermark was degraded,
17
+ * it comes from a legacy generation model, or it was created before provenance
18
+ * signals were available. Content could also still be AI-generated by another
19
+ * company's model, which the tool currently does not detect.
20
+ */
21
+ create(
22
+ body: ContentProvenanceCheckCreateParams,
23
+ options?: RequestOptions,
24
+ ): APIPromise<ContentProvenanceCheck> {
25
+ return this._client.post(
26
+ '/content_provenance_checks',
27
+ multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client),
28
+ );
29
+ }
30
+ }
31
+
32
+ export interface ContentProvenanceCheck {
33
+ /**
34
+ * The Unix timestamp, in seconds, when the provenance check was created.
35
+ */
36
+ created_at: number;
37
+
38
+ /**
39
+ * The object type. Always `content_provenance_check` for this endpoint.
40
+ */
41
+ object: 'content_provenance_check';
42
+
43
+ /**
44
+ * The provenance results that apply to the uploaded file. Image results include
45
+ * C2PA and SynthID; audio results include SynthID.
46
+ */
47
+ results: Array<ContentProvenanceCheck.C2PA | ContentProvenanceCheck.SynthID>;
48
+ }
49
+
50
+ export namespace ContentProvenanceCheck {
51
+ export interface C2PA {
52
+ /**
53
+ * The UTC RFC 3339 timestamp recorded by the provenance signal for when the asset
54
+ * was generated, when available.
55
+ */
56
+ generated_at: string | null;
57
+
58
+ /**
59
+ * The C2PA manifest issuer, when available.
60
+ */
61
+ issuer: string | null;
62
+
63
+ /**
64
+ * The OpenAI model recorded by the provenance signal, when available.
65
+ */
66
+ model: string | null;
67
+
68
+ /**
69
+ * Whether a supported OpenAI C2PA provenance signal was detected. If
70
+ * `not_detected`, it means the tool did not find supported signals in the uploaded
71
+ * file. The content could still have been generated by OpenAI if the metadata was
72
+ * stripped or has evidence of tampering, the watermark was degraded, it comes from
73
+ * a legacy generation model, or it was created before provenance signals were
74
+ * available. Content could also still be AI-generated by another company's model,
75
+ * which the tool currently does not detect.
76
+ */
77
+ outcome: 'detected' | 'not_detected';
78
+
79
+ /**
80
+ * The provenance signal type. Always `c2pa`.
81
+ */
82
+ type: 'c2pa';
83
+
84
+ /**
85
+ * The validation status of the C2PA manifest in the uploaded image.
86
+ */
87
+ validation_state: 'trusted' | 'valid' | 'invalid' | 'not_present';
88
+ }
89
+
90
+ export interface SynthID {
91
+ /**
92
+ * The UTC RFC 3339 timestamp recorded by the provenance signal for when the asset
93
+ * was generated, when available.
94
+ */
95
+ generated_at: string | null;
96
+
97
+ /**
98
+ * The OpenAI model recorded by the provenance signal, when available.
99
+ */
100
+ model: string | null;
101
+
102
+ /**
103
+ * Whether a supported OpenAI SynthID watermark was detected. If `not_detected`, it
104
+ * means the tool did not find supported signals in the uploaded file. The content
105
+ * could still have been generated by OpenAI if the metadata was stripped or has
106
+ * evidence of tampering, the watermark was degraded, it comes from a legacy
107
+ * generation model, or it was created before provenance signals were available.
108
+ * Content could also still be AI-generated by another company's model, which the
109
+ * tool currently does not detect.
110
+ */
111
+ outcome: 'detected' | 'not_detected';
112
+
113
+ /**
114
+ * The provenance signal type. Always `synthid`.
115
+ */
116
+ type: 'synthid';
117
+ }
118
+ }
119
+
120
+ export interface ContentProvenanceCheckCreateParams {
121
+ /**
122
+ * The image or audio file to check for supported OpenAI provenance signals.
123
+ */
124
+ file: Uploadable;
125
+ }
126
+
127
+ export declare namespace ContentProvenanceChecks {
128
+ export {
129
+ type ContentProvenanceCheck as ContentProvenanceCheck,
130
+ type ContentProvenanceCheckCreateParams as ContentProvenanceCheckCreateParams,
131
+ };
132
+ }
@@ -33,6 +33,11 @@ export {
33
33
  type ContainerListParams,
34
34
  type ContainerListResponsesPage,
35
35
  } from './containers/containers';
36
+ export {
37
+ ContentProvenanceChecks,
38
+ type ContentProvenanceCheck,
39
+ type ContentProvenanceCheckCreateParams,
40
+ } from './content-provenance-checks';
36
41
  export { Conversations } from './conversations/conversations';
37
42
  export {
38
43
  Embeddings,
@@ -1228,15 +1228,19 @@ export interface Response {
1228
1228
  * will use 'default'.
1229
1229
  * - If set to 'default', then the request will be processed with the standard
1230
1230
  * pricing and performance for the selected model.
1231
- * - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
1232
- * '[priority](https://openai.com/api-priority-processing/)', then the request
1233
- * will be processed with the corresponding service tier.
1231
+ * - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
1232
+ * then the request will be processed with the Flex Processing service tier.
1233
+ * - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
1234
+ * include the `service_tier=fast` or `service_tier=priority` parameter for
1235
+ * Responses or Chat Completions. The response will show `service_tier=priority`
1236
+ * regardless of if you specify `service_tier=fast` or `priority` in your
1237
+ * request.
1234
1238
  * - When not set, the default behavior is 'auto'.
1235
1239
  *
1236
1240
  * When this parameter is set, the response body will include the `service_tier`
1237
1241
  * utilized.
1238
1242
  */
1239
- service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | null;
1243
+ service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | 'fast' | null;
1240
1244
 
1241
1245
  /**
1242
1246
  * The status of the response generation. One of `completed`, `failed`,
@@ -7552,9 +7556,13 @@ export interface ResponsesClientEvent {
7552
7556
  * will use 'default'.
7553
7557
  * - If set to 'default', then the request will be processed with the standard
7554
7558
  * pricing and performance for the selected model.
7555
- * - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
7556
- * '[priority](https://openai.com/api-priority-processing/)', then the request
7557
- * will be processed with the corresponding service tier.
7559
+ * - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
7560
+ * then the request will be processed with the Flex Processing service tier.
7561
+ * - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
7562
+ * include the `service_tier=fast` or `service_tier=priority` parameter for
7563
+ * Responses or Chat Completions. The response will show `service_tier=priority`
7564
+ * regardless of if you specify `service_tier=fast` or `priority` in your
7565
+ * request.
7558
7566
  * - When not set, the default behavior is 'auto'.
7559
7567
  *
7560
7568
  * When the `service_tier` parameter is set, the response body will include the
@@ -7562,7 +7570,7 @@ export interface ResponsesClientEvent {
7562
7570
  * request. This response value may be different from the value set in the
7563
7571
  * parameter.
7564
7572
  */
7565
- service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | null;
7573
+ service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | 'fast' | null;
7566
7574
 
7567
7575
  /**
7568
7576
  * Whether to store the generated model response for later retrieval via API.
@@ -8742,15 +8750,19 @@ export interface ResponseCreateParamsBase {
8742
8750
  * will use 'default'.
8743
8751
  * - If set to 'default', then the request will be processed with the standard
8744
8752
  * pricing and performance for the selected model.
8745
- * - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
8746
- * '[priority](https://openai.com/api-priority-processing/)', then the request
8747
- * will be processed with the corresponding service tier.
8753
+ * - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
8754
+ * then the request will be processed with the Flex Processing service tier.
8755
+ * - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
8756
+ * include the `service_tier=fast` or `service_tier=priority` parameter for
8757
+ * Responses or Chat Completions. The response will show `service_tier=priority`
8758
+ * regardless of if you specify `service_tier=fast` or `priority` in your
8759
+ * request.
8748
8760
  * - When not set, the default behavior is 'auto'.
8749
8761
  *
8750
8762
  * When this parameter is set, the response body will include the `service_tier`
8751
8763
  * utilized.
8752
8764
  */
8753
- service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | null;
8765
+ service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | 'fast' | null;
8754
8766
 
8755
8767
  /**
8756
8768
  * Whether to store the generated model response for later retrieval via API.
@@ -9224,9 +9236,23 @@ export interface ResponseCompactParams {
9224
9236
  prompt_cache_retention?: 'in_memory' | '24h' | null;
9225
9237
 
9226
9238
  /**
9227
- * The service tier to use for this request.
9228
- */
9229
- service_tier?: 'auto' | 'default' | 'flex' | 'priority' | null;
9239
+ * Specifies the processing type used for serving the request. - If set to 'auto',
9240
+ * then the request will be processed with the service tier configured in the
9241
+ * Project settings. Unless otherwise configured, the Project will use 'default'. -
9242
+ * If set to 'default', then the request will be processed with the standard
9243
+ * pricing and performance for the selected model. - If set to
9244
+ * '[flex](https://platform.openai.com/docs/guides/flex-processing)', then the
9245
+ * request will be processed with the Flex Processing service tier. - To opt-in to
9246
+ * [Fast mode](/api/docs/guides/fast-mode) at the request level, include the
9247
+ * `service_tier=fast` or `service_tier=priority` parameter for Responses or Chat
9248
+ * Completions. The response will show `service_tier=priority` regardless of if you
9249
+ * specify `service_tier=fast` or `priority` in your request. - When not set, the
9250
+ * default behavior is 'auto'. When the `service_tier` parameter is set, the
9251
+ * response body will include the `service_tier` value based on the processing mode
9252
+ * actually used to serve the request. This response value may be different from
9253
+ * the value set in the parameter.
9254
+ */
9255
+ service_tier?: 'auto' | 'default' | 'fast' | 'flex' | 'priority' | null;
9230
9256
  }
9231
9257
 
9232
9258
  export namespace ResponseCompactParams {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '7.1.0'; // x-release-please-version
1
+ export const VERSION = '7.3.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "7.1.0";
1
+ export declare const VERSION = "7.3.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "7.1.0";
1
+ export declare const VERSION = "7.3.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '7.1.0'; // x-release-please-version
4
+ exports.VERSION = '7.3.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '7.1.0'; // x-release-please-version
1
+ export const VERSION = '7.3.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map