openai 7.7.0 → 7.9.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 (223) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +15 -30
  3. package/auth/index.d.mts +1 -1
  4. package/auth/index.d.mts.map +1 -1
  5. package/auth/index.d.ts +1 -1
  6. package/auth/index.d.ts.map +1 -1
  7. package/auth/index.js.map +1 -1
  8. package/auth/index.mjs.map +1 -1
  9. package/auth/types.d.mts +9 -4
  10. package/auth/types.d.mts.map +1 -1
  11. package/auth/types.d.ts +9 -4
  12. package/auth/types.d.ts.map +1 -1
  13. package/auth/workload-identity-auth.d.mts +1 -1
  14. package/auth/workload-identity-auth.d.mts.map +1 -1
  15. package/auth/workload-identity-auth.d.ts +1 -1
  16. package/auth/workload-identity-auth.d.ts.map +1 -1
  17. package/auth/workload-identity-auth.js +23 -6
  18. package/auth/workload-identity-auth.js.map +1 -1
  19. package/auth/workload-identity-auth.mjs +23 -6
  20. package/auth/workload-identity-auth.mjs.map +1 -1
  21. package/auth/x509-transport.d.mts +36 -1
  22. package/auth/x509-transport.d.mts.map +1 -1
  23. package/auth/x509-transport.d.ts +36 -1
  24. package/auth/x509-transport.d.ts.map +1 -1
  25. package/auth/x509-transport.js +224 -1
  26. package/auth/x509-transport.js.map +1 -1
  27. package/auth/x509-transport.mjs +222 -1
  28. package/auth/x509-transport.mjs.map +1 -1
  29. package/azure.d.mts +3 -1
  30. package/azure.d.mts.map +1 -1
  31. package/azure.d.ts +3 -1
  32. package/azure.d.ts.map +1 -1
  33. package/azure.js.map +1 -1
  34. package/azure.mjs.map +1 -1
  35. package/bedrock.d.mts +3 -1
  36. package/bedrock.d.mts.map +1 -1
  37. package/bedrock.d.ts +3 -1
  38. package/bedrock.d.ts.map +1 -1
  39. package/bedrock.js.map +1 -1
  40. package/bedrock.mjs.map +1 -1
  41. package/beta/realtime/ws.d.mts.map +1 -1
  42. package/beta/realtime/ws.d.ts.map +1 -1
  43. package/beta/realtime/ws.js +2 -0
  44. package/beta/realtime/ws.js.map +1 -1
  45. package/beta/realtime/ws.mjs +2 -0
  46. package/beta/realtime/ws.mjs.map +1 -1
  47. package/client.d.mts +3 -1
  48. package/client.d.mts.map +1 -1
  49. package/client.d.ts +3 -1
  50. package/client.d.ts.map +1 -1
  51. package/client.js +31 -38
  52. package/client.js.map +1 -1
  53. package/client.mjs +31 -38
  54. package/client.mjs.map +1 -1
  55. package/core/EventEmitter.d.mts.map +1 -1
  56. package/core/EventEmitter.d.ts.map +1 -1
  57. package/core/EventEmitter.js +14 -1
  58. package/core/EventEmitter.js.map +1 -1
  59. package/core/EventEmitter.mjs +14 -1
  60. package/core/EventEmitter.mjs.map +1 -1
  61. package/internal/auth/x509-api-origin.d.mts +5 -0
  62. package/internal/auth/x509-api-origin.d.mts.map +1 -0
  63. package/internal/auth/x509-api-origin.d.ts +5 -0
  64. package/internal/auth/x509-api-origin.d.ts.map +1 -0
  65. package/internal/auth/x509-api-origin.js +28 -0
  66. package/internal/auth/x509-api-origin.js.map +1 -0
  67. package/internal/auth/x509-api-origin.mjs +24 -0
  68. package/internal/auth/x509-api-origin.mjs.map +1 -0
  69. package/internal/auth/x509-credential-options.d.mts +13 -0
  70. package/internal/auth/x509-credential-options.d.mts.map +1 -0
  71. package/internal/auth/x509-credential-options.d.ts +13 -0
  72. package/internal/auth/x509-credential-options.d.ts.map +1 -0
  73. package/internal/auth/x509-credential-options.js +122 -0
  74. package/internal/auth/x509-credential-options.js.map +1 -0
  75. package/internal/auth/x509-credential-options.mjs +118 -0
  76. package/internal/auth/x509-credential-options.mjs.map +1 -0
  77. package/internal/auth/x509-token-exchange.js +1 -1
  78. package/internal/auth/x509-token-exchange.mjs +1 -1
  79. package/internal/auth/x509-transport-capability.d.mts +12 -5
  80. package/internal/auth/x509-transport-capability.d.mts.map +1 -1
  81. package/internal/auth/x509-transport-capability.d.ts +12 -5
  82. package/internal/auth/x509-transport-capability.d.ts.map +1 -1
  83. package/internal/auth/x509-transport-capability.js +6 -5
  84. package/internal/auth/x509-transport-capability.js.map +1 -1
  85. package/internal/auth/x509-transport-capability.mjs +6 -5
  86. package/internal/auth/x509-transport-capability.mjs.map +1 -1
  87. package/internal/auth/x509-transport-registry.d.mts +8 -0
  88. package/internal/auth/x509-transport-registry.d.mts.map +1 -1
  89. package/internal/auth/x509-transport-registry.d.ts +8 -0
  90. package/internal/auth/x509-transport-registry.d.ts.map +1 -1
  91. package/internal/auth/x509-transport-registry.js +1 -1
  92. package/internal/auth/x509-transport-registry.js.map +1 -1
  93. package/internal/auth/x509-transport-registry.mjs +1 -1
  94. package/internal/auth/x509-transport-registry.mjs.map +1 -1
  95. package/internal/auth/x509-transport-state-browser.d.mts +4 -0
  96. package/internal/auth/x509-transport-state-browser.d.mts.map +1 -1
  97. package/internal/auth/x509-transport-state-browser.d.ts +4 -0
  98. package/internal/auth/x509-transport-state-browser.d.ts.map +1 -1
  99. package/internal/auth/x509-transport-state-browser.js +6 -1
  100. package/internal/auth/x509-transport-state-browser.js.map +1 -1
  101. package/internal/auth/x509-transport-state-browser.mjs +5 -0
  102. package/internal/auth/x509-transport-state-browser.mjs.map +1 -1
  103. package/internal/auth/x509-transport-state.cjs +6 -1
  104. package/internal/auth/x509-transport-state.cjs.map +1 -1
  105. package/internal/auth/x509-transport-state.d.cts +4 -0
  106. package/internal/auth/x509-transport-state.d.cts.map +1 -1
  107. package/internal/auth/x509-transport-state.js +36 -0
  108. package/internal/auth/x509-transport-state.mjs +19 -0
  109. package/internal/auth/x509-workload-identity-auth.d.mts +2 -4
  110. package/internal/auth/x509-workload-identity-auth.d.mts.map +1 -1
  111. package/internal/auth/x509-workload-identity-auth.d.ts +2 -4
  112. package/internal/auth/x509-workload-identity-auth.d.ts.map +1 -1
  113. package/internal/auth/x509-workload-identity-auth.js +44 -35
  114. package/internal/auth/x509-workload-identity-auth.js.map +1 -1
  115. package/internal/auth/x509-workload-identity-auth.mjs +40 -30
  116. package/internal/auth/x509-workload-identity-auth.mjs.map +1 -1
  117. package/internal/uploads.js +4 -2
  118. package/internal/uploads.js.map +1 -1
  119. package/internal/uploads.mjs +4 -2
  120. package/internal/uploads.mjs.map +1 -1
  121. package/internal/utils/log.d.mts +6 -0
  122. package/internal/utils/log.d.mts.map +1 -1
  123. package/internal/utils/log.d.ts +6 -0
  124. package/internal/utils/log.d.ts.map +1 -1
  125. package/internal/utils/log.js +72 -11
  126. package/internal/utils/log.js.map +1 -1
  127. package/internal/utils/log.mjs +69 -11
  128. package/internal/utils/log.mjs.map +1 -1
  129. package/lib/EventEmitter.d.mts.map +1 -1
  130. package/lib/EventEmitter.d.ts.map +1 -1
  131. package/lib/EventEmitter.js +14 -1
  132. package/lib/EventEmitter.js.map +1 -1
  133. package/lib/EventEmitter.mjs +14 -1
  134. package/lib/EventEmitter.mjs.map +1 -1
  135. package/package.json +10 -6
  136. package/realtime/ws.d.mts.map +1 -1
  137. package/realtime/ws.d.ts.map +1 -1
  138. package/realtime/ws.js +2 -0
  139. package/realtime/ws.js.map +1 -1
  140. package/realtime/ws.mjs +2 -0
  141. package/realtime/ws.mjs.map +1 -1
  142. package/resources/admin/organization/audit-logs.d.mts +2 -2
  143. package/resources/admin/organization/audit-logs.d.mts.map +1 -1
  144. package/resources/admin/organization/audit-logs.d.ts +2 -2
  145. package/resources/admin/organization/audit-logs.d.ts.map +1 -1
  146. package/resources/admin/organization/usage.d.mts +5 -0
  147. package/resources/admin/organization/usage.d.mts.map +1 -1
  148. package/resources/admin/organization/usage.d.ts +5 -0
  149. package/resources/admin/organization/usage.d.ts.map +1 -1
  150. package/resources/batches.d.mts +3 -3
  151. package/resources/batches.d.ts +3 -3
  152. package/resources/beta/responses/responses.d.mts +11 -23
  153. package/resources/beta/responses/responses.d.mts.map +1 -1
  154. package/resources/beta/responses/responses.d.ts +11 -23
  155. package/resources/beta/responses/responses.d.ts.map +1 -1
  156. package/resources/beta/responses/responses.js.map +1 -1
  157. package/resources/beta/responses/responses.mjs.map +1 -1
  158. package/resources/beta/responses/ws.d.mts.map +1 -1
  159. package/resources/beta/responses/ws.d.ts.map +1 -1
  160. package/resources/beta/responses/ws.js +3 -0
  161. package/resources/beta/responses/ws.js.map +1 -1
  162. package/resources/beta/responses/ws.mjs +3 -0
  163. package/resources/beta/responses/ws.mjs.map +1 -1
  164. package/resources/chat/completions/completions.d.mts +4 -4
  165. package/resources/chat/completions/completions.d.ts +4 -4
  166. package/resources/evals/evals.d.mts +4 -4
  167. package/resources/evals/evals.d.ts +4 -4
  168. package/resources/evals/runs/runs.d.mts +1 -1
  169. package/resources/evals/runs/runs.d.ts +1 -1
  170. package/resources/responses/responses.d.mts +13 -19
  171. package/resources/responses/responses.d.mts.map +1 -1
  172. package/resources/responses/responses.d.ts +13 -19
  173. package/resources/responses/responses.d.ts.map +1 -1
  174. package/resources/responses/responses.js.map +1 -1
  175. package/resources/responses/responses.mjs.map +1 -1
  176. package/resources/responses/ws.d.mts.map +1 -1
  177. package/resources/responses/ws.d.ts.map +1 -1
  178. package/resources/responses/ws.js +3 -0
  179. package/resources/responses/ws.js.map +1 -1
  180. package/resources/responses/ws.mjs +3 -0
  181. package/resources/responses/ws.mjs.map +1 -1
  182. package/resources/shared.d.mts +0 -2
  183. package/resources/shared.d.mts.map +1 -1
  184. package/resources/shared.d.ts +0 -2
  185. package/resources/shared.d.ts.map +1 -1
  186. package/src/_vendor/partial-json-parser/LICENSE +21 -0
  187. package/src/_vendor/partial-json-parser/README.md +11 -1
  188. package/src/auth/index.ts +1 -0
  189. package/src/auth/types.ts +10 -4
  190. package/src/auth/workload-identity-auth.ts +30 -6
  191. package/src/auth/x509-transport.ts +311 -2
  192. package/src/azure.ts +4 -1
  193. package/src/bedrock.ts +4 -1
  194. package/src/beta/realtime/ws.ts +2 -0
  195. package/src/client.ts +39 -34
  196. package/src/core/EventEmitter.ts +13 -1
  197. package/src/internal/auth/x509-api-origin.ts +27 -0
  198. package/src/internal/auth/x509-credential-options.ts +146 -0
  199. package/src/internal/auth/x509-transport-capability.ts +12 -5
  200. package/src/internal/auth/x509-transport-registry.ts +9 -0
  201. package/src/internal/auth/x509-transport-state-browser.ts +7 -0
  202. package/src/internal/auth/x509-transport-state.cts +7 -0
  203. package/src/internal/auth/x509-workload-identity-auth.ts +42 -33
  204. package/src/internal/uploads.ts +4 -2
  205. package/src/internal/utils/log.ts +76 -11
  206. package/src/lib/EventEmitter.ts +13 -1
  207. package/src/realtime/ws.ts +2 -0
  208. package/src/resources/admin/organization/audit-logs.ts +4 -0
  209. package/src/resources/admin/organization/usage.ts +6 -0
  210. package/src/resources/batches.ts +3 -3
  211. package/src/resources/beta/responses/responses.ts +11 -23
  212. package/src/resources/beta/responses/ws.ts +4 -0
  213. package/src/resources/chat/completions/completions.ts +4 -4
  214. package/src/resources/evals/evals.ts +4 -4
  215. package/src/resources/evals/runs/runs.ts +1 -1
  216. package/src/resources/responses/responses.ts +13 -19
  217. package/src/resources/responses/ws.ts +4 -0
  218. package/src/resources/shared.ts +0 -2
  219. package/src/version.ts +1 -1
  220. package/version.d.mts +1 -1
  221. package/version.d.ts +1 -1
  222. package/version.js +1 -1
  223. package/version.mjs +1 -1
