resources/evals/subresources/runs/methods/create/index.md +0 −4407 deleted
File Deleted View Diff
1## Create eval run
2
3**post** `/evals/{eval_id}/runs`
4
5Kicks off a new run for a given evaluation, specifying the data source, and what model configuration to use to test. The datasource will be validated against the schema specified in the config of the evaluation.
6
7### Path Parameters
8
9- `eval_id: string`
10
11### Body Parameters
12
13- `data_source: CreateEvalJSONLRunDataSource or CreateEvalCompletionsRunDataSource or object { source, type, input_messages, 2 more }`
14
15 Details about the run's data source.
16
17 - `CreateEvalJSONLRunDataSource object { source, type }`
18
19 A JsonlRunDataSource object with that specifies a JSONL file that matches the eval
20
21 - `source: object { content, type } or object { id, type }`
22
23 Determines what populates the `item` namespace in the data source.
24
25 - `EvalJSONLFileContentSource object { content, type }`
26
27 - `content: array of object { item, sample }`
28
29 The content of the jsonl file.
30
31 - `item: map[unknown]`
32
33 - `sample: optional map[unknown]`
34
35 - `type: "file_content"`
36
37 The type of jsonl source. Always `file_content`.
38
39 - `"file_content"`
40
41 - `EvalJSONLFileIDSource object { id, type }`
42
43 - `id: string`
44
45 The identifier of the file.
46
47 - `type: "file_id"`
48
49 The type of jsonl source. Always `file_id`.
50
51 - `"file_id"`
52
53 - `type: "jsonl"`
54
55 The type of data source. Always `jsonl`.
56
57 - `"jsonl"`
58
59 - `CreateEvalCompletionsRunDataSource object { source, type, input_messages, 2 more }`
60
61 A CompletionsRunDataSource object describing a model sampling configuration.
62
63 - `source: object { content, type } or object { id, type } or object { type, created_after, created_before, 3 more }`
64
65 Determines what populates the `item` namespace in this run's data source.
66
67 - `EvalJSONLFileContentSource object { content, type }`
68
69 - `content: array of object { item, sample }`
70
71 The content of the jsonl file.
72
73 - `item: map[unknown]`
74
75 - `sample: optional map[unknown]`
76
77 - `type: "file_content"`
78
79 The type of jsonl source. Always `file_content`.
80
81 - `"file_content"`
82
83 - `EvalJSONLFileIDSource object { id, type }`
84
85 - `id: string`
86
87 The identifier of the file.
88
89 - `type: "file_id"`
90
91 The type of jsonl source. Always `file_id`.
92
93 - `"file_id"`
94
95 - `StoredCompletionsRunDataSource object { type, created_after, created_before, 3 more }`
96
97 A StoredCompletionsRunDataSource configuration describing a set of filters
98
99 - `type: "stored_completions"`
100
101 The type of source. Always `stored_completions`.
102
103 - `"stored_completions"`
104
105 - `created_after: optional number or null`
106
107 An optional Unix timestamp to filter items created after this time.
108
109 - `created_before: optional number or null`
110
111 An optional Unix timestamp to filter items created before this time.
112
113 - `limit: optional number or null`
114
115 An optional maximum number of items to return.
116
117 - `metadata: optional Metadata or null`
118
119 Set of 16 key-value pairs that can be attached to an object. This can be
120 useful for storing additional information about the object in a structured
121 format, and querying for objects via API or the dashboard.
122
123 Keys are strings with a maximum length of 64 characters. Values are strings
124 with a maximum length of 512 characters.
125
126 - `model: optional string or null`
127
128 An optional model to filter by (e.g., 'gpt-6-astra').
129
130 - `type: "completions"`
131
132 The type of run data source. Always `completions`.
133
134 - `"completions"`
135
136 - `input_messages: optional object { template, type } or object { item_reference, type }`
137
138 Used when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie, `item.input_trajectory`), or a template with variable references to the `item` namespace.
139
140 - `TemplateInputMessages object { template, type }`
141
142 - `template: array of EasyInputMessage or object { content, role, type }`
143
144 A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}.
145
146 - `EasyInputMessage object { content, role, phase, type }`
147
148 A message input to the model with a role indicating instruction following
149 hierarchy. Instructions given with the `developer` or `system` role take
150 precedence over instructions given with the `user` role. Messages with the
151 `assistant` role are presumed to have been generated by the model in previous
152 interactions.
153
154 - `content: string or ResponseInputMessageContentList`
155
156 Text, image, or audio input to the model, used to generate a response.
157 Can also contain previous assistant responses.
158
159 - `TextInput = string`
160
161 A text input to the model.
162
163 - `ResponseInputMessageContentList = array of ResponseInputContent`
164
165 A list of one or many input items to the model, containing different content
166 types.
167
168 - `ResponseInputText object { text, type, prompt_cache_breakpoint }`
169
170 A text input to the model.
171
172 - `text: string`
173
174 The text input to the model.
175
176 - `type: "input_text"`
177
178 The type of the input item. Always `input_text`.
179
180 - `"input_text"`
181
182 - `prompt_cache_breakpoint: optional object { mode }`
183
184 Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.
185
186 - `mode: "explicit"`
187
188 The breakpoint mode. Always `explicit`.
189
190 - `"explicit"`
191
192 - `ResponseInputImage object { detail, type, file_id, 2 more }`
193
194 An image input to the model. Learn about [image inputs](/api/docs/guides/images-vision).
195
196 - `detail: ImageDetail`
197
198 The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
199
200 - `"low"`
201
202 - `"high"`
203
204 - `"auto"`
205
206 - `"original"`
207
208 - `type: "input_image"`
209
210 The type of the input item. Always `input_image`.
211
212 - `"input_image"`
213
214 - `file_id: optional string or null`
215
216 The ID of the file to be sent to the model.
217
218 - `image_url: optional string or null`
219
220 The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
221
222 - `prompt_cache_breakpoint: optional object { mode }`
223
224 Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.
225
226 - `mode: "explicit"`
227
228 The breakpoint mode. Always `explicit`.
229
230 - `"explicit"`
231
232 - `ResponseInputFile object { type, detail, file_data, 4 more }`
233
234 A file input to the model.
235
236 - `type: "input_file"`
237
238 The type of the input item. Always `input_file`.
239
240 - `"input_file"`
241
242 - `detail: optional "auto" or "low" or "high"`
243
244 The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.
245
246 - `"auto"`
247
248 - `"low"`
249
250 - `"high"`
251
252 - `file_data: optional string`
253
254 The content of the file to be sent to the model.
255
256 - `file_id: optional string or null`
257
258 The ID of the file to be sent to the model.
259
260 - `file_url: optional string`
261
262 The URL of the file to be sent to the model.
263
264 - `filename: optional string`
265
266 The name of the file to be sent to the model.
267
268 - `prompt_cache_breakpoint: optional object { mode }`
269
270 Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.
271
272 - `mode: "explicit"`
273
274 The breakpoint mode. Always `explicit`.
275
276 - `"explicit"`
277
278 - `role: "user" or "assistant" or "system" or "developer"`
279
280 The role of the message input. One of `user`, `assistant`, `system`, or
281 `developer`.
282
283 - `"user"`
284
285 - `"assistant"`
286
287 - `"system"`
288
289 - `"developer"`
290
291 - `phase: optional "commentary" or "final_answer" or null`
292
293 Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
294 For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
295 phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
296
297 - `"commentary"`
298
299 - `"final_answer"`
300
301 - `type: optional "message"`
302
303 The type of the message input. Always `message`.
304
305 - `"message"`
306
307 - `EvalMessageObject object { content, role, type }`
308
309 A message input to the model with a role indicating instruction following
310 hierarchy. Instructions given with the `developer` or `system` role take
311 precedence over instructions given with the `user` role. Messages with the
312 `assistant` role are presumed to have been generated by the model in previous
313 interactions.
314
315 - `content: string or ResponseInputText or object { text, type } or 3 more`
316
317 Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
318
319 - `TextInput = string`
320
321 A text input to the model.
322
323 - `ResponseInputText object { text, type, prompt_cache_breakpoint }`
324
325 A text input to the model.
326
327 - `OutputText object { text, type }`
328
329 A text output from the model.
330
331 - `text: string`
332
333 The text output from the model.
334
335 - `type: "output_text"`
336
337 The type of the output text. Always `output_text`.
338
339 - `"output_text"`
340
341 - `InputImage object { image_url, type, detail }`
342
343 An image input block used within EvalItem content arrays.
344
345 - `image_url: string`
346
347 The URL of the image input.
348
349 - `type: "input_image"`
350
351 The type of the image input. Always `input_image`.
352
353 - `"input_image"`
354
355 - `detail: optional string`
356
357 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
358
359 - `ResponseInputAudio object { input_audio, type }`
360
361 An audio input to the model.
362
363 - `input_audio: object { data, format }`
364
365 - `data: string`
366
367 Base64-encoded audio data.
368
369 - `format: "mp3" or "wav"`
370
371 The format of the audio data. Currently supported formats are `mp3` and
372 `wav`.
373
374 - `"mp3"`
375
376 - `"wav"`
377
378 - `type: "input_audio"`
379
380 The type of the input item. Always `input_audio`.
381
382 - `"input_audio"`
383
384 - `GraderInputs = array of string or ResponseInputText or object { text, type } or 2 more`
385
386 A list of inputs, each of which may be either an input text, output text, input
387 image, or input audio object.
388
389 - `TextInput = string`
390
391 A text input to the model.
392
393 - `ResponseInputText object { text, type, prompt_cache_breakpoint }`
394
395 A text input to the model.
396
397 - `OutputText object { text, type }`
398
399 A text output from the model.
400
401 - `text: string`
402
403 The text output from the model.
404
405 - `type: "output_text"`
406
407 The type of the output text. Always `output_text`.
408
409 - `"output_text"`
410
411 - `InputImage object { image_url, type, detail }`
412
413 An image input block used within EvalItem content arrays.
414
415 - `image_url: string`
416
417 The URL of the image input.
418
419 - `type: "input_image"`
420
421 The type of the image input. Always `input_image`.
422
423 - `"input_image"`
424
425 - `detail: optional string`
426
427 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
428
429 - `ResponseInputAudio object { input_audio, type }`
430
431 An audio input to the model.
432
433 - `role: "user" or "assistant" or "system" or "developer"`
434
435 The role of the message input. One of `user`, `assistant`, `system`, or
436 `developer`.
437
438 - `"user"`
439
440 - `"assistant"`
441
442 - `"system"`
443
444 - `"developer"`
445
446 - `type: optional "message"`
447
448 The type of the message input. Always `message`.
449
450 - `"message"`
451
452 - `type: "template"`
453
454 The type of input messages. Always `template`.
455
456 - `"template"`
457
458 - `ItemReferenceInputMessages object { item_reference, type }`
459
460 - `item_reference: string`
461
462 A reference to a variable in the `item` namespace. Ie, "item.input_trajectory"
463
464 - `type: "item_reference"`
465
466 The type of input messages. Always `item_reference`.
467
468 - `"item_reference"`
469
470 - `model: optional string`
471
472 The name of the model to use for generating completions (e.g. "o3-mini").
473
474 - `sampling_params: optional object { max_completion_tokens, reasoning_effort, response_format, 4 more }`
475
476 - `max_completion_tokens: optional number`
477
478 The maximum number of tokens in the generated output.
479
480 - `reasoning_effort: optional ReasoningEffort or null`
481
482 Constrains effort on reasoning for reasoning models. Currently supported
483 values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
484 Reducing reasoning effort can result in faster responses and fewer tokens
485 used on reasoning in a response. Not all reasoning models support every
486 value. See the
487 [reasoning guide](/api/docs/guides/reasoning)
488 for model-specific support.
489
490 - `"none"`
491
492 - `"minimal"`
493
494 - `"low"`
495
496 - `"medium"`
497
498 - `"high"`
499
500 - `"xhigh"`
501
502 - `"max"`
503
504 - `response_format: optional ResponseFormatText or ResponseFormatJSONSchema or ResponseFormatJSONObject`
505
506 An object specifying the format that the model must output.
507
508 Setting to `{ "type": "json_schema", "json_schema": {...} }` enables
509 Structured Outputs which ensures the model will match your supplied JSON
510 schema. Learn more in the [Structured Outputs
511 guide](/api/docs/guides/structured-outputs).
512
513 Setting to `{ "type": "json_object" }` enables the older JSON mode, which
514 ensures the message the model generates is valid JSON. Using `json_schema`
515 is preferred for models that support it.
516
517 - `ResponseFormatText object { type }`
518
519 Default response format. Used to generate text responses.
520
521 - `type: "text"`
522
523 The type of response format being defined. Always `text`.
524
525 - `"text"`
526
527 - `ResponseFormatJSONSchema object { json_schema, type }`
528
529 JSON Schema response format. Used to generate structured JSON responses.
530 Learn more about [Structured Outputs](/api/docs/guides/structured-outputs).
531
532 - `json_schema: object { name, description, schema, strict }`
533
534 Structured Outputs configuration options, including a JSON Schema.
535
536 - `name: string`
537
538 The name of the response format. Must be a-z, A-Z, 0-9, or contain
539 underscores and dashes, with a maximum length of 64.
540
541 - `description: optional string`
542
543 A description of what the response format is for, used by the model to
544 determine how to respond in the format.
545
546 - `schema: optional map[unknown]`
547
548 The schema for the response format, described as a JSON Schema object.
549 Learn how to build JSON schemas [here](https://json-schema.org/).
550
551 - `strict: optional boolean or null`
552
553 Whether to enable strict schema adherence when generating the output.
554 If set to true, the model will always follow the exact schema defined
555 in the `schema` field. Only a subset of JSON Schema is supported when
556 `strict` is `true`. To learn more, read the [Structured Outputs
557 guide](/api/docs/guides/structured-outputs).
558
559 - `type: "json_schema"`
560
561 The type of response format being defined. Always `json_schema`.
562
563 - `"json_schema"`
564
565 - `ResponseFormatJSONObject object { type }`
566
567 JSON object response format. An older method of generating JSON responses.
568 Using `json_schema` is recommended for models that support it. Note that the
569 model will not generate JSON without a system or user message instructing it
570 to do so.
571
572 - `type: "json_object"`
573
574 The type of response format being defined. Always `json_object`.
575
576 - `"json_object"`
577
578 - `seed: optional number`
579
580 A seed value to initialize the randomness, during sampling.
581
582 - `temperature: optional number`
583
584 A higher temperature increases randomness in the outputs.
585
586 - `tools: optional array of ChatCompletionFunctionTool`
587
588 A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.
589
590 - `function: FunctionDefinition`
591
592 - `name: string`
593
594 The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
595
596 - `description: optional string`
597
598 A description of what the function does, used by the model to choose when and how to call the function.
599
600 - `parameters: optional FunctionParameters`
601
602 The parameters the functions accepts, described as a JSON Schema object. See the [guide](/api/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
603
604 Omitting `parameters` defines a function with an empty parameter list.
605
606 - `strict: optional boolean or null`
607
608 Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/api/docs/guides/function-calling).
609
610 - `type: "function"`
611
612 The type of the tool. Currently, only `function` is supported.
613
614 - `"function"`
615
616 - `top_p: optional number`
617
618 An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
619
620 - `ResponsesRunDataSource object { source, type, input_messages, 2 more }`
621
622 A ResponsesRunDataSource object describing a model sampling configuration.
623
624 - `source: object { content, type } or object { id, type } or object { type, created_after, created_before, 8 more }`
625
626 Determines what populates the `item` namespace in this run's data source.
627
628 - `EvalJSONLFileContentSource object { content, type }`
629
630 - `content: array of object { item, sample }`
631
632 The content of the jsonl file.
633
634 - `item: map[unknown]`
635
636 - `sample: optional map[unknown]`
637
638 - `type: "file_content"`
639
640 The type of jsonl source. Always `file_content`.
641
642 - `"file_content"`
643
644 - `EvalJSONLFileIDSource object { id, type }`
645
646 - `id: string`
647
648 The identifier of the file.
649
650 - `type: "file_id"`
651
652 The type of jsonl source. Always `file_id`.
653
654 - `"file_id"`
655
656 - `EvalResponsesSource object { type, created_after, created_before, 8 more }`
657
658 A EvalResponsesSource object describing a run data source configuration.
659
660 - `type: "responses"`
661
662 The type of run data source. Always `responses`.
663
664 - `"responses"`
665
666 - `created_after: optional number or null`
667
668 Only include items created after this timestamp (inclusive). This is a query parameter used to select responses.
669
670 - `created_before: optional number or null`
671
672 Only include items created before this timestamp (inclusive). This is a query parameter used to select responses.
673
674 - `instructions_search: optional string or null`
675
676 Optional string to search the 'instructions' field. This is a query parameter used to select responses.
677
678 - `metadata: optional unknown or null`
679
680 Metadata filter for the responses. This is a query parameter used to select responses.
681
682 - `model: optional string or null`
683
684 The name of the model to find responses for. This is a query parameter used to select responses.
685
686 - `reasoning_effort: optional ReasoningEffort or null`
687
688 Constrains effort on reasoning for reasoning models. Currently supported
689 values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
690 Reducing reasoning effort can result in faster responses and fewer tokens
691 used on reasoning in a response. Not all reasoning models support every
692 value. See the
693 [reasoning guide](/api/docs/guides/reasoning)
694 for model-specific support.
695
696 - `temperature: optional number or null`
697
698 Sampling temperature. This is a query parameter used to select responses.
699
700 - `tools: optional array of string or null`
701
702 List of tool names. This is a query parameter used to select responses.
703
704 - `top_p: optional number or null`
705
706 Nucleus sampling parameter. This is a query parameter used to select responses.
707
708 - `users: optional array of string or null`
709
710 List of user identifiers. This is a query parameter used to select responses.
711
712 - `type: "responses"`
713
714 The type of run data source. Always `responses`.
715
716 - `"responses"`
717
718 - `input_messages: optional object { template, type } or object { item_reference, type }`
719
720 Used when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie, `item.input_trajectory`), or a template with variable references to the `item` namespace.
721
722 - `InputMessagesTemplate object { template, type }`
723
724 - `template: array of object { content, role } or object { content, role, type }`
725
726 A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}.
727
728 - `ChatMessage object { content, role }`
729
730 - `content: string`
731
732 The content of the message.
733
734 - `role: string`
735
736 The role of the message (e.g. "system", "assistant", "user").
737
738 - `EvalMessageObject object { content, role, type }`
739
740 A message input to the model with a role indicating instruction following
741 hierarchy. Instructions given with the `developer` or `system` role take
742 precedence over instructions given with the `user` role. Messages with the
743 `assistant` role are presumed to have been generated by the model in previous
744 interactions.
745
746 - `content: string or ResponseInputText or object { text, type } or 3 more`
747
748 Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
749
750 - `TextInput = string`
751
752 A text input to the model.
753
754 - `ResponseInputText object { text, type, prompt_cache_breakpoint }`
755
756 A text input to the model.
757
758 - `OutputText object { text, type }`
759
760 A text output from the model.
761
762 - `text: string`
763
764 The text output from the model.
765
766 - `type: "output_text"`
767
768 The type of the output text. Always `output_text`.
769
770 - `"output_text"`
771
772 - `InputImage object { image_url, type, detail }`
773
774 An image input block used within EvalItem content arrays.
775
776 - `image_url: string`
777
778 The URL of the image input.
779
780 - `type: "input_image"`
781
782 The type of the image input. Always `input_image`.
783
784 - `"input_image"`
785
786 - `detail: optional string`
787
788 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
789
790 - `ResponseInputAudio object { input_audio, type }`
791
792 An audio input to the model.
793
794 - `GraderInputs = array of string or ResponseInputText or object { text, type } or 2 more`
795
796 A list of inputs, each of which may be either an input text, output text, input
797 image, or input audio object.
798
799 - `role: "user" or "assistant" or "system" or "developer"`
800
801 The role of the message input. One of `user`, `assistant`, `system`, or
802 `developer`.
803
804 - `"user"`
805
806 - `"assistant"`
807
808 - `"system"`
809
810 - `"developer"`
811
812 - `type: optional "message"`
813
814 The type of the message input. Always `message`.
815
816 - `"message"`
817
818 - `type: "template"`
819
820 The type of input messages. Always `template`.
821
822 - `"template"`
823
824 - `InputMessagesItemReference object { item_reference, type }`
825
826 - `item_reference: string`
827
828 A reference to a variable in the `item` namespace. Ie, "item.name"
829
830 - `type: "item_reference"`
831
832 The type of input messages. Always `item_reference`.
833
834 - `"item_reference"`
835
836 - `model: optional string`
837
838 The name of the model to use for generating completions (e.g. "o3-mini").
839
840 - `sampling_params: optional object { max_completion_tokens, reasoning_effort, seed, 4 more }`
841
842 - `max_completion_tokens: optional number`
843
844 The maximum number of tokens in the generated output.
845
846 - `reasoning_effort: optional ReasoningEffort or null`
847
848 Constrains effort on reasoning for reasoning models. Currently supported
849 values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
850 Reducing reasoning effort can result in faster responses and fewer tokens
851 used on reasoning in a response. Not all reasoning models support every
852 value. See the
853 [reasoning guide](/api/docs/guides/reasoning)
854 for model-specific support.
855
856 - `seed: optional number`
857
858 A seed value to initialize the randomness, during sampling.
859
860 - `temperature: optional number`
861
862 A higher temperature increases randomness in the outputs.
863
864 - `text: optional object { format }`
865
866 Configuration options for a text response from the model. Can be plain
867 text or structured JSON data. Learn more:
868
869 - [Text inputs and outputs](/api/docs/guides/text)
870 - [Structured Outputs](/api/docs/guides/structured-outputs)
871
872 - `format: optional ResponseFormatTextConfig`
873
874 An object specifying the format that the model must output.
875
876 Configuring `{ "type": "json_schema" }` enables Structured Outputs,
877 which ensures the model will match your supplied JSON schema. Learn more in the
878 [Structured Outputs guide](/api/docs/guides/structured-outputs).
879
880 The default format is `{ "type": "text" }` with no additional options.
881
882 **Not recommended for gpt-4o and newer models:**
883
884 Setting to `{ "type": "json_object" }` enables the older JSON mode, which
885 ensures the message the model generates is valid JSON. Using `json_schema`
886 is preferred for models that support it.
887
888 - `ResponseFormatText object { type }`
889
890 Default response format. Used to generate text responses.
891
892 - `ResponseFormatTextJSONSchemaConfig object { name, schema, type, 2 more }`
893
894 JSON Schema response format. Used to generate structured JSON responses.
895 Learn more about [Structured Outputs](/api/docs/guides/structured-outputs).
896
897 - `name: string`
898
899 The name of the response format. Must be a-z, A-Z, 0-9, or contain
900 underscores and dashes, with a maximum length of 64.
901
902 - `schema: map[unknown]`
903
904 The schema for the response format, described as a JSON Schema object.
905 Learn how to build JSON schemas [here](https://json-schema.org/).
906
907 - `type: "json_schema"`
908
909 The type of response format being defined. Always `json_schema`.
910
911 - `"json_schema"`
912
913 - `description: optional string`
914
915 A description of what the response format is for, used by the model to
916 determine how to respond in the format.
917
918 - `strict: optional boolean or null`
919
920 Whether to enable strict schema adherence when generating the output.
921 If set to true, the model will always follow the exact schema defined
922 in the `schema` field. Only a subset of JSON Schema is supported when
923 `strict` is `true`. To learn more, read the [Structured Outputs
924 guide](/api/docs/guides/structured-outputs).
925
926 - `ResponseFormatJSONObject object { type }`
927
928 JSON object response format. An older method of generating JSON responses.
929 Using `json_schema` is recommended for models that support it. Note that the
930 model will not generate JSON without a system or user message instructing it
931 to do so.
932
933 - `tools: optional array of object { name, parameters, strict, 6 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 13 more`
934
935 An array of tools the model may call while generating a response. You
936 can specify which tool to use by setting the `tool_choice` parameter.
937
938 The two categories of tools you can provide the model are:
939
940 - **Built-in tools**: Tools that are provided by OpenAI that extend the
941 model's capabilities, like [web search](/api/docs/guides/tools-web-search)
942 or [file search](/api/docs/guides/tools-file-search). Learn more about
943 [built-in tools](/api/docs/guides/tools).
944 - **Function calls (custom tools)**: Functions that are defined by you,
945 enabling the model to call your own code. Learn more about
946 [function calling](/api/docs/guides/function-calling).
947
948 - `Function object { name, parameters, strict, 6 more }`
949
950 Defines a function in your own code the model can choose to call. Learn more about [function calling](/api/docs/guides/function-calling).
951
952 - `name: string`
953
954 The name of the function to call.
955
956 - `parameters: map[unknown] or null`
957
958 A JSON schema object describing the parameters of the function.
959
960 - `strict: boolean or null`
961
962 Whether strict parameter validation is enforced for this function tool.
963
964 - `type: "function"`
965
966 The type of the function tool. Always `function`.
967
968 - `"function"`
969
970 - `allowed_callers: optional array of "direct" or "programmatic" or null`
971
972 The tool invocation context(s).
973
974 - `"direct"`
975
976 - `"programmatic"`
977
978 - `async: optional boolean`
979
980 - `defer_loading: optional boolean`
981
982 Whether this function is deferred and loaded via tool search.
983
984 - `description: optional string or null`
985
986 A description of the function. Used by the model to determine whether or not to call the function.
987
988 - `output_schema: optional map[unknown] or null`
989
990 A JSON schema object describing the JSON value encoded in string outputs for this function.
991
992 - `FileSearch object { type, vector_store_ids, filters, 2 more }`
993
994 A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](/api/docs/guides/tools-file-search).
995
996 - `type: "file_search"`
997
998 The type of the file search tool. Always `file_search`.
999
1000 - `"file_search"`
1001
1002 - `vector_store_ids: array of string`
1003
1004 The IDs of the vector stores to search.
1005
1006 - `filters: optional ComparisonFilter or CompoundFilter or null`
1007
1008 A filter to apply.
1009
1010 - `ComparisonFilter object { key, type, value }`
1011
1012 A filter used to compare a specified attribute key to a given value using a defined comparison operation.
1013
1014 - `key: string`
1015
1016 The key to compare against the value.
1017
1018 - `type: "eq" or "ne" or "gt" or 5 more`
1019
1020 Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.
1021
1022 - `eq`: equals
1023 - `ne`: not equal
1024 - `gt`: greater than
1025 - `gte`: greater than or equal
1026 - `lt`: less than
1027 - `lte`: less than or equal
1028 - `in`: in
1029 - `nin`: not in
1030
1031 - `"eq"`
1032
1033 - `"ne"`
1034
1035 - `"gt"`
1036
1037 - `"gte"`
1038
1039 - `"lt"`
1040
1041 - `"lte"`
1042
1043 - `"in"`
1044
1045 - `"nin"`
1046
1047 - `value: string or number or boolean or array of string or number`
1048
1049 The value to compare against the attribute key; supports string, number, or boolean types.
1050
1051 - `string`
1052
1053 - `number`
1054
1055 - `boolean`
1056
1057 - `array of string or number`
1058
1059 - `string`
1060
1061 - `number`
1062
1063 - `CompoundFilter object { filters, type }`
1064
1065 Combine multiple filters using `and` or `or`.
1066
1067 - `filters: array of ComparisonFilter or unknown`
1068
1069 Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.
1070
1071 - `ComparisonFilter object { key, type, value }`
1072
1073 A filter used to compare a specified attribute key to a given value using a defined comparison operation.
1074
1075 - `unknown`
1076
1077 - `type: "and" or "or"`
1078
1079 Type of operation: `and` or `or`.
1080
1081 - `"and"`
1082
1083 - `"or"`
1084
1085 - `max_num_results: optional number`
1086
1087 The maximum number of results to return. This number should be between 1 and 50 inclusive.
1088
1089 - `ranking_options: optional object { hybrid_search, ranker, score_threshold }`
1090
1091 Ranking options for search.
1092
1093 - `hybrid_search: optional object { embedding_weight, text_weight }`
1094
1095 Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
1096
1097 - `embedding_weight: number`
1098
1099 The weight of the embedding in the reciprocal ranking fusion.
1100
1101 - `text_weight: number`
1102
1103 The weight of the text in the reciprocal ranking fusion.
1104
1105 - `ranker: optional "auto" or "default-2024-11-15"`
1106
1107 The ranker to use for the file search.
1108
1109 - `"auto"`
1110
1111 - `"default-2024-11-15"`
1112
1113 - `score_threshold: optional number`
1114
1115 The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
1116
1117 - `Computer object { type }`
1118
1119 A tool that controls a virtual computer. Learn more about the [computer tool](/api/docs/guides/tools-computer-use).
1120
1121 - `type: "computer"`
1122
1123 The type of the computer tool. Always `computer`.
1124
1125 - `"computer"`
1126
1127 - `ComputerUsePreview object { display_height, display_width, environment, type }`
1128
1129 A tool that controls a virtual computer. Learn more about the [computer tool](/api/docs/guides/tools-computer-use).
1130
1131 - `display_height: number`
1132
1133 The height of the computer display.
1134
1135 - `display_width: number`
1136
1137 The width of the computer display.
1138
1139 - `environment: "windows" or "mac" or "linux" or 2 more`
1140
1141 The type of computer environment to control.
1142
1143 - `"windows"`
1144
1145 - `"mac"`
1146
1147 - `"linux"`
1148
1149 - `"ubuntu"`
1150
1151 - `"browser"`
1152
1153 - `type: "computer_use_preview"`
1154
1155 The type of the computer use tool. Always `computer_use_preview`.
1156
1157 - `"computer_use_preview"`
1158
1159 - `WebSearch object { type, external_web_access, filters, 2 more }`
1160
1161 Search the Internet for sources related to the prompt. Learn more about the
1162 [web search tool](/api/docs/guides/tools-web-search).
1163
1164 - `type: "web_search" or "web_search_2025_08_26"`
1165
1166 The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.
1167
1168 - `"web_search"`
1169
1170 - `"web_search_2025_08_26"`
1171
1172 - `external_web_access: optional boolean`
1173
1174 Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.
1175
1176 - `filters: optional object { allowed_domains } or null`
1177
1178 Filters for the search.
1179
1180 - `allowed_domains: optional array of string or null`
1181
1182 Allowed domains for the search. If not provided, all domains are allowed.
1183 Subdomains of the provided domains are allowed as well.
1184
1185 Example: `["pubmed.ncbi.nlm.nih.gov"]`
1186
1187 - `search_context_size: optional "low" or "medium" or "high"`
1188
1189 High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.
1190
1191 - `"low"`
1192
1193 - `"medium"`
1194
1195 - `"high"`
1196
1197 - `user_location: optional object { city, country, region, 2 more } or null`
1198
1199 The approximate location of the user.
1200
1201 - `city: optional string or null`
1202
1203 Free text input for the city of the user, e.g. `San Francisco`.
1204
1205 - `country: optional string or null`
1206
1207 The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.
1208
1209 - `region: optional string or null`
1210
1211 Free text input for the region of the user, e.g. `California`.
1212
1213 - `timezone: optional string or null`
1214
1215 The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.
1216
1217 - `type: optional "approximate"`
1218
1219 The type of location approximation. Always `approximate`.
1220
1221 - `"approximate"`
1222
1223 - `Mcp object { server_label, type, allowed_callers, 9 more }`
1224
1225 Give the model access to additional tools via remote Model Context Protocol
1226 (MCP) servers. [Learn more about MCP](/api/docs/guides/tools-connectors-mcp).
1227
1228 - `server_label: string`
1229
1230 A label for this MCP server, used to identify it in tool calls.
1231
1232 - `type: "mcp"`
1233
1234 The type of the MCP tool. Always `mcp`.
1235
1236 - `"mcp"`
1237
1238 - `allowed_callers: optional array of "direct" or "programmatic" or null`
1239
1240 The tool invocation context(s).
1241
1242 - `"direct"`
1243
1244 - `"programmatic"`
1245
1246 - `allowed_tools: optional array of string or object { read_only, tool_names } or null`
1247
1248 List of allowed tool names or a filter object.
1249
1250 - `McpAllowedTools = array of string`
1251
1252 A string array of allowed tool names
1253
1254 - `McpToolFilter object { read_only, tool_names }`
1255
1256 A filter object to specify which tools are allowed.
1257
1258 - `read_only: optional boolean`
1259
1260 Indicates whether or not a tool modifies data or is read-only. If an
1261 MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
1262 it will match this filter.
1263
1264 - `tool_names: optional array of string`
1265
1266 List of allowed tool names.
1267
1268 - `authorization: optional string`
1269
1270 An OAuth access token that can be used with a remote MCP server, either
1271 with a custom MCP server URL or a service connector. Your application
1272 must handle the OAuth authorization flow and provide the token here.
1273
1274 - `connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more`
1275
1276 Identifier for service connectors, like those available in ChatGPT. One of
1277 `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more
1278 about service connectors [here](/api/docs/guides/tools-connectors-mcp#connectors).
1279
1280 This field is deprecated for models released after September 1, 2026.
1281 Use `server_url` to connect to a remote MCP server, or `tunnel_id` to
1282 connect through a Secure MCP Tunnel.
1283
1284 Currently supported `connector_id` values are:
1285
1286 - Dropbox: `connector_dropbox`
1287 - Gmail: `connector_gmail`
1288 - Google Calendar: `connector_googlecalendar`
1289 - Google Drive: `connector_googledrive`
1290 - Microsoft Teams: `connector_microsoftteams`
1291 - Outlook Calendar: `connector_outlookcalendar`
1292 - Outlook Email: `connector_outlookemail`
1293 - SharePoint: `connector_sharepoint`
1294
1295 - `"connector_dropbox"`
1296
1297 - `"connector_gmail"`
1298
1299 - `"connector_googlecalendar"`
1300
1301 - `"connector_googledrive"`
1302
1303 - `"connector_microsoftteams"`
1304
1305 - `"connector_outlookcalendar"`
1306
1307 - `"connector_outlookemail"`
1308
1309 - `"connector_sharepoint"`
1310
1311 - `defer_loading: optional boolean`
1312
1313 Whether this MCP tool is deferred and discovered via tool search.
1314
1315 - `headers: optional map[string] or null`
1316
1317 Optional HTTP headers to send to the MCP server. Use for authentication
1318 or other purposes.
1319
1320 - `require_approval: optional object { always, never } or "always" or "never" or null`
1321
1322 Specify which of the MCP server's tools require approval.
1323
1324 - `McpToolApprovalFilter object { always, never }`
1325
1326 Specify which of the MCP server's tools require approval. Can be
1327 `always`, `never`, or a filter object associated with tools
1328 that require approval.
1329
1330 - `always: optional object { read_only, tool_names }`
1331
1332 A filter object to specify which tools are allowed.
1333
1334 - `read_only: optional boolean`
1335
1336 Indicates whether or not a tool modifies data or is read-only. If an
1337 MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
1338 it will match this filter.
1339
1340 - `tool_names: optional array of string`
1341
1342 List of allowed tool names.
1343
1344 - `never: optional object { read_only, tool_names }`
1345
1346 A filter object to specify which tools are allowed.
1347
1348 - `read_only: optional boolean`
1349
1350 Indicates whether or not a tool modifies data or is read-only. If an
1351 MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
1352 it will match this filter.
1353
1354 - `tool_names: optional array of string`
1355
1356 List of allowed tool names.
1357
1358 - `McpToolApprovalSetting = "always" or "never"`
1359
1360 Specify a single approval policy for all tools. One of `always` or
1361 `never`. When set to `always`, all tools will require approval. When
1362 set to `never`, all tools will not require approval.
1363
1364 - `"always"`
1365
1366 - `"never"`
1367
1368 - `server_description: optional string`
1369
1370 Optional description of the MCP server, used to provide more context.
1371
1372 - `server_url: optional string`
1373
1374 The URL for the MCP server. One of `server_url`, `connector_id`, or
1375 `tunnel_id` must be provided.
1376
1377 - `tunnel_id: optional string`
1378
1379 The Secure MCP Tunnel ID to use instead of a direct server URL. One of
1380 `server_url`, `connector_id`, or `tunnel_id` must be provided.
1381
1382 - `CodeInterpreter object { container, type, allowed_callers }`
1383
1384 A tool that runs Python code to help generate a response to a prompt.
1385
1386 - `container: string or object { type, file_ids, memory_limit, network_policy }`
1387
1388 The code interpreter container. Can be a container ID or an object that
1389 specifies uploaded file IDs to make available to your code, along with an
1390 optional `memory_limit` setting.
1391
1392 - `string`
1393
1394 The container ID.
1395
1396 - `CodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }`
1397
1398 Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
1399
1400 - `type: "auto"`
1401
1402 Always `auto`.
1403
1404 - `"auto"`
1405
1406 - `file_ids: optional array of string`
1407
1408 An optional list of uploaded files to make available to your code.
1409
1410 - `memory_limit: optional "1g" or "4g" or "16g" or "64g" or null`
1411
1412 The memory limit for the code interpreter container.
1413
1414 - `"1g"`
1415
1416 - `"4g"`
1417
1418 - `"16g"`
1419
1420 - `"64g"`
1421
1422 - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist`
1423
1424 Network access policy for the container.
1425
1426 - `ContainerNetworkPolicyDisabled object { type }`
1427
1428 - `type: "disabled"`
1429
1430 Disable outbound network access. Always `disabled`.
1431
1432 - `"disabled"`
1433
1434 - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }`
1435
1436 - `allowed_domains: array of string`
1437
1438 A list of allowed domains when type is `allowlist`.
1439
1440 - `type: "allowlist"`
1441
1442 Allow outbound network access only to specified domains. Always `allowlist`.
1443
1444 - `"allowlist"`
1445
1446 - `domain_secrets: optional array of ContainerNetworkPolicyDomainSecret`
1447
1448 Optional domain-scoped secrets for allowlisted domains.
1449
1450 - `domain: string`
1451
1452 The domain associated with the secret.
1453
1454 - `name: string`
1455
1456 The name of the secret to inject for the domain.
1457
1458 - `value: string`
1459
1460 The secret value to inject for the domain.
1461
1462 - `type: "code_interpreter"`
1463
1464 The type of the code interpreter tool. Always `code_interpreter`.
1465
1466 - `"code_interpreter"`
1467
1468 - `allowed_callers: optional array of "direct" or "programmatic" or null`
1469
1470 The tool invocation context(s).
1471
1472 - `"direct"`
1473
1474 - `"programmatic"`
1475
1476 - `ProgrammaticToolCalling object { type }`
1477
1478 - `type: "programmatic_tool_calling"`
1479
1480 The type of the tool. Always `programmatic_tool_calling`.
1481
1482 - `"programmatic_tool_calling"`
1483
1484 - `ImageGeneration object { type, action, background, 9 more }`
1485
1486 A tool that generates images using the GPT image models.
1487
1488 - `type: "image_generation"`
1489
1490 The type of the image generation tool. Always `image_generation`.
1491
1492 - `"image_generation"`
1493
1494 - `action: optional "generate" or "edit" or "auto"`
1495
1496 Whether to generate a new image or edit an existing image. Default: `auto`.
1497
1498 - `"generate"`
1499
1500 - `"edit"`
1501
1502 - `"auto"`
1503
1504 - `background: optional "transparent" or "opaque" or "auto"`
1505
1506 Set the background of the generated image. One of `transparent`, `opaque`,
1507 or `auto`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including
1508 their `2026-09-08` snapshots, support `opaque` and `transparent`
1509 backgrounds. Transparent backgrounds are available for supported GPT Image
1510 models. For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
1511 preview. When using `transparent`, set the output format to `png` or `webp`.
1512 Default: `auto`.
1513
1514 - `"transparent"`
1515
1516 - `"opaque"`
1517
1518 - `"auto"`
1519
1520 - `input_fidelity: optional "high" or "low" or null`
1521
1522 Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.
1523
1524 - `"high"`
1525
1526 - `"low"`
1527
1528 - `input_image_mask: optional object { file_id, image_url }`
1529
1530 Optional mask for inpainting. Contains `image_url`
1531 (string, optional) and `file_id` (string, optional).
1532
1533 - `file_id: optional string`
1534
1535 File ID for the mask image.
1536
1537 - `image_url: optional string`
1538
1539 Base64-encoded mask image.
1540
1541 - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5" or 6 more`
1542
1543 The image generation model to use. One of `gpt-image-1`,
1544 `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
1545 `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
1546 `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
1547 `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`. Default:
1548 `gpt-image-1`.
1549
1550 - `string`
1551
1552 - `"gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5" or 6 more`
1553
1554 The image generation model to use. One of `gpt-image-1`,
1555 `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
1556 `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
1557 `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
1558 `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`. Default:
1559 `gpt-image-1`.
1560
1561 - `"gpt-image-1"`
1562
1563 - `"gpt-image-1-mini"`
1564
1565 - `"gpt-image-1.5"`
1566
1567 - `"gpt-image-2"`
1568
1569 - `"gpt-image-2-2026-04-21"`
1570
1571 - `"gpt-image-2.5-sunburst"`
1572
1573 - `"gpt-image-2.5-sunburst-2026-09-08"`
1574
1575 - `"gpt-image-2.5-flare"`
1576
1577 - `"gpt-image-2.5-flare-2026-09-08"`
1578
1579 - `moderation: optional "auto" or "low"`
1580
1581 Moderation level for the generated image. Default: `auto`.
1582
1583 - `"auto"`
1584
1585 - `"low"`
1586
1587 - `output_compression: optional number`
1588
1589 Compression level for the output image. Default: 100.
1590
1591 - `output_format: optional "png" or "webp" or "jpeg"`
1592
1593 The output format of the generated image. One of `png`, `webp`, or
1594 `jpeg`. Default: `png`.
1595
1596 - `"png"`
1597
1598 - `"webp"`
1599
1600 - `"jpeg"`
1601
1602 - `partial_images: optional number`
1603
1604 Number of partial images to generate in streaming mode, from 0 (default value) to 3.
1605
1606 - `quality: optional "low" or "medium" or "high" or 3 more`
1607
1608 The quality of the generated image. The GPT image models support `low`,
1609 `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`,
1610 including their `2026-09-08` snapshots, also support `xhigh` and `max`.
1611 Default: `auto`.
1612
1613 - `"low"`
1614
1615 - `"medium"`
1616
1617 - `"high"`
1618
1619 - `"xhigh"`
1620
1621 - `"max"`
1622
1623 - `"auto"`
1624
1625 - `size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"`
1626
1627 The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
1628
1629 - `string`
1630
1631 - `"1024x1024" or "1024x1536" or "1536x1024" or "auto"`
1632
1633 The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
1634
1635 - `"1024x1024"`
1636
1637 - `"1024x1536"`
1638
1639 - `"1536x1024"`
1640
1641 - `"auto"`
1642
1643 - `LocalShell object { type }`
1644
1645 A tool that allows the model to execute shell commands in a local environment.
1646
1647 - `type: "local_shell"`
1648
1649 The type of the local shell tool. Always `local_shell`.
1650
1651 - `"local_shell"`
1652
1653 - `Shell object { type, allowed_callers, environment }`
1654
1655 A tool that allows the model to execute shell commands.
1656
1657 - `type: "shell"`
1658
1659 The type of the shell tool. Always `shell`.
1660
1661 - `"shell"`
1662
1663 - `allowed_callers: optional array of "direct" or "programmatic" or null`
1664
1665 The tool invocation context(s).
1666
1667 - `"direct"`
1668
1669 - `"programmatic"`
1670
1671 - `environment: optional ContainerAuto or LocalEnvironment or ContainerReference or null`
1672
1673 - `ContainerAuto object { type, file_ids, memory_limit, 2 more }`
1674
1675 - `type: "container_auto"`
1676
1677 Automatically creates a container for this request
1678
1679 - `"container_auto"`
1680
1681 - `file_ids: optional array of string`
1682
1683 An optional list of uploaded files to make available to your code.
1684
1685 - `memory_limit: optional "1g" or "4g" or "16g" or "64g" or null`
1686
1687 The memory limit for the container.
1688
1689 - `"1g"`
1690
1691 - `"4g"`
1692
1693 - `"16g"`
1694
1695 - `"64g"`
1696
1697 - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist`
1698
1699 Network access policy for the container.
1700
1701 - `ContainerNetworkPolicyDisabled object { type }`
1702
1703 - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }`
1704
1705 - `skills: optional array of SkillReference or InlineSkill`
1706
1707 An optional list of skills referenced by id or inline data.
1708
1709 - `SkillReference object { skill_id, type, version }`
1710
1711 - `skill_id: string`
1712
1713 The ID of the referenced skill.
1714
1715 - `type: "skill_reference"`
1716
1717 References a skill created with the /v1/skills endpoint.
1718
1719 - `"skill_reference"`
1720
1721 - `version: optional string`
1722
1723 Optional skill version. Use a positive integer or 'latest'. Omit for default.
1724
1725 - `InlineSkill object { description, name, source, type }`
1726
1727 - `description: string`
1728
1729 The description of the skill.
1730
1731 - `name: string`
1732
1733 The name of the skill.
1734
1735 - `source: InlineSkillSource`
1736
1737 Inline skill payload
1738
1739 - `data: string`
1740
1741 Base64-encoded skill zip bundle.
1742
1743 - `media_type: "application/zip"`
1744
1745 The media type of the inline skill payload. Must be `application/zip`.
1746
1747 - `"application/zip"`
1748
1749 - `type: "base64"`
1750
1751 The type of the inline skill source. Must be `base64`.
1752
1753 - `"base64"`
1754
1755 - `type: "inline"`
1756
1757 Defines an inline skill for this request.
1758
1759 - `"inline"`
1760
1761 - `LocalEnvironment object { type, skills }`
1762
1763 - `type: "local"`
1764
1765 Use a local computer environment.
1766
1767 - `"local"`
1768
1769 - `skills: optional array of LocalSkill`
1770
1771 An optional list of skills.
1772
1773 - `description: string`
1774
1775 The description of the skill.
1776
1777 - `name: string`
1778
1779 The name of the skill.
1780
1781 - `path: string`
1782
1783 The path to the directory containing the skill.
1784
1785 - `ContainerReference object { container_id, type }`
1786
1787 - `container_id: string`
1788
1789 The ID of the referenced container.
1790
1791 - `type: "container_reference"`
1792
1793 References a container created with the /v1/containers endpoint
1794
1795 - `"container_reference"`
1796
1797 - `Custom object { name, type, allowed_callers, 4 more }`
1798
1799 A custom tool that processes input using a specified format. Learn more about [custom tools](/api/docs/guides/function-calling#custom-tools)
1800
1801 - `name: string`
1802
1803 The name of the custom tool, used to identify it in tool calls.
1804
1805 - `type: "custom"`
1806
1807 The type of the custom tool. Always `custom`.
1808
1809 - `"custom"`
1810
1811 - `allowed_callers: optional array of "direct" or "programmatic" or null`
1812
1813 The tool invocation context(s).
1814
1815 - `"direct"`
1816
1817 - `"programmatic"`
1818
1819 - `async: optional boolean`
1820
1821 Whether the tool response can be returned asynchronously versus immediately returned on next response creation.
1822
1823 - `defer_loading: optional boolean`
1824
1825 Whether this tool should be deferred and discovered via tool search.
1826
1827 - `description: optional string`
1828
1829 Optional description of the custom tool, used to provide more context.
1830
1831 - `format: optional CustomToolInputFormat`
1832
1833 The input format for the custom tool. Default is unconstrained text.
1834
1835 - `Text object { type }`
1836
1837 Unconstrained free-form text.
1838
1839 - `type: "text"`
1840
1841 Unconstrained text format. Always `text`.
1842
1843 - `"text"`
1844
1845 - `Grammar object { definition, syntax, type }`
1846
1847 A grammar defined by the user.
1848
1849 - `definition: string`
1850
1851 The grammar definition.
1852
1853 - `syntax: "lark" or "regex"`
1854
1855 The syntax of the grammar definition. One of `lark` or `regex`.
1856
1857 - `"lark"`
1858
1859 - `"regex"`
1860
1861 - `type: "grammar"`
1862
1863 Grammar format. Always `grammar`.
1864
1865 - `"grammar"`
1866
1867 - `Namespace object { description, name, tools, type }`
1868
1869 Groups function/custom tools under a shared namespace.
1870
1871 - `description: string`
1872
1873 A description of the namespace shown to the model.
1874
1875 - `name: string`
1876
1877 The namespace name used in tool calls (for example, `crm`).
1878
1879 - `tools: array of object { name, type, allowed_callers, 6 more } or object { name, type, allowed_callers, 4 more }`
1880
1881 The function/custom tools available inside this namespace.
1882
1883 - `Function object { name, type, allowed_callers, 6 more }`
1884
1885 - `name: string`
1886
1887 - `type: "function"`
1888
1889 - `"function"`
1890
1891 - `allowed_callers: optional array of "direct" or "programmatic" or null`
1892
1893 The tool invocation context(s).
1894
1895 - `"direct"`
1896
1897 - `"programmatic"`
1898
1899 - `async: optional boolean`
1900
1901 Whether the tool response can be returned asynchronously versus immediately returned on next response creation.
1902
1903 - `defer_loading: optional boolean`
1904
1905 Whether this function should be deferred and discovered via tool search.
1906
1907 - `description: optional string or null`
1908
1909 - `output_schema: optional map[unknown] or null`
1910
1911 A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.
1912
1913 - `parameters: optional unknown or null`
1914
1915 - `strict: optional boolean or null`
1916
1917 Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.
1918
1919 - `Custom object { name, type, allowed_callers, 4 more }`
1920
1921 A custom tool that processes input using a specified format. Learn more about [custom tools](/api/docs/guides/function-calling#custom-tools)
1922
1923 - `name: string`
1924
1925 The name of the custom tool, used to identify it in tool calls.
1926
1927 - `type: "custom"`
1928
1929 The type of the custom tool. Always `custom`.
1930
1931 - `"custom"`
1932
1933 - `allowed_callers: optional array of "direct" or "programmatic" or null`
1934
1935 The tool invocation context(s).
1936
1937 - `"direct"`
1938
1939 - `"programmatic"`
1940
1941 - `async: optional boolean`
1942
1943 Whether the tool response can be returned asynchronously versus immediately returned on next response creation.
1944
1945 - `defer_loading: optional boolean`
1946
1947 Whether this tool should be deferred and discovered via tool search.
1948
1949 - `description: optional string`
1950
1951 Optional description of the custom tool, used to provide more context.
1952
1953 - `format: optional CustomToolInputFormat`
1954
1955 The input format for the custom tool. Default is unconstrained text.
1956
1957 - `type: "namespace"`
1958
1959 The type of the tool. Always `namespace`.
1960
1961 - `"namespace"`
1962
1963 - `ToolSearch object { type, description, execution, parameters }`
1964
1965 Hosted or BYOT tool search configuration for deferred tools.
1966
1967 - `type: "tool_search"`
1968
1969 The type of the tool. Always `tool_search`.
1970
1971 - `"tool_search"`
1972
1973 - `description: optional string or null`
1974
1975 Description shown to the model for a client-executed tool search tool.
1976
1977 - `execution: optional "server" or "client"`
1978
1979 Whether tool search is executed by the server or by the client.
1980
1981 - `"server"`
1982
1983 - `"client"`
1984
1985 - `parameters: optional unknown or null`
1986
1987 Parameter schema for a client-executed tool search tool.
1988
1989 - `WebSearchPreview object { type, search_content_types, search_context_size, user_location }`
1990
1991 This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](/api/docs/guides/tools-web-search).
1992
1993 - `type: "web_search_preview" or "web_search_preview_2025_03_11"`
1994
1995 The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.
1996
1997 - `"web_search_preview"`
1998
1999 - `"web_search_preview_2025_03_11"`
2000
2001 - `search_content_types: optional array of "text" or "image"`
2002
2003 - `"text"`
2004
2005 - `"image"`
2006
2007 - `search_context_size: optional "low" or "medium" or "high"`
2008
2009 High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.
2010
2011 - `"low"`
2012
2013 - `"medium"`
2014
2015 - `"high"`
2016
2017 - `user_location: optional object { type, city, country, 2 more } or null`
2018
2019 The user's location.
2020
2021 - `type: "approximate"`
2022
2023 The type of location approximation. Always `approximate`.
2024
2025 - `"approximate"`
2026
2027 - `city: optional string or null`
2028
2029 Free text input for the city of the user, e.g. `San Francisco`.
2030
2031 - `country: optional string or null`
2032
2033 The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.
2034
2035 - `region: optional string or null`
2036
2037 Free text input for the region of the user, e.g. `California`.
2038
2039 - `timezone: optional string or null`
2040
2041 The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.
2042
2043 - `ApplyPatch object { type, allowed_callers }`
2044
2045 Allows the assistant to create, delete, or update files using unified diffs.
2046
2047 - `type: "apply_patch"`
2048
2049 The type of the tool. Always `apply_patch`.
2050
2051 - `"apply_patch"`
2052
2053 - `allowed_callers: optional array of "direct" or "programmatic" or null`
2054
2055 The tool invocation context(s).
2056
2057 - `"direct"`
2058
2059 - `"programmatic"`
2060
2061 - `top_p: optional number`
2062
2063 An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
2064
2065- `metadata: optional Metadata or null`
2066
2067 Set of 16 key-value pairs that can be attached to an object. This can be
2068 useful for storing additional information about the object in a structured
2069 format, and querying for objects via API or the dashboard.
2070
2071 Keys are strings with a maximum length of 64 characters. Values are strings
2072 with a maximum length of 512 characters.
2073
2074- `name: optional string`
2075
2076 The name of the run.
2077
2078### Returns
2079
2080- `id: string`
2081
2082 Unique identifier for the evaluation run.
2083
2084- `created_at: number`
2085
2086 Unix timestamp (in seconds) when the evaluation run was created.
2087
2088- `data_source: CreateEvalJSONLRunDataSource or CreateEvalCompletionsRunDataSource or object { source, type, input_messages, 2 more }`
2089
2090 Information about the run's data source.
2091
2092 - `CreateEvalJSONLRunDataSource object { source, type }`
2093
2094 A JsonlRunDataSource object with that specifies a JSONL file that matches the eval
2095
2096 - `source: object { content, type } or object { id, type }`
2097
2098 Determines what populates the `item` namespace in the data source.
2099
2100 - `EvalJSONLFileContentSource object { content, type }`
2101
2102 - `content: array of object { item, sample }`
2103
2104 The content of the jsonl file.
2105
2106 - `item: map[unknown]`
2107
2108 - `sample: optional map[unknown]`
2109
2110 - `type: "file_content"`
2111
2112 The type of jsonl source. Always `file_content`.
2113
2114 - `"file_content"`
2115
2116 - `EvalJSONLFileIDSource object { id, type }`
2117
2118 - `id: string`
2119
2120 The identifier of the file.
2121
2122 - `type: "file_id"`
2123
2124 The type of jsonl source. Always `file_id`.
2125
2126 - `"file_id"`
2127
2128 - `type: "jsonl"`
2129
2130 The type of data source. Always `jsonl`.
2131
2132 - `"jsonl"`
2133
2134 - `CreateEvalCompletionsRunDataSource object { source, type, input_messages, 2 more }`
2135
2136 A CompletionsRunDataSource object describing a model sampling configuration.
2137
2138 - `source: object { content, type } or object { id, type } or object { type, created_after, created_before, 3 more }`
2139
2140 Determines what populates the `item` namespace in this run's data source.
2141
2142 - `EvalJSONLFileContentSource object { content, type }`
2143
2144 - `content: array of object { item, sample }`
2145
2146 The content of the jsonl file.
2147
2148 - `item: map[unknown]`
2149
2150 - `sample: optional map[unknown]`
2151
2152 - `type: "file_content"`
2153
2154 The type of jsonl source. Always `file_content`.
2155
2156 - `"file_content"`
2157
2158 - `EvalJSONLFileIDSource object { id, type }`
2159
2160 - `id: string`
2161
2162 The identifier of the file.
2163
2164 - `type: "file_id"`
2165
2166 The type of jsonl source. Always `file_id`.
2167
2168 - `"file_id"`
2169
2170 - `StoredCompletionsRunDataSource object { type, created_after, created_before, 3 more }`
2171
2172 A StoredCompletionsRunDataSource configuration describing a set of filters
2173
2174 - `type: "stored_completions"`
2175
2176 The type of source. Always `stored_completions`.
2177
2178 - `"stored_completions"`
2179
2180 - `created_after: optional number or null`
2181
2182 An optional Unix timestamp to filter items created after this time.
2183
2184 - `created_before: optional number or null`
2185
2186 An optional Unix timestamp to filter items created before this time.
2187
2188 - `limit: optional number or null`
2189
2190 An optional maximum number of items to return.
2191
2192 - `metadata: optional Metadata or null`
2193
2194 Set of 16 key-value pairs that can be attached to an object. This can be
2195 useful for storing additional information about the object in a structured
2196 format, and querying for objects via API or the dashboard.
2197
2198 Keys are strings with a maximum length of 64 characters. Values are strings
2199 with a maximum length of 512 characters.
2200
2201 - `model: optional string or null`
2202
2203 An optional model to filter by (e.g., 'gpt-6-astra').
2204
2205 - `type: "completions"`
2206
2207 The type of run data source. Always `completions`.
2208
2209 - `"completions"`
2210
2211 - `input_messages: optional object { template, type } or object { item_reference, type }`
2212
2213 Used when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie, `item.input_trajectory`), or a template with variable references to the `item` namespace.
2214
2215 - `TemplateInputMessages object { template, type }`
2216
2217 - `template: array of EasyInputMessage or object { content, role, type }`
2218
2219 A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}.
2220
2221 - `EasyInputMessage object { content, role, phase, type }`
2222
2223 A message input to the model with a role indicating instruction following
2224 hierarchy. Instructions given with the `developer` or `system` role take
2225 precedence over instructions given with the `user` role. Messages with the
2226 `assistant` role are presumed to have been generated by the model in previous
2227 interactions.
2228
2229 - `content: string or ResponseInputMessageContentList`
2230
2231 Text, image, or audio input to the model, used to generate a response.
2232 Can also contain previous assistant responses.
2233
2234 - `TextInput = string`
2235
2236 A text input to the model.
2237
2238 - `ResponseInputMessageContentList = array of ResponseInputContent`
2239
2240 A list of one or many input items to the model, containing different content
2241 types.
2242
2243 - `ResponseInputText object { text, type, prompt_cache_breakpoint }`
2244
2245 A text input to the model.
2246
2247 - `text: string`
2248
2249 The text input to the model.
2250
2251 - `type: "input_text"`
2252
2253 The type of the input item. Always `input_text`.
2254
2255 - `"input_text"`
2256
2257 - `prompt_cache_breakpoint: optional object { mode }`
2258
2259 Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.
2260
2261 - `mode: "explicit"`
2262
2263 The breakpoint mode. Always `explicit`.
2264
2265 - `"explicit"`
2266
2267 - `ResponseInputImage object { detail, type, file_id, 2 more }`
2268
2269 An image input to the model. Learn about [image inputs](/api/docs/guides/images-vision).
2270
2271 - `detail: ImageDetail`
2272
2273 The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
2274
2275 - `"low"`
2276
2277 - `"high"`
2278
2279 - `"auto"`
2280
2281 - `"original"`
2282
2283 - `type: "input_image"`
2284
2285 The type of the input item. Always `input_image`.
2286
2287 - `"input_image"`
2288
2289 - `file_id: optional string or null`
2290
2291 The ID of the file to be sent to the model.
2292
2293 - `image_url: optional string or null`
2294
2295 The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
2296
2297 - `prompt_cache_breakpoint: optional object { mode }`
2298
2299 Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.
2300
2301 - `mode: "explicit"`
2302
2303 The breakpoint mode. Always `explicit`.
2304
2305 - `"explicit"`
2306
2307 - `ResponseInputFile object { type, detail, file_data, 4 more }`
2308
2309 A file input to the model.
2310
2311 - `type: "input_file"`
2312
2313 The type of the input item. Always `input_file`.
2314
2315 - `"input_file"`
2316
2317 - `detail: optional "auto" or "low" or "high"`
2318
2319 The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.
2320
2321 - `"auto"`
2322
2323 - `"low"`
2324
2325 - `"high"`
2326
2327 - `file_data: optional string`
2328
2329 The content of the file to be sent to the model.
2330
2331 - `file_id: optional string or null`
2332
2333 The ID of the file to be sent to the model.
2334
2335 - `file_url: optional string`
2336
2337 The URL of the file to be sent to the model.
2338
2339 - `filename: optional string`
2340
2341 The name of the file to be sent to the model.
2342
2343 - `prompt_cache_breakpoint: optional object { mode }`
2344
2345 Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.
2346
2347 - `mode: "explicit"`
2348
2349 The breakpoint mode. Always `explicit`.
2350
2351 - `"explicit"`
2352
2353 - `role: "user" or "assistant" or "system" or "developer"`
2354
2355 The role of the message input. One of `user`, `assistant`, `system`, or
2356 `developer`.
2357
2358 - `"user"`
2359
2360 - `"assistant"`
2361
2362 - `"system"`
2363
2364 - `"developer"`
2365
2366 - `phase: optional "commentary" or "final_answer" or null`
2367
2368 Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
2369 For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
2370 phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
2371
2372 - `"commentary"`
2373
2374 - `"final_answer"`
2375
2376 - `type: optional "message"`
2377
2378 The type of the message input. Always `message`.
2379
2380 - `"message"`
2381
2382 - `EvalMessageObject object { content, role, type }`
2383
2384 A message input to the model with a role indicating instruction following
2385 hierarchy. Instructions given with the `developer` or `system` role take
2386 precedence over instructions given with the `user` role. Messages with the
2387 `assistant` role are presumed to have been generated by the model in previous
2388 interactions.
2389
2390 - `content: string or ResponseInputText or object { text, type } or 3 more`
2391
2392 Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
2393
2394 - `TextInput = string`
2395
2396 A text input to the model.
2397
2398 - `ResponseInputText object { text, type, prompt_cache_breakpoint }`
2399
2400 A text input to the model.
2401
2402 - `OutputText object { text, type }`
2403
2404 A text output from the model.
2405
2406 - `text: string`
2407
2408 The text output from the model.
2409
2410 - `type: "output_text"`
2411
2412 The type of the output text. Always `output_text`.
2413
2414 - `"output_text"`
2415
2416 - `InputImage object { image_url, type, detail }`
2417
2418 An image input block used within EvalItem content arrays.
2419
2420 - `image_url: string`
2421
2422 The URL of the image input.
2423
2424 - `type: "input_image"`
2425
2426 The type of the image input. Always `input_image`.
2427
2428 - `"input_image"`
2429
2430 - `detail: optional string`
2431
2432 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
2433
2434 - `ResponseInputAudio object { input_audio, type }`
2435
2436 An audio input to the model.
2437
2438 - `input_audio: object { data, format }`
2439
2440 - `data: string`
2441
2442 Base64-encoded audio data.
2443
2444 - `format: "mp3" or "wav"`
2445
2446 The format of the audio data. Currently supported formats are `mp3` and
2447 `wav`.
2448
2449 - `"mp3"`
2450
2451 - `"wav"`
2452
2453 - `type: "input_audio"`
2454
2455 The type of the input item. Always `input_audio`.
2456
2457 - `"input_audio"`
2458
2459 - `GraderInputs = array of string or ResponseInputText or object { text, type } or 2 more`
2460
2461 A list of inputs, each of which may be either an input text, output text, input
2462 image, or input audio object.
2463
2464 - `TextInput = string`
2465
2466 A text input to the model.
2467
2468 - `ResponseInputText object { text, type, prompt_cache_breakpoint }`
2469
2470 A text input to the model.
2471
2472 - `OutputText object { text, type }`
2473
2474 A text output from the model.
2475
2476 - `text: string`
2477
2478 The text output from the model.
2479
2480 - `type: "output_text"`
2481
2482 The type of the output text. Always `output_text`.
2483
2484 - `"output_text"`
2485
2486 - `InputImage object { image_url, type, detail }`
2487
2488 An image input block used within EvalItem content arrays.
2489
2490 - `image_url: string`
2491
2492 The URL of the image input.
2493
2494 - `type: "input_image"`
2495
2496 The type of the image input. Always `input_image`.
2497
2498 - `"input_image"`
2499
2500 - `detail: optional string`
2501
2502 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
2503
2504 - `ResponseInputAudio object { input_audio, type }`
2505
2506 An audio input to the model.
2507
2508 - `role: "user" or "assistant" or "system" or "developer"`
2509
2510 The role of the message input. One of `user`, `assistant`, `system`, or
2511 `developer`.
2512
2513 - `"user"`
2514
2515 - `"assistant"`
2516
2517 - `"system"`
2518
2519 - `"developer"`
2520
2521 - `type: optional "message"`
2522
2523 The type of the message input. Always `message`.
2524
2525 - `"message"`
2526
2527 - `type: "template"`
2528
2529 The type of input messages. Always `template`.
2530
2531 - `"template"`
2532
2533 - `ItemReferenceInputMessages object { item_reference, type }`
2534
2535 - `item_reference: string`
2536
2537 A reference to a variable in the `item` namespace. Ie, "item.input_trajectory"
2538
2539 - `type: "item_reference"`
2540
2541 The type of input messages. Always `item_reference`.
2542
2543 - `"item_reference"`
2544
2545 - `model: optional string`
2546
2547 The name of the model to use for generating completions (e.g. "o3-mini").
2548
2549 - `sampling_params: optional object { max_completion_tokens, reasoning_effort, response_format, 4 more }`
2550
2551 - `max_completion_tokens: optional number`
2552
2553 The maximum number of tokens in the generated output.
2554
2555 - `reasoning_effort: optional ReasoningEffort or null`
2556
2557 Constrains effort on reasoning for reasoning models. Currently supported
2558 values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
2559 Reducing reasoning effort can result in faster responses and fewer tokens
2560 used on reasoning in a response. Not all reasoning models support every
2561 value. See the
2562 [reasoning guide](/api/docs/guides/reasoning)
2563 for model-specific support.
2564
2565 - `"none"`
2566
2567 - `"minimal"`
2568
2569 - `"low"`
2570
2571 - `"medium"`
2572
2573 - `"high"`
2574
2575 - `"xhigh"`
2576
2577 - `"max"`
2578
2579 - `response_format: optional ResponseFormatText or ResponseFormatJSONSchema or ResponseFormatJSONObject`
2580
2581 An object specifying the format that the model must output.
2582
2583 Setting to `{ "type": "json_schema", "json_schema": {...} }` enables
2584 Structured Outputs which ensures the model will match your supplied JSON
2585 schema. Learn more in the [Structured Outputs
2586 guide](/api/docs/guides/structured-outputs).
2587
2588 Setting to `{ "type": "json_object" }` enables the older JSON mode, which
2589 ensures the message the model generates is valid JSON. Using `json_schema`
2590 is preferred for models that support it.
2591
2592 - `ResponseFormatText object { type }`
2593
2594 Default response format. Used to generate text responses.
2595
2596 - `type: "text"`
2597
2598 The type of response format being defined. Always `text`.
2599
2600 - `"text"`
2601
2602 - `ResponseFormatJSONSchema object { json_schema, type }`
2603
2604 JSON Schema response format. Used to generate structured JSON responses.
2605 Learn more about [Structured Outputs](/api/docs/guides/structured-outputs).
2606
2607 - `json_schema: object { name, description, schema, strict }`
2608
2609 Structured Outputs configuration options, including a JSON Schema.
2610
2611 - `name: string`
2612
2613 The name of the response format. Must be a-z, A-Z, 0-9, or contain
2614 underscores and dashes, with a maximum length of 64.
2615
2616 - `description: optional string`
2617
2618 A description of what the response format is for, used by the model to
2619 determine how to respond in the format.
2620
2621 - `schema: optional map[unknown]`
2622
2623 The schema for the response format, described as a JSON Schema object.
2624 Learn how to build JSON schemas [here](https://json-schema.org/).
2625
2626 - `strict: optional boolean or null`
2627
2628 Whether to enable strict schema adherence when generating the output.
2629 If set to true, the model will always follow the exact schema defined
2630 in the `schema` field. Only a subset of JSON Schema is supported when
2631 `strict` is `true`. To learn more, read the [Structured Outputs
2632 guide](/api/docs/guides/structured-outputs).
2633
2634 - `type: "json_schema"`
2635
2636 The type of response format being defined. Always `json_schema`.
2637
2638 - `"json_schema"`
2639
2640 - `ResponseFormatJSONObject object { type }`
2641
2642 JSON object response format. An older method of generating JSON responses.
2643 Using `json_schema` is recommended for models that support it. Note that the
2644 model will not generate JSON without a system or user message instructing it
2645 to do so.
2646
2647 - `type: "json_object"`
2648
2649 The type of response format being defined. Always `json_object`.
2650
2651 - `"json_object"`
2652
2653 - `seed: optional number`
2654
2655 A seed value to initialize the randomness, during sampling.
2656
2657 - `temperature: optional number`
2658
2659 A higher temperature increases randomness in the outputs.
2660
2661 - `tools: optional array of ChatCompletionFunctionTool`
2662
2663 A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.
2664
2665 - `function: FunctionDefinition`
2666
2667 - `name: string`
2668
2669 The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
2670
2671 - `description: optional string`
2672
2673 A description of what the function does, used by the model to choose when and how to call the function.
2674
2675 - `parameters: optional FunctionParameters`
2676
2677 The parameters the functions accepts, described as a JSON Schema object. See the [guide](/api/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
2678
2679 Omitting `parameters` defines a function with an empty parameter list.
2680
2681 - `strict: optional boolean or null`
2682
2683 Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/api/docs/guides/function-calling).
2684
2685 - `type: "function"`
2686
2687 The type of the tool. Currently, only `function` is supported.
2688
2689 - `"function"`
2690
2691 - `top_p: optional number`
2692
2693 An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
2694
2695 - `ResponsesRunDataSource object { source, type, input_messages, 2 more }`
2696
2697 A ResponsesRunDataSource object describing a model sampling configuration.
2698
2699 - `source: object { content, type } or object { id, type } or object { type, created_after, created_before, 8 more }`
2700
2701 Determines what populates the `item` namespace in this run's data source.
2702
2703 - `EvalJSONLFileContentSource object { content, type }`
2704
2705 - `content: array of object { item, sample }`
2706
2707 The content of the jsonl file.
2708
2709 - `item: map[unknown]`
2710
2711 - `sample: optional map[unknown]`
2712
2713 - `type: "file_content"`
2714
2715 The type of jsonl source. Always `file_content`.
2716
2717 - `"file_content"`
2718
2719 - `EvalJSONLFileIDSource object { id, type }`
2720
2721 - `id: string`
2722
2723 The identifier of the file.
2724
2725 - `type: "file_id"`
2726
2727 The type of jsonl source. Always `file_id`.
2728
2729 - `"file_id"`
2730
2731 - `EvalResponsesSource object { type, created_after, created_before, 8 more }`
2732
2733 A EvalResponsesSource object describing a run data source configuration.
2734
2735 - `type: "responses"`
2736
2737 The type of run data source. Always `responses`.
2738
2739 - `"responses"`
2740
2741 - `created_after: optional number or null`
2742
2743 Only include items created after this timestamp (inclusive). This is a query parameter used to select responses.
2744
2745 - `created_before: optional number or null`
2746
2747 Only include items created before this timestamp (inclusive). This is a query parameter used to select responses.
2748
2749 - `instructions_search: optional string or null`
2750
2751 Optional string to search the 'instructions' field. This is a query parameter used to select responses.
2752
2753 - `metadata: optional unknown or null`
2754
2755 Metadata filter for the responses. This is a query parameter used to select responses.
2756
2757 - `model: optional string or null`
2758
2759 The name of the model to find responses for. This is a query parameter used to select responses.
2760
2761 - `reasoning_effort: optional ReasoningEffort or null`
2762
2763 Constrains effort on reasoning for reasoning models. Currently supported
2764 values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
2765 Reducing reasoning effort can result in faster responses and fewer tokens
2766 used on reasoning in a response. Not all reasoning models support every
2767 value. See the
2768 [reasoning guide](/api/docs/guides/reasoning)
2769 for model-specific support.
2770
2771 - `temperature: optional number or null`
2772
2773 Sampling temperature. This is a query parameter used to select responses.
2774
2775 - `tools: optional array of string or null`
2776
2777 List of tool names. This is a query parameter used to select responses.
2778
2779 - `top_p: optional number or null`
2780
2781 Nucleus sampling parameter. This is a query parameter used to select responses.
2782
2783 - `users: optional array of string or null`
2784
2785 List of user identifiers. This is a query parameter used to select responses.
2786
2787 - `type: "responses"`
2788
2789 The type of run data source. Always `responses`.
2790
2791 - `"responses"`
2792
2793 - `input_messages: optional object { template, type } or object { item_reference, type }`
2794
2795 Used when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie, `item.input_trajectory`), or a template with variable references to the `item` namespace.
2796
2797 - `InputMessagesTemplate object { template, type }`
2798
2799 - `template: array of object { content, role } or object { content, role, type }`
2800
2801 A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}.
2802
2803 - `ChatMessage object { content, role }`
2804
2805 - `content: string`
2806
2807 The content of the message.
2808
2809 - `role: string`
2810
2811 The role of the message (e.g. "system", "assistant", "user").
2812
2813 - `EvalMessageObject object { content, role, type }`
2814
2815 A message input to the model with a role indicating instruction following
2816 hierarchy. Instructions given with the `developer` or `system` role take
2817 precedence over instructions given with the `user` role. Messages with the
2818 `assistant` role are presumed to have been generated by the model in previous
2819 interactions.
2820
2821 - `content: string or ResponseInputText or object { text, type } or 3 more`
2822
2823 Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
2824
2825 - `TextInput = string`
2826
2827 A text input to the model.
2828
2829 - `ResponseInputText object { text, type, prompt_cache_breakpoint }`
2830
2831 A text input to the model.
2832
2833 - `OutputText object { text, type }`
2834
2835 A text output from the model.
2836
2837 - `text: string`
2838
2839 The text output from the model.
2840
2841 - `type: "output_text"`
2842
2843 The type of the output text. Always `output_text`.
2844
2845 - `"output_text"`
2846
2847 - `InputImage object { image_url, type, detail }`
2848
2849 An image input block used within EvalItem content arrays.
2850
2851 - `image_url: string`
2852
2853 The URL of the image input.
2854
2855 - `type: "input_image"`
2856
2857 The type of the image input. Always `input_image`.
2858
2859 - `"input_image"`
2860
2861 - `detail: optional string`
2862
2863 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
2864
2865 - `ResponseInputAudio object { input_audio, type }`
2866
2867 An audio input to the model.
2868
2869 - `GraderInputs = array of string or ResponseInputText or object { text, type } or 2 more`
2870
2871 A list of inputs, each of which may be either an input text, output text, input
2872 image, or input audio object.
2873
2874 - `role: "user" or "assistant" or "system" or "developer"`
2875
2876 The role of the message input. One of `user`, `assistant`, `system`, or
2877 `developer`.
2878
2879 - `"user"`
2880
2881 - `"assistant"`
2882
2883 - `"system"`
2884
2885 - `"developer"`
2886
2887 - `type: optional "message"`
2888
2889 The type of the message input. Always `message`.
2890
2891 - `"message"`
2892
2893 - `type: "template"`
2894
2895 The type of input messages. Always `template`.
2896
2897 - `"template"`
2898
2899 - `InputMessagesItemReference object { item_reference, type }`
2900
2901 - `item_reference: string`
2902
2903 A reference to a variable in the `item` namespace. Ie, "item.name"
2904
2905 - `type: "item_reference"`
2906
2907 The type of input messages. Always `item_reference`.
2908
2909 - `"item_reference"`
2910
2911 - `model: optional string`
2912
2913 The name of the model to use for generating completions (e.g. "o3-mini").
2914
2915 - `sampling_params: optional object { max_completion_tokens, reasoning_effort, seed, 4 more }`
2916
2917 - `max_completion_tokens: optional number`
2918
2919 The maximum number of tokens in the generated output.
2920
2921 - `reasoning_effort: optional ReasoningEffort or null`
2922
2923 Constrains effort on reasoning for reasoning models. Currently supported
2924 values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
2925 Reducing reasoning effort can result in faster responses and fewer tokens
2926 used on reasoning in a response. Not all reasoning models support every
2927 value. See the
2928 [reasoning guide](/api/docs/guides/reasoning)
2929 for model-specific support.
2930
2931 - `seed: optional number`
2932
2933 A seed value to initialize the randomness, during sampling.
2934
2935 - `temperature: optional number`
2936
2937 A higher temperature increases randomness in the outputs.
2938
2939 - `text: optional object { format }`
2940
2941 Configuration options for a text response from the model. Can be plain
2942 text or structured JSON data. Learn more:
2943
2944 - [Text inputs and outputs](/api/docs/guides/text)
2945 - [Structured Outputs](/api/docs/guides/structured-outputs)
2946
2947 - `format: optional ResponseFormatTextConfig`
2948
2949 An object specifying the format that the model must output.
2950
2951 Configuring `{ "type": "json_schema" }` enables Structured Outputs,
2952 which ensures the model will match your supplied JSON schema. Learn more in the
2953 [Structured Outputs guide](/api/docs/guides/structured-outputs).
2954
2955 The default format is `{ "type": "text" }` with no additional options.
2956
2957 **Not recommended for gpt-4o and newer models:**
2958
2959 Setting to `{ "type": "json_object" }` enables the older JSON mode, which
2960 ensures the message the model generates is valid JSON. Using `json_schema`
2961 is preferred for models that support it.
2962
2963 - `ResponseFormatText object { type }`
2964
2965 Default response format. Used to generate text responses.
2966
2967 - `ResponseFormatTextJSONSchemaConfig object { name, schema, type, 2 more }`
2968
2969 JSON Schema response format. Used to generate structured JSON responses.
2970 Learn more about [Structured Outputs](/api/docs/guides/structured-outputs).
2971
2972 - `name: string`
2973
2974 The name of the response format. Must be a-z, A-Z, 0-9, or contain
2975 underscores and dashes, with a maximum length of 64.
2976
2977 - `schema: map[unknown]`
2978
2979 The schema for the response format, described as a JSON Schema object.
2980 Learn how to build JSON schemas [here](https://json-schema.org/).
2981
2982 - `type: "json_schema"`
2983
2984 The type of response format being defined. Always `json_schema`.
2985
2986 - `"json_schema"`
2987
2988 - `description: optional string`
2989
2990 A description of what the response format is for, used by the model to
2991 determine how to respond in the format.
2992
2993 - `strict: optional boolean or null`
2994
2995 Whether to enable strict schema adherence when generating the output.
2996 If set to true, the model will always follow the exact schema defined
2997 in the `schema` field. Only a subset of JSON Schema is supported when
2998 `strict` is `true`. To learn more, read the [Structured Outputs
2999 guide](/api/docs/guides/structured-outputs).
3000
3001 - `ResponseFormatJSONObject object { type }`
3002
3003 JSON object response format. An older method of generating JSON responses.
3004 Using `json_schema` is recommended for models that support it. Note that the
3005 model will not generate JSON without a system or user message instructing it
3006 to do so.
3007
3008 - `tools: optional array of object { name, parameters, strict, 6 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 13 more`
3009
3010 An array of tools the model may call while generating a response. You
3011 can specify which tool to use by setting the `tool_choice` parameter.
3012
3013 The two categories of tools you can provide the model are:
3014
3015 - **Built-in tools**: Tools that are provided by OpenAI that extend the
3016 model's capabilities, like [web search](/api/docs/guides/tools-web-search)
3017 or [file search](/api/docs/guides/tools-file-search). Learn more about
3018 [built-in tools](/api/docs/guides/tools).
3019 - **Function calls (custom tools)**: Functions that are defined by you,
3020 enabling the model to call your own code. Learn more about
3021 [function calling](/api/docs/guides/function-calling).
3022
3023 - `Function object { name, parameters, strict, 6 more }`
3024
3025 Defines a function in your own code the model can choose to call. Learn more about [function calling](/api/docs/guides/function-calling).
3026
3027 - `name: string`
3028
3029 The name of the function to call.
3030
3031 - `parameters: map[unknown] or null`
3032
3033 A JSON schema object describing the parameters of the function.
3034
3035 - `strict: boolean or null`
3036
3037 Whether strict parameter validation is enforced for this function tool.
3038
3039 - `type: "function"`
3040
3041 The type of the function tool. Always `function`.
3042
3043 - `"function"`
3044
3045 - `allowed_callers: optional array of "direct" or "programmatic" or null`
3046
3047 The tool invocation context(s).
3048
3049 - `"direct"`
3050
3051 - `"programmatic"`
3052
3053 - `async: optional boolean`
3054
3055 - `defer_loading: optional boolean`
3056
3057 Whether this function is deferred and loaded via tool search.
3058
3059 - `description: optional string or null`
3060
3061 A description of the function. Used by the model to determine whether or not to call the function.
3062
3063 - `output_schema: optional map[unknown] or null`
3064
3065 A JSON schema object describing the JSON value encoded in string outputs for this function.
3066
3067 - `FileSearch object { type, vector_store_ids, filters, 2 more }`
3068
3069 A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](/api/docs/guides/tools-file-search).
3070
3071 - `type: "file_search"`
3072
3073 The type of the file search tool. Always `file_search`.
3074
3075 - `"file_search"`
3076
3077 - `vector_store_ids: array of string`
3078
3079 The IDs of the vector stores to search.
3080
3081 - `filters: optional ComparisonFilter or CompoundFilter or null`
3082
3083 A filter to apply.
3084
3085 - `ComparisonFilter object { key, type, value }`
3086
3087 A filter used to compare a specified attribute key to a given value using a defined comparison operation.
3088
3089 - `key: string`
3090
3091 The key to compare against the value.
3092
3093 - `type: "eq" or "ne" or "gt" or 5 more`
3094
3095 Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.
3096
3097 - `eq`: equals
3098 - `ne`: not equal
3099 - `gt`: greater than
3100 - `gte`: greater than or equal
3101 - `lt`: less than
3102 - `lte`: less than or equal
3103 - `in`: in
3104 - `nin`: not in
3105
3106 - `"eq"`
3107
3108 - `"ne"`
3109
3110 - `"gt"`
3111
3112 - `"gte"`
3113
3114 - `"lt"`
3115
3116 - `"lte"`
3117
3118 - `"in"`
3119
3120 - `"nin"`
3121
3122 - `value: string or number or boolean or array of string or number`
3123
3124 The value to compare against the attribute key; supports string, number, or boolean types.
3125
3126 - `string`
3127
3128 - `number`
3129
3130 - `boolean`
3131
3132 - `array of string or number`
3133
3134 - `string`
3135
3136 - `number`
3137
3138 - `CompoundFilter object { filters, type }`
3139
3140 Combine multiple filters using `and` or `or`.
3141
3142 - `filters: array of ComparisonFilter or unknown`
3143
3144 Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.
3145
3146 - `ComparisonFilter object { key, type, value }`
3147
3148 A filter used to compare a specified attribute key to a given value using a defined comparison operation.
3149
3150 - `unknown`
3151
3152 - `type: "and" or "or"`
3153
3154 Type of operation: `and` or `or`.
3155
3156 - `"and"`
3157
3158 - `"or"`
3159
3160 - `max_num_results: optional number`
3161
3162 The maximum number of results to return. This number should be between 1 and 50 inclusive.
3163
3164 - `ranking_options: optional object { hybrid_search, ranker, score_threshold }`
3165
3166 Ranking options for search.
3167
3168 - `hybrid_search: optional object { embedding_weight, text_weight }`
3169
3170 Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
3171
3172 - `embedding_weight: number`
3173
3174 The weight of the embedding in the reciprocal ranking fusion.
3175
3176 - `text_weight: number`
3177
3178 The weight of the text in the reciprocal ranking fusion.
3179
3180 - `ranker: optional "auto" or "default-2024-11-15"`
3181
3182 The ranker to use for the file search.
3183
3184 - `"auto"`
3185
3186 - `"default-2024-11-15"`
3187
3188 - `score_threshold: optional number`
3189
3190 The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
3191
3192 - `Computer object { type }`
3193
3194 A tool that controls a virtual computer. Learn more about the [computer tool](/api/docs/guides/tools-computer-use).
3195
3196 - `type: "computer"`
3197
3198 The type of the computer tool. Always `computer`.
3199
3200 - `"computer"`
3201
3202 - `ComputerUsePreview object { display_height, display_width, environment, type }`
3203
3204 A tool that controls a virtual computer. Learn more about the [computer tool](/api/docs/guides/tools-computer-use).
3205
3206 - `display_height: number`
3207
3208 The height of the computer display.
3209
3210 - `display_width: number`
3211
3212 The width of the computer display.
3213
3214 - `environment: "windows" or "mac" or "linux" or 2 more`
3215
3216 The type of computer environment to control.
3217
3218 - `"windows"`
3219
3220 - `"mac"`
3221
3222 - `"linux"`
3223
3224 - `"ubuntu"`
3225
3226 - `"browser"`
3227
3228 - `type: "computer_use_preview"`
3229
3230 The type of the computer use tool. Always `computer_use_preview`.
3231
3232 - `"computer_use_preview"`
3233
3234 - `WebSearch object { type, external_web_access, filters, 2 more }`
3235
3236 Search the Internet for sources related to the prompt. Learn more about the
3237 [web search tool](/api/docs/guides/tools-web-search).
3238
3239 - `type: "web_search" or "web_search_2025_08_26"`
3240
3241 The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.
3242
3243 - `"web_search"`
3244
3245 - `"web_search_2025_08_26"`
3246
3247 - `external_web_access: optional boolean`
3248
3249 Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.
3250
3251 - `filters: optional object { allowed_domains } or null`
3252
3253 Filters for the search.
3254
3255 - `allowed_domains: optional array of string or null`
3256
3257 Allowed domains for the search. If not provided, all domains are allowed.
3258 Subdomains of the provided domains are allowed as well.
3259
3260 Example: `["pubmed.ncbi.nlm.nih.gov"]`
3261
3262 - `search_context_size: optional "low" or "medium" or "high"`
3263
3264 High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.
3265
3266 - `"low"`
3267
3268 - `"medium"`
3269
3270 - `"high"`
3271
3272 - `user_location: optional object { city, country, region, 2 more } or null`
3273
3274 The approximate location of the user.
3275
3276 - `city: optional string or null`
3277
3278 Free text input for the city of the user, e.g. `San Francisco`.
3279
3280 - `country: optional string or null`
3281
3282 The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.
3283
3284 - `region: optional string or null`
3285
3286 Free text input for the region of the user, e.g. `California`.
3287
3288 - `timezone: optional string or null`
3289
3290 The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.
3291
3292 - `type: optional "approximate"`
3293
3294 The type of location approximation. Always `approximate`.
3295
3296 - `"approximate"`
3297
3298 - `Mcp object { server_label, type, allowed_callers, 9 more }`
3299
3300 Give the model access to additional tools via remote Model Context Protocol
3301 (MCP) servers. [Learn more about MCP](/api/docs/guides/tools-connectors-mcp).
3302
3303 - `server_label: string`
3304
3305 A label for this MCP server, used to identify it in tool calls.
3306
3307 - `type: "mcp"`
3308
3309 The type of the MCP tool. Always `mcp`.
3310
3311 - `"mcp"`
3312
3313 - `allowed_callers: optional array of "direct" or "programmatic" or null`
3314
3315 The tool invocation context(s).
3316
3317 - `"direct"`
3318
3319 - `"programmatic"`
3320
3321 - `allowed_tools: optional array of string or object { read_only, tool_names } or null`
3322
3323 List of allowed tool names or a filter object.
3324
3325 - `McpAllowedTools = array of string`
3326
3327 A string array of allowed tool names
3328
3329 - `McpToolFilter object { read_only, tool_names }`
3330
3331 A filter object to specify which tools are allowed.
3332
3333 - `read_only: optional boolean`
3334
3335 Indicates whether or not a tool modifies data or is read-only. If an
3336 MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
3337 it will match this filter.
3338
3339 - `tool_names: optional array of string`
3340
3341 List of allowed tool names.
3342
3343 - `authorization: optional string`
3344
3345 An OAuth access token that can be used with a remote MCP server, either
3346 with a custom MCP server URL or a service connector. Your application
3347 must handle the OAuth authorization flow and provide the token here.
3348
3349 - `connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more`
3350
3351 Identifier for service connectors, like those available in ChatGPT. One of
3352 `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more
3353 about service connectors [here](/api/docs/guides/tools-connectors-mcp#connectors).
3354
3355 This field is deprecated for models released after September 1, 2026.
3356 Use `server_url` to connect to a remote MCP server, or `tunnel_id` to
3357 connect through a Secure MCP Tunnel.
3358
3359 Currently supported `connector_id` values are:
3360
3361 - Dropbox: `connector_dropbox`
3362 - Gmail: `connector_gmail`
3363 - Google Calendar: `connector_googlecalendar`
3364 - Google Drive: `connector_googledrive`
3365 - Microsoft Teams: `connector_microsoftteams`
3366 - Outlook Calendar: `connector_outlookcalendar`
3367 - Outlook Email: `connector_outlookemail`
3368 - SharePoint: `connector_sharepoint`
3369
3370 - `"connector_dropbox"`
3371
3372 - `"connector_gmail"`
3373
3374 - `"connector_googlecalendar"`
3375
3376 - `"connector_googledrive"`
3377
3378 - `"connector_microsoftteams"`
3379
3380 - `"connector_outlookcalendar"`
3381
3382 - `"connector_outlookemail"`
3383
3384 - `"connector_sharepoint"`
3385
3386 - `defer_loading: optional boolean`
3387
3388 Whether this MCP tool is deferred and discovered via tool search.
3389
3390 - `headers: optional map[string] or null`
3391
3392 Optional HTTP headers to send to the MCP server. Use for authentication
3393 or other purposes.
3394
3395 - `require_approval: optional object { always, never } or "always" or "never" or null`
3396
3397 Specify which of the MCP server's tools require approval.
3398
3399 - `McpToolApprovalFilter object { always, never }`
3400
3401 Specify which of the MCP server's tools require approval. Can be
3402 `always`, `never`, or a filter object associated with tools
3403 that require approval.
3404
3405 - `always: optional object { read_only, tool_names }`
3406
3407 A filter object to specify which tools are allowed.
3408
3409 - `read_only: optional boolean`
3410
3411 Indicates whether or not a tool modifies data or is read-only. If an
3412 MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
3413 it will match this filter.
3414
3415 - `tool_names: optional array of string`
3416
3417 List of allowed tool names.
3418
3419 - `never: optional object { read_only, tool_names }`
3420
3421 A filter object to specify which tools are allowed.
3422
3423 - `read_only: optional boolean`
3424
3425 Indicates whether or not a tool modifies data or is read-only. If an
3426 MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
3427 it will match this filter.
3428
3429 - `tool_names: optional array of string`
3430
3431 List of allowed tool names.
3432
3433 - `McpToolApprovalSetting = "always" or "never"`
3434
3435 Specify a single approval policy for all tools. One of `always` or
3436 `never`. When set to `always`, all tools will require approval. When
3437 set to `never`, all tools will not require approval.
3438
3439 - `"always"`
3440
3441 - `"never"`
3442
3443 - `server_description: optional string`
3444
3445 Optional description of the MCP server, used to provide more context.
3446
3447 - `server_url: optional string`
3448
3449 The URL for the MCP server. One of `server_url`, `connector_id`, or
3450 `tunnel_id` must be provided.
3451
3452 - `tunnel_id: optional string`
3453
3454 The Secure MCP Tunnel ID to use instead of a direct server URL. One of
3455 `server_url`, `connector_id`, or `tunnel_id` must be provided.
3456
3457 - `CodeInterpreter object { container, type, allowed_callers }`
3458
3459 A tool that runs Python code to help generate a response to a prompt.
3460
3461 - `container: string or object { type, file_ids, memory_limit, network_policy }`
3462
3463 The code interpreter container. Can be a container ID or an object that
3464 specifies uploaded file IDs to make available to your code, along with an
3465 optional `memory_limit` setting.
3466
3467 - `string`
3468
3469 The container ID.
3470
3471 - `CodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }`
3472
3473 Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
3474
3475 - `type: "auto"`
3476
3477 Always `auto`.
3478
3479 - `"auto"`
3480
3481 - `file_ids: optional array of string`
3482
3483 An optional list of uploaded files to make available to your code.
3484
3485 - `memory_limit: optional "1g" or "4g" or "16g" or "64g" or null`
3486
3487 The memory limit for the code interpreter container.
3488
3489 - `"1g"`
3490
3491 - `"4g"`
3492
3493 - `"16g"`
3494
3495 - `"64g"`
3496
3497 - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist`
3498
3499 Network access policy for the container.
3500
3501 - `ContainerNetworkPolicyDisabled object { type }`
3502
3503 - `type: "disabled"`
3504
3505 Disable outbound network access. Always `disabled`.
3506
3507 - `"disabled"`
3508
3509 - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }`
3510
3511 - `allowed_domains: array of string`
3512
3513 A list of allowed domains when type is `allowlist`.
3514
3515 - `type: "allowlist"`
3516
3517 Allow outbound network access only to specified domains. Always `allowlist`.
3518
3519 - `"allowlist"`
3520
3521 - `domain_secrets: optional array of ContainerNetworkPolicyDomainSecret`
3522
3523 Optional domain-scoped secrets for allowlisted domains.
3524
3525 - `domain: string`
3526
3527 The domain associated with the secret.
3528
3529 - `name: string`
3530
3531 The name of the secret to inject for the domain.
3532
3533 - `value: string`
3534
3535 The secret value to inject for the domain.
3536
3537 - `type: "code_interpreter"`
3538
3539 The type of the code interpreter tool. Always `code_interpreter`.
3540
3541 - `"code_interpreter"`
3542
3543 - `allowed_callers: optional array of "direct" or "programmatic" or null`
3544
3545 The tool invocation context(s).
3546
3547 - `"direct"`
3548
3549 - `"programmatic"`
3550
3551 - `ProgrammaticToolCalling object { type }`
3552
3553 - `type: "programmatic_tool_calling"`
3554
3555 The type of the tool. Always `programmatic_tool_calling`.
3556
3557 - `"programmatic_tool_calling"`
3558
3559 - `ImageGeneration object { type, action, background, 9 more }`
3560
3561 A tool that generates images using the GPT image models.
3562
3563 - `type: "image_generation"`
3564
3565 The type of the image generation tool. Always `image_generation`.
3566
3567 - `"image_generation"`
3568
3569 - `action: optional "generate" or "edit" or "auto"`
3570
3571 Whether to generate a new image or edit an existing image. Default: `auto`.
3572
3573 - `"generate"`
3574
3575 - `"edit"`
3576
3577 - `"auto"`
3578
3579 - `background: optional "transparent" or "opaque" or "auto"`
3580
3581 Set the background of the generated image. One of `transparent`, `opaque`,
3582 or `auto`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including
3583 their `2026-09-08` snapshots, support `opaque` and `transparent`
3584 backgrounds. Transparent backgrounds are available for supported GPT Image
3585 models. For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
3586 preview. When using `transparent`, set the output format to `png` or `webp`.
3587 Default: `auto`.
3588
3589 - `"transparent"`
3590
3591 - `"opaque"`
3592
3593 - `"auto"`
3594
3595 - `input_fidelity: optional "high" or "low" or null`
3596
3597 Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.
3598
3599 - `"high"`
3600
3601 - `"low"`
3602
3603 - `input_image_mask: optional object { file_id, image_url }`
3604
3605 Optional mask for inpainting. Contains `image_url`
3606 (string, optional) and `file_id` (string, optional).
3607
3608 - `file_id: optional string`
3609
3610 File ID for the mask image.
3611
3612 - `image_url: optional string`
3613
3614 Base64-encoded mask image.
3615
3616 - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5" or 6 more`
3617
3618 The image generation model to use. One of `gpt-image-1`,
3619 `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
3620 `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
3621 `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
3622 `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`. Default:
3623 `gpt-image-1`.
3624
3625 - `string`
3626
3627 - `"gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5" or 6 more`
3628
3629 The image generation model to use. One of `gpt-image-1`,
3630 `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
3631 `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
3632 `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
3633 `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`. Default:
3634 `gpt-image-1`.
3635
3636 - `"gpt-image-1"`
3637
3638 - `"gpt-image-1-mini"`
3639
3640 - `"gpt-image-1.5"`
3641
3642 - `"gpt-image-2"`
3643
3644 - `"gpt-image-2-2026-04-21"`
3645
3646 - `"gpt-image-2.5-sunburst"`
3647
3648 - `"gpt-image-2.5-sunburst-2026-09-08"`
3649
3650 - `"gpt-image-2.5-flare"`
3651
3652 - `"gpt-image-2.5-flare-2026-09-08"`
3653
3654 - `moderation: optional "auto" or "low"`
3655
3656 Moderation level for the generated image. Default: `auto`.
3657
3658 - `"auto"`
3659
3660 - `"low"`
3661
3662 - `output_compression: optional number`
3663
3664 Compression level for the output image. Default: 100.
3665
3666 - `output_format: optional "png" or "webp" or "jpeg"`
3667
3668 The output format of the generated image. One of `png`, `webp`, or
3669 `jpeg`. Default: `png`.
3670
3671 - `"png"`
3672
3673 - `"webp"`
3674
3675 - `"jpeg"`
3676
3677 - `partial_images: optional number`
3678
3679 Number of partial images to generate in streaming mode, from 0 (default value) to 3.
3680
3681 - `quality: optional "low" or "medium" or "high" or 3 more`
3682
3683 The quality of the generated image. The GPT image models support `low`,
3684 `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`,
3685 including their `2026-09-08` snapshots, also support `xhigh` and `max`.
3686 Default: `auto`.
3687
3688 - `"low"`
3689
3690 - `"medium"`
3691
3692 - `"high"`
3693
3694 - `"xhigh"`
3695
3696 - `"max"`
3697
3698 - `"auto"`
3699
3700 - `size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"`
3701
3702 The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
3703
3704 - `string`
3705
3706 - `"1024x1024" or "1024x1536" or "1536x1024" or "auto"`
3707
3708 The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
3709
3710 - `"1024x1024"`
3711
3712 - `"1024x1536"`
3713
3714 - `"1536x1024"`
3715
3716 - `"auto"`
3717
3718 - `LocalShell object { type }`
3719
3720 A tool that allows the model to execute shell commands in a local environment.
3721
3722 - `type: "local_shell"`
3723
3724 The type of the local shell tool. Always `local_shell`.
3725
3726 - `"local_shell"`
3727
3728 - `Shell object { type, allowed_callers, environment }`
3729
3730 A tool that allows the model to execute shell commands.
3731
3732 - `type: "shell"`
3733
3734 The type of the shell tool. Always `shell`.
3735
3736 - `"shell"`
3737
3738 - `allowed_callers: optional array of "direct" or "programmatic" or null`
3739
3740 The tool invocation context(s).
3741
3742 - `"direct"`
3743
3744 - `"programmatic"`
3745
3746 - `environment: optional ContainerAuto or LocalEnvironment or ContainerReference or null`
3747
3748 - `ContainerAuto object { type, file_ids, memory_limit, 2 more }`
3749
3750 - `type: "container_auto"`
3751
3752 Automatically creates a container for this request
3753
3754 - `"container_auto"`
3755
3756 - `file_ids: optional array of string`
3757
3758 An optional list of uploaded files to make available to your code.
3759
3760 - `memory_limit: optional "1g" or "4g" or "16g" or "64g" or null`
3761
3762 The memory limit for the container.
3763
3764 - `"1g"`
3765
3766 - `"4g"`
3767
3768 - `"16g"`
3769
3770 - `"64g"`
3771
3772 - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist`
3773
3774 Network access policy for the container.
3775
3776 - `ContainerNetworkPolicyDisabled object { type }`
3777
3778 - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }`
3779
3780 - `skills: optional array of SkillReference or InlineSkill`
3781
3782 An optional list of skills referenced by id or inline data.
3783
3784 - `SkillReference object { skill_id, type, version }`
3785
3786 - `skill_id: string`
3787
3788 The ID of the referenced skill.
3789
3790 - `type: "skill_reference"`
3791
3792 References a skill created with the /v1/skills endpoint.
3793
3794 - `"skill_reference"`
3795
3796 - `version: optional string`
3797
3798 Optional skill version. Use a positive integer or 'latest'. Omit for default.
3799
3800 - `InlineSkill object { description, name, source, type }`
3801
3802 - `description: string`
3803
3804 The description of the skill.
3805
3806 - `name: string`
3807
3808 The name of the skill.
3809
3810 - `source: InlineSkillSource`
3811
3812 Inline skill payload
3813
3814 - `data: string`
3815
3816 Base64-encoded skill zip bundle.
3817
3818 - `media_type: "application/zip"`
3819
3820 The media type of the inline skill payload. Must be `application/zip`.
3821
3822 - `"application/zip"`
3823
3824 - `type: "base64"`
3825
3826 The type of the inline skill source. Must be `base64`.
3827
3828 - `"base64"`
3829
3830 - `type: "inline"`
3831
3832 Defines an inline skill for this request.
3833
3834 - `"inline"`
3835
3836 - `LocalEnvironment object { type, skills }`
3837
3838 - `type: "local"`
3839
3840 Use a local computer environment.
3841
3842 - `"local"`
3843
3844 - `skills: optional array of LocalSkill`
3845
3846 An optional list of skills.
3847
3848 - `description: string`
3849
3850 The description of the skill.
3851
3852 - `name: string`
3853
3854 The name of the skill.
3855
3856 - `path: string`
3857
3858 The path to the directory containing the skill.
3859
3860 - `ContainerReference object { container_id, type }`
3861
3862 - `container_id: string`
3863
3864 The ID of the referenced container.
3865
3866 - `type: "container_reference"`
3867
3868 References a container created with the /v1/containers endpoint
3869
3870 - `"container_reference"`
3871
3872 - `Custom object { name, type, allowed_callers, 4 more }`
3873
3874 A custom tool that processes input using a specified format. Learn more about [custom tools](/api/docs/guides/function-calling#custom-tools)
3875
3876 - `name: string`
3877
3878 The name of the custom tool, used to identify it in tool calls.
3879
3880 - `type: "custom"`
3881
3882 The type of the custom tool. Always `custom`.
3883
3884 - `"custom"`
3885
3886 - `allowed_callers: optional array of "direct" or "programmatic" or null`
3887
3888 The tool invocation context(s).
3889
3890 - `"direct"`
3891
3892 - `"programmatic"`
3893
3894 - `async: optional boolean`
3895
3896 Whether the tool response can be returned asynchronously versus immediately returned on next response creation.
3897
3898 - `defer_loading: optional boolean`
3899
3900 Whether this tool should be deferred and discovered via tool search.
3901
3902 - `description: optional string`
3903
3904 Optional description of the custom tool, used to provide more context.
3905
3906 - `format: optional CustomToolInputFormat`
3907
3908 The input format for the custom tool. Default is unconstrained text.
3909
3910 - `Text object { type }`
3911
3912 Unconstrained free-form text.
3913
3914 - `type: "text"`
3915
3916 Unconstrained text format. Always `text`.
3917
3918 - `"text"`
3919
3920 - `Grammar object { definition, syntax, type }`
3921
3922 A grammar defined by the user.
3923
3924 - `definition: string`
3925
3926 The grammar definition.
3927
3928 - `syntax: "lark" or "regex"`
3929
3930 The syntax of the grammar definition. One of `lark` or `regex`.
3931
3932 - `"lark"`
3933
3934 - `"regex"`
3935
3936 - `type: "grammar"`
3937
3938 Grammar format. Always `grammar`.
3939
3940 - `"grammar"`
3941
3942 - `Namespace object { description, name, tools, type }`
3943
3944 Groups function/custom tools under a shared namespace.
3945
3946 - `description: string`
3947
3948 A description of the namespace shown to the model.
3949
3950 - `name: string`
3951
3952 The namespace name used in tool calls (for example, `crm`).
3953
3954 - `tools: array of object { name, type, allowed_callers, 6 more } or object { name, type, allowed_callers, 4 more }`
3955
3956 The function/custom tools available inside this namespace.
3957
3958 - `Function object { name, type, allowed_callers, 6 more }`
3959
3960 - `name: string`
3961
3962 - `type: "function"`
3963
3964 - `"function"`
3965
3966 - `allowed_callers: optional array of "direct" or "programmatic" or null`
3967
3968 The tool invocation context(s).
3969
3970 - `"direct"`
3971
3972 - `"programmatic"`
3973
3974 - `async: optional boolean`
3975
3976 Whether the tool response can be returned asynchronously versus immediately returned on next response creation.
3977
3978 - `defer_loading: optional boolean`
3979
3980 Whether this function should be deferred and discovered via tool search.
3981
3982 - `description: optional string or null`
3983
3984 - `output_schema: optional map[unknown] or null`
3985
3986 A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.
3987
3988 - `parameters: optional unknown or null`
3989
3990 - `strict: optional boolean or null`
3991
3992 Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.
3993
3994 - `Custom object { name, type, allowed_callers, 4 more }`
3995
3996 A custom tool that processes input using a specified format. Learn more about [custom tools](/api/docs/guides/function-calling#custom-tools)
3997
3998 - `name: string`
3999
4000 The name of the custom tool, used to identify it in tool calls.
4001
4002 - `type: "custom"`
4003
4004 The type of the custom tool. Always `custom`.
4005
4006 - `"custom"`
4007
4008 - `allowed_callers: optional array of "direct" or "programmatic" or null`
4009
4010 The tool invocation context(s).
4011
4012 - `"direct"`
4013
4014 - `"programmatic"`
4015
4016 - `async: optional boolean`
4017
4018 Whether the tool response can be returned asynchronously versus immediately returned on next response creation.
4019
4020 - `defer_loading: optional boolean`
4021
4022 Whether this tool should be deferred and discovered via tool search.
4023
4024 - `description: optional string`
4025
4026 Optional description of the custom tool, used to provide more context.
4027
4028 - `format: optional CustomToolInputFormat`
4029
4030 The input format for the custom tool. Default is unconstrained text.
4031
4032 - `type: "namespace"`
4033
4034 The type of the tool. Always `namespace`.
4035
4036 - `"namespace"`
4037
4038 - `ToolSearch object { type, description, execution, parameters }`
4039
4040 Hosted or BYOT tool search configuration for deferred tools.
4041
4042 - `type: "tool_search"`
4043
4044 The type of the tool. Always `tool_search`.
4045
4046 - `"tool_search"`
4047
4048 - `description: optional string or null`
4049
4050 Description shown to the model for a client-executed tool search tool.
4051
4052 - `execution: optional "server" or "client"`
4053
4054 Whether tool search is executed by the server or by the client.
4055
4056 - `"server"`
4057
4058 - `"client"`
4059
4060 - `parameters: optional unknown or null`
4061
4062 Parameter schema for a client-executed tool search tool.
4063
4064 - `WebSearchPreview object { type, search_content_types, search_context_size, user_location }`
4065
4066 This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](/api/docs/guides/tools-web-search).
4067
4068 - `type: "web_search_preview" or "web_search_preview_2025_03_11"`
4069
4070 The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.
4071
4072 - `"web_search_preview"`
4073
4074 - `"web_search_preview_2025_03_11"`
4075
4076 - `search_content_types: optional array of "text" or "image"`
4077
4078 - `"text"`
4079
4080 - `"image"`
4081
4082 - `search_context_size: optional "low" or "medium" or "high"`
4083
4084 High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.
4085
4086 - `"low"`
4087
4088 - `"medium"`
4089
4090 - `"high"`
4091
4092 - `user_location: optional object { type, city, country, 2 more } or null`
4093
4094 The user's location.
4095
4096 - `type: "approximate"`
4097
4098 The type of location approximation. Always `approximate`.
4099
4100 - `"approximate"`
4101
4102 - `city: optional string or null`
4103
4104 Free text input for the city of the user, e.g. `San Francisco`.
4105
4106 - `country: optional string or null`
4107
4108 The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.
4109
4110 - `region: optional string or null`
4111
4112 Free text input for the region of the user, e.g. `California`.
4113
4114 - `timezone: optional string or null`
4115
4116 The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.
4117
4118 - `ApplyPatch object { type, allowed_callers }`
4119
4120 Allows the assistant to create, delete, or update files using unified diffs.
4121
4122 - `type: "apply_patch"`
4123
4124 The type of the tool. Always `apply_patch`.
4125
4126 - `"apply_patch"`
4127
4128 - `allowed_callers: optional array of "direct" or "programmatic" or null`
4129
4130 The tool invocation context(s).
4131
4132 - `"direct"`
4133
4134 - `"programmatic"`
4135
4136 - `top_p: optional number`
4137
4138 An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
4139
4140- `error: EvalAPIError`
4141
4142 An object representing an error response from the Eval API.
4143
4144 - `code: string`
4145
4146 The error code.
4147
4148 - `message: string`
4149
4150 The error message.
4151
4152- `eval_id: string`
4153
4154 The identifier of the associated evaluation.
4155
4156- `metadata: Metadata or null`
4157
4158 Set of 16 key-value pairs that can be attached to an object. This can be
4159 useful for storing additional information about the object in a structured
4160 format, and querying for objects via API or the dashboard.
4161
4162 Keys are strings with a maximum length of 64 characters. Values are strings
4163 with a maximum length of 512 characters.
4164
4165- `model: string`
4166
4167 The model that is evaluated, if applicable.
4168
4169- `name: string`
4170
4171 The name of the evaluation run.
4172
4173- `object: "eval.run"`
4174
4175 The type of the object. Always "eval.run".
4176
4177 - `"eval.run"`
4178
4179- `per_model_usage: array of object { cached_tokens, completion_tokens, invocation_count, 3 more }`
4180
4181 Usage statistics for each model during the evaluation run.
4182
4183 - `cached_tokens: number`
4184
4185 The number of tokens retrieved from cache.
4186
4187 - `completion_tokens: number`
4188
4189 The number of completion tokens generated.
4190
4191 - `invocation_count: number`
4192
4193 The number of invocations.
4194
4195 - `model_name: string`
4196
4197 The name of the model.
4198
4199 - `prompt_tokens: number`
4200
4201 The number of prompt tokens used.
4202
4203 - `total_tokens: number`
4204
4205 The total number of tokens used.
4206
4207- `per_testing_criteria_results: array of object { failed, passed, testing_criteria }`
4208
4209 Results per testing criteria applied during the evaluation run.
4210
4211 - `failed: number`
4212
4213 Number of tests failed for this criteria.
4214
4215 - `passed: number`
4216
4217 Number of tests passed for this criteria.
4218
4219 - `testing_criteria: string`
4220
4221 A description of the testing criteria.
4222
4223- `report_url: string`
4224
4225 The URL to the rendered evaluation run report on the UI dashboard.
4226
4227- `result_counts: object { errored, failed, passed, total }`
4228
4229 Counters summarizing the outcomes of the evaluation run.
4230
4231 - `errored: number`
4232
4233 Number of output items that resulted in an error.
4234
4235 - `failed: number`
4236
4237 Number of output items that failed to pass the evaluation.
4238
4239 - `passed: number`
4240
4241 Number of output items that passed the evaluation.
4242
4243 - `total: number`
4244
4245 Total number of executed output items.
4246
4247- `status: string`
4248
4249 The status of the evaluation run.
4250
4251### Example
4252
4253```http
4254curl https://api.openai.com/v1/evals/$EVAL_ID/runs \
4255 -H 'Content-Type: application/json' \
4256 -H "Authorization: Bearer $OPENAI_API_KEY" \
4257 -d '{
4258 "data_source": {
4259 "source": {
4260 "content": [
4261 {
4262 "item": {
4263 "foo": "bar"
4264 }
4265 }
4266 ],
4267 "type": "file_content"
4268 },
4269 "type": "jsonl"
4270 }
4271 }'
4272```
4273
4274#### Response
4275
4276```json
4277{
4278 "id": "id",
4279 "created_at": 0,
4280 "data_source": {
4281 "source": {
4282 "content": [
4283 {
4284 "item": {
4285 "foo": "bar"
4286 },
4287 "sample": {
4288 "foo": "bar"
4289 }
4290 }
4291 ],
4292 "type": "file_content"
4293 },
4294 "type": "jsonl"
4295 },
4296 "error": {
4297 "code": "code",
4298 "message": "message"
4299 },
4300 "eval_id": "eval_id",
4301 "metadata": {
4302 "foo": "string"
4303 },
4304 "model": "model",
4305 "name": "name",
4306 "object": "eval.run",
4307 "per_model_usage": [
4308 {
4309 "cached_tokens": 0,
4310 "completion_tokens": 0,
4311 "invocation_count": 0,
4312 "model_name": "model_name",
4313 "prompt_tokens": 0,
4314 "total_tokens": 0
4315 }
4316 ],
4317 "per_testing_criteria_results": [
4318 {
4319 "failed": 0,
4320 "passed": 0,
4321 "testing_criteria": "testing_criteria"
4322 }
4323 ],
4324 "report_url": "https://example.com",
4325 "result_counts": {
4326 "errored": 0,
4327 "failed": 0,
4328 "passed": 0,
4329 "total": 0
4330 },
4331 "status": "status"
4332}
4333```
4334
4335### Example
4336
4337```http
4338curl https://api.openai.com/v1/evals/eval_67e579652b548190aaa83ada4b125f47/runs \
4339 -X POST \
4340 -H "Authorization: Bearer $OPENAI_API_KEY" \
4341 -H "Content-Type: application/json" \
4342 -d '{"name":"gpt-6-astra","data_source":{"type":"completions","input_messages":{"type":"template","template":[{"role":"developer","content":"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\" \n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\" \n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\" \n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\" \n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\" \n**Output**: \"Sports\" \n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n"} , {"role":"user","content":"{{item.input}}"}]} ,"sampling_params":{"max_completions_tokens":2048},"model":"gpt-6-astra","source":{"type":"file_content","content":[{"item":{"input":"Tech Company Launches Advanced Artificial Intelligence Platform","ground_truth":"Technology"}}]}}}'
4343```
4344
4345#### Response
4346
4347```json
4348{
4349 "object": "eval.run",
4350 "id": "evalrun_67e57965b480819094274e3a32235e4c",
4351 "eval_id": "eval_67e579652b548190aaa83ada4b125f47",
4352 "report_url": "https://platform.openai.com/evaluations/eval_67e579652b548190aaa83ada4b125f47&run_id=evalrun_67e57965b480819094274e3a32235e4c",
4353 "status": "queued",
4354 "model": "gpt-6-astra",
4355 "name": "gpt-6-astra",
4356 "created_at": 1743092069,
4357 "result_counts": {
4358 "total": 0,
4359 "errored": 0,
4360 "failed": 0,
4361 "passed": 0
4362 },
4363 "per_model_usage": null,
4364 "per_testing_criteria_results": null,
4365 "data_source": {
4366 "type": "completions",
4367 "source": {
4368 "type": "file_content",
4369 "content": [
4370 {
4371 "item": {
4372 "input": "Tech Company Launches Advanced Artificial Intelligence Platform",
4373 "ground_truth": "Technology"
4374 }
4375 }
4376 ]
4377 },
4378 "input_messages": {
4379 "type": "template",
4380 "template": [
4381 {
4382 "type": "message",
4383 "role": "developer",
4384 "content": {
4385 "type": "input_text",
4386 "text": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\" \n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\" \n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\" \n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\" \n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\" \n**Output**: \"Sports\" \n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n"
4387 }
4388 },
4389 {
4390 "type": "message",
4391 "role": "user",
4392 "content": {
4393 "type": "input_text",
4394 "text": "{{item.input}}"
4395 }
4396 }
4397 ]
4398 },
4399 "model": "gpt-6-astra",
4400 "sampling_params": {
4401 "max_completions_tokens": 2048
4402 }
4403 },
4404 "error": null,
4405 "metadata": {}
4406}
4407```