openai 7.18.0 → 7.19.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 (154) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +6 -3
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts.map +1 -1
  5. package/client.js +13 -7
  6. package/client.js.map +1 -1
  7. package/client.mjs +13 -7
  8. package/client.mjs.map +1 -1
  9. package/internal/parse.d.mts.map +1 -1
  10. package/internal/parse.d.ts.map +1 -1
  11. package/internal/parse.js +11 -7
  12. package/internal/parse.js.map +1 -1
  13. package/internal/parse.mjs +11 -7
  14. package/internal/parse.mjs.map +1 -1
  15. package/internal/utils/log.d.mts.map +1 -1
  16. package/internal/utils/log.d.ts.map +1 -1
  17. package/internal/utils/log.js +1 -0
  18. package/internal/utils/log.js.map +1 -1
  19. package/internal/utils/log.mjs +1 -0
  20. package/internal/utils/log.mjs.map +1 -1
  21. package/package.json +1 -1
  22. package/resources/admin/organization/admin-api-keys.d.mts +5 -1
  23. package/resources/admin/organization/admin-api-keys.d.mts.map +1 -1
  24. package/resources/admin/organization/admin-api-keys.d.ts +5 -1
  25. package/resources/admin/organization/admin-api-keys.d.ts.map +1 -1
  26. package/resources/beta/agents/agents.d.mts +6 -3
  27. package/resources/beta/agents/agents.d.mts.map +1 -1
  28. package/resources/beta/agents/agents.d.ts +6 -3
  29. package/resources/beta/agents/agents.d.ts.map +1 -1
  30. package/resources/beta/agents/agents.js.map +1 -1
  31. package/resources/beta/agents/agents.mjs.map +1 -1
  32. package/resources/beta/agents/environments/files.d.mts +5 -1
  33. package/resources/beta/agents/environments/files.d.mts.map +1 -1
  34. package/resources/beta/agents/environments/files.d.ts +5 -1
  35. package/resources/beta/agents/environments/files.d.ts.map +1 -1
  36. package/resources/beta/agents/environments/templates.d.mts +2 -4
  37. package/resources/beta/agents/environments/templates.d.mts.map +1 -1
  38. package/resources/beta/agents/environments/templates.d.ts +2 -4
  39. package/resources/beta/agents/environments/templates.d.ts.map +1 -1
  40. package/resources/beta/agents/sessions/artifacts.d.mts +9 -1
  41. package/resources/beta/agents/sessions/artifacts.d.mts.map +1 -1
  42. package/resources/beta/agents/sessions/artifacts.d.ts +9 -1
  43. package/resources/beta/agents/sessions/artifacts.d.ts.map +1 -1
  44. package/resources/beta/agents/sessions/events.d.mts +4 -1
  45. package/resources/beta/agents/sessions/events.d.mts.map +1 -1
  46. package/resources/beta/agents/sessions/events.d.ts +4 -1
  47. package/resources/beta/agents/sessions/events.d.ts.map +1 -1
  48. package/resources/beta/agents/sessions/events.js +4 -1
  49. package/resources/beta/agents/sessions/events.js.map +1 -1
  50. package/resources/beta/agents/sessions/events.mjs +4 -1
  51. package/resources/beta/agents/sessions/events.mjs.map +1 -1
  52. package/resources/beta/agents/sessions/sessions.d.mts +8 -2
  53. package/resources/beta/agents/sessions/sessions.d.mts.map +1 -1
  54. package/resources/beta/agents/sessions/sessions.d.ts +8 -2
  55. package/resources/beta/agents/sessions/sessions.d.ts.map +1 -1
  56. package/resources/beta/agents/sessions/sessions.js +3 -1
  57. package/resources/beta/agents/sessions/sessions.js.map +1 -1
  58. package/resources/beta/agents/sessions/sessions.mjs +3 -1
  59. package/resources/beta/agents/sessions/sessions.mjs.map +1 -1
  60. package/resources/beta/agents/vaults/credentials.d.mts +6 -1
  61. package/resources/beta/agents/vaults/credentials.d.mts.map +1 -1
  62. package/resources/beta/agents/vaults/credentials.d.ts +6 -1
  63. package/resources/beta/agents/vaults/credentials.d.ts.map +1 -1
  64. package/resources/beta/agents/vaults/vaults.d.mts +6 -1
  65. package/resources/beta/agents/vaults/vaults.d.mts.map +1 -1
  66. package/resources/beta/agents/vaults/vaults.d.ts +6 -1
  67. package/resources/beta/agents/vaults/vaults.d.ts.map +1 -1
  68. package/resources/beta/agents/vaults/vaults.js.map +1 -1
  69. package/resources/beta/agents/vaults/vaults.mjs.map +1 -1
  70. package/resources/beta/responses/responses.d.mts +11 -7
  71. package/resources/beta/responses/responses.d.mts.map +1 -1
  72. package/resources/beta/responses/responses.d.ts +11 -7
  73. package/resources/beta/responses/responses.d.ts.map +1 -1
  74. package/resources/beta/responses/responses.js.map +1 -1
  75. package/resources/beta/responses/responses.mjs.map +1 -1
  76. package/resources/index.d.mts +1 -1
  77. package/resources/index.d.mts.map +1 -1
  78. package/resources/index.d.ts +1 -1
  79. package/resources/index.d.ts.map +1 -1
  80. package/resources/index.js +1 -1
  81. package/resources/index.js.map +1 -1
  82. package/resources/index.mjs +1 -1
  83. package/resources/index.mjs.map +1 -1
  84. package/resources/realtime/client-secrets.d.mts +7 -3
  85. package/resources/realtime/client-secrets.d.mts.map +1 -1
  86. package/resources/realtime/client-secrets.d.ts +7 -3
  87. package/resources/realtime/client-secrets.d.ts.map +1 -1
  88. package/resources/realtime/realtime.d.mts +17 -8
  89. package/resources/realtime/realtime.d.mts.map +1 -1
  90. package/resources/realtime/realtime.d.ts +17 -8
  91. package/resources/realtime/realtime.d.ts.map +1 -1
  92. package/resources/realtime/realtime.js.map +1 -1
  93. package/resources/realtime/realtime.mjs.map +1 -1
  94. package/resources/responses/responses.d.mts +8 -4
  95. package/resources/responses/responses.d.mts.map +1 -1
  96. package/resources/responses/responses.d.ts +8 -4
  97. package/resources/responses/responses.d.ts.map +1 -1
  98. package/resources/responses/responses.js.map +1 -1
  99. package/resources/responses/responses.mjs.map +1 -1
  100. package/resources/shared.d.mts +1 -1
  101. package/resources/shared.d.mts.map +1 -1
  102. package/resources/shared.d.ts +1 -1
  103. package/resources/shared.d.ts.map +1 -1
  104. package/resources/webhooks/event-types.d.mts +17 -0
  105. package/resources/webhooks/event-types.d.mts.map +1 -0
  106. package/resources/webhooks/event-types.d.ts +17 -0
  107. package/resources/webhooks/event-types.d.ts.map +1 -0
  108. package/resources/webhooks/event-types.js +21 -0
  109. package/resources/webhooks/event-types.js.map +1 -0
  110. package/resources/webhooks/event-types.mjs +17 -0
  111. package/resources/webhooks/event-types.mjs.map +1 -0
  112. package/resources/webhooks/index.d.mts +1 -0
  113. package/resources/webhooks/index.d.mts.map +1 -1
  114. package/resources/webhooks/index.d.ts +1 -0
  115. package/resources/webhooks/index.d.ts.map +1 -1
  116. package/resources/webhooks/index.js +3 -0
  117. package/resources/webhooks/index.js.map +1 -1
  118. package/resources/webhooks/index.mjs +1 -0
  119. package/resources/webhooks/index.mjs.map +1 -1
  120. package/resources/webhooks/webhooks.d.mts +279 -1
  121. package/resources/webhooks/webhooks.d.mts.map +1 -1
  122. package/resources/webhooks/webhooks.d.ts +279 -1
  123. package/resources/webhooks/webhooks.d.ts.map +1 -1
  124. package/resources/webhooks/webhooks.js +121 -0
  125. package/resources/webhooks/webhooks.js.map +1 -1
  126. package/resources/webhooks/webhooks.mjs +121 -0
  127. package/resources/webhooks/webhooks.mjs.map +1 -1
  128. package/src/client.ts +16 -10
  129. package/src/internal/parse.ts +14 -10
  130. package/src/internal/utils/log.ts +1 -0
  131. package/src/resources/admin/organization/admin-api-keys.ts +6 -1
  132. package/src/resources/beta/agents/agents.ts +7 -3
  133. package/src/resources/beta/agents/environments/files.ts +6 -1
  134. package/src/resources/beta/agents/environments/templates.ts +2 -4
  135. package/src/resources/beta/agents/sessions/artifacts.ts +11 -1
  136. package/src/resources/beta/agents/sessions/events.ts +4 -1
  137. package/src/resources/beta/agents/sessions/sessions.ts +9 -2
  138. package/src/resources/beta/agents/vaults/credentials.ts +7 -1
  139. package/src/resources/beta/agents/vaults/vaults.ts +7 -1
  140. package/src/resources/beta/responses/responses.ts +11 -7
  141. package/src/resources/index.ts +1 -1
  142. package/src/resources/realtime/client-secrets.ts +7 -3
  143. package/src/resources/realtime/realtime.ts +17 -8
  144. package/src/resources/responses/responses.ts +8 -4
  145. package/src/resources/shared.ts +2 -2
  146. package/src/resources/webhooks/api.md +40 -21
  147. package/src/resources/webhooks/event-types.ts +21 -0
  148. package/src/resources/webhooks/index.ts +1 -0
  149. package/src/resources/webhooks/webhooks.ts +452 -0
  150. package/src/version.ts +1 -1
  151. package/version.d.mts +1 -1
  152. package/version.d.ts +1 -1
  153. package/version.js +1 -1
  154. package/version.mjs +1 -1