@@ -82,6 +82,62 @@ export function loggerFor(client: OpenAI): Logger {
82
82
  return levelLogger;
83
83
  }
84
84
 
85
+ const sensitiveQueryNames = new Set([
86
+ 'apikey',
87
+ 'accesstoken',
88
+ 'refreshtoken',
89
+ 'sessiontoken',
90
+ 'sessionid',
91
+ 'idtoken',
92
+ 'authtoken',
93
+ 'authorization',
94
+ 'token',
95
+ 'password',
96
+ 'clientsecret',
97
+ 'xamzsecuritytoken',
98
+ 'xamzsignature',
99
+ 'xamzcredential',
100
+ ]);
101
+
102
+ /** Recognizes credential-bearing query names across ordinary and provider authentication. */
103
+ export function isSensitiveQueryParameter(name: string): boolean {
104
+ const normalized = name.toLowerCase().replace(/[-_]/gu, '');
105
+ return sensitiveQueryNames.has(normalized) || sensitiveQueryNames.has(normalized.replace(/^x/u, ''));
106
+ }
107
+
108
+ const sensitiveHeaderNames = new Set([
109
+ 'authorization',
110
+ 'proxy-authorization',
111
+ 'api-key',
112
+ 'x-api-key',
113
+ 'x-amz-security-token',
114
+ 'cookie',
115
+ 'set-cookie',
116
+ 'x-session-token',
117
+ 'x-session-id',
118
+ 'x-auth-token',
119
+ 'x-id-token',
120
+ ]);
121
+
122
+ /** Recognizes credential-bearing request headers across provider and workload authentication. */
123
+ export function isSensitiveHeader(name: string): boolean {
124
+ return sensitiveHeaderNames.has(name.toLowerCase().replace(/_/gu, '-')) || isSensitiveQueryParameter(name);
125
+ }
126
+
127
+ /** Removes credential-valued query parameters before a request URL reaches any logger. */
128
+ export function redactURL(value: string): string {
129
+ const url = new URL(value);
130
+ url.username = '';
131
+ url.password = '';
132
+ url.hash = '';
133
+ for (const name of url.searchParams.keys()) {
134
+ if (isSensitiveQueryParameter(name)) {
135
+ url.searchParams.set(name, '***');
136
+ }
137
+ }
138
+ return url.href;
139
+ }
140
+
85
141
  export const formatRequestDetails = (details: {
86
142
  options?: RequestOptions | undefined;
87
143
  headers?: Headers | Record<string, string> | undefined;
@@ -97,21 +153,30 @@ export const formatRequestDetails = (details: {
97
153
  if (details.options) {
98
154
  details.options = { ...details.options };
99
155
  delete details.options['headers']; // redundant + leaks internals
156
+ if (details.options.path) {
157
+ const path = details.options.path;
158
+ const redacted = new URL(redactURL(new URL(path, 'https://redacted.invalid').href));
159
+ details.options.path =
160
+ redacted.origin === 'https://redacted.invalid'
161
+ ? `${path.startsWith('/') ? '/' : ''}${redacted.pathname.slice(1)}${redacted.search}`
162
+ : redacted.href;
163
+ }
164
+ if (details.options.query) {
165
+ details.options.query = Object.fromEntries(
166
+ Object.entries(details.options.query).map(([name, value]) => [
167
+ name,
168
+ isSensitiveQueryParameter(name) ? '***' : value,
169
+ ]),
170
+ );
171
+ }
172
+ }
173
+ if (details.url) {
174
+ details.url = redactURL(details.url);
100
175
  }
101
176
  if (details.headers) {
102
177
  details.headers = Object.fromEntries(
103
178
  (details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(
104
- ([name, value]) => [
105
- name,
106
- name.toLowerCase() === 'authorization' ||
107
- name.toLowerCase() === 'api-key' ||
108
- name.toLowerCase() === 'x-api-key' ||
109
- name.toLowerCase() === 'x-amz-security-token' ||
110
- name.toLowerCase() === 'cookie' ||
111
- name.toLowerCase() === 'set-cookie'
112
- ? '***'
113
- : value,
114
- ],
179
+ ([name, value]) => [name, isSensitiveHeader(name) ? '***' : value],
115
180
  ),
116
181
  );
117
182
  }
@@ -184,11 +184,20 @@ export class EventEmitter<EventTypes extends Record<string, (...args: any) => an
184
184
  }
185
185
  return !listener.once && !listener.removed;
186
186
  }) as any;
187
+ let listenerThrew = false;
188
+ let firstListenerError: unknown;
187
189
  this.#listenerDispatchDepth += 1;
188
190
  try {
189
191
  for (const registration of listeners as any) {
190
192
  if (!registration.removed) {
191
- registration.listener(...(args as any));
193
+ try {
194
+ registration.listener(...(args as any));
195
+ } catch (error) {
196
+ if (!listenerThrew) {
197
+ listenerThrew = true;
198
+ firstListenerError = error;
199
+ }
200
+ }
192
201
  }
193
202
  }
194
203
  } finally {
@@ -197,6 +206,9 @@ export class EventEmitter<EventTypes extends Record<string, (...args: any) => an
197
206
  this.#cleanupEmittedListeners();
198
207
  }
199
208
  }
209
+ if (listenerThrew) {
210
+ throw firstListenerError;
211
+ }
200
212
  }
