Skip to content

Commit 4908505

Browse files
authored
feat(api): update usage APIs and documentation (#2565)
## Summary Updates organization usage filtering, Responses and Chat Completions usage types, and API documentation. ## Changes - Add optional `line_items` filtering to organization cost usage requests, allowing results to be limited to exact cost line-item names - Remove the unlaunched `compute_units` field from Responses and Chat Completions usage types - Refresh model examples, documentation links, and reasoning-model guidance across affected API documentation Co-authored-by: apcha-oai <228803254+apcha-oai@users.noreply.github.com>
1 parent 82c5b2d commit 4908505

15 files changed

Lines changed: 406 additions & 465 deletions

File tree

‎.castiron.stats.yml‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
schema_version: 1
2-
generation_id: b1cc4193-4b37-4231-bc0a-c97dcbe985f7
3-
openapi_spec_hash: 4af7018ff56446e0398fc7946a92680f
4-
openapi_transformed_spec_hash: b2689771e08c3fdc6ae8f0433dc2c784
5-
config_hash: 5c00fe18ea913ed0186f9894adc02a70
6-
codegen_sha: 4d3155b4c645e90b0a2d754982db6245de8b372d
7-
codegen_hash: a6e4616dbb72afa61505b2333668b0f6787e9640cb63a06a09776b943c10e731
8-
public_codegen_sha: 65094c1637432c123c310d03e0cda1e7e6f1c997
2+
generation_id: 2fb25ef4-9328-404e-81ee-187df88e9823
3+
openapi_spec_hash: 0ba3e4acd88b521d832e2a42d5471e00
4+
openapi_transformed_spec_hash: 0a6002520553b981f4c0bf6555a0a623
5+
config_hash: d8813efd847d1966dd7f03bb648c41dc
6+
codegen_sha: d44ad72c971c340a062e71e7f42cf3165900617f
7+
codegen_hash: ab9bbd4ad8fb62f87523d20533c12d2be90b694a44b1916d17aec512d5e6ec76
8+
public_codegen_sha: 0a3d94b850d1dabbc8f3f46d4a208e6a1fc98274

‎api_reference/openapi.transformed.yml‎

Lines changed: 351 additions & 382 deletions
Large diffs are not rendered by default.

‎src/resources/admin/organization/usage.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6638,6 +6638,12 @@ export interface UsageCostsParams {
66386638
*/
66396639
limit?: number;
66406640

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+
66416647
/**
66426648
* A cursor for use in pagination. Corresponding to the `next_page` field from the
66436649
* previous response.

‎src/resources/batches.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ export interface Batch {
154154
metadata?: Shared.Metadata | null;
155155

156156
/**
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
160160
* [model guide](https://platform.openai.com/docs/models) to browse and compare
161161
* available models.
162162
*/

‎src/resources/beta/responses/responses.ts‎

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,9 +1122,9 @@ export interface BetaResponse {
11221122
metadata: { [key: string]: string } | null;
11231123

11241124
/**
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
11281128
* [model guide](https://platform.openai.com/docs/models) to browse and compare
11291129
* available models.
11301130
*/
@@ -1398,8 +1398,6 @@ export interface BetaResponse {
13981398
prompt_cache_retention?: 'in_memory' | '24h' | null;
13991399

14001400
/**
1401-
* **gpt-5 and o-series models only**
1402-
*
14031401
* Configuration options for
14041402
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
14051403
*/
@@ -1501,7 +1499,7 @@ export namespace BetaResponse {
15011499
/**
15021500
* The reason why the response is incomplete.
15031501
*/
1504-
reason?: 'max_output_tokens' | 'content_filter';
1502+
reason?: 'max_output_tokens' | 'max_messages' | 'content_filter';
15051503
}
15061504

15071505
export interface BetaSpecificProgrammaticToolCallingParam {
@@ -1671,8 +1669,6 @@ export namespace BetaResponse {
16711669
}
16721670

16731671
/**
1674-
* **gpt-5 and o-series models only**
1675-
*
16761672
* Configuration options for
16771673
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
16781674
*/
@@ -10525,11 +10521,6 @@ export interface BetaResponseUsage {
1052510521
* The total number of tokens used.
1052610522
*/
1052710523
total_tokens: number;
10528-
10529-
/**
10530-
* Compute units for the request. Currently null when available.
10531-
*/
10532-
compute_units?: number | null;
1053310524
}
1053410525

1053510526
export namespace BetaResponseUsage {
@@ -10798,9 +10789,9 @@ export namespace BetaResponsesClientEvent {
1079810789
metadata?: { [key: string]: string } | null;
1079910790

1080010791
/**
10801-
* Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
10802-
* wide range of models with different capabilities, performance characteristics,
10803-
* 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
1080410795
* [model guide](https://platform.openai.com/docs/models) to browse and compare
1080510796
* available models.
1080610797
*/
@@ -10980,8 +10971,6 @@ export namespace BetaResponsesClientEvent {
1098010971
prompt_cache_retention?: 'in_memory' | '24h' | null;
1098110972

1098210973
/**
10983-
* **gpt-5 and o-series models only**
10984-
*
1098510974
* Configuration options for
1098610975
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
1098710976
*/
@@ -11261,8 +11250,6 @@ export namespace BetaResponsesClientEvent {
1126111250
}
1126211251

1126311252
/**
11264-
* **gpt-5 and o-series models only**
11265-
*
1126611253
* Configuration options for
1126711254
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
1126811255
*/
@@ -12961,8 +12948,8 @@ export interface ResponseCreateParamsBase {
1296112948
metadata?: { [key: string]: string } | null;
1296212949

1296312950
/**
12964-
* Body param: Model ID used to generate the response, like `gpt-4o` or `o3`.
12965-
* 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
1296612953
* characteristics, and price points. Refer to the
1296712954
* [model guide](https://platform.openai.com/docs/models) to browse and compare
1296812955
* available models.
@@ -13145,9 +13132,7 @@ export interface ResponseCreateParamsBase {
1314513132
prompt_cache_retention?: 'in_memory' | '24h' | null;
1314613133

1314713134
/**
13148-
* Body param: **gpt-5 and o-series models only**
13149-
*
13150-
* Configuration options for
13135+
* Body param: Configuration options for
1315113136
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
1315213137
*/
1315313138
reasoning?: ResponseCreateParams.Reasoning | null;
@@ -13426,8 +13411,6 @@ export namespace ResponseCreateParams {
1342613411
}
1342713412

1342813413
/**
13429-
* **gpt-5 and o-series models only**
13430-
*
1343113414
* Configuration options for
1343213415
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
1343313416
*/
@@ -13615,7 +13598,7 @@ export interface ResponseCancelParams {
1361513598

1361613599
export interface ResponseCompactParams {
1361713600
/**
13618-
* 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
1361913602
* offers a wide range of models with different capabilities, performance
1362013603
* characteristics, and price points. Refer to the
1362113604
* [model guide](https://platform.openai.com/docs/models) to browse and compare

‎src/resources/chat/completions/completions.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class Completions extends APIResource {
6060
* const chatCompletion = await client.chat.completions.create(
6161
* {
6262
* messages: [{ content: 'string', role: 'developer' }],
63-
* model: 'gpt-5.4',
63+
* model: 'gpt-5.6-sol',
6464
* },
6565
* );
6666
* ```
@@ -2079,9 +2079,9 @@ export interface ChatCompletionCreateParamsBase {
20792079
messages: Array<ChatCompletionMessageParam>;
20802080

20812081
/**
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
20852085
* [model guide](https://platform.openai.com/docs/models) to browse and compare
20862086
* available models.
20872087
*/

‎src/resources/completions.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,6 @@ export interface CompletionUsage {
140140
*/
141141
completion_tokens_details?: CompletionUsage.CompletionTokensDetails;
142142

143-
/**
144-
* Compute units for the request. Currently null when available.
145-
*/
146-
compute_units?: number | null;
147-
148143
/**
149144
* Breakdown of tokens used in the prompt.
150145
*/

‎src/resources/evals/evals.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export interface EvalStoredCompletionsDataSourceConfig {
136136
*
137137
* - Improve the quality of my chatbot
138138
* - 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
140140
*/
141141
export interface EvalCreateResponse {
142142
/**
@@ -257,7 +257,7 @@ export namespace EvalCreateResponse {
257257
*
258258
* - Improve the quality of my chatbot
259259
* - 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
261261
*/
262262
export interface EvalRetrieveResponse {
263263
/**
@@ -378,7 +378,7 @@ export namespace EvalRetrieveResponse {
378378
*
379379
* - Improve the quality of my chatbot
380380
* - 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
382382
*/
383383
export interface EvalUpdateResponse {
384384
/**
@@ -499,7 +499,7 @@ export namespace EvalUpdateResponse {
499499
*
500500
* - Improve the quality of my chatbot
501501
* - 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
503503
*/
504504
export interface EvalListResponse {
505505
/**

‎src/resources/evals/runs/runs.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export namespace CreateEvalCompletionsRunDataSource {
196196
metadata?: Shared.Metadata | null;
197197

198198
/**
199-
* An optional model to filter by (e.g., 'gpt-4o').
199+
* An optional model to filter by (e.g., 'gpt-5.6-sol').
200200
*/
201201
model?: string | null;
202202
}

‎src/resources/responses/responses.ts‎

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,9 +1068,9 @@ export interface Response {
10681068
metadata: Shared.Metadata | null;
10691069

10701070
/**
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
10741074
* [model guide](https://platform.openai.com/docs/models) to browse and compare
10751075
* available models.
10761076
*/
@@ -1233,8 +1233,6 @@ export interface Response {
12331233
prompt_cache_retention?: 'in_memory' | '24h' | null;
12341234

12351235
/**
1236-
* **gpt-5 and o-series models only**
1237-
*
12381236
* Configuration options for
12391237
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
12401238
*/
@@ -1335,7 +1333,7 @@ export namespace Response {
13351333
/**
13361334
* The reason why the response is incomplete.
13371335
*/
1338-
reason?: 'max_output_tokens' | 'content_filter';
1336+
reason?: 'max_output_tokens' | 'max_messages' | 'content_filter';
13391337
}
13401338

13411339
export interface SpecificProgrammaticToolCallingParam {
@@ -7699,11 +7697,6 @@ export interface ResponseUsage {
76997697
* The total number of tokens used.
77007698
*/
77017699
total_tokens: number;
7702-
7703-
/**
7704-
* Compute units for the request. Currently null when available.
7705-
*/
7706-
compute_units?: number | null;
77077700
}
77087701

77097702
export namespace ResponseUsage {
@@ -7904,9 +7897,9 @@ export interface ResponsesClientEvent {
79047897
metadata?: Shared.Metadata | null;
79057898

79067899
/**
7907-
* Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
7908-
* wide range of models with different capabilities, performance characteristics,
7909-
* 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
79107903
* [model guide](https://platform.openai.com/docs/models) to browse and compare
79117904
* available models.
79127905
*/
@@ -7978,8 +7971,6 @@ export interface ResponsesClientEvent {
79787971
prompt_cache_retention?: 'in_memory' | '24h' | null;
79797972

79807973
/**
7981-
* **gpt-5 and o-series models only**
7982-
*
79837974
* Configuration options for
79847975
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
79857976
*/
@@ -9855,9 +9846,9 @@ export interface ResponseCreateParamsBase {
98559846
metadata?: Shared.Metadata | null;
98569847

98579848
/**
9858-
* Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
9859-
* wide range of models with different capabilities, performance characteristics,
9860-
* 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
98619852
* [model guide](https://platform.openai.com/docs/models) to browse and compare
98629853
* available models.
98639854
*/
@@ -9929,8 +9920,6 @@ export interface ResponseCreateParamsBase {
99299920
prompt_cache_retention?: 'in_memory' | '24h' | null;
99309921

99319922
/**
9932-
* **gpt-5 and o-series models only**
9933-
*
99349923
* Configuration options for
99359924
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
99369925
*/
@@ -10295,9 +10284,9 @@ export interface ResponseRetrieveParamsStreaming extends ResponseRetrieveParamsB
1029510284

1029610285
export interface ResponseCompactParams {
1029710286
/**
10298-
* Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a
10299-
* wide range of models with different capabilities, performance characteristics,
10300-
* 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
1030110290
* [model guide](https://platform.openai.com/docs/models) to browse and compare
1030210291
* available models.
1030310292
*/

0 commit comments

Comments
 (0)