openai 6.48.0 → 6.49.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 +32 -0
- package/azure.d.mts.map +1 -1
- package/azure.d.ts.map +1 -1
- package/azure.js +5 -1
- package/azure.js.map +1 -1
- package/azure.mjs +5 -1
- package/azure.mjs.map +1 -1
- package/helpers/standard-schema.d.mts +104 -0
- package/helpers/standard-schema.d.mts.map +1 -0
- package/helpers/standard-schema.d.ts +104 -0
- package/helpers/standard-schema.d.ts.map +1 -0
- package/helpers/standard-schema.js +320 -0
- package/helpers/standard-schema.js.map +1 -0
- package/helpers/standard-schema.mjs +314 -0
- package/helpers/standard-schema.mjs.map +1 -0
- package/helpers/zod.d.mts +26 -3
- package/helpers/zod.d.mts.map +1 -1
- package/helpers/zod.d.ts +26 -3
- package/helpers/zod.d.ts.map +1 -1
- package/helpers/zod.js +97 -7
- package/helpers/zod.js.map +1 -1
- package/helpers/zod.mjs +96 -7
- package/helpers/zod.mjs.map +1 -1
- package/lib/AbstractChatCompletionRunner.d.mts.map +1 -1
- package/lib/AbstractChatCompletionRunner.d.ts.map +1 -1
- package/lib/AbstractChatCompletionRunner.js +43 -1
- package/lib/AbstractChatCompletionRunner.js.map +1 -1
- package/lib/AbstractChatCompletionRunner.mjs +43 -1
- package/lib/AbstractChatCompletionRunner.mjs.map +1 -1
- package/lib/ChatCompletionStream.d.mts +2 -1
- package/lib/ChatCompletionStream.d.mts.map +1 -1
- package/lib/ChatCompletionStream.d.ts +2 -1
- package/lib/ChatCompletionStream.d.ts.map +1 -1
- package/lib/ChatCompletionStream.js +53 -14
- package/lib/ChatCompletionStream.js.map +1 -1
- package/lib/ChatCompletionStream.mjs +53 -14
- package/lib/ChatCompletionStream.mjs.map +1 -1
- package/lib/ResponsesParser.d.mts.map +1 -1
- package/lib/ResponsesParser.d.ts.map +1 -1
- package/lib/ResponsesParser.js +3 -5
- package/lib/ResponsesParser.js.map +1 -1
- package/lib/ResponsesParser.mjs +3 -5
- package/lib/ResponsesParser.mjs.map +1 -1
- package/lib/jsonschema.d.mts +3 -0
- package/lib/jsonschema.d.mts.map +1 -1
- package/lib/jsonschema.d.ts +3 -0
- package/lib/jsonschema.d.ts.map +1 -1
- package/lib/transform.d.mts +25 -1
- package/lib/transform.d.mts.map +1 -1
- package/lib/transform.d.ts +25 -1
- package/lib/transform.d.ts.map +1 -1
- package/lib/transform.js +1521 -82
- package/lib/transform.js.map +1 -1
- package/lib/transform.mjs +1515 -82
- package/lib/transform.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/admin/organization/index.d.mts +1 -0
- package/resources/admin/organization/index.d.mts.map +1 -1
- package/resources/admin/organization/index.d.ts +1 -0
- package/resources/admin/organization/index.d.ts.map +1 -1
- package/resources/admin/organization/index.js +3 -1
- package/resources/admin/organization/index.js.map +1 -1
- package/resources/admin/organization/index.mjs +1 -0
- package/resources/admin/organization/index.mjs.map +1 -1
- package/resources/admin/organization/organization.d.mts +4 -0
- package/resources/admin/organization/organization.d.mts.map +1 -1
- package/resources/admin/organization/organization.d.ts +4 -0
- package/resources/admin/organization/organization.d.ts.map +1 -1
- package/resources/admin/organization/organization.js +4 -0
- package/resources/admin/organization/organization.js.map +1 -1
- package/resources/admin/organization/organization.mjs +4 -0
- package/resources/admin/organization/organization.mjs.map +1 -1
- package/resources/admin/organization/projects/index.d.mts +1 -0
- package/resources/admin/organization/projects/index.d.mts.map +1 -1
- package/resources/admin/organization/projects/index.d.ts +1 -0
- package/resources/admin/organization/projects/index.d.ts.map +1 -1
- package/resources/admin/organization/projects/index.js +3 -1
- package/resources/admin/organization/projects/index.js.map +1 -1
- package/resources/admin/organization/projects/index.mjs +1 -0
- package/resources/admin/organization/projects/index.mjs.map +1 -1
- package/resources/admin/organization/projects/projects.d.mts +4 -0
- package/resources/admin/organization/projects/projects.d.mts.map +1 -1
- package/resources/admin/organization/projects/projects.d.ts +4 -0
- package/resources/admin/organization/projects/projects.d.ts.map +1 -1
- package/resources/admin/organization/projects/projects.js +4 -0
- package/resources/admin/organization/projects/projects.js.map +1 -1
- package/resources/admin/organization/projects/projects.mjs +4 -0
- package/resources/admin/organization/projects/projects.mjs.map +1 -1
- package/resources/admin/organization/projects/spend-limit.d.mts +115 -0
- package/resources/admin/organization/projects/spend-limit.d.mts.map +1 -0
- package/resources/admin/organization/projects/spend-limit.d.ts +115 -0
- package/resources/admin/organization/projects/spend-limit.d.ts.map +1 -0
- package/resources/admin/organization/projects/spend-limit.js +67 -0
- package/resources/admin/organization/projects/spend-limit.js.map +1 -0
- package/resources/admin/organization/projects/spend-limit.mjs +63 -0
- package/resources/admin/organization/projects/spend-limit.mjs.map +1 -0
- package/resources/admin/organization/spend-limit.d.mts +108 -0
- package/resources/admin/organization/spend-limit.d.mts.map +1 -0
- package/resources/admin/organization/spend-limit.d.ts +108 -0
- package/resources/admin/organization/spend-limit.d.ts.map +1 -0
- package/resources/admin/organization/spend-limit.js +59 -0
- package/resources/admin/organization/spend-limit.js.map +1 -0
- package/resources/admin/organization/spend-limit.mjs +55 -0
- package/resources/admin/organization/spend-limit.mjs.map +1 -0
- package/resources/beta/responses/input-tokens.d.mts +6 -2
- package/resources/beta/responses/input-tokens.d.mts.map +1 -1
- package/resources/beta/responses/input-tokens.d.ts +6 -2
- package/resources/beta/responses/input-tokens.d.ts.map +1 -1
- package/resources/beta/responses/responses.d.mts +21 -11
- package/resources/beta/responses/responses.d.mts.map +1 -1
- package/resources/beta/responses/responses.d.ts +21 -11
- package/resources/beta/responses/responses.d.ts.map +1 -1
- package/resources/beta/responses/responses.js.map +1 -1
- package/resources/beta/responses/responses.mjs.map +1 -1
- package/resources/chat/completions/completions.d.mts +4 -3
- package/resources/chat/completions/completions.d.mts.map +1 -1
- package/resources/chat/completions/completions.d.ts +4 -3
- package/resources/chat/completions/completions.d.ts.map +1 -1
- package/resources/chat/completions/completions.js.map +1 -1
- package/resources/chat/completions/completions.mjs.map +1 -1
- package/resources/responses/input-tokens.d.mts +2 -1
- package/resources/responses/input-tokens.d.mts.map +1 -1
- package/resources/responses/input-tokens.d.ts +2 -1
- package/resources/responses/input-tokens.d.ts.map +1 -1
- package/resources/responses/responses.d.mts +9 -8
- package/resources/responses/responses.d.mts.map +1 -1
- package/resources/responses/responses.d.ts +9 -8
- package/resources/responses/responses.d.ts.map +1 -1
- package/resources/responses/responses.js.map +1 -1
- package/resources/responses/responses.mjs.map +1 -1
- package/resources/shared.d.mts +4 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +4 -1
- package/resources/shared.d.ts.map +1 -1
- package/src/azure.ts +5 -1
- package/src/helpers/standard-schema.ts +570 -0
- package/src/helpers/zod.ts +158 -29
- package/src/lib/AbstractChatCompletionRunner.ts +43 -1
- package/src/lib/ChatCompletionStream.ts +56 -8
- package/src/lib/ResponsesParser.ts +7 -5
- package/src/lib/jsonschema.ts +3 -0
- package/src/lib/transform.ts +1930 -103
- package/src/resources/admin/organization/index.ts +6 -0
- package/src/resources/admin/organization/organization.ts +16 -0
- package/src/resources/admin/organization/projects/index.ts +6 -0
- package/src/resources/admin/organization/projects/projects.ts +16 -0
- package/src/resources/admin/organization/projects/spend-limit.ts +156 -0
- package/src/resources/admin/organization/spend-limit.ts +144 -0
- package/src/resources/beta/responses/input-tokens.ts +6 -2
- package/src/resources/beta/responses/responses.ts +21 -10
- package/src/resources/chat/completions/completions.ts +4 -3
- package/src/resources/responses/input-tokens.ts +2 -1
- package/src/resources/responses/responses.ts +9 -7
- package/src/resources/shared.ts +4 -1
- 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
|
@@ -82,6 +82,12 @@ export {
|
|
|
82
82
|
type SpendAlertListParams,
|
|
83
83
|
type OrganizationSpendAlertsPage,
|
|
84
84
|
} from './spend-alerts';
|
|
85
|
+
export {
|
|
86
|
+
SpendLimit,
|
|
87
|
+
type OrganizationSpendLimit,
|
|
88
|
+
type OrganizationSpendLimitDeleted,
|
|
89
|
+
type SpendLimitUpdateParams,
|
|
90
|
+
} from './spend-limit';
|
|
85
91
|
export {
|
|
86
92
|
Usage,
|
|
87
93
|
type UsageAudioSpeechesResponse,
|
|
@@ -62,6 +62,13 @@ import {
|
|
|
62
62
|
SpendAlertUpdateParams,
|
|
63
63
|
SpendAlerts,
|
|
64
64
|
} from './spend-alerts';
|
|
65
|
+
import * as SpendLimitAPI from './spend-limit';
|
|
66
|
+
import {
|
|
67
|
+
OrganizationSpendLimit,
|
|
68
|
+
OrganizationSpendLimitDeleted,
|
|
69
|
+
SpendLimit,
|
|
70
|
+
SpendLimitUpdateParams,
|
|
71
|
+
} from './spend-limit';
|
|
65
72
|
import * as UsageAPI from './usage';
|
|
66
73
|
import {
|
|
67
74
|
Usage,
|
|
@@ -127,6 +134,7 @@ export class Organization extends APIResource {
|
|
|
127
134
|
groups: GroupsAPI.Groups = new GroupsAPI.Groups(this._client);
|
|
128
135
|
roles: RolesAPI.Roles = new RolesAPI.Roles(this._client);
|
|
129
136
|
dataRetention: DataRetentionAPI.DataRetention = new DataRetentionAPI.DataRetention(this._client);
|
|
137
|
+
spendLimit: SpendLimitAPI.SpendLimit = new SpendLimitAPI.SpendLimit(this._client);
|
|
130
138
|
spendAlerts: SpendAlertsAPI.SpendAlerts = new SpendAlertsAPI.SpendAlerts(this._client);
|
|
131
139
|
certificates: CertificatesAPI.Certificates = new CertificatesAPI.Certificates(this._client);
|
|
132
140
|
projects: ProjectsAPI.Projects = new ProjectsAPI.Projects(this._client);
|
|
@@ -140,6 +148,7 @@ Organization.Users = Users;
|
|
|
140
148
|
Organization.Groups = Groups;
|
|
141
149
|
Organization.Roles = Roles;
|
|
142
150
|
Organization.DataRetention = DataRetention;
|
|
151
|
+
Organization.SpendLimit = SpendLimit;
|
|
143
152
|
Organization.SpendAlerts = SpendAlerts;
|
|
144
153
|
Organization.Certificates = Certificates;
|
|
145
154
|
Organization.Projects = Projects;
|
|
@@ -233,6 +242,13 @@ export declare namespace Organization {
|
|
|
233
242
|
type DataRetentionUpdateParams as DataRetentionUpdateParams,
|
|
234
243
|
};
|
|
235
244
|
|
|
245
|
+
export {
|
|
246
|
+
SpendLimit as SpendLimit,
|
|
247
|
+
type OrganizationSpendLimit as OrganizationSpendLimit,
|
|
248
|
+
type OrganizationSpendLimitDeleted as OrganizationSpendLimitDeleted,
|
|
249
|
+
type SpendLimitUpdateParams as SpendLimitUpdateParams,
|
|
250
|
+
};
|
|
251
|
+
|
|
236
252
|
export {
|
|
237
253
|
SpendAlerts as SpendAlerts,
|
|
238
254
|
type OrganizationSpendAlert as OrganizationSpendAlert,
|
|
@@ -90,6 +90,12 @@ export {
|
|
|
90
90
|
type SpendAlertDeleteParams,
|
|
91
91
|
type ProjectSpendAlertsPage,
|
|
92
92
|
} from './spend-alerts';
|
|
93
|
+
export {
|
|
94
|
+
SpendLimit,
|
|
95
|
+
type ProjectSpendLimit,
|
|
96
|
+
type ProjectSpendLimitDeleted,
|
|
97
|
+
type SpendLimitUpdateParams,
|
|
98
|
+
} from './spend-limit';
|
|
93
99
|
export {
|
|
94
100
|
Users,
|
|
95
101
|
type ProjectUser,
|
|
@@ -69,6 +69,13 @@ import {
|
|
|
69
69
|
SpendAlertUpdateParams,
|
|
70
70
|
SpendAlerts,
|
|
71
71
|
} from './spend-alerts';
|
|
72
|
+
import * as SpendLimitAPI from './spend-limit';
|
|
73
|
+
import {
|
|
74
|
+
ProjectSpendLimit,
|
|
75
|
+
ProjectSpendLimitDeleted,
|
|
76
|
+
SpendLimit,
|
|
77
|
+
SpendLimitUpdateParams,
|
|
78
|
+
} from './spend-limit';
|
|
72
79
|
import * as GroupsAPI from './groups/groups';
|
|
73
80
|
import {
|
|
74
81
|
GroupCreateParams,
|
|
@@ -127,6 +134,7 @@ export class Projects extends APIResource {
|
|
|
127
134
|
groups: GroupsAPI.Groups = new GroupsAPI.Groups(this._client);
|
|
128
135
|
roles: RolesAPI.Roles = new RolesAPI.Roles(this._client);
|
|
129
136
|
dataRetention: DataRetentionAPI.DataRetention = new DataRetentionAPI.DataRetention(this._client);
|
|
137
|
+
spendLimit: SpendLimitAPI.SpendLimit = new SpendLimitAPI.SpendLimit(this._client);
|
|
130
138
|
spendAlerts: SpendAlertsAPI.SpendAlerts = new SpendAlertsAPI.SpendAlerts(this._client);
|
|
131
139
|
certificates: CertificatesAPI.Certificates = new CertificatesAPI.Certificates(this._client);
|
|
132
140
|
|
|
@@ -325,6 +333,7 @@ Projects.HostedToolPermissions = HostedToolPermissions;
|
|
|
325
333
|
Projects.Groups = Groups;
|
|
326
334
|
Projects.Roles = Roles;
|
|
327
335
|
Projects.DataRetention = DataRetention;
|
|
336
|
+
Projects.SpendLimit = SpendLimit;
|
|
328
337
|
Projects.SpendAlerts = SpendAlerts;
|
|
329
338
|
Projects.Certificates = Certificates;
|
|
330
339
|
|
|
@@ -420,6 +429,13 @@ export declare namespace Projects {
|
|
|
420
429
|
type DataRetentionUpdateParams as DataRetentionUpdateParams,
|
|
421
430
|
};
|
|
422
431
|
|
|
432
|
+
export {
|
|
433
|
+
SpendLimit as SpendLimit,
|
|
434
|
+
type ProjectSpendLimit as ProjectSpendLimit,
|
|
435
|
+
type ProjectSpendLimitDeleted as ProjectSpendLimitDeleted,
|
|
436
|
+
type SpendLimitUpdateParams as SpendLimitUpdateParams,
|
|
437
|
+
};
|
|
438
|
+
|
|
423
439
|
export {
|
|
424
440
|
SpendAlerts as SpendAlerts,
|
|
425
441
|
type ProjectSpendAlert as ProjectSpendAlert,
|
|
@@ -0,0 +1,156 @@
|
|
|
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 { RequestOptions } from '../../../../internal/request-options';
|
|
6
|
+
import { path } from '../../../../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class SpendLimit extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Get a project's hard spend limit.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const projectSpendLimit =
|
|
15
|
+
* await client.admin.organization.projects.spendLimit.retrieve(
|
|
16
|
+
* 'proj_123',
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
retrieve(projectID: string, options?: RequestOptions): APIPromise<ProjectSpendLimit> {
|
|
21
|
+
return this._client.get(path`/organization/projects/${projectID}/spend_limit`, {
|
|
22
|
+
...options,
|
|
23
|
+
__security: { adminAPIKeyAuth: true },
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Create or replace a project's hard spend limit.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const projectSpendLimit =
|
|
33
|
+
* await client.admin.organization.projects.spendLimit.update(
|
|
34
|
+
* 'proj_123',
|
|
35
|
+
* {
|
|
36
|
+
* currency: 'USD',
|
|
37
|
+
* interval: 'month',
|
|
38
|
+
* threshold_amount: 1,
|
|
39
|
+
* },
|
|
40
|
+
* );
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
update(
|
|
44
|
+
projectID: string,
|
|
45
|
+
body: SpendLimitUpdateParams,
|
|
46
|
+
options?: RequestOptions,
|
|
47
|
+
): APIPromise<ProjectSpendLimit> {
|
|
48
|
+
return this._client.post(path`/organization/projects/${projectID}/spend_limit`, {
|
|
49
|
+
body,
|
|
50
|
+
...options,
|
|
51
|
+
__security: { adminAPIKeyAuth: true },
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Delete a project's hard spend limit.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const projectSpendLimitDeleted =
|
|
61
|
+
* await client.admin.organization.projects.spendLimit.delete(
|
|
62
|
+
* 'proj_123',
|
|
63
|
+
* );
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
delete(projectID: string, options?: RequestOptions): APIPromise<ProjectSpendLimitDeleted> {
|
|
67
|
+
return this._client.delete(path`/organization/projects/${projectID}/spend_limit`, {
|
|
68
|
+
...options,
|
|
69
|
+
__security: { adminAPIKeyAuth: true },
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Represents a hard spend limit configured at the project level.
|
|
76
|
+
*/
|
|
77
|
+
export interface ProjectSpendLimit {
|
|
78
|
+
/**
|
|
79
|
+
* The currency for the threshold amount. Currently, only `USD` is supported.
|
|
80
|
+
*/
|
|
81
|
+
currency: (string & {}) | 'USD';
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The current enforcement state of the hard spend limit.
|
|
85
|
+
*/
|
|
86
|
+
enforcement: ProjectSpendLimit.Enforcement;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The time interval for evaluating spend against the threshold. Currently, only
|
|
90
|
+
* `month` is supported.
|
|
91
|
+
*/
|
|
92
|
+
interval: (string & {}) | 'month';
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The object type, which is always `project.spend_limit`.
|
|
96
|
+
*/
|
|
97
|
+
object: 'project.spend_limit';
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The hard spend limit amount, in cents.
|
|
101
|
+
*/
|
|
102
|
+
threshold_amount: number;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export namespace ProjectSpendLimit {
|
|
106
|
+
/**
|
|
107
|
+
* The current enforcement state of the hard spend limit.
|
|
108
|
+
*/
|
|
109
|
+
export interface Enforcement {
|
|
110
|
+
/**
|
|
111
|
+
* Whether the hard spend limit is currently enforcing.
|
|
112
|
+
*/
|
|
113
|
+
status: (string & {}) | 'inactive' | 'enforcing';
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Confirmation payload returned after deleting a project hard spend limit.
|
|
119
|
+
*/
|
|
120
|
+
export interface ProjectSpendLimitDeleted {
|
|
121
|
+
/**
|
|
122
|
+
* Whether the hard spend limit was deleted.
|
|
123
|
+
*/
|
|
124
|
+
deleted: boolean;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The object type, which is always `project.spend_limit.deleted`.
|
|
128
|
+
*/
|
|
129
|
+
object: 'project.spend_limit.deleted';
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface SpendLimitUpdateParams {
|
|
133
|
+
/**
|
|
134
|
+
* The currency for the threshold amount. Currently, only `USD` is supported.
|
|
135
|
+
*/
|
|
136
|
+
currency: 'USD';
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* The time interval for evaluating spend against the threshold. Currently, only
|
|
140
|
+
* `month` is supported.
|
|
141
|
+
*/
|
|
142
|
+
interval: 'month';
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The hard spend limit amount, in cents.
|
|
146
|
+
*/
|
|
147
|
+
threshold_amount: number;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export declare namespace SpendLimit {
|
|
151
|
+
export {
|
|
152
|
+
type ProjectSpendLimit as ProjectSpendLimit,
|
|
153
|
+
type ProjectSpendLimitDeleted as ProjectSpendLimitDeleted,
|
|
154
|
+
type SpendLimitUpdateParams as SpendLimitUpdateParams,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
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 { RequestOptions } from '../../../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class SpendLimit extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Get the organization's hard spend limit.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const organizationSpendLimit =
|
|
14
|
+
* await client.admin.organization.spendLimit.retrieve();
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
retrieve(options?: RequestOptions): APIPromise<OrganizationSpendLimit> {
|
|
18
|
+
return this._client.get('/organization/spend_limit', {
|
|
19
|
+
...options,
|
|
20
|
+
__security: { adminAPIKeyAuth: true },
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Create or replace the organization's hard spend limit.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const organizationSpendLimit =
|
|
30
|
+
* await client.admin.organization.spendLimit.update({
|
|
31
|
+
* currency: 'USD',
|
|
32
|
+
* interval: 'month',
|
|
33
|
+
* threshold_amount: 1,
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
update(body: SpendLimitUpdateParams, options?: RequestOptions): APIPromise<OrganizationSpendLimit> {
|
|
38
|
+
return this._client.post('/organization/spend_limit', {
|
|
39
|
+
body,
|
|
40
|
+
...options,
|
|
41
|
+
__security: { adminAPIKeyAuth: true },
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Delete the organization's hard spend limit.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const organizationSpendLimitDeleted =
|
|
51
|
+
* await client.admin.organization.spendLimit.delete();
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
delete(options?: RequestOptions): APIPromise<OrganizationSpendLimitDeleted> {
|
|
55
|
+
return this._client.delete('/organization/spend_limit', {
|
|
56
|
+
...options,
|
|
57
|
+
__security: { adminAPIKeyAuth: true },
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Represents a hard spend limit configured at the organization level.
|
|
64
|
+
*/
|
|
65
|
+
export interface OrganizationSpendLimit {
|
|
66
|
+
/**
|
|
67
|
+
* The currency for the threshold amount. Currently, only `USD` is supported.
|
|
68
|
+
*/
|
|
69
|
+
currency: (string & {}) | 'USD';
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The current enforcement state of the hard spend limit.
|
|
73
|
+
*/
|
|
74
|
+
enforcement: OrganizationSpendLimit.Enforcement;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The time interval for evaluating spend against the threshold. Currently, only
|
|
78
|
+
* `month` is supported.
|
|
79
|
+
*/
|
|
80
|
+
interval: (string & {}) | 'month';
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The object type, which is always `organization.spend_limit`.
|
|
84
|
+
*/
|
|
85
|
+
object: 'organization.spend_limit';
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The hard spend limit amount, in cents.
|
|
89
|
+
*/
|
|
90
|
+
threshold_amount: number;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export namespace OrganizationSpendLimit {
|
|
94
|
+
/**
|
|
95
|
+
* The current enforcement state of the hard spend limit.
|
|
96
|
+
*/
|
|
97
|
+
export interface Enforcement {
|
|
98
|
+
/**
|
|
99
|
+
* Whether the hard spend limit is currently enforcing.
|
|
100
|
+
*/
|
|
101
|
+
status: (string & {}) | 'inactive' | 'enforcing';
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Confirmation payload returned after deleting an organization hard spend limit.
|
|
107
|
+
*/
|
|
108
|
+
export interface OrganizationSpendLimitDeleted {
|
|
109
|
+
/**
|
|
110
|
+
* Whether the hard spend limit was deleted.
|
|
111
|
+
*/
|
|
112
|
+
deleted: boolean;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The object type, which is always `organization.spend_limit.deleted`.
|
|
116
|
+
*/
|
|
117
|
+
object: 'organization.spend_limit.deleted';
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface SpendLimitUpdateParams {
|
|
121
|
+
/**
|
|
122
|
+
* The currency for the threshold amount. Currently, only `USD` is supported.
|
|
123
|
+
*/
|
|
124
|
+
currency: 'USD';
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The time interval for evaluating spend against the threshold. Currently, only
|
|
128
|
+
* `month` is supported.
|
|
129
|
+
*/
|
|
130
|
+
interval: 'month';
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The hard spend limit amount, in cents.
|
|
134
|
+
*/
|
|
135
|
+
threshold_amount: number;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export declare namespace SpendLimit {
|
|
139
|
+
export {
|
|
140
|
+
type OrganizationSpendLimit as OrganizationSpendLimit,
|
|
141
|
+
type OrganizationSpendLimitDeleted as OrganizationSpendLimitDeleted,
|
|
142
|
+
type SpendLimitUpdateParams as SpendLimitUpdateParams,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
@@ -153,7 +153,10 @@ export namespace InputTokenCountParams {
|
|
|
153
153
|
*/
|
|
154
154
|
export interface Reasoning {
|
|
155
155
|
/**
|
|
156
|
-
* Controls which reasoning items are rendered back to the model on later turns.
|
|
156
|
+
* Controls which reasoning items are rendered back to the model on later turns. If
|
|
157
|
+
* omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
|
|
158
|
+
* model family defaults to `all_turns`; earlier models default to `current_turn`.
|
|
159
|
+
*
|
|
157
160
|
* When returned on a response, this is the effective reasoning context mode used
|
|
158
161
|
* for the response.
|
|
159
162
|
*/
|
|
@@ -224,7 +227,8 @@ export namespace InputTokenCountParams {
|
|
|
224
227
|
/**
|
|
225
228
|
* Constrains the verbosity of the model's response. Lower values will result in
|
|
226
229
|
* more concise responses, while higher values will result in more verbose
|
|
227
|
-
* responses. Currently supported values are `low`, `medium`, and `high`.
|
|
230
|
+
* responses. Currently supported values are `low`, `medium`, and `high`. The
|
|
231
|
+
* default is `medium`.
|
|
228
232
|
*/
|
|
229
233
|
verbosity?: 'low' | 'medium' | 'high' | null;
|
|
230
234
|
}
|
|
@@ -1330,7 +1330,7 @@ export interface BetaResponse {
|
|
|
1330
1330
|
* hit rates. Replaces the `user` field.
|
|
1331
1331
|
* [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
|
|
1332
1332
|
*/
|
|
1333
|
-
prompt_cache_key?: string;
|
|
1333
|
+
prompt_cache_key?: string | null;
|
|
1334
1334
|
|
|
1335
1335
|
/**
|
|
1336
1336
|
* The prompt-caching options that were applied to the response. Supported for
|
|
@@ -1375,7 +1375,7 @@ export interface BetaResponse {
|
|
|
1375
1375
|
* identifying information.
|
|
1376
1376
|
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
1377
1377
|
*/
|
|
1378
|
-
safety_identifier?: string;
|
|
1378
|
+
safety_identifier?: string | null;
|
|
1379
1379
|
|
|
1380
1380
|
/**
|
|
1381
1381
|
* Specifies the processing type used for serving the request.
|
|
@@ -1632,7 +1632,10 @@ export namespace BetaResponse {
|
|
|
1632
1632
|
*/
|
|
1633
1633
|
export interface Reasoning {
|
|
1634
1634
|
/**
|
|
1635
|
-
* Controls which reasoning items are rendered back to the model on later turns.
|
|
1635
|
+
* Controls which reasoning items are rendered back to the model on later turns. If
|
|
1636
|
+
* omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
|
|
1637
|
+
* model family defaults to `all_turns`; earlier models default to `current_turn`.
|
|
1638
|
+
*
|
|
1636
1639
|
* When returned on a response, this is the effective reasoning context mode used
|
|
1637
1640
|
* for the response.
|
|
1638
1641
|
*/
|
|
@@ -3124,6 +3127,7 @@ export interface BetaResponseError {
|
|
|
3124
3127
|
| 'server_error'
|
|
3125
3128
|
| 'rate_limit_exceeded'
|
|
3126
3129
|
| 'invalid_prompt'
|
|
3130
|
+
| 'data_residency_mismatch'
|
|
3127
3131
|
| 'bio_policy'
|
|
3128
3132
|
| 'vector_store_timeout'
|
|
3129
3133
|
| 'invalid_image'
|
|
@@ -9611,7 +9615,8 @@ export interface BetaResponseTextConfig {
|
|
|
9611
9615
|
/**
|
|
9612
9616
|
* Constrains the verbosity of the model's response. Lower values will result in
|
|
9613
9617
|
* more concise responses, while higher values will result in more verbose
|
|
9614
|
-
* responses. Currently supported values are `low`, `medium`, and `high`.
|
|
9618
|
+
* responses. Currently supported values are `low`, `medium`, and `high`. The
|
|
9619
|
+
* default is `medium`.
|
|
9615
9620
|
*/
|
|
9616
9621
|
verbosity?: 'low' | 'medium' | 'high' | null;
|
|
9617
9622
|
}
|
|
@@ -10392,7 +10397,7 @@ export namespace BetaResponsesClientEvent {
|
|
|
10392
10397
|
* hit rates. Replaces the `user` field.
|
|
10393
10398
|
* [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
|
|
10394
10399
|
*/
|
|
10395
|
-
prompt_cache_key?: string;
|
|
10400
|
+
prompt_cache_key?: string | null;
|
|
10396
10401
|
|
|
10397
10402
|
/**
|
|
10398
10403
|
* Options for prompt caching. Supported for `gpt-5.6` and later models. By
|
|
@@ -10444,7 +10449,7 @@ export namespace BetaResponsesClientEvent {
|
|
|
10444
10449
|
* identifying information.
|
|
10445
10450
|
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
10446
10451
|
*/
|
|
10447
|
-
safety_identifier?: string;
|
|
10452
|
+
safety_identifier?: string | null;
|
|
10448
10453
|
|
|
10449
10454
|
/**
|
|
10450
10455
|
* Specifies the processing type used for serving the request.
|
|
@@ -10700,7 +10705,10 @@ export namespace BetaResponsesClientEvent {
|
|
|
10700
10705
|
*/
|
|
10701
10706
|
export interface Reasoning {
|
|
10702
10707
|
/**
|
|
10703
|
-
* Controls which reasoning items are rendered back to the model on later turns.
|
|
10708
|
+
* Controls which reasoning items are rendered back to the model on later turns. If
|
|
10709
|
+
* omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
|
|
10710
|
+
* model family defaults to `all_turns`; earlier models default to `current_turn`.
|
|
10711
|
+
*
|
|
10704
10712
|
* When returned on a response, this is the effective reasoning context mode used
|
|
10705
10713
|
* for the response.
|
|
10706
10714
|
*/
|
|
@@ -11761,7 +11769,7 @@ export interface ResponseCreateParamsBase {
|
|
|
11761
11769
|
* your cache hit rates. Replaces the `user` field.
|
|
11762
11770
|
* [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
|
|
11763
11771
|
*/
|
|
11764
|
-
prompt_cache_key?: string;
|
|
11772
|
+
prompt_cache_key?: string | null;
|
|
11765
11773
|
|
|
11766
11774
|
/**
|
|
11767
11775
|
* Body param: Options for prompt caching. Supported for `gpt-5.6` and later
|
|
@@ -11814,7 +11822,7 @@ export interface ResponseCreateParamsBase {
|
|
|
11814
11822
|
* any identifying information.
|
|
11815
11823
|
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
11816
11824
|
*/
|
|
11817
|
-
safety_identifier?: string;
|
|
11825
|
+
safety_identifier?: string | null;
|
|
11818
11826
|
|
|
11819
11827
|
/**
|
|
11820
11828
|
* Body param: Specifies the processing type used for serving the request.
|
|
@@ -12079,7 +12087,10 @@ export namespace ResponseCreateParams {
|
|
|
12079
12087
|
*/
|
|
12080
12088
|
export interface Reasoning {
|
|
12081
12089
|
/**
|
|
12082
|
-
* Controls which reasoning items are rendered back to the model on later turns.
|
|
12090
|
+
* Controls which reasoning items are rendered back to the model on later turns. If
|
|
12091
|
+
* omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
|
|
12092
|
+
* model family defaults to `all_turns`; earlier models default to `current_turn`.
|
|
12093
|
+
*
|
|
12083
12094
|
* When returned on a response, this is the effective reasoning context mode used
|
|
12084
12095
|
* for the response.
|
|
12085
12096
|
*/
|
|
@@ -2178,7 +2178,7 @@ export interface ChatCompletionCreateParamsBase {
|
|
|
2178
2178
|
* hit rates. Replaces the `user` field.
|
|
2179
2179
|
* [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
|
|
2180
2180
|
*/
|
|
2181
|
-
prompt_cache_key?: string;
|
|
2181
|
+
prompt_cache_key?: string | null;
|
|
2182
2182
|
|
|
2183
2183
|
/**
|
|
2184
2184
|
* Options for prompt caching. Supported for `gpt-5.6` and later models. By
|
|
@@ -2249,7 +2249,7 @@ export interface ChatCompletionCreateParamsBase {
|
|
|
2249
2249
|
* identifying information.
|
|
2250
2250
|
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
2251
2251
|
*/
|
|
2252
|
-
safety_identifier?: string;
|
|
2252
|
+
safety_identifier?: string | null;
|
|
2253
2253
|
|
|
2254
2254
|
/**
|
|
2255
2255
|
* @deprecated This feature is in Beta. If specified, our system will make a best
|
|
@@ -2372,7 +2372,8 @@ export interface ChatCompletionCreateParamsBase {
|
|
|
2372
2372
|
/**
|
|
2373
2373
|
* Constrains the verbosity of the model's response. Lower values will result in
|
|
2374
2374
|
* more concise responses, while higher values will result in more verbose
|
|
2375
|
-
* responses. Currently supported values are `low`, `medium`, and `high`.
|
|
2375
|
+
* responses. Currently supported values are `low`, `medium`, and `high`. The
|
|
2376
|
+
* default is `medium`.
|
|
2376
2377
|
*/
|
|
2377
2378
|
verbosity?: 'low' | 'medium' | 'high' | null;
|
|
2378
2379
|
|
|
@@ -163,7 +163,8 @@ export namespace InputTokenCountParams {
|
|
|
163
163
|
/**
|
|
164
164
|
* Constrains the verbosity of the model's response. Lower values will result in
|
|
165
165
|
* more concise responses, while higher values will result in more verbose
|
|
166
|
-
* responses. Currently supported values are `low`, `medium`, and `high`.
|
|
166
|
+
* responses. Currently supported values are `low`, `medium`, and `high`. The
|
|
167
|
+
* default is `medium`.
|
|
167
168
|
*/
|
|
168
169
|
verbosity?: 'low' | 'medium' | 'high' | null;
|
|
169
170
|
}
|
|
@@ -1172,7 +1172,7 @@ export interface Response {
|
|
|
1172
1172
|
* hit rates. Replaces the `user` field.
|
|
1173
1173
|
* [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
|
|
1174
1174
|
*/
|
|
1175
|
-
prompt_cache_key?: string;
|
|
1175
|
+
prompt_cache_key?: string | null;
|
|
1176
1176
|
|
|
1177
1177
|
/**
|
|
1178
1178
|
* The prompt-caching options that were applied to the response. Supported for
|
|
@@ -1217,7 +1217,7 @@ export interface Response {
|
|
|
1217
1217
|
* identifying information.
|
|
1218
1218
|
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
1219
1219
|
*/
|
|
1220
|
-
safety_identifier?: string;
|
|
1220
|
+
safety_identifier?: string | null;
|
|
1221
1221
|
|
|
1222
1222
|
/**
|
|
1223
1223
|
* Specifies the latency tier to use for processing the request. This parameter is
|
|
@@ -2753,6 +2753,7 @@ export interface ResponseError {
|
|
|
2753
2753
|
| 'server_error'
|
|
2754
2754
|
| 'rate_limit_exceeded'
|
|
2755
2755
|
| 'invalid_prompt'
|
|
2756
|
+
| 'data_residency_mismatch'
|
|
2756
2757
|
| 'bio_policy'
|
|
2757
2758
|
| 'vector_store_timeout'
|
|
2758
2759
|
| 'invalid_image'
|
|
@@ -6955,7 +6956,8 @@ export interface ResponseTextConfig {
|
|
|
6955
6956
|
/**
|
|
6956
6957
|
* Constrains the verbosity of the model's response. Lower values will result in
|
|
6957
6958
|
* more concise responses, while higher values will result in more verbose
|
|
6958
|
-
* responses. Currently supported values are `low`, `medium`, and `high`.
|
|
6959
|
+
* responses. Currently supported values are `low`, `medium`, and `high`. The
|
|
6960
|
+
* default is `medium`.
|
|
6959
6961
|
*/
|
|
6960
6962
|
verbosity?: 'low' | 'medium' | 'high' | null;
|
|
6961
6963
|
}
|
|
@@ -7488,7 +7490,7 @@ export interface ResponsesClientEvent {
|
|
|
7488
7490
|
* hit rates. Replaces the `user` field.
|
|
7489
7491
|
* [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
|
|
7490
7492
|
*/
|
|
7491
|
-
prompt_cache_key?: string;
|
|
7493
|
+
prompt_cache_key?: string | null;
|
|
7492
7494
|
|
|
7493
7495
|
/**
|
|
7494
7496
|
* Options for prompt caching. Supported for `gpt-5.6` and later models. By
|
|
@@ -7540,7 +7542,7 @@ export interface ResponsesClientEvent {
|
|
|
7540
7542
|
* identifying information.
|
|
7541
7543
|
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
7542
7544
|
*/
|
|
7543
|
-
safety_identifier?: string;
|
|
7545
|
+
safety_identifier?: string | null;
|
|
7544
7546
|
|
|
7545
7547
|
/**
|
|
7546
7548
|
* Specifies the processing type used for serving the request.
|
|
@@ -8677,7 +8679,7 @@ export interface ResponseCreateParamsBase {
|
|
|
8677
8679
|
* hit rates. Replaces the `user` field.
|
|
8678
8680
|
* [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
|
|
8679
8681
|
*/
|
|
8680
|
-
prompt_cache_key?: string;
|
|
8682
|
+
prompt_cache_key?: string | null;
|
|
8681
8683
|
|
|
8682
8684
|
/**
|
|
8683
8685
|
* Options for prompt caching. Supported for `gpt-5.6` and later models. By
|
|
@@ -8729,7 +8731,7 @@ export interface ResponseCreateParamsBase {
|
|
|
8729
8731
|
* identifying information.
|
|
8730
8732
|
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
8731
8733
|
*/
|
|
8732
|
-
safety_identifier?: string;
|
|
8734
|
+
safety_identifier?: string | null;
|
|
8733
8735
|
|
|
8734
8736
|
/**
|
|
8735
8737
|
* Specifies the latency tier to use for processing the request. This parameter is
|
package/src/resources/shared.ts
CHANGED
|
@@ -261,7 +261,10 @@ export type OAuthErrorCode = 'invalid_grant' | 'invalid_subject_token' | (string
|
|
|
261
261
|
*/
|
|
262
262
|
export interface Reasoning {
|
|
263
263
|
/**
|
|
264
|
-
* Controls which reasoning items are rendered back to the model on later turns.
|
|
264
|
+
* Controls which reasoning items are rendered back to the model on later turns. If
|
|
265
|
+
* omitted or set to `auto`, the model determines the context mode. The `gpt-5.6`
|
|
266
|
+
* model family defaults to `all_turns`; earlier models default to `current_turn`.
|
|
267
|
+
*
|
|
265
268
|
* When returned on a response, this is the effective reasoning context mode used
|
|
266
269
|
* for the response.
|
|
267
270
|
*/
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '6.
|
|
1
|
+
export const VERSION = '6.49.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "6.
|
|
1
|
+
export declare const VERSION = "6.49.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "6.
|
|
1
|
+
export declare const VERSION = "6.49.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED