@ai-sdk/openai 3.0.14 → 3.0.15

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 (110) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/index.js +1 -1
  3. package/dist/index.mjs +1 -1
  4. package/package.json +6 -5
  5. package/src/chat/__fixtures__/azure-model-router.1.chunks.txt +8 -0
  6. package/src/chat/__snapshots__/openai-chat-language-model.test.ts.snap +88 -0
  7. package/src/chat/convert-openai-chat-usage.ts +57 -0
  8. package/src/chat/convert-to-openai-chat-messages.test.ts +516 -0
  9. package/src/chat/convert-to-openai-chat-messages.ts +225 -0
  10. package/src/chat/get-response-metadata.ts +15 -0
  11. package/src/chat/map-openai-finish-reason.ts +19 -0
  12. package/src/chat/openai-chat-api.ts +198 -0
  13. package/src/chat/openai-chat-language-model.test.ts +3496 -0
  14. package/src/chat/openai-chat-language-model.ts +700 -0
  15. package/src/chat/openai-chat-options.ts +186 -0
  16. package/src/chat/openai-chat-prepare-tools.test.ts +322 -0
  17. package/src/chat/openai-chat-prepare-tools.ts +84 -0
  18. package/src/chat/openai-chat-prompt.ts +70 -0
  19. package/src/completion/convert-openai-completion-usage.ts +46 -0
  20. package/src/completion/convert-to-openai-completion-prompt.ts +93 -0
  21. package/src/completion/get-response-metadata.ts +15 -0
  22. package/src/completion/map-openai-finish-reason.ts +19 -0
  23. package/src/completion/openai-completion-api.ts +81 -0
  24. package/src/completion/openai-completion-language-model.test.ts +752 -0
  25. package/src/completion/openai-completion-language-model.ts +336 -0
  26. package/src/completion/openai-completion-options.ts +58 -0
  27. package/src/embedding/__snapshots__/openai-embedding-model.test.ts.snap +43 -0
  28. package/src/embedding/openai-embedding-api.ts +13 -0
  29. package/src/embedding/openai-embedding-model.test.ts +146 -0
  30. package/src/embedding/openai-embedding-model.ts +95 -0
  31. package/src/embedding/openai-embedding-options.ts +30 -0
  32. package/src/image/openai-image-api.ts +35 -0
  33. package/src/image/openai-image-model.test.ts +722 -0
  34. package/src/image/openai-image-model.ts +305 -0
  35. package/src/image/openai-image-options.ts +28 -0
  36. package/src/index.ts +9 -0
  37. package/src/internal/index.ts +19 -0
  38. package/src/openai-config.ts +18 -0
  39. package/src/openai-error.test.ts +34 -0
  40. package/src/openai-error.ts +22 -0
  41. package/src/openai-language-model-capabilities.test.ts +93 -0
  42. package/src/openai-language-model-capabilities.ts +54 -0
  43. package/src/openai-provider.test.ts +98 -0
  44. package/src/openai-provider.ts +270 -0
  45. package/src/openai-tools.ts +114 -0
  46. package/src/responses/__fixtures__/openai-apply-patch-tool-delete.1.chunks.txt +5 -0
  47. package/src/responses/__fixtures__/openai-apply-patch-tool.1.chunks.txt +38 -0
  48. package/src/responses/__fixtures__/openai-apply-patch-tool.1.json +69 -0
  49. package/src/responses/__fixtures__/openai-code-interpreter-tool.1.chunks.txt +393 -0
  50. package/src/responses/__fixtures__/openai-code-interpreter-tool.1.json +137 -0
  51. package/src/responses/__fixtures__/openai-error.1.chunks.txt +4 -0
  52. package/src/responses/__fixtures__/openai-error.1.json +8 -0
  53. package/src/responses/__fixtures__/openai-file-search-tool.1.chunks.txt +94 -0
  54. package/src/responses/__fixtures__/openai-file-search-tool.1.json +89 -0
  55. package/src/responses/__fixtures__/openai-file-search-tool.2.chunks.txt +93 -0
  56. package/src/responses/__fixtures__/openai-file-search-tool.2.json +112 -0
  57. package/src/responses/__fixtures__/openai-image-generation-tool.1.chunks.txt +16 -0
  58. package/src/responses/__fixtures__/openai-image-generation-tool.1.json +96 -0
  59. package/src/responses/__fixtures__/openai-local-shell-tool.1.chunks.txt +7 -0
  60. package/src/responses/__fixtures__/openai-local-shell-tool.1.json +70 -0
  61. package/src/responses/__fixtures__/openai-mcp-tool-approval.1.chunks.txt +11 -0
  62. package/src/responses/__fixtures__/openai-mcp-tool-approval.1.json +169 -0
  63. package/src/responses/__fixtures__/openai-mcp-tool-approval.2.chunks.txt +123 -0
  64. package/src/responses/__fixtures__/openai-mcp-tool-approval.2.json +176 -0
  65. package/src/responses/__fixtures__/openai-mcp-tool-approval.3.chunks.txt +11 -0
  66. package/src/responses/__fixtures__/openai-mcp-tool-approval.3.json +169 -0
  67. package/src/responses/__fixtures__/openai-mcp-tool-approval.4.chunks.txt +84 -0
  68. package/src/responses/__fixtures__/openai-mcp-tool-approval.4.json +182 -0
  69. package/src/responses/__fixtures__/openai-mcp-tool.1.chunks.txt +373 -0
  70. package/src/responses/__fixtures__/openai-mcp-tool.1.json +159 -0
  71. package/src/responses/__fixtures__/openai-reasoning-encrypted-content.1.chunks.txt +110 -0
  72. package/src/responses/__fixtures__/openai-reasoning-encrypted-content.1.json +117 -0
  73. package/src/responses/__fixtures__/openai-shell-tool.1.chunks.txt +182 -0
  74. package/src/responses/__fixtures__/openai-shell-tool.1.json +73 -0
  75. package/src/responses/__fixtures__/openai-web-search-tool.1.chunks.txt +185 -0
  76. package/src/responses/__fixtures__/openai-web-search-tool.1.json +266 -0
  77. package/src/responses/__snapshots__/openai-responses-language-model.test.ts.snap +10955 -0
  78. package/src/responses/convert-openai-responses-usage.ts +53 -0
  79. package/src/responses/convert-to-openai-responses-input.test.ts +2976 -0
  80. package/src/responses/convert-to-openai-responses-input.ts +578 -0
  81. package/src/responses/map-openai-responses-finish-reason.ts +22 -0
  82. package/src/responses/openai-responses-api.test.ts +89 -0
  83. package/src/responses/openai-responses-api.ts +1086 -0
  84. package/src/responses/openai-responses-language-model.test.ts +6927 -0
  85. package/src/responses/openai-responses-language-model.ts +1932 -0
  86. package/src/responses/openai-responses-options.ts +312 -0
  87. package/src/responses/openai-responses-prepare-tools.test.ts +924 -0
  88. package/src/responses/openai-responses-prepare-tools.ts +264 -0
  89. package/src/responses/openai-responses-provider-metadata.ts +39 -0
  90. package/src/speech/openai-speech-api.ts +38 -0
  91. package/src/speech/openai-speech-model.test.ts +202 -0
  92. package/src/speech/openai-speech-model.ts +137 -0
  93. package/src/speech/openai-speech-options.ts +22 -0
  94. package/src/tool/apply-patch.ts +141 -0
  95. package/src/tool/code-interpreter.ts +104 -0
  96. package/src/tool/file-search.ts +145 -0
  97. package/src/tool/image-generation.ts +126 -0
  98. package/src/tool/local-shell.test-d.ts +20 -0
  99. package/src/tool/local-shell.ts +72 -0
  100. package/src/tool/mcp.ts +125 -0
  101. package/src/tool/shell.ts +85 -0
  102. package/src/tool/web-search-preview.ts +139 -0
  103. package/src/tool/web-search.test-d.ts +13 -0
  104. package/src/tool/web-search.ts +179 -0
  105. package/src/transcription/openai-transcription-api.ts +37 -0
  106. package/src/transcription/openai-transcription-model.test.ts +507 -0
  107. package/src/transcription/openai-transcription-model.ts +232 -0
  108. package/src/transcription/openai-transcription-options.ts +50 -0
  109. package/src/transcription/transcription-test.mp3 +0 -0
  110. package/src/version.ts +6 -0
@@ -0,0 +1,270 @@
1
+ import {
2
+ EmbeddingModelV3,
3
+ ImageModelV3,
4
+ LanguageModelV3,
5
+ ProviderV3,
6
+ SpeechModelV3,
7
+ TranscriptionModelV3,
8
+ } from '@ai-sdk/provider';
9
+ import {
10
+ FetchFunction,
11
+ loadApiKey,
12
+ loadOptionalSetting,
13
+ withoutTrailingSlash,
14
+ withUserAgentSuffix,
15
+ } from '@ai-sdk/provider-utils';
16
+ import { OpenAIChatLanguageModel } from './chat/openai-chat-language-model';
17
+ import { OpenAIChatModelId } from './chat/openai-chat-options';
18
+ import { OpenAICompletionLanguageModel } from './completion/openai-completion-language-model';
19
+ import { OpenAICompletionModelId } from './completion/openai-completion-options';
20
+ import { OpenAIEmbeddingModel } from './embedding/openai-embedding-model';
21
+ import { OpenAIEmbeddingModelId } from './embedding/openai-embedding-options';
22
+ import { OpenAIImageModel } from './image/openai-image-model';
23
+ import { OpenAIImageModelId } from './image/openai-image-options';
24
+ import { openaiTools } from './openai-tools';
25
+ import { OpenAIResponsesLanguageModel } from './responses/openai-responses-language-model';
26
+ import { OpenAIResponsesModelId } from './responses/openai-responses-options';
27
+ import { OpenAISpeechModel } from './speech/openai-speech-model';
28
+ import { OpenAISpeechModelId } from './speech/openai-speech-options';
29
+ import { OpenAITranscriptionModel } from './transcription/openai-transcription-model';
30
+ import { OpenAITranscriptionModelId } from './transcription/openai-transcription-options';
31
+ import { VERSION } from './version';
32
+
33
+ export interface OpenAIProvider extends ProviderV3 {
34
+ (modelId: OpenAIResponsesModelId): LanguageModelV3;
35
+
36
+ /**
37
+ Creates an OpenAI model for text generation.
38
+ */
39
+ languageModel(modelId: OpenAIResponsesModelId): LanguageModelV3;
40
+
41
+ /**
42
+ Creates an OpenAI chat model for text generation.
43
+ */
44
+ chat(modelId: OpenAIChatModelId): LanguageModelV3;
45
+
46
+ /**
47
+ Creates an OpenAI responses API model for text generation.
48
+ */
49
+ responses(modelId: OpenAIResponsesModelId): LanguageModelV3;
50
+
51
+ /**
52
+ Creates an OpenAI completion model for text generation.
53
+ */
54
+ completion(modelId: OpenAICompletionModelId): LanguageModelV3;
55
+
56
+ /**
57
+ Creates a model for text embeddings.
58
+ */
59
+ embedding(modelId: OpenAIEmbeddingModelId): EmbeddingModelV3;
60
+
61
+ /**
62
+ Creates a model for text embeddings.
63
+ */
64
+ embeddingModel(modelId: OpenAIEmbeddingModelId): EmbeddingModelV3;
65
+
66
+ /**
67
+ * @deprecated Use `embedding` instead.
68
+ */
69
+ textEmbedding(modelId: OpenAIEmbeddingModelId): EmbeddingModelV3;
70
+
71
+ /**
72
+ * @deprecated Use `embeddingModel` instead.
73
+ */
74
+ textEmbeddingModel(modelId: OpenAIEmbeddingModelId): EmbeddingModelV3;
75
+
76
+ /**
77
+ Creates a model for image generation.
78
+ */
79
+ image(modelId: OpenAIImageModelId): ImageModelV3;
80
+
81
+ /**
82
+ Creates a model for image generation.
83
+ */
84
+ imageModel(modelId: OpenAIImageModelId): ImageModelV3;
85
+
86
+ /**
87
+ Creates a model for transcription.
88
+ */
89
+ transcription(modelId: OpenAITranscriptionModelId): TranscriptionModelV3;
90
+
91
+ /**
92
+ Creates a model for speech generation.
93
+ */
94
+ speech(modelId: OpenAISpeechModelId): SpeechModelV3;
95
+
96
+ /**
97
+ OpenAI-specific tools.
98
+ */
99
+ tools: typeof openaiTools;
100
+ }
101
+
102
+ export interface OpenAIProviderSettings {
103
+ /**
104
+ Base URL for the OpenAI API calls.
105
+ */
106
+ baseURL?: string;
107
+
108
+ /**
109
+ API key for authenticating requests.
110
+ */
111
+ apiKey?: string;
112
+
113
+ /**
114
+ OpenAI Organization.
115
+ */
116
+ organization?: string;
117
+
118
+ /**
119
+ OpenAI project.
120
+ */
121
+ project?: string;
122
+
123
+ /**
124
+ Custom headers to include in the requests.
125
+ */
126
+ headers?: Record<string, string>;
127
+
128
+ /**
129
+ Provider name. Overrides the `openai` default name for 3rd party providers.
130
+ */
131
+ name?: string;
132
+
133
+ /**
134
+ Custom fetch implementation. You can use it as a middleware to intercept requests,
135
+ or to provide a custom fetch implementation for e.g. testing.
136
+ */
137
+ fetch?: FetchFunction;
138
+ }
139
+
140
+ /**
141
+ Create an OpenAI provider instance.
142
+ */
143
+ export function createOpenAI(
144
+ options: OpenAIProviderSettings = {},
145
+ ): OpenAIProvider {
146
+ const baseURL =
147
+ withoutTrailingSlash(
148
+ loadOptionalSetting({
149
+ settingValue: options.baseURL,
150
+ environmentVariableName: 'OPENAI_BASE_URL',
151
+ }),
152
+ ) ?? 'https://api.openai.com/v1';
153
+
154
+ const providerName = options.name ?? 'openai';
155
+
156
+ const getHeaders = () =>
157
+ withUserAgentSuffix(
158
+ {
159
+ Authorization: `Bearer ${loadApiKey({
160
+ apiKey: options.apiKey,
161
+ environmentVariableName: 'OPENAI_API_KEY',
162
+ description: 'OpenAI',
163
+ })}`,
164
+ 'OpenAI-Organization': options.organization,
165
+ 'OpenAI-Project': options.project,
166
+ ...options.headers,
167
+ },
168
+ `ai-sdk/openai/${VERSION}`,
169
+ );
170
+
171
+ const createChatModel = (modelId: OpenAIChatModelId) =>
172
+ new OpenAIChatLanguageModel(modelId, {
173
+ provider: `${providerName}.chat`,
174
+ url: ({ path }) => `${baseURL}${path}`,
175
+ headers: getHeaders,
176
+ fetch: options.fetch,
177
+ });
178
+
179
+ const createCompletionModel = (modelId: OpenAICompletionModelId) =>
180
+ new OpenAICompletionLanguageModel(modelId, {
181
+ provider: `${providerName}.completion`,
182
+ url: ({ path }) => `${baseURL}${path}`,
183
+ headers: getHeaders,
184
+ fetch: options.fetch,
185
+ });
186
+
187
+ const createEmbeddingModel = (modelId: OpenAIEmbeddingModelId) =>
188
+ new OpenAIEmbeddingModel(modelId, {
189
+ provider: `${providerName}.embedding`,
190
+ url: ({ path }) => `${baseURL}${path}`,
191
+ headers: getHeaders,
192
+ fetch: options.fetch,
193
+ });
194
+
195
+ const createImageModel = (modelId: OpenAIImageModelId) =>
196
+ new OpenAIImageModel(modelId, {
197
+ provider: `${providerName}.image`,
198
+ url: ({ path }) => `${baseURL}${path}`,
199
+ headers: getHeaders,
200
+ fetch: options.fetch,
201
+ });
202
+
203
+ const createTranscriptionModel = (modelId: OpenAITranscriptionModelId) =>
204
+ new OpenAITranscriptionModel(modelId, {
205
+ provider: `${providerName}.transcription`,
206
+ url: ({ path }) => `${baseURL}${path}`,
207
+ headers: getHeaders,
208
+ fetch: options.fetch,
209
+ });
210
+
211
+ const createSpeechModel = (modelId: OpenAISpeechModelId) =>
212
+ new OpenAISpeechModel(modelId, {
213
+ provider: `${providerName}.speech`,
214
+ url: ({ path }) => `${baseURL}${path}`,
215
+ headers: getHeaders,
216
+ fetch: options.fetch,
217
+ });
218
+
219
+ const createLanguageModel = (modelId: OpenAIResponsesModelId) => {
220
+ if (new.target) {
221
+ throw new Error(
222
+ 'The OpenAI model function cannot be called with the new keyword.',
223
+ );
224
+ }
225
+
226
+ return createResponsesModel(modelId);
227
+ };
228
+
229
+ const createResponsesModel = (modelId: OpenAIResponsesModelId) => {
230
+ return new OpenAIResponsesLanguageModel(modelId, {
231
+ provider: `${providerName}.responses`,
232
+ url: ({ path }) => `${baseURL}${path}`,
233
+ headers: getHeaders,
234
+ fetch: options.fetch,
235
+ fileIdPrefixes: ['file-'],
236
+ });
237
+ };
238
+
239
+ const provider = function (modelId: OpenAIResponsesModelId) {
240
+ return createLanguageModel(modelId);
241
+ };
242
+
243
+ provider.specificationVersion = 'v3' as const;
244
+ provider.languageModel = createLanguageModel;
245
+ provider.chat = createChatModel;
246
+ provider.completion = createCompletionModel;
247
+ provider.responses = createResponsesModel;
248
+ provider.embedding = createEmbeddingModel;
249
+ provider.embeddingModel = createEmbeddingModel;
250
+ provider.textEmbedding = createEmbeddingModel;
251
+ provider.textEmbeddingModel = createEmbeddingModel;
252
+
253
+ provider.image = createImageModel;
254
+ provider.imageModel = createImageModel;
255
+
256
+ provider.transcription = createTranscriptionModel;
257
+ provider.transcriptionModel = createTranscriptionModel;
258
+
259
+ provider.speech = createSpeechModel;
260
+ provider.speechModel = createSpeechModel;
261
+
262
+ provider.tools = openaiTools;
263
+
264
+ return provider as OpenAIProvider;
265
+ }
266
+
267
+ /**
268
+ Default OpenAI provider instance.
269
+ */
270
+ export const openai = createOpenAI();
@@ -0,0 +1,114 @@
1
+ import { applyPatch } from './tool/apply-patch';
2
+ import { codeInterpreter } from './tool/code-interpreter';
3
+ import { fileSearch } from './tool/file-search';
4
+ import { imageGeneration } from './tool/image-generation';
5
+ import { localShell } from './tool/local-shell';
6
+ import { shell } from './tool/shell';
7
+ import { webSearch } from './tool/web-search';
8
+ import { webSearchPreview } from './tool/web-search-preview';
9
+ import { mcp } from './tool/mcp';
10
+
11
+ export const openaiTools = {
12
+ /**
13
+ * The apply_patch tool lets GPT-5.1 create, update, and delete files in your
14
+ * codebase using structured diffs. Instead of just suggesting edits, the model
15
+ * emits patch operations that your application applies and then reports back on,
16
+ * enabling iterative, multi-step code editing workflows.
17
+ *
18
+ */
19
+ applyPatch,
20
+
21
+ /**
22
+ * The Code Interpreter tool allows models to write and run Python code in a
23
+ * sandboxed environment to solve complex problems in domains like data analysis,
24
+ * coding, and math.
25
+ *
26
+ * @param container - The container to use for the code interpreter.
27
+ */
28
+ codeInterpreter,
29
+
30
+ /**
31
+ * File search is a tool available in the Responses API. It enables models to
32
+ * retrieve information in a knowledge base of previously uploaded files through
33
+ * semantic and keyword search.
34
+ *
35
+ * @param vectorStoreIds - The vector store IDs to use for the file search.
36
+ * @param maxNumResults - The maximum number of results to return.
37
+ * @param ranking - The ranking options to use for the file search.
38
+ * @param filters - The filters to use for the file search.
39
+ */
40
+ fileSearch,
41
+
42
+ /**
43
+ * The image generation tool allows you to generate images using a text prompt,
44
+ * and optionally image inputs. It leverages the GPT Image model,
45
+ * and automatically optimizes text inputs for improved performance.
46
+ *
47
+ * @param background - Background type for the generated image. One of 'auto', 'opaque', or 'transparent'.
48
+ * @param inputFidelity - Input fidelity for the generated image. One of 'low' or 'high'.
49
+ * @param inputImageMask - Optional mask for inpainting. Contains fileId and/or imageUrl.
50
+ * @param model - The image generation model to use. Default: gpt-image-1.
51
+ * @param moderation - Moderation level for the generated image. Default: 'auto'.
52
+ * @param outputCompression - Compression level for the output image (0-100).
53
+ * @param outputFormat - The output format of the generated image. One of 'png', 'jpeg', or 'webp'.
54
+ * @param partialImages - Number of partial images to generate in streaming mode (0-3).
55
+ * @param quality - The quality of the generated image. One of 'auto', 'low', 'medium', or 'high'.
56
+ * @param size - The size of the generated image. One of 'auto', '1024x1024', '1024x1536', or '1536x1024'.
57
+ */
58
+ imageGeneration,
59
+
60
+ /**
61
+ * Local shell is a tool that allows agents to run shell commands locally
62
+ * on a machine you or the user provides.
63
+ *
64
+ * Supported models: `gpt-5-codex` and `codex-mini-latest`
65
+ */
66
+ localShell,
67
+
68
+ /**
69
+ * The shell tool allows the model to interact with your local computer through
70
+ * a controlled command-line interface. The model proposes shell commands; your
71
+ * integration executes them and returns the outputs.
72
+ *
73
+ * Available through the Responses API for use with GPT-5.1.
74
+ *
75
+ * WARNING: Running arbitrary shell commands can be dangerous. Always sandbox
76
+ * execution or add strict allow-/deny-lists before forwarding a command to
77
+ * the system shell.
78
+ */
79
+ shell,
80
+
81
+ /**
82
+ * Web search allows models to access up-to-date information from the internet
83
+ * and provide answers with sourced citations.
84
+ *
85
+ * @param searchContextSize - The search context size to use for the web search.
86
+ * @param userLocation - The user location to use for the web search.
87
+ */
88
+ webSearchPreview,
89
+
90
+ /**
91
+ * Web search allows models to access up-to-date information from the internet
92
+ * and provide answers with sourced citations.
93
+ *
94
+ * @param filters - The filters to use for the web search.
95
+ * @param searchContextSize - The search context size to use for the web search.
96
+ * @param userLocation - The user location to use for the web search.
97
+ */
98
+ webSearch,
99
+
100
+ /**
101
+ * MCP (Model Context Protocol) allows models to call tools exposed by
102
+ * remote MCP servers or service connectors.
103
+ *
104
+ * @param serverLabel - Label to identify the MCP server.
105
+ * @param allowedTools - Allowed tool names or filter object.
106
+ * @param authorization - OAuth access token for the MCP server/connector.
107
+ * @param connectorId - Identifier for a service connector.
108
+ * @param headers - Optional headers to include in MCP requests.
109
+ * // param requireApproval - Approval policy ('always'|'never'|filter object). (Removed - always 'never')
110
+ * @param serverDescription - Optional description of the server.
111
+ * @param serverUrl - URL for the MCP server.
112
+ */
113
+ mcp,
114
+ };
@@ -0,0 +1,5 @@
1
+ {"type":"response.created","sequence_number":0,"response":{"id":"resp_delete_001","object":"response","created_at":1764180467,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5.1-2025-11-13","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"none","summary":null},"safety_identifier":null,"service_tier":"default","store":true,"temperature":1,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"apply_patch"}],"top_logprobs":0,"top_p":1,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
2
+ {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_delete_001","object":"response","created_at":1764180467,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5.1-2025-11-13","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"none","summary":null},"safety_identifier":null,"service_tier":"default","store":true,"temperature":1,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"apply_patch"}],"top_logprobs":0,"top_p":1,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
3
+ {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"apc_delete_001","type":"apply_patch_call","status":"in_progress","call_id":"call_delete_1","operation":{"type":"delete_file","path":"obsolete.txt"}}}
4
+ {"type":"response.output_item.done","sequence_number":3,"output_index":0,"item":{"id":"apc_delete_001","type":"apply_patch_call","status":"completed","call_id":"call_delete_1","operation":{"type":"delete_file","path":"obsolete.txt"}}}
5
+ {"type":"response.completed","sequence_number":4,"response":{"id":"resp_delete_001","object":"response","created_at":1764180467,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5.1-2025-11-13","output":[{"id":"apc_delete_001","type":"apply_patch_call","status":"completed","call_id":"call_delete_1","operation":{"type":"delete_file","path":"obsolete.txt"}}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"none","summary":null},"safety_identifier":null,"service_tier":"default","store":true,"temperature":1,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"apply_patch"}],"top_logprobs":0,"top_p":1,"truncation":"disabled","usage":{"input_tokens":24,"input_tokens_details":{"cached_tokens":0},"output_tokens":0,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":24},"user":null,"metadata":{}}}
@@ -0,0 +1,38 @@
1
+ {"type":"response.created","sequence_number":0,"response":{"id":"resp_0372d86dfc1762fe00692741f339a08190bce9b78ee2079295","object":"response","created_at":1764180467,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5.1-2025-11-13","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"none","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"apply_patch"}],"top_logprobs":0,"top_p":1,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
2
+ {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_0372d86dfc1762fe00692741f339a08190bce9b78ee2079295","object":"response","created_at":1764180467,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5.1-2025-11-13","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"none","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"apply_patch"}],"top_logprobs":0,"top_p":1,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
3
+ {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","type":"apply_patch_call","status":"in_progress","call_id":"call_kA46f91ZwocQyMCKyyZqRyC5","operation":{"type":"create_file","diff":"","path":"shopping-checklist.md"}}}
4
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":3,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":"+","obfuscation":"wsWQt8Nr5nwWBf7"}
5
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":4,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":"##","obfuscation":"4SVQhl9Je0GGg6"}
6
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":5,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":" Shopping","obfuscation":"LHvs3Ds"}
7
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":6,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":" Checklist","obfuscation":"cNN95N"}
8
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":7,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":"\n","obfuscation":"ZdUN3W6do9KqYf6"}
9
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":8,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":"+\n","obfuscation":"eKOocIbOw7ENLx"}
10
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":9,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":"+-","obfuscation":"Q6AtCgXIlkU4Zn"}
11
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":10,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":" [","obfuscation":"Q2OZcn4FZwRJS0"}
12
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":11,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":" ]","obfuscation":"Y2snn3Nt17feXS"}
13
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":12,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":" Milk","obfuscation":"y1EDwNBoRKJ"}
14
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":13,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":"\n","obfuscation":"xZMXDj2J1C9KA1B"}
15
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":14,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":"+-","obfuscation":"HfSHks3c2Fb3LJ"}
16
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":15,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":" [","obfuscation":"dRCuki6EZbgOwK"}
17
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":16,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":" ]","obfuscation":"SyHlgmTrU66CEl"}
18
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":17,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":" Bread","obfuscation":"oj1GhrOKwm"}
19
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":18,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":"\n","obfuscation":"3Cgwc02KBnbE31u"}
20
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":19,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":"+-","obfuscation":"ULvp3RkV66J2qY"}
21
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":20,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":" [","obfuscation":"kNXRopsTU9au9S"}
22
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":21,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":" ]","obfuscation":"HdLsMKMkpJL9z3"}
23
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":22,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":" Eggs","obfuscation":"AEtqUs3B8Vk"}
24
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":23,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":"\n","obfuscation":"RIiBnACfCTilgHz"}
25
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":24,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":"+-","obfuscation":"FE3QLxTOZN8ue6"}
26
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":25,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":" [","obfuscation":"udB5TV9Kd35ZGx"}
27
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":26,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":" ]","obfuscation":"5jGBioIRXE4vJ6"}
28
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":27,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":" Fresh","obfuscation":"A4HVwDowqM"}
29
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":28,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":" fruit","obfuscation":"Pt3gTjNh79"}
30
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":29,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":"\n","obfuscation":"qh3bmFx1yTQSvxY"}
31
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":30,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":"+-","obfuscation":"u5UpmA7UNFEu7T"}
32
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":31,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":" [","obfuscation":"SYbXYkzhPSBrz9"}
33
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":32,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":" ]","obfuscation":"lcICMZPiql7PBm"}
34
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":33,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":" Coffee","obfuscation":"7aHYTinRi"}
35
+ {"type":"response.apply_patch_call_operation_diff.delta","sequence_number":34,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"delta":"\n","obfuscation":"iOIsQfym87sD47L"}
36
+ {"type":"response.apply_patch_call_operation_diff.done","sequence_number":35,"item_id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","output_index":0,"diff":"+## Shopping Checklist\n+\n+- [ ] Milk\n+- [ ] Bread\n+- [ ] Eggs\n+- [ ] Fresh fruit\n+- [ ] Coffee\n"}
37
+ {"type":"response.output_item.done","sequence_number":36,"output_index":0,"item":{"id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","type":"apply_patch_call","status":"completed","call_id":"call_kA46f91ZwocQyMCKyyZqRyC5","operation":{"type":"create_file","diff":"+## Shopping Checklist\n+\n+- [ ] Milk\n+- [ ] Bread\n+- [ ] Eggs\n+- [ ] Fresh fruit\n+- [ ] Coffee\n","path":"shopping-checklist.md"}}}
38
+ {"type":"response.completed","sequence_number":37,"response":{"id":"resp_0372d86dfc1762fe00692741f339a08190bce9b78ee2079295","object":"response","created_at":1764180467,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5.1-2025-11-13","output":[{"id":"apc_0372d86dfc1762fe00692741f3f3dc8190879cba489ff2fc8b","type":"apply_patch_call","status":"completed","call_id":"call_kA46f91ZwocQyMCKyyZqRyC5","operation":{"type":"create_file","diff":"+## Shopping Checklist\n+\n+- [ ] Milk\n+- [ ] Bread\n+- [ ] Eggs\n+- [ ] Fresh fruit\n+- [ ] Coffee\n","path":"shopping-checklist.md"}}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"none","summary":null},"safety_identifier":null,"service_tier":"default","store":true,"temperature":1,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"apply_patch"}],"top_logprobs":0,"top_p":1,"truncation":"disabled","usage":{"input_tokens":642,"input_tokens_details":{"cached_tokens":0},"output_tokens":67,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":709},"user":null,"metadata":{}}}
@@ -0,0 +1,69 @@
1
+ {
2
+ "id": "resp_0b04c5f8dfc43af500692749bc5b288197b45e830995fd32d3",
3
+ "object": "response",
4
+ "created_at": 1764182460,
5
+ "status": "completed",
6
+ "background": false,
7
+ "billing": {
8
+ "payer": "developer"
9
+ },
10
+ "error": null,
11
+ "incomplete_details": null,
12
+ "instructions": null,
13
+ "max_output_tokens": null,
14
+ "max_tool_calls": null,
15
+ "model": "gpt-5.1-2025-11-13",
16
+ "output": [
17
+ {
18
+ "id": "apc_0b04c5f8dfc43af500692749bd60908197b0e453c38f30191a",
19
+ "type": "apply_patch_call",
20
+ "status": "completed",
21
+ "call_id": "call_CdXiGtcRl49Q6Ek20tG9lYOr",
22
+ "operation": {
23
+ "type": "create_file",
24
+ "diff": "+## Shopping Checklist\n+\n+- [ ] Milk\n+- [ ] Bread\n+- [ ] Eggs\n+- [ ] Apples\n+- [ ] Coffee\n+\n",
25
+ "path": "shopping-checklist.md"
26
+ }
27
+ }
28
+ ],
29
+ "parallel_tool_calls": true,
30
+ "previous_response_id": null,
31
+ "prompt_cache_key": null,
32
+ "prompt_cache_retention": null,
33
+ "reasoning": {
34
+ "effort": "none",
35
+ "summary": null
36
+ },
37
+ "safety_identifier": null,
38
+ "service_tier": "default",
39
+ "store": true,
40
+ "temperature": 1,
41
+ "text": {
42
+ "format": {
43
+ "type": "text"
44
+ },
45
+ "verbosity": "medium"
46
+ },
47
+ "tool_choice": "auto",
48
+ "tools": [
49
+ {
50
+ "type": "apply_patch"
51
+ }
52
+ ],
53
+ "top_logprobs": 0,
54
+ "top_p": 1,
55
+ "truncation": "disabled",
56
+ "usage": {
57
+ "input_tokens": 642,
58
+ "input_tokens_details": {
59
+ "cached_tokens": 0
60
+ },
61
+ "output_tokens": 67,
62
+ "output_tokens_details": {
63
+ "reasoning_tokens": 0
64
+ },
65
+ "total_tokens": 709
66
+ },
67
+ "user": null,
68
+ "metadata": {}
69
+ }