package/src/client.ts CHANGED
@@ -1278,16 +1278,22 @@ export class OpenAI {
1278
1278
  const retryLogStr = retryOfRequestLogID === undefined ? '' : `, retryOf: ${retryOfRequestLogID}`;
1279
1279
  const startTime = x509Authentication?.requestStartedAt(options) ?? Date.now();
1280
1280
 
1281
- loggerFor(this).debug(
1282
- `[${requestLogID}] sending request`,
1283
- formatRequestDetails({
1284
- retryOfRequestLogID,
1285
- method: options.method,
1286
- url,
1287
- options: x509Authentication ? { body: req.body, ...x509Authentication.requestSnapshot() } : options,
1288
- headers: req.headers,
1289
- }),
1290
- );
1281
+ if (this.logLevel === 'debug') {
1282
+ // Summarize serialized strings without reparsing or re-running caller serialization hooks.
1283
+ const body = typeof req.body === 'string' ? { type: 'string', length: req.body.length } : req.body;
1284
+ loggerFor(this).debug(
1285
+ `[${requestLogID}] sending request`,
1286
+ formatRequestDetails({
1287
+ retryOfRequestLogID,
1288
+ method: options.method,
1289
+ url,
1290
+ options: x509Authentication
1291
+ ? { body, ...x509Authentication.requestSnapshot() }
1292
+ : { ...options, body },
1293
+ headers: req.headers,
1294
+ }),
1295
+ );
1296
+ }
1291
1297
 
1292
1298
  const callerSignal = x509Authentication ? x509Authentication.requestSnapshot().signal : options.signal;
1293
1299
  if (callerSignal?.aborted || req.signal?.aborted) {
@@ -20,6 +20,7 @@ export async function defaultParseResponse<T>(
20
20
  props: APIResponseProps,
21
21
  ): Promise<WithRequestID<T>> {
22
22
  const { response, requestLogID, retryOfRequestLogID, startTime } = props;
23
+ let jsonBodyLength: number | undefined;
23
24
  const body = await (async () => {
24
25
  if (props.options.stream) {
25
26
  loggerFor(client).debug('response', response.status, response.url, response.headers, response.body);
@@ -73,6 +74,7 @@ export async function defaultParseResponse<T>(
73
74
  }
74
75
 
75
76
  const json = JSON.parse(bodyText);
77
+ jsonBodyLength = bodyText.length;
76
78
  return addRequestID(json as T, response);
77
79
  }
78
80
 
@@ -81,16 +83,18 @@ export async function defaultParseResponse<T>(
81
83
  })().catch((error: unknown) => {
82
84
  throw asAbortError(error, props.controller.signal);
83
85
  });
84
- loggerFor(client).debug(
85
- `[${requestLogID}] response parsed`,
86
- formatRequestDetails({
87
- retryOfRequestLogID,
88
- url: response.url,
89
- status: response.status,
90
- body,
91
- durationMs: Date.now() - startTime,
92
- }),
93
- );
86
+ if (client.logLevel === 'debug') {
87
+ loggerFor(client).debug(
88
+ `[${requestLogID}] response parsed`,
89
+ formatRequestDetails({
90
+ retryOfRequestLogID,
91
+ url: response.url,
92
+ status: response.status,
93
+ body: jsonBodyLength === undefined ? body : { type: 'json', length: jsonBodyLength },
94
+ durationMs: Date.now() - startTime,
95
+ }),
96
+ );
97
+ }
94
98
  return body;
95
99
  }
96
100
 
@@ -94,6 +94,7 @@ const sensitiveQueryNames = new Set([
94
94
  'token',
95
95
  'password',
96
96
  'clientsecret',
97
+ 'signingsecret',
97
98
  'xamzsecuritytoken',
98
99
  'xamzsignature',
99
100
  'xamzcredential',
@@ -191,7 +191,12 @@ export interface AdminAPIKeyCreateParams {
191
191
  expires_in_seconds?: number;
192
192
  }
193
193
 
194
- export interface AdminAPIKeyListParams extends CursorPageParams {
194
+ export interface AdminAPIKeyListParams extends Omit<CursorPageParams, 'after'> {
195
+ /**
196
+ * Return keys with IDs that come after this ID in the pagination order.
197
+ */
198
+ after?: string | null;
199
+
195
200
  /**
196
201
  * Order results by creation time, ascending or descending.
197
202
  */
@@ -2955,8 +2955,7 @@ export namespace EnvironmentParam {
2955
2955
  /**
2956
2956
  * The environment's network access mode.
2957
2957
  *
2958
- * - `enabled` - Allows unrestricted network access, matching an omitted network
2959
- * policy.
2958
+ * - `enabled` - Allows unrestricted network access.
2960
2959
  * - `disabled` - Disables network access.
2961
2960
  * - `restricted` - Allows access only to configured domains.
2962
2961
  */
@@ -4481,7 +4480,12 @@ export interface AgentUpdateParams {
4481
4480
  tools?: Array<PersistedAgentToolParam> | null;
4482
4481
  }
4483
4482
 
4484
- export interface AgentListParams extends CursorPageParams {
4483
+ export interface AgentListParams extends Omit<CursorPageParams, 'limit'> {
4484
+ /**
4485
+ * The maximum number of resources to return.
4486
+ */
4487
+ limit?: number | null;
4488
+
4485
4489
  /**
4486
4490
  * The order in which resources are returned. Defaults to `desc`.
4487
4491
  *
@@ -139,7 +139,12 @@ export declare namespace FileCreateParams {
139
139
  }
140
140
  }
141
141
 
142
- export interface FileListParams extends TokenPageParams {
142
+ export interface FileListParams extends Omit<TokenPageParams, 'limit'> {
143
+ /**
144
+ * The maximum number of files to return, between 1 and 100.
145
+ */
146
+ limit?: number | null;
147
+
143
148
  /**
144
149
  * Sort by case-sensitive path components. Defaults to descending.
145
150
  *
@@ -392,8 +392,7 @@ export namespace TemplateCreateParams {
392
392
  /**
393
393
  * The environment's network access mode.
394
394
  *
395
- * - `enabled` - Allows unrestricted network access, matching an omitted network
396
- * policy.
395
+ * - `enabled` - Allows unrestricted network access.
397
396
  * - `disabled` - Disables network access.
398
397
  * - `restricted` - Allows access only to configured domains.
399
398
  */
@@ -481,8 +480,7 @@ export namespace TemplateUpdateParams {
481
480
  /**
482
481
  * The environment's network access mode.
483
482
  *
484
- * - `enabled` - Allows unrestricted network access, matching an omitted network
485
- * policy.
483
+ * - `enabled` - Allows unrestricted network access.
486
484
  * - `disabled` - Disables network access.
487
485
  * - `restricted` - Allows access only to configured domains.
488
486
  */
@@ -197,12 +197,22 @@ export interface ArtifactRetrieveParams {
197
197
  session_id: string;
198
198
  }
199
199
 
200
- export interface ArtifactListParams extends CursorPageParams {
200
+ export interface ArtifactListParams extends Omit<CursorPageParams, 'after' | 'limit'> {
201
+ /**
202
+ * Return artifacts after this immutable artifact ID.
203
+ */
204
+ after?: string | null;
205
+
201
206
  /**
202
207
  * Restrict the listing to artifacts produced by this environment.
203
208
  */
204
209
  environment_id?: string | null;
205
210
 
211
+ /**
212
+ * The maximum number of artifacts to return, between 1 and 100.
213
+ */
214
+ limit?: number | null;
215
+
206
216
  /**
207
217
  * Sort by creation time and ID. Defaults to descending.
208
218
  *
@@ -11,7 +11,10 @@ import { path } from '../../../../internal/utils/path';
11
11
  export class Events extends APIResource {
12
12
  /**
13
13
  * Submits message, cancellation, or tool-result events to a managed agent session.
14
- * See
14
+ * Cancellation can recover a still-open turn whose backend execution has ended by
15
+ * marking it cancelled and abandoning unpublished outputs. Saved results,
16
+ * published files, and existing terminal outcomes are preserved. HTTP 202 confirms
17
+ * acceptance, not durable completion. See
15
18
  * [session events](https://developers.openai.com/api/docs/guides/agents-api/sessions/events).
16
19
  *
17
20
  * @example
@@ -150,7 +150,9 @@ export class Sessions extends APIResource {
150
150
 
151
151
  /**
152
152
  * Removes a managed agent session from the public API and returns a deletion
153
- * confirmation. Physical cleanup may continue asynchronously. See
153
+ * confirmation. If backend execution has ended, deletion can cancel a still-open
154
+ * public turn and abandon unpublished outputs. Running execution must be cancelled
155
+ * first. Physical cleanup may continue asynchronously. See
154
156
  * [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).
155
157
  *
156
158
  * @example
@@ -331,13 +333,18 @@ export namespace SessionUpdateParams {
331
333
  }
332
334
  }
333
335
 
334
- export interface SessionListParams extends CursorPageParams {
336
+ export interface SessionListParams extends Omit<CursorPageParams, 'limit'> {
335
337
  /**
336
338
  * Only return sessions whose root agent has this ID. Omit to return sessions for
337
339
  * all agents.
338
340
  */
339
341
  agent_id?: string;
340
342
 
343
+ /**
344
+ * The maximum number of resources to return.
345
+ */
346
+ limit?: number | null;
347
+
341
348
  /**
342
349
  * Sort order by the `created_at` timestamp. Use `asc` for ascending order or
343
350
  * `desc` for descending order. Defaults to `desc`.
@@ -643,7 +643,13 @@ export interface CredentialUpdateParams {
643
643
  auth: CredentialAuthRotateParam;
644
644
  }
645
645
 
646
- export interface CredentialListParams extends CursorPageParams {
646
+ export interface CredentialListParams extends Omit<CursorPageParams, 'limit'> {
647
+ /**
648
+ * The maximum number of resources to return. Defaults to 20. Values are clamped
649
+ * between 1 and 100.
650
+ */
651
+ limit?: number | null;
652
+
647
653
  /**
648
654
  * Sort order by the `created_at` timestamp. Use `asc` for ascending order or
649
655
  * `desc` for descending order. Defaults to `desc`.
@@ -187,7 +187,13 @@ export interface VaultCreateParams {
187
187
  name?: string;
188
188
  }
189
189
 
190
- export interface VaultListParams extends CursorPageParams {
190
+ export interface VaultListParams extends Omit<CursorPageParams, 'limit'> {
191
+ /**
192
+ * The maximum number of resources to return. Defaults to 20. Values are clamped
193
+ * between 1 and 100.
194
+ */
195
+ limit?: number | null;
196
+
191
197
  /**
192
198
  * Sort order by the `created_at` timestamp. Use `asc` for ascending order or
193
199
  * `desc` for descending order. Defaults to `desc`.
@@ -1163,6 +1163,7 @@ export interface BetaResponse {
1163
1163
  | 'gpt-5.1'
1164
1164
  | 'gpt-5.1-2025-11-13'
1165
1165
  | 'gpt-5.1-codex'
1166
+ | 'gpt-5.1-mini'
1166
1167
  | 'gpt-5.1-chat-latest'
1167
1168
  | 'gpt-5'
1168
1169
  | 'gpt-5-mini'
@@ -1228,7 +1229,6 @@ export interface BetaResponse {
1228
1229
  | 'gpt-3.5-turbo-1106'
1229
1230
  | 'gpt-3.5-turbo-0125'
1230
1231
  | 'gpt-3.5-turbo-16k-0613'
1231
- | 'gpt-5.1-mini'
1232
1232
  | 'o1-pro'
1233
1233
  | 'o1-pro-2025-03-19'
1234
1234
  | 'o3-pro'
@@ -11742,6 +11742,7 @@ export namespace BetaResponsesClientEvent {
11742
11742
  | 'gpt-5.1'
11743
11743
  | 'gpt-5.1-2025-11-13'
11744
11744
  | 'gpt-5.1-codex'
11745
+ | 'gpt-5.1-mini'
11745
11746
  | 'gpt-5.1-chat-latest'
11746
11747
  | 'gpt-5'
11747
11748
  | 'gpt-5-mini'
@@ -11807,7 +11808,6 @@ export namespace BetaResponsesClientEvent {
11807
11808
  | 'gpt-3.5-turbo-1106'
11808
11809
  | 'gpt-3.5-turbo-0125'
11809
11810
  | 'gpt-3.5-turbo-16k-0613'
11810
- | 'gpt-5.1-mini'
11811
11811
  | 'o1-pro'
11812
11812
  | 'o1-pro-2025-03-19'
11813
11813
  | 'o3-pro'
@@ -13229,11 +13229,15 @@ export namespace BetaTool {
13229
13229
  authorization?: string;
13230
13230
 
13231
13231
  /**
13232
- * Identifier for service connectors, like those available in ChatGPT. One of
13233
- * `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more about
13234
- * service connectors
13232
+ * @deprecated Identifier for service connectors, like those available in ChatGPT.
13233
+ * One of `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more
13234
+ * about service connectors
13235
13235
  * [here](https://developers.openai.com/api/docs/guides/tools-connectors-mcp#connectors).
13236
13236
  *
13237
+ * This field is deprecated for models released after September 1, 2026. Use
13238
+ * `server_url` to connect to a remote MCP server, or `tunnel_id` to connect
13239
+ * through a Secure MCP Tunnel.
13240
+ *
13237
13241
  * Currently supported `connector_id` values are:
13238
13242
  *
13239
13243
  * - Dropbox: `connector_dropbox`
@@ -13993,6 +13997,7 @@ export interface ResponseCreateParamsBase {
13993
13997
  | 'gpt-5.1'
13994
13998
  | 'gpt-5.1-2025-11-13'
13995
13999
  | 'gpt-5.1-codex'
14000
+ | 'gpt-5.1-mini'
13996
14001
  | 'gpt-5.1-chat-latest'
13997
14002
  | 'gpt-5'
13998
14003
  | 'gpt-5-mini'
@@ -14058,7 +14063,6 @@ export interface ResponseCreateParamsBase {
14058
14063
  | 'gpt-3.5-turbo-1106'
14059
14064
  | 'gpt-3.5-turbo-0125'
14060
14065
  | 'gpt-3.5-turbo-16k-0613'
14061
- | 'gpt-5.1-mini'
14062
14066
  | 'o1-pro'
14063
14067
  | 'o1-pro-2025-03-19'
14064
14068
  | 'o3-pro'
@@ -14663,6 +14667,7 @@ export interface ResponseCompactParams {
14663
14667
  | 'gpt-5.1'
14664
14668
  | 'gpt-5.1-2025-11-13'
14665
14669
  | 'gpt-5.1-codex'
14670
+ | 'gpt-5.1-mini'
14666
14671
  | 'gpt-5.1-chat-latest'
14667
14672
  | 'gpt-5'
14668
14673
  | 'gpt-5-mini'
@@ -14728,7 +14733,6 @@ export interface ResponseCompactParams {
14728
14733
  | 'gpt-3.5-turbo-1106'
14729
14734
  | 'gpt-3.5-turbo-0125'
14730
14735
  | 'gpt-3.5-turbo-16k-0613'
14731
- | 'gpt-5.1-mini'
14732
14736
  | 'o1-pro'
14733
14737
  | 'o1-pro-2025-03-19'
14734
14738
  | 'o3-pro'
@@ -156,4 +156,4 @@ export {
156
156
  type VideoRemixParams,
157
157
  type VideosPage,
158
158
  } from './videos';
159
- export { Webhooks } from './webhooks';
159
+ export { Webhooks } from './webhooks/webhooks';
@@ -427,11 +427,15 @@ export namespace RealtimeSessionCreateResponse {
427
427
  authorization?: string;
428
428
 
429
429
  /**
430
- * Identifier for service connectors, like those available in ChatGPT. One of
431
- * `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more about
432
- * service connectors
430
+ * @deprecated Identifier for service connectors, like those available in ChatGPT.
431
+ * One of `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more
432
+ * about service connectors
433
433
  * [here](https://developers.openai.com/api/docs/guides/tools-connectors-mcp#connectors).
434
434
  *
435
+ * This field is deprecated for models released after September 1, 2026. Use
436
+ * `server_url` to connect to a remote MCP server, or `tunnel_id` to connect
437
+ * through a Secure MCP Tunnel.
438
+ *
435
439
  * Currently supported `connector_id` values are:
436
440
  *
437
441
  * - Dropbox: `connector_dropbox`
@@ -175,8 +175,9 @@ export interface ConversationItemAdded {
175
175
  * "history" of the conversation and to add new items mid-stream, but has the
176
176
  * current limitation that it cannot populate assistant audio messages.
177
177
  *
178
- * If successful, the server will respond with a `conversation.item.created` event,
179
- * otherwise an `error` event will be sent.
178
+ * If successful, the server will emit a `conversation.item.added` event and, when
179
+ * the item is finalized, a `conversation.item.done` event. Otherwise, an `error`
180
+ * event will be sent.
180
181
  */
181
182
  export interface ConversationItemCreateEvent {
182
183
  /**
@@ -2263,11 +2264,15 @@ export interface RealtimeResponseCreateMcpTool {
2263
2264
  authorization?: string;
2264
2265
 
2265
2266
  /**
2266
- * Identifier for service connectors, like those available in ChatGPT. One of
2267
- * `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more about
2268
- * service connectors
2267
+ * @deprecated Identifier for service connectors, like those available in ChatGPT.
2268
+ * One of `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more
2269
+ * about service connectors
2269
2270
  * [here](https://developers.openai.com/api/docs/guides/tools-connectors-mcp#connectors).
2270
2271
  *
2272
+ * This field is deprecated for models released after September 1, 2026. Use
2273
+ * `server_url` to connect to a remote MCP server, or `tunnel_id` to connect
2274
+ * through a Secure MCP Tunnel.
2275
+ *
2271
2276
  * Currently supported `connector_id` values are:
2272
2277
  *
2273
2278
  * - Dropbox: `connector_dropbox`
@@ -3317,11 +3322,15 @@ export namespace RealtimeToolsConfigUnion {
3317
3322
  authorization?: string;
3318
3323
 
3319
3324
  /**
3320
- * Identifier for service connectors, like those available in ChatGPT. One of
3321
- * `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more about
3322
- * service connectors
3325
+ * @deprecated Identifier for service connectors, like those available in ChatGPT.
3326
+ * One of `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more
3327
+ * about service connectors
3323
3328
  * [here](https://developers.openai.com/api/docs/guides/tools-connectors-mcp#connectors).
3324
3329
  *
3330
+ * This field is deprecated for models released after September 1, 2026. Use
3331
+ * `server_url` to connect to a remote MCP server, or `tunnel_id` to connect
3332
+ * through a Secure MCP Tunnel.
3333
+ *
3325
3334
  * Currently supported `connector_id` values are:
3326
3335
  *
3327
3336
  * - Dropbox: `connector_dropbox`
@@ -10080,11 +10080,15 @@ export namespace Tool {
10080
10080
  authorization?: string;
10081
10081
 
10082
10082
  /**
10083
- * Identifier for service connectors, like those available in ChatGPT. One of
10084
- * `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more about
10085
- * service connectors
10083
+ * @deprecated Identifier for service connectors, like those available in ChatGPT.
10084
+ * One of `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more
10085
+ * about service connectors
10086
10086
  * [here](https://developers.openai.com/api/docs/guides/tools-connectors-mcp#connectors).
10087
10087
  *
10088
+ * This field is deprecated for models released after September 1, 2026. Use
10089
+ * `server_url` to connect to a remote MCP server, or `tunnel_id` to connect
10090
+ * through a Secure MCP Tunnel.
10091
+ *
10088
10092
  * Currently supported `connector_id` values are:
10089
10093
  *
10090
10094
  * - Dropbox: `connector_dropbox`
@@ -11296,6 +11300,7 @@ export interface ResponseCompactParams {
11296
11300
  | 'gpt-5.1'
11297
11301
  | 'gpt-5.1-2025-11-13'
11298
11302
  | 'gpt-5.1-codex'
11303
+ | 'gpt-5.1-mini'
11299
11304
  | 'gpt-5.1-chat-latest'
11300
11305
  | 'gpt-5'
11301
11306
  | 'gpt-5-mini'
@@ -11361,7 +11366,6 @@ export interface ResponseCompactParams {
11361
11366
  | 'gpt-3.5-turbo-1106'
11362
11367
  | 'gpt-3.5-turbo-0125'
11363
11368
  | 'gpt-3.5-turbo-16k-0613'
11364
- | 'gpt-5.1-mini'
11365
11369
  | 'o1-pro'
11366
11370
  | 'o1-pro-2025-03-19'
11367
11371
  | 'o3-pro'
@@ -44,6 +44,7 @@ export type ChatModel =
44
44
  | 'gpt-5.1'
45
45
  | 'gpt-5.1-2025-11-13'
46
46
  | 'gpt-5.1-codex'
47
+ | 'gpt-5.1-mini'
47
48
  | 'gpt-5.1-chat-latest'
48
49
  | 'gpt-5'
49
50
  | 'gpt-5-mini'
@@ -108,8 +109,7 @@ export type ChatModel =
108
109
  | 'gpt-3.5-turbo-0613'
109
110
  | 'gpt-3.5-turbo-1106'
110
111
  | 'gpt-3.5-turbo-0125'
111
- | 'gpt-3.5-turbo-16k-0613'
112
- | 'gpt-5.1-mini';
112
+ | 'gpt-3.5-turbo-16k-0613';
113
113
 
114
114
  /**
115
115
  * A filter used to compare a specified attribute key to a given value using a
@@ -2,27 +2,46 @@
2
2
 
3
3
  Types:
4
4
 
5
- - <code><a href="./src/resources/webhooks.ts">BatchCancelledWebhookEvent</a></code>
6
- - <code><a href="./src/resources/webhooks.ts">BatchCompletedWebhookEvent</a></code>
7
- - <code><a href="./src/resources/webhooks.ts">BatchExpiredWebhookEvent</a></code>
8
- - <code><a href="./src/resources/webhooks.ts">BatchFailedWebhookEvent</a></code>
9
- - <code><a href="./src/resources/webhooks.ts">EvalRunCanceledWebhookEvent</a></code>
10
- - <code><a href="./src/resources/webhooks.ts">EvalRunFailedWebhookEvent</a></code>
11
- - <code><a href="./src/resources/webhooks.ts">EvalRunSucceededWebhookEvent</a></code>
12
- - <code><a href="./src/resources/webhooks.ts">FineTuningJobCancelledWebhookEvent</a></code>
13
- - <code><a href="./src/resources/webhooks.ts">FineTuningJobFailedWebhookEvent</a></code>
14
- - <code><a href="./src/resources/webhooks.ts">FineTuningJobSucceededWebhookEvent</a></code>
15
- - <code><a href="./src/resources/webhooks.ts">LiveCallIncomingWebhookEvent</a></code>
16
- - <code><a href="./src/resources/webhooks.ts">LiveTransportIncomingWebhookEvent</a></code>
17
- - <code><a href="./src/resources/webhooks.ts">RealtimeCallIncomingWebhookEvent</a></code>
18
- - <code><a href="./src/resources/webhooks.ts">ResponseCancelledWebhookEvent</a></code>
19
- - <code><a href="./src/resources/webhooks.ts">ResponseCompletedWebhookEvent</a></code>
20
- - <code><a href="./src/resources/webhooks.ts">ResponseFailedWebhookEvent</a></code>
21
- - <code><a href="./src/resources/webhooks.ts">ResponseIncompleteWebhookEvent</a></code>
22
- - <code><a href="./src/resources/webhooks.ts">SafetyAlertCreatedWebhookEvent</a></code>
23
- - <code><a href="./src/resources/webhooks.ts">SafetyOrgAlertCreatedWebhookEvent</a></code>
24
- - <code><a href="./src/resources/webhooks.ts">UnwrapWebhookEvent</a></code>
5
+ - <code><a href="./src/resources/webhooks/webhooks.ts">BatchCancelledWebhookEvent</a></code>
6
+ - <code><a href="./src/resources/webhooks/webhooks.ts">BatchCompletedWebhookEvent</a></code>
7
+ - <code><a href="./src/resources/webhooks/webhooks.ts">BatchExpiredWebhookEvent</a></code>
8
+ - <code><a href="./src/resources/webhooks/webhooks.ts">BatchFailedWebhookEvent</a></code>
9
+ - <code><a href="./src/resources/webhooks/webhooks.ts">DeletedWebhookEndpoint</a></code>
10
+ - <code><a href="./src/resources/webhooks/webhooks.ts">EvalRunCanceledWebhookEvent</a></code>
11
+ - <code><a href="./src/resources/webhooks/webhooks.ts">EvalRunFailedWebhookEvent</a></code>
12
+ - <code><a href="./src/resources/webhooks/webhooks.ts">EvalRunSucceededWebhookEvent</a></code>
13
+ - <code><a href="./src/resources/webhooks/webhooks.ts">FineTuningJobCancelledWebhookEvent</a></code>
14
+ - <code><a href="./src/resources/webhooks/webhooks.ts">FineTuningJobFailedWebhookEvent</a></code>
15
+ - <code><a href="./src/resources/webhooks/webhooks.ts">FineTuningJobSucceededWebhookEvent</a></code>
16
+ - <code><a href="./src/resources/webhooks/webhooks.ts">LiveCallIncomingWebhookEvent</a></code>
17
+ - <code><a href="./src/resources/webhooks/webhooks.ts">LiveTransportIncomingWebhookEvent</a></code>
18
+ - <code><a href="./src/resources/webhooks/webhooks.ts">RealtimeCallIncomingWebhookEvent</a></code>
19
+ - <code><a href="./src/resources/webhooks/webhooks.ts">ResponseCancelledWebhookEvent</a></code>
20
+ - <code><a href="./src/resources/webhooks/webhooks.ts">ResponseCompletedWebhookEvent</a></code>
21
+ - <code><a href="./src/resources/webhooks/webhooks.ts">ResponseFailedWebhookEvent</a></code>
22
+ - <code><a href="./src/resources/webhooks/webhooks.ts">ResponseIncompleteWebhookEvent</a></code>
23
+ - <code><a href="./src/resources/webhooks/webhooks.ts">SafetyAlertCreatedWebhookEvent</a></code>
24
+ - <code><a href="./src/resources/webhooks/webhooks.ts">SafetyOrgAlertCreatedWebhookEvent</a></code>
25
+ - <code><a href="./src/resources/webhooks/webhooks.ts">UnwrapWebhookEvent</a></code>
26
+ - <code><a href="./src/resources/webhooks/webhooks.ts">WebhookEndpoint</a></code>
27
+ - <code><a href="./src/resources/webhooks/webhooks.ts">WebhookEndpointList</a></code>
28
+ - <code><a href="./src/resources/webhooks/webhooks.ts">WebhookEndpointTestResult</a></code>
29
+ - <code><a href="./src/resources/webhooks/webhooks.ts">WebhookEndpointWithSecret</a></code>
30
+ - <code><a href="./src/resources/webhooks/webhooks.ts">WebhookEventTypeList</a></code>
25
31
 
26
32
  Methods:
27
33
 
28
- - <code>client.webhooks.<a href="./src/resources/webhooks.ts">unwrap</a>(body) -> void</code>
34
+ - <code title="post /webhook_endpoints">client.webhooks.<a href="./src/resources/webhooks/webhooks.ts">create</a>({ ...params }) -> WebhookEndpointWithSecret</code>
35
+ - <code title="get /webhook_endpoints/{webhook_endpoint_id}">client.webhooks.<a href="./src/resources/webhooks/webhooks.ts">retrieve</a>(webhookEndpointID) -> WebhookEndpoint</code>
36
+ - <code title="post /webhook_endpoints/{webhook_endpoint_id}">client.webhooks.<a href="./src/resources/webhooks/webhooks.ts">update</a>(webhookEndpointID, { ...params }) -> WebhookEndpoint</code>
37
+ - <code title="get /webhook_endpoints">client.webhooks.<a href="./src/resources/webhooks/webhooks.ts">list</a>({ ...params }) -> WebhookEndpointsPage</code>
38
+ - <code title="delete /webhook_endpoints/{webhook_endpoint_id}">client.webhooks.<a href="./src/resources/webhooks/webhooks.ts">delete</a>(webhookEndpointID) -> DeletedWebhookEndpoint</code>
39
+ - <code title="post /webhook_endpoints/{webhook_endpoint_id}/rotate_secret">client.webhooks.<a href="./src/resources/webhooks/webhooks.ts">rotateSecret</a>(webhookEndpointID, { ...params }) -> WebhookEndpointWithSecret</code>
40
+ - <code title="post /webhook_endpoints/{webhook_endpoint_id}/test">client.webhooks.<a href="./src/resources/webhooks/webhooks.ts">test</a>(webhookEndpointID, { ...params }) -> WebhookEndpointTestResult</code>
41
+ - <code>client.webhooks.<a href="./src/resources/webhooks/webhooks.ts">unwrap</a>(body) -> void</code>
42
+
43
+ ## EventTypes
44
+
45
+ Methods:
46
+
47
+ - <code title="get /webhook_event_types">client.webhooks.eventTypes.<a href="./src/resources/webhooks/event-types.ts">list</a>() -> WebhookEventTypeList</code>
@@ -0,0 +1,21 @@
1
+ // File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as WebhooksAPI from './webhooks';
5
+ import { APIPromise } from '../../core/api-promise';
6
+ import { RequestOptions } from '../../internal/request-options';
7
+
8
+ export class EventTypes extends APIResource {
9
+ /**
10
+ * Returns webhook event types visible to the authenticated project.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const webhookEventTypeList =
15
+ * await client.webhooks.eventTypes.list();
16
+ * ```
17
+ */
18
+ list(options?: RequestOptions): APIPromise<WebhooksAPI.WebhookEventTypeList> {
19
+ return this._client.get('/webhook_event_types', { ...options, __security: { bearerAuth: true } });
20
+ }
21
+ }
@@ -1,3 +1,4 @@
1
1
  // File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
2
2
 
3
+ export { EventTypes } from './event-types';
3
4
  export * from './webhooks';