Skip to content

Commit 7a3c26e

Browse files
feat(api): gpt 5.1
1 parent 88135c8 commit 7a3c26e

File tree

16 files changed

+825
-105
lines changed

16 files changed

+825
-105
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 135
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-eeba8addf3a5f412e5ce8d22031e60c61650cee3f5d9e587a2533f6818a249ea.yml
3-
openapi_spec_hash: 0a4d8ad2469823ce24a3fd94f23f1c2b
4-
config_hash: 630eea84bb3067d25640419af058ed56
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-ca24bc4d8125b5153514ce643c4e3220f25971b7d67ca384d56d493c72c0d977.yml
3+
openapi_spec_hash: c6f048c7b3d29f4de48fde0e845ba33f
4+
config_hash: b876221dfb213df9f0a999e75d38a65e

api.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,12 +695,16 @@ Methods:
695695

696696
Types:
697697

698+
- <code><a href="./src/resources/responses/responses.ts">ApplyPatchTool</a></code>
698699
- <code><a href="./src/resources/responses/responses.ts">ComputerTool</a></code>
699700
- <code><a href="./src/resources/responses/responses.ts">CustomTool</a></code>
700701
- <code><a href="./src/resources/responses/responses.ts">EasyInputMessage</a></code>
701702
- <code><a href="./src/resources/responses/responses.ts">FileSearchTool</a></code>
703+
- <code><a href="./src/resources/responses/responses.ts">FunctionShellTool</a></code>
702704
- <code><a href="./src/resources/responses/responses.ts">FunctionTool</a></code>
703705
- <code><a href="./src/resources/responses/responses.ts">Response</a></code>
706+
- <code><a href="./src/resources/responses/responses.ts">ResponseApplyPatchToolCall</a></code>
707+
- <code><a href="./src/resources/responses/responses.ts">ResponseApplyPatchToolCallOutput</a></code>
704708
- <code><a href="./src/resources/responses/responses.ts">ResponseAudioDeltaEvent</a></code>
705709
- <code><a href="./src/resources/responses/responses.ts">ResponseAudioDoneEvent</a></code>
706710
- <code><a href="./src/resources/responses/responses.ts">ResponseAudioTranscriptDeltaEvent</a></code>
@@ -737,6 +741,9 @@ Types:
737741
- <code><a href="./src/resources/responses/responses.ts">ResponseFunctionCallArgumentsDoneEvent</a></code>
738742
- <code><a href="./src/resources/responses/responses.ts">ResponseFunctionCallOutputItem</a></code>
739743
- <code><a href="./src/resources/responses/responses.ts">ResponseFunctionCallOutputItemList</a></code>
744+
- <code><a href="./src/resources/responses/responses.ts">ResponseFunctionShellCallOutputContent</a></code>
745+
- <code><a href="./src/resources/responses/responses.ts">ResponseFunctionShellToolCall</a></code>
746+
- <code><a href="./src/resources/responses/responses.ts">ResponseFunctionShellToolCallOutput</a></code>
740747
- <code><a href="./src/resources/responses/responses.ts">ResponseFunctionToolCall</a></code>
741748
- <code><a href="./src/resources/responses/responses.ts">ResponseFunctionToolCallItem</a></code>
742749
- <code><a href="./src/resources/responses/responses.ts">ResponseFunctionToolCallOutputItem</a></code>
@@ -799,10 +806,12 @@ Types:
799806
- <code><a href="./src/resources/responses/responses.ts">ResponseWebSearchCallSearchingEvent</a></code>
800807
- <code><a href="./src/resources/responses/responses.ts">Tool</a></code>
801808
- <code><a href="./src/resources/responses/responses.ts">ToolChoiceAllowed</a></code>
809+
- <code><a href="./src/resources/responses/responses.ts">ToolChoiceApplyPatch</a></code>
802810
- <code><a href="./src/resources/responses/responses.ts">ToolChoiceCustom</a></code>
803811
- <code><a href="./src/resources/responses/responses.ts">ToolChoiceFunction</a></code>
804812
- <code><a href="./src/resources/responses/responses.ts">ToolChoiceMcp</a></code>
805813
- <code><a href="./src/resources/responses/responses.ts">ToolChoiceOptions</a></code>
814+
- <code><a href="./src/resources/responses/responses.ts">ToolChoiceShell</a></code>
806815
- <code><a href="./src/resources/responses/responses.ts">ToolChoiceTypes</a></code>
807816
- <code><a href="./src/resources/responses/responses.ts">WebSearchPreviewTool</a></code>
808817
- <code><a href="./src/resources/responses/responses.ts">WebSearchTool</a></code>