201
213
  }
202
214
 
@@ -3,6 +3,7 @@ import { assertBedrockWebSocketOrigin } from '../internal/bedrock';
3
3
  import { protectWebSocketOptionsFromCredentialRedirects } from '../internal/ws';
4
4
  import type { AzureOpenAI } from '../index';
5
5
  import { OpenAI } from '../index';
6
+ import { VERSION } from '../version';
6
7
  import type { RealtimeClientEvent } from '../resources/realtime/realtime';
7
8
  import {
8
9
  OpenAIRealtimeEmitter,
@@ -62,6 +63,7 @@ export class OpenAIRealtimeWS extends OpenAIRealtimeEmitter {
62
63
  this.url = buildRealtimeURL(client, props);
63
64
  assertBedrockWebSocketOrigin(client, this.url);
64
65
  const headers = {
66
+ 'User-Agent': `${client.constructor.name}/JS ${VERSION}`,
65
67
  ...props.options?.headers,
66
68
  ...(isAzure(client) && !props.__resolvedApiKey ? {} : { Authorization: `Bearer ${client.apiKey}` }),
67
69
  };
@@ -130,6 +130,8 @@ export interface AuditLogListResponse {
130
130
  | 'tenant.admin_api_key.updated'
131
131
  | 'tenant.admin_api_key.deleted'
132
132
  | 'tenant.project_api_key.created'
133
+ | 'tenant.trusted_access.business_verification.started'
134
+ | 'tenant.trusted_access.application.submitted'
133
135
  | 'tenant.chatgpt_access_token.revoked'
134
136
  | 'tenant.migration.completed'
135
137
  | 'tenant.sso.migrated'
@@ -1936,6 +1938,8 @@ export interface AuditLogListParams extends ConversationCursorPageParams {
1936
1938
  | 'tenant.admin_api_key.updated'
1937
1939
  | 'tenant.admin_api_key.deleted'
1938
1940
  | 'tenant.project_api_key.created'
1941
+ | 'tenant.trusted_access.business_verification.started'
1942
+ | 'tenant.trusted_access.application.submitted'
1939
1943
  | 'tenant.chatgpt_access_token.revoked'
1940
1944
  | 'tenant.migration.completed'
1941
1945
  | 'tenant.sso.migrated'
@@ -6638,6 +6638,12 @@ export interface UsageCostsParams {
6638
6638
  */
6639
6639
  limit?: number;
6640
6640
 
6641
+ /**
6642
+ * Return only costs for these exact line item names. Each value must match the
6643
+ * complete `line_item` value, for example `gpt-5.6-sol, input_tokens`.
6644
+ */
6645
+ line_items?: Array<string>;
6646
+
6641
6647
  /**
6642
6648
  * A cursor for use in pagination. Corresponding to the `next_page` field from the
6643
6649
  * previous response.
@@ -154,9 +154,9 @@ export interface Batch {
154
154
  metadata?: Shared.Metadata | null;
155
155
 
156
156
  /**
157
- * Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI offers a
158
- * wide range of models with different capabilities, performance characteristics,
159
- * and price points. Refer to the
157
+ * Model ID used to process the batch, like `gpt-5.6-sol`. OpenAI offers a wide
158
+ * range of models with different capabilities, performance characteristics, and
159
+ * price points. Refer to the
160
160
  * [model guide](https://platform.openai.com/docs/models) to browse and compare
161
161
  * available models.
162
162
  */
@@ -1122,9 +1122,9 @@ export interface BetaResponse {
1122
1122
  metadata: { [key: string]: string } | null;
1123
1123
 
1124
1124
  /**
1125
- * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
1126
- * wide range of models with different capabilities, performance characteristics,
1127
- * and price points. Refer to the
1125
+ * Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
1126
+ * range of models with different capabilities, performance characteristics, and
1127
+ * price points. Refer to the
1128
1128
  * [model guide](https://platform.openai.com/docs/models) to browse and compare
1129
1129
  * available models.
1130
1130
  */
@@ -1398,8 +1398,6 @@ export interface BetaResponse {
1398
1398
  prompt_cache_retention?: 'in_memory' | '24h' | null;
1399
1399
 
1400
1400
  /**
1401
- * **gpt-5 and o-series models only**
1402
- *
1403
1401
  * Configuration options for
1404
1402
  * [reasoning models](https://platform.openai.com/docs/guides/reasoning).
1405
1403
  */
@@ -1501,7 +1499,7 @@ export namespace BetaResponse {
1501
1499
  /**
1502
1500
  * The reason why the response is incomplete.
1503
1501
  */
1504
- reason?: 'max_output_tokens' | 'content_filter';
1502
+ reason?: 'max_output_tokens' | 'max_messages' | 'content_filter';
1505
1503
  }
1506
1504
 
1507
1505
  export interface BetaSpecificProgrammaticToolCallingParam {
@@ -1671,8 +1669,6 @@ export namespace BetaResponse {
1671
1669
  }
1672
1670
 
1673
1671
  /**
1674
- * **gpt-5 and o-series models only**
1675
- *
1676
1672
  * Configuration options for
1677
1673
  * [reasoning models](https://platform.openai.com/docs/guides/reasoning).
1678
1674
  */
@@ -10793,9 +10789,9 @@ export namespace BetaResponsesClientEvent {
10793
10789
  metadata?: { [key: string]: string } | null;
10794
10790
 
10795
10791
  /**
10796
- * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
10797
- * wide range of models with different capabilities, performance characteristics,
10798
- * and price points. Refer to the
10792
+ * Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
10793
+ * range of models with different capabilities, performance characteristics, and
10794
+ * price points. Refer to the
10799
10795
  * [model guide](https://platform.openai.com/docs/models) to browse and compare
10800
10796
  * available models.
10801
10797
  */
@@ -10975,8 +10971,6 @@ export namespace BetaResponsesClientEvent {
10975
10971
  prompt_cache_retention?: 'in_memory' | '24h' | null;
10976
10972
 
10977
10973
  /**
10978
- * **gpt-5 and o-series models only**
10979
- *
10980
10974
  * Configuration options for
10981
10975
  * [reasoning models](https://platform.openai.com/docs/guides/reasoning).
10982
10976
  */
@@ -11256,8 +11250,6 @@ export namespace BetaResponsesClientEvent {
11256
11250
  }
11257
11251
 
11258
11252
  /**
11259
- * **gpt-5 and o-series models only**
11260
- *
11261
11253
  * Configuration options for
11262
11254
  * [reasoning models](https://platform.openai.com/docs/guides/reasoning).
11263
11255
  */
@@ -12956,8 +12948,8 @@ export interface ResponseCreateParamsBase {
12956
12948
  metadata?: { [key: string]: string } | null;
12957
12949
 
12958
12950
  /**
12959
- * Body param: Model ID used to generate the response, like `gpt-4o` or `o3`.
12960
- * OpenAI offers a wide range of models with different capabilities, performance
12951
+ * Body param: Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI
12952
+ * offers a wide range of models with different capabilities, performance
12961
12953
  * characteristics, and price points. Refer to the
12962
12954
  * [model guide](https://platform.openai.com/docs/models) to browse and compare
12963
12955
  * available models.
@@ -13140,9 +13132,7 @@ export interface ResponseCreateParamsBase {
13140
13132
  prompt_cache_retention?: 'in_memory' | '24h' | null;
13141
13133
 
13142
13134
  /**
13143
- * Body param: **gpt-5 and o-series models only**
13144
- *
13145
- * Configuration options for
13135
+ * Body param: Configuration options for
13146
13136
  * [reasoning models](https://platform.openai.com/docs/guides/reasoning).
13147
13137
  */
13148
13138
  reasoning?: ResponseCreateParams.Reasoning | null;
@@ -13421,8 +13411,6 @@ export namespace ResponseCreateParams {
13421
13411
  }
13422
13412
 
13423
13413
  /**
13424
- * **gpt-5 and o-series models only**
13425
- *
13426
13414
  * Configuration options for
13427
13415
  * [reasoning models](https://platform.openai.com/docs/guides/reasoning).
13428
13416
  */
@@ -13610,7 +13598,7 @@ export interface ResponseCancelParams {
13610
13598
 
13611
13599
  export interface ResponseCompactParams {
13612
13600
  /**
13613
- * Body param: Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI
13601
+ * Body param: Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI
13614
13602
  * offers a wide range of models with different capabilities, performance
13615
13603
  * characteristics, and price points. Refer to the
13616
13604
  * [model guide](https://platform.openai.com/docs/models) to browse and compare
@@ -4,6 +4,7 @@ import * as WS from 'ws';
4
4
  import { NodeWebSocket } from '../../../internal/ws-adapter-node';
5
5
  import { ResponsesWSBase, type ResponsesWSBaseOptions } from './ws-base';
6
6
  import { OpenAI } from '../../../client';
7
+ import { VERSION } from '../../../version';
7
8
 
8
9
  export type { ResponsesWSReconnectOptions } from './ws-base';
9
10
 
@@ -29,9 +30,12 @@ export class ResponsesWS extends ResponsesWSBase<NodeWebSocket> {
29
30
  const ws = new WS.WebSocket(url, {
30
31
  ...this._wsOptions,
31
32
  headers: {
33
+ 'User-Agent': `${this._client.constructor.name}/JS ${VERSION}`,
34
+
32
35
  ...authHeaders,
33
36
  ...this._wsOptions?.headers,
34
37
  },
38
+ followRedirects: false,
35
39
  });
36
40
  return new NodeWebSocket(ws);
37
41
  }
@@ -60,7 +60,7 @@ export class Completions extends APIResource {
60
60
  * const chatCompletion = await client.chat.completions.create(
61
61
  * {
62
62
  * messages: [{ content: 'string', role: 'developer' }],
63
- * model: 'gpt-5.4',
63
+ * model: 'gpt-5.6-sol',
64
64
  * },
65
65
  * );
66
66
  * ```
@@ -2079,9 +2079,9 @@ export interface ChatCompletionCreateParamsBase {
2079
2079
  messages: Array<ChatCompletionMessageParam>;
2080
2080
 
2081
2081
  /**
2082
- * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
2083
- * wide range of models with different capabilities, performance characteristics,
2084
- * and price points. Refer to the
2082
+ * Model ID used to generate the response, like `gpt-5.6-sol` or `o3`. OpenAI
2083
+ * offers a wide range of models with different capabilities, performance
2084
+ * characteristics, and price points. Refer to the
2085
2085
  * [model guide](https://platform.openai.com/docs/models) to browse and compare
2086
2086
  * available models.
2087
2087
  */
@@ -136,7 +136,7 @@ export interface EvalStoredCompletionsDataSourceConfig {
136
136
  *
137
137
  * - Improve the quality of my chatbot
138
138
  * - See how well my chatbot handles customer support
139
- * - Check if o4-mini is better at my usecase than gpt-4o
139
+ * - Check if o4-mini is better at my usecase than gpt-5.6-sol
140
140
  */
141
141
  export interface EvalCreateResponse {
142
142
  /**
@@ -257,7 +257,7 @@ export namespace EvalCreateResponse {
257
257
  *
258
258
  * - Improve the quality of my chatbot
259
259
  * - See how well my chatbot handles customer support
260
- * - Check if o4-mini is better at my usecase than gpt-4o
260
+ * - Check if o4-mini is better at my usecase than gpt-5.6-sol
261
261
  */
262
262
  export interface EvalRetrieveResponse {
263
263
  /**
@@ -378,7 +378,7 @@ export namespace EvalRetrieveResponse {
378
378
  *
379
379
  * - Improve the quality of my chatbot
380
380
  * - See how well my chatbot handles customer support
381
- * - Check if o4-mini is better at my usecase than gpt-4o
381
+ * - Check if o4-mini is better at my usecase than gpt-5.6-sol
382
382
  */
383
383
  export interface EvalUpdateResponse {
384
384
  /**
@@ -499,7 +499,7 @@ export namespace EvalUpdateResponse {
499
499
  *
500
500
  * - Improve the quality of my chatbot
501
501
  * - See how well my chatbot handles customer support
502
- * - Check if o4-mini is better at my usecase than gpt-4o
502
+ * - Check if o4-mini is better at my usecase than gpt-5.6-sol
503
503
  */
504
504
  export interface EvalListResponse {
505
505
  /**
@@ -196,7 +196,7 @@ export namespace CreateEvalCompletionsRunDataSource {
196
196
  metadata?: Shared.Metadata | null;
197
197
 
198
198
  /**
199
- * An optional model to filter by (e.g., 'gpt-4o').
199
+ * An optional model to filter by (e.g., 'gpt-5.6-sol').
200
200
  */
201
201
  model?: string | null;
202
202
  }
@@ -1068,9 +1068,9 @@ export interface Response {
1068
1068
  metadata: Shared.Metadata | null;
1069
1069
 
1070
1070
  /**
1071
- * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
1072
- * wide range of models with different capabilities, performance characteristics,
1073
- * and price points. Refer to the
1071
+ * Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
1072
+ * range of models with different capabilities, performance characteristics, and
1073
+ * price points. Refer to the
1074
1074
  * [model guide](https://platform.openai.com/docs/models) to browse and compare
1075
1075
  * available models.
1076
1076
  */
@@ -1233,8 +1233,6 @@ export interface Response {
1233
1233
  prompt_cache_retention?: 'in_memory' | '24h' | null;
1234
1234
 
1235
1235
  /**
1236
- * **gpt-5 and o-series models only**
1237
- *
1238
1236
  * Configuration options for
1239
1237
  * [reasoning models](https://platform.openai.com/docs/guides/reasoning).
1240
1238
  */
@@ -1335,7 +1333,7 @@ export namespace Response {
1335
1333
  /**
1336
1334
  * The reason why the response is incomplete.
1337
1335
  */
1338
- reason?: 'max_output_tokens' | 'content_filter';
1336
+ reason?: 'max_output_tokens' | 'max_messages' | 'content_filter';
1339
1337
  }
1340
1338
 
1341
1339
  export interface SpecificProgrammaticToolCallingParam {
@@ -7899,9 +7897,9 @@ export interface ResponsesClientEvent {
7899
7897
  metadata?: Shared.Metadata | null;
7900
7898
 
7901
7899
  /**
7902
- * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
7903
- * wide range of models with different capabilities, performance characteristics,
7904
- * and price points. Refer to the
7900
+ * Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
7901
+ * range of models with different capabilities, performance characteristics, and
7902
+ * price points. Refer to the
7905
7903
  * [model guide](https://platform.openai.com/docs/models) to browse and compare
7906
7904
  * available models.
7907
7905
  */
@@ -7973,8 +7971,6 @@ export interface ResponsesClientEvent {
7973
7971
  prompt_cache_retention?: 'in_memory' | '24h' | null;
7974
7972
 
7975
7973
  /**
7976
- * **gpt-5 and o-series models only**
7977
- *
7978
7974
  * Configuration options for
7979
7975
  * [reasoning models](https://platform.openai.com/docs/guides/reasoning).
7980
7976
  */
@@ -9850,9 +9846,9 @@ export interface ResponseCreateParamsBase {
9850
9846
  metadata?: Shared.Metadata | null;
9851
9847
 
9852
9848
  /**
9853
- * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
9854
- * wide range of models with different capabilities, performance characteristics,
9855
- * and price points. Refer to the
9849
+ * Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
9850
+ * range of models with different capabilities, performance characteristics, and
9851
+ * price points. Refer to the
9856
9852
  * [model guide](https://platform.openai.com/docs/models) to browse and compare
9857
9853
  * available models.
9858
9854
  */
@@ -9924,8 +9920,6 @@ export interface ResponseCreateParamsBase {
9924
9920
  prompt_cache_retention?: 'in_memory' | '24h' | null;
9925
9921
 
9926
9922
  /**
9927
- * **gpt-5 and o-series models only**
9928
- *
9929
9923
  * Configuration options for
9930
9924
  * [reasoning models](https://platform.openai.com/docs/guides/reasoning).
9931
9925
  */
@@ -10290,9 +10284,9 @@ export interface ResponseRetrieveParamsStreaming extends ResponseRetrieveParamsB
10290
10284
 
10291
10285
  export interface ResponseCompactParams {
10292
10286
  /**
10293
- * Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a
10294
- * wide range of models with different capabilities, performance characteristics,
10295
- * and price points. Refer to the
10287
+ * Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
10288
+ * range of models with different capabilities, performance characteristics, and
10289
+ * price points. Refer to the
10296
10290
  * [model guide](https://platform.openai.com/docs/models) to browse and compare
10297
10291
  * available models.
10298
10292
  */
@@ -4,6 +4,7 @@ import * as WS from 'ws';
4
4
  import { NodeWebSocket } from '../../internal/ws-adapter-node';
5
5
  import { ResponsesWSBase, type ResponsesWSBaseOptions } from './ws-base';
6
6
  import { OpenAI } from '../../client';
7
+ import { VERSION } from '../../version';
7
8
 
8
9
  export type { ResponsesWSReconnectOptions } from './ws-base';
9
10
 
@@ -29,9 +30,12 @@ export class ResponsesWS extends ResponsesWSBase<NodeWebSocket> {
29
30
  const ws = new WS.WebSocket(url, {
30
31
  ...this._wsOptions,
31
32
  headers: {
33
+ 'User-Agent': `${this._client.constructor.name}/JS ${VERSION}`,
34
+
32
35
  ...authHeaders,
33
36
  ...this._wsOptions?.headers,
34
37
  },
38
+ followRedirects: false,
35
39
  });
36
40
  return new NodeWebSocket(ws);
37
41
  }
@@ -261,8 +261,6 @@ export type Metadata = { [key: string]: string };
261
261
  export type OAuthErrorCode = 'invalid_grant' | 'invalid_subject_token' | (string & {});
262
262
 
263
263
  /**
264
- * **gpt-5 and o-series models only**
265
- *
266
264
  * Configuration options for
267
265
  * [reasoning models](https://platform.openai.com/docs/guides/reasoning).
268
266
  */
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** Version of the installed OpenAI SDK package. */
2
- export const VERSION = '7.7.0'; // x-release-please-version
2
+ export const VERSION = '7.9.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,3 +1,3 @@
1
1
  /** Version of the installed OpenAI SDK package. */
2
- export declare const VERSION = "7.7.0";
2
+ export declare const VERSION = "7.9.0";
3
3
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  /** Version of the installed OpenAI SDK package. */
2
- export declare const VERSION = "7.7.0";
2
+ export declare const VERSION = "7.9.0";
3
3
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  /** Version of the installed OpenAI SDK package. */
5
- exports.VERSION = '7.7.0'; // x-release-please-version
5
+ exports.VERSION = '7.9.0'; // x-release-please-version
6
6
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  /** Version of the installed OpenAI SDK package. */
2
- export const VERSION = '7.7.0'; // x-release-please-version
2
+ export const VERSION = '7.9.0'; // x-release-please-version
3
3
  //# sourceMappingURL=version.mjs.map