src/resources/batches.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,17 @@ export interface BatchCreateParams {
287287

288288
/**
289289
* The endpoint to be used for all requests in the batch. Currently
290-
* `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions`
291-
* are supported. Note that `/v1/embeddings` batches are also restricted to a
292-
* maximum of 50,000 embedding inputs across all requests in the batch.
290+
* `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, `/v1/completions`,
291+
* and `/v1/moderations` are supported. Note that `/v1/embeddings` batches are also
292+
* restricted to a maximum of 50,000 embedding inputs across all requests in the
293+
* batch.
293294
*/
294-
endpoint: '/v1/responses' | '/v1/chat/completions' | '/v1/embeddings' | '/v1/completions';
295+
endpoint:
296+
| '/v1/responses'
297+
| '/v1/chat/completions'
298+
| '/v1/embeddings'
299+
| '/v1/completions'
300+
| '/v1/moderations';
295301

296302
/**
297303
* The ID of an uploaded file that contains requests for the new batch.

src/resources/beta/assistants.ts

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,12 +1160,16 @@ export interface AssistantCreateParams {
11601160
/**
11611161
* Constrains effort on reasoning for
11621162
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
1163-
* supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
1164-
* effort can result in faster responses and fewer tokens used on reasoning in a
1165-
* response.
1163+
* supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
1164+
* reasoning effort can result in faster responses and fewer tokens used on
1165+
* reasoning in a response.
11661166
*
1167-
* Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
1168-
* effort.
1167+
* - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
1168+
* reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
1169+
* calls are supported for all reasoning values in gpt-5.1.
1170+
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
1171+
* support `none`.
1172+
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
11691173
*/
11701174
reasoning_effort?: Shared.ReasoningEffort | null;
11711175

@@ -1416,12 +1420,16 @@ export interface AssistantUpdateParams {
14161420
/**
14171421
* Constrains effort on reasoning for
14181422
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
1419-
* supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
1420-
* effort can result in faster responses and fewer tokens used on reasoning in a
1421-
* response.
1423+
* supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
1424+
* reasoning effort can result in faster responses and fewer tokens used on
1425+
* reasoning in a response.
14221426
*
1423-
* Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
1424-
* effort.
1427+
* - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
1428+
* reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
1429+
* calls are supported for all reasoning values in gpt-5.1.
1430+
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
1431+
* support `none`.
1432+
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
14251433
*/
14261434
reasoning_effort?: Shared.ReasoningEffort | null;
14271435

src/resources/beta/threads/runs/runs.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -725,12 +725,16 @@ export interface RunCreateParamsBase {
725725
/**
726726
* Body param: Constrains effort on reasoning for
727727
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
728-
* supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
729-
* effort can result in faster responses and fewer tokens used on reasoning in a
730-
* response.
728+
* supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
729+
* reasoning effort can result in faster responses and fewer tokens used on
730+
* reasoning in a response.
731731
*
732-
* Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
733-
* effort.
732+
* - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
733+
* reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
734+
* calls are supported for all reasoning values in gpt-5.1.
735+
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
736+
* support `none`.
737+
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
734738
*/
735739
reasoning_effort?: Shared.ReasoningEffort | null;
736740

src/resources/chat/completions/completions.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,15 +1638,27 @@ export interface ChatCompletionCreateParamsBase {
16381638
*/
16391639
prompt_cache_key?: string;
16401640

1641+
/**
1642+
* The retention policy for the prompt cache. Set to `24h` to enable extended
1643+
* prompt caching, which keeps cached prefixes active for longer, up to a maximum
1644+
* of 24 hours.
1645+
* [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
1646+
*/
1647+
prompt_cache_retention?: 'in-memory' | '24h' | null;
1648+
16411649
/**
16421650
* Constrains effort on reasoning for
16431651
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
1644-
* supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
1645-
* effort can result in faster responses and fewer tokens used on reasoning in a
1646-
* response.
1652+
* supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
1653+
* reasoning effort can result in faster responses and fewer tokens used on
1654+
* reasoning in a response.
16471655
*
1648-
* Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
1649-
* effort.
1656+
* - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
1657+
* reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
1658+
* calls are supported for all reasoning values in gpt-5.1.
1659+
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
1660+
* support `none`.
1661+
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
16501662
*/
16511663
reasoning_effort?: Shared.ReasoningEffort | null;
16521664

src/resources/conversations/items.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ export type ConversationItem =
8989
| ResponsesAPI.ResponseCodeInterpreterToolCall
9090
| ConversationItem.LocalShellCall
9191
| ConversationItem.LocalShellCallOutput
92+
| ResponsesAPI.ResponseFunctionShellToolCall
93+
| ResponsesAPI.ResponseFunctionShellToolCallOutput
94+
| ResponsesAPI.ResponseApplyPatchToolCall
95+
| ResponsesAPI.ResponseApplyPatchToolCallOutput
9296
| ConversationItem.McpListTools
9397
| ConversationItem.McpApprovalRequest
9498
| ConversationItem.McpApprovalResponse

0 commit comments

Comments
 (0)