github.com/instill-ai/component@v0.16.0-beta/pkg/connector/openai/v0/config/openai.json (about)

     1  {
     2    "components": {
     3      "schemas": {
     4        "AssistantFileObject": {
     5          "description": "A list of [Files](/docs/api-reference/files) attached to an `assistant`.",
     6          "properties": {
     7            "assistant_id": {
     8              "description": "The assistant ID that the file is attached to.",
     9              "type": "string"
    10            },
    11            "created_at": {
    12              "description": "The Unix timestamp (in seconds) for when the assistant file was created.",
    13              "type": "integer"
    14            },
    15            "id": {
    16              "description": "The identifier, which can be referenced in API endpoints.",
    17              "type": "string"
    18            },
    19            "object": {
    20              "description": "The object type, which is always `assistant.file`.",
    21              "enum": [
    22                "assistant.file"
    23              ],
    24              "type": "string"
    25            }
    26          },
    27          "required": [
    28            "id",
    29            "object",
    30            "created_at",
    31            "assistant_id"
    32          ],
    33          "title": "Assistant files",
    34          "type": "object",
    35          "x-oaiMeta": {
    36            "beta": true,
    37            "example": "{\n  \"id\": \"file-abc123\",\n  \"object\": \"assistant.file\",\n  \"created_at\": 1699055364,\n  \"assistant_id\": \"asst_abc123\"\n}\n",
    38            "name": "The assistant file object"
    39          }
    40        },
    41        "AssistantObject": {
    42          "description": "Represents an `assistant` that can call the model and use tools.",
    43          "properties": {
    44            "created_at": {
    45              "description": "The Unix timestamp (in seconds) for when the assistant was created.",
    46              "type": "integer"
    47            },
    48            "description": {
    49              "description": "The description of the assistant. The maximum length is 512 characters.\n",
    50              "maxLength": 512,
    51              "nullable": true,
    52              "type": "string"
    53            },
    54            "file_ids": {
    55              "default": [],
    56              "description": "A list of [file](/docs/api-reference/files) IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order.\n",
    57              "items": {
    58                "type": "string"
    59              },
    60              "maxItems": 20,
    61              "type": "array"
    62            },
    63            "id": {
    64              "description": "The identifier, which can be referenced in API endpoints.",
    65              "type": "string"
    66            },
    67            "instructions": {
    68              "description": "The system instructions that the assistant uses. The maximum length is 32768 characters.\n",
    69              "maxLength": 32768,
    70              "nullable": true,
    71              "type": "string"
    72            },
    73            "metadata": {
    74              "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.\n",
    75              "nullable": true,
    76              "type": "object",
    77              "x-oaiTypeLabel": "map"
    78            },
    79            "model": {
    80              "description": "ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.\n",
    81              "type": "string"
    82            },
    83            "name": {
    84              "description": "The name of the assistant. The maximum length is 256 characters.\n",
    85              "maxLength": 256,
    86              "nullable": true,
    87              "type": "string"
    88            },
    89            "object": {
    90              "description": "The object type, which is always `assistant`.",
    91              "enum": [
    92                "assistant"
    93              ],
    94              "type": "string"
    95            },
    96            "tools": {
    97              "default": [],
    98              "description": "A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`.\n",
    99              "items": {
   100                "oneOf": [
   101                  {
   102                    "$ref": "#/components/schemas/AssistantToolsCode"
   103                  },
   104                  {
   105                    "$ref": "#/components/schemas/AssistantToolsRetrieval"
   106                  },
   107                  {
   108                    "$ref": "#/components/schemas/AssistantToolsFunction"
   109                  }
   110                ],
   111                "x-oaiExpandable": true
   112              },
   113              "maxItems": 128,
   114              "type": "array"
   115            }
   116          },
   117          "required": [
   118            "id",
   119            "object",
   120            "created_at",
   121            "name",
   122            "description",
   123            "model",
   124            "instructions",
   125            "tools",
   126            "file_ids",
   127            "metadata"
   128          ],
   129          "title": "Assistant",
   130          "type": "object",
   131          "x-oaiMeta": {
   132            "beta": true,
   133            "example": "{\n  \"id\": \"asst_abc123\",\n  \"object\": \"assistant\",\n  \"created_at\": 1698984975,\n  \"name\": \"Math Tutor\",\n  \"description\": null,\n  \"model\": \"gpt-4\",\n  \"instructions\": \"You are a personal math tutor. When asked a question, write and run Python code to answer the question.\",\n  \"tools\": [\n    {\n      \"type\": \"code_interpreter\"\n    }\n  ],\n  \"file_ids\": [],\n  \"metadata\": {}\n}\n",
   134            "name": "The assistant object"
   135          }
   136        },
   137        "AssistantToolsCode": {
   138          "properties": {
   139            "type": {
   140              "description": "The type of tool being defined: `code_interpreter`",
   141              "enum": [
   142                "code_interpreter"
   143              ],
   144              "type": "string"
   145            }
   146          },
   147          "required": [
   148            "type"
   149          ],
   150          "title": "Code interpreter tool",
   151          "type": "object"
   152        },
   153        "AssistantToolsFunction": {
   154          "properties": {
   155            "function": {
   156              "$ref": "#/components/schemas/FunctionObject"
   157            },
   158            "type": {
   159              "description": "The type of tool being defined: `function`",
   160              "enum": [
   161                "function"
   162              ],
   163              "type": "string"
   164            }
   165          },
   166          "required": [
   167            "type",
   168            "function"
   169          ],
   170          "title": "Function tool",
   171          "type": "object"
   172        },
   173        "AssistantToolsRetrieval": {
   174          "properties": {
   175            "type": {
   176              "description": "The type of tool being defined: `retrieval`",
   177              "enum": [
   178                "retrieval"
   179              ],
   180              "type": "string"
   181            }
   182          },
   183          "required": [
   184            "type"
   185          ],
   186          "title": "Retrieval tool",
   187          "type": "object"
   188        },
   189        "ChatCompletionFunctionCallOption": {
   190          "description": "Specifying a particular function via `{\"name\": \"my_function\"}` forces the model to call that function.\n",
   191          "properties": {
   192            "name": {
   193              "description": "The name of the function to call.",
   194              "type": "string"
   195            }
   196          },
   197          "required": [
   198            "name"
   199          ],
   200          "type": "object"
   201        },
   202        "ChatCompletionFunctions": {
   203          "deprecated": true,
   204          "properties": {
   205            "description": {
   206              "description": "A description of what the function does, used by the model to choose when and how to call the function.",
   207              "type": "string"
   208            },
   209            "name": {
   210              "description": "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.",
   211              "type": "string"
   212            },
   213            "parameters": {
   214              "$ref": "#/components/schemas/FunctionParameters"
   215            }
   216          },
   217          "required": [
   218            "name"
   219          ],
   220          "type": "object"
   221        },
   222        "ChatCompletionMessageToolCall": {
   223          "properties": {
   224            "function": {
   225              "description": "The function that the model called.",
   226              "properties": {
   227                "arguments": {
   228                  "description": "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.",
   229                  "type": "string"
   230                },
   231                "name": {
   232                  "description": "The name of the function to call.",
   233                  "type": "string"
   234                }
   235              },
   236              "required": [
   237                "name",
   238                "arguments"
   239              ],
   240              "type": "object"
   241            },
   242            "id": {
   243              "description": "The ID of the tool call.",
   244              "type": "string"
   245            },
   246            "type": {
   247              "description": "The type of the tool. Currently, only `function` is supported.",
   248              "enum": [
   249                "function"
   250              ],
   251              "type": "string"
   252            }
   253          },
   254          "required": [
   255            "id",
   256            "type",
   257            "function"
   258          ],
   259          "type": "object"
   260        },
   261        "ChatCompletionMessageToolCallChunk": {
   262          "properties": {
   263            "function": {
   264              "properties": {
   265                "arguments": {
   266                  "description": "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.",
   267                  "type": "string"
   268                },
   269                "name": {
   270                  "description": "The name of the function to call.",
   271                  "type": "string"
   272                }
   273              },
   274              "type": "object"
   275            },
   276            "id": {
   277              "description": "The ID of the tool call.",
   278              "type": "string"
   279            },
   280            "index": {
   281              "type": "integer"
   282            },
   283            "type": {
   284              "description": "The type of the tool. Currently, only `function` is supported.",
   285              "enum": [
   286                "function"
   287              ],
   288              "type": "string"
   289            }
   290          },
   291          "required": [
   292            "index"
   293          ],
   294          "type": "object"
   295        },
   296        "ChatCompletionMessageToolCalls": {
   297          "description": "The tool calls generated by the model, such as function calls.",
   298          "items": {
   299            "$ref": "#/components/schemas/ChatCompletionMessageToolCall"
   300          },
   301          "type": "array"
   302        },
   303        "ChatCompletionNamedToolChoice": {
   304          "description": "Specifies a tool the model should use. Use to force the model to call a specific function.",
   305          "properties": {
   306            "function": {
   307              "properties": {
   308                "name": {
   309                  "description": "The name of the function to call.",
   310                  "type": "string"
   311                }
   312              },
   313              "required": [
   314                "name"
   315              ],
   316              "type": "object"
   317            },
   318            "type": {
   319              "description": "The type of the tool. Currently, only `function` is supported.",
   320              "enum": [
   321                "function"
   322              ],
   323              "type": "string"
   324            }
   325          },
   326          "required": [
   327            "type",
   328            "function"
   329          ],
   330          "type": "object"
   331        },
   332        "ChatCompletionRequestAssistantMessage": {
   333          "properties": {
   334            "content": {
   335              "description": "The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.\n",
   336              "nullable": true,
   337              "type": "string"
   338            },
   339            "function_call": {
   340              "deprecated": true,
   341              "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.",
   342              "properties": {
   343                "arguments": {
   344                  "description": "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.",
   345                  "type": "string"
   346                },
   347                "name": {
   348                  "description": "The name of the function to call.",
   349                  "type": "string"
   350                }
   351              },
   352              "required": [
   353                "arguments",
   354                "name"
   355              ],
   356              "type": "object"
   357            },
   358            "name": {
   359              "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.",
   360              "type": "string"
   361            },
   362            "role": {
   363              "description": "The role of the messages author, in this case `assistant`.",
   364              "enum": [
   365                "assistant"
   366              ],
   367              "type": "string"
   368            },
   369            "tool_calls": {
   370              "$ref": "#/components/schemas/ChatCompletionMessageToolCalls"
   371            }
   372          },
   373          "required": [
   374            "role"
   375          ],
   376          "title": "Assistant message",
   377          "type": "object"
   378        },
   379        "ChatCompletionRequestFunctionMessage": {
   380          "deprecated": true,
   381          "properties": {
   382            "content": {
   383              "description": "The contents of the function message.",
   384              "nullable": true,
   385              "type": "string"
   386            },
   387            "name": {
   388              "description": "The name of the function to call.",
   389              "type": "string"
   390            },
   391            "role": {
   392              "description": "The role of the messages author, in this case `function`.",
   393              "enum": [
   394                "function"
   395              ],
   396              "type": "string"
   397            }
   398          },
   399          "required": [
   400            "role",
   401            "content",
   402            "name"
   403          ],
   404          "title": "Function message",
   405          "type": "object"
   406        },
   407        "ChatCompletionRequestMessage": {
   408          "oneOf": [
   409            {
   410              "$ref": "#/components/schemas/ChatCompletionRequestSystemMessage"
   411            },
   412            {
   413              "$ref": "#/components/schemas/ChatCompletionRequestUserMessage"
   414            },
   415            {
   416              "$ref": "#/components/schemas/ChatCompletionRequestAssistantMessage"
   417            },
   418            {
   419              "$ref": "#/components/schemas/ChatCompletionRequestToolMessage"
   420            },
   421            {
   422              "$ref": "#/components/schemas/ChatCompletionRequestFunctionMessage"
   423            }
   424          ],
   425          "x-oaiExpandable": true
   426        },
   427        "ChatCompletionRequestMessageContentPart": {
   428          "oneOf": [
   429            {
   430              "$ref": "#/components/schemas/ChatCompletionRequestMessageContentPartText"
   431            },
   432            {
   433              "$ref": "#/components/schemas/ChatCompletionRequestMessageContentPartImage"
   434            }
   435          ],
   436          "x-oaiExpandable": true
   437        },
   438        "ChatCompletionRequestMessageContentPartImage": {
   439          "properties": {
   440            "image_url": {
   441              "properties": {
   442                "detail": {
   443                  "default": "auto",
   444                  "description": "Specifies the detail level of the image. Learn more in the [Vision guide](/docs/guides/vision/low-or-high-fidelity-image-understanding).",
   445                  "enum": [
   446                    "auto",
   447                    "low",
   448                    "high"
   449                  ],
   450                  "type": "string"
   451                },
   452                "url": {
   453                  "description": "Either a URL of the image or the base64 encoded image data.",
   454                  "format": "uri",
   455                  "type": "string"
   456                }
   457              },
   458              "required": [
   459                "url"
   460              ],
   461              "type": "object"
   462            },
   463            "type": {
   464              "description": "The type of the content part.",
   465              "enum": [
   466                "image_url"
   467              ],
   468              "type": "string"
   469            }
   470          },
   471          "required": [
   472            "type",
   473            "image_url"
   474          ],
   475          "title": "Image content part",
   476          "type": "object"
   477        },
   478        "ChatCompletionRequestMessageContentPartText": {
   479          "properties": {
   480            "text": {
   481              "description": "The text content.",
   482              "type": "string"
   483            },
   484            "type": {
   485              "description": "The type of the content part.",
   486              "enum": [
   487                "text"
   488              ],
   489              "type": "string"
   490            }
   491          },
   492          "required": [
   493            "type",
   494            "text"
   495          ],
   496          "title": "Text content part",
   497          "type": "object"
   498        },
   499        "ChatCompletionRequestSystemMessage": {
   500          "properties": {
   501            "content": {
   502              "description": "The contents of the system message.",
   503              "type": "string"
   504            },
   505            "name": {
   506              "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.",
   507              "type": "string"
   508            },
   509            "role": {
   510              "description": "The role of the messages author, in this case `system`.",
   511              "enum": [
   512                "system"
   513              ],
   514              "type": "string"
   515            }
   516          },
   517          "required": [
   518            "content",
   519            "role"
   520          ],
   521          "title": "System message",
   522          "type": "object"
   523        },
   524        "ChatCompletionRequestToolMessage": {
   525          "properties": {
   526            "content": {
   527              "description": "The contents of the tool message.",
   528              "type": "string"
   529            },
   530            "role": {
   531              "description": "The role of the messages author, in this case `tool`.",
   532              "enum": [
   533                "tool"
   534              ],
   535              "type": "string"
   536            },
   537            "tool_call_id": {
   538              "description": "Tool call that this message is responding to.",
   539              "type": "string"
   540            }
   541          },
   542          "required": [
   543            "role",
   544            "content",
   545            "tool_call_id"
   546          ],
   547          "title": "Tool message",
   548          "type": "object"
   549        },
   550        "ChatCompletionRequestUserMessage": {
   551          "properties": {
   552            "content": {
   553              "description": "The contents of the user message.\n",
   554              "oneOf": [
   555                {
   556                  "description": "The text contents of the message.",
   557                  "title": "Text content",
   558                  "type": "string"
   559                },
   560                {
   561                  "description": "An array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts. Image input is only supported when using the `gpt-4-visual-preview` model.",
   562                  "items": {
   563                    "$ref": "#/components/schemas/ChatCompletionRequestMessageContentPart"
   564                  },
   565                  "minItems": 1,
   566                  "title": "Array of content parts",
   567                  "type": "array"
   568                }
   569              ],
   570              "x-oaiExpandable": true
   571            },
   572            "name": {
   573              "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.",
   574              "type": "string"
   575            },
   576            "role": {
   577              "description": "The role of the messages author, in this case `user`.",
   578              "enum": [
   579                "user"
   580              ],
   581              "type": "string"
   582            }
   583          },
   584          "required": [
   585            "content",
   586            "role"
   587          ],
   588          "title": "User message",
   589          "type": "object"
   590        },
   591        "ChatCompletionResponseMessage": {
   592          "description": "A chat completion message generated by the model.",
   593          "properties": {
   594            "content": {
   595              "description": "The contents of the message.",
   596              "nullable": true,
   597              "type": "string"
   598            },
   599            "function_call": {
   600              "deprecated": true,
   601              "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.",
   602              "properties": {
   603                "arguments": {
   604                  "description": "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.",
   605                  "type": "string"
   606                },
   607                "name": {
   608                  "description": "The name of the function to call.",
   609                  "type": "string"
   610                }
   611              },
   612              "required": [
   613                "name",
   614                "arguments"
   615              ],
   616              "type": "object"
   617            },
   618            "role": {
   619              "description": "The role of the author of this message.",
   620              "enum": [
   621                "assistant"
   622              ],
   623              "type": "string"
   624            },
   625            "tool_calls": {
   626              "$ref": "#/components/schemas/ChatCompletionMessageToolCalls"
   627            }
   628          },
   629          "required": [
   630            "role",
   631            "content"
   632          ],
   633          "type": "object"
   634        },
   635        "ChatCompletionRole": {
   636          "description": "The role of the author of a message",
   637          "enum": [
   638            "system",
   639            "user",
   640            "assistant",
   641            "tool",
   642            "function"
   643          ],
   644          "type": "string"
   645        },
   646        "ChatCompletionStreamResponseDelta": {
   647          "description": "A chat completion delta generated by streamed model responses.",
   648          "properties": {
   649            "content": {
   650              "description": "The contents of the chunk message.",
   651              "nullable": true,
   652              "type": "string"
   653            },
   654            "function_call": {
   655              "deprecated": true,
   656              "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.",
   657              "properties": {
   658                "arguments": {
   659                  "description": "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.",
   660                  "type": "string"
   661                },
   662                "name": {
   663                  "description": "The name of the function to call.",
   664                  "type": "string"
   665                }
   666              },
   667              "type": "object"
   668            },
   669            "role": {
   670              "description": "The role of the author of this message.",
   671              "enum": [
   672                "system",
   673                "user",
   674                "assistant",
   675                "tool"
   676              ],
   677              "type": "string"
   678            },
   679            "tool_calls": {
   680              "items": {
   681                "$ref": "#/components/schemas/ChatCompletionMessageToolCallChunk"
   682              },
   683              "type": "array"
   684            }
   685          },
   686          "type": "object"
   687        },
   688        "ChatCompletionTokenLogprob": {
   689          "properties": {
   690            "bytes": {
   691              "description": "A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.",
   692              "items": {
   693                "type": "integer"
   694              },
   695              "nullable": true,
   696              "type": "array"
   697            },
   698            "logprob": {
   699              "description": "The log probability of this token.",
   700              "type": "number"
   701            },
   702            "token": {
   703              "description": "The token.",
   704              "type": "string"
   705            },
   706            "top_logprobs": {
   707              "description": "List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned.",
   708              "items": {
   709                "properties": {
   710                  "bytes": {
   711                    "description": "A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.",
   712                    "items": {
   713                      "type": "integer"
   714                    },
   715                    "nullable": true,
   716                    "type": "array"
   717                  },
   718                  "logprob": {
   719                    "description": "The log probability of this token.",
   720                    "type": "number"
   721                  },
   722                  "token": {
   723                    "description": "The token.",
   724                    "type": "string"
   725                  }
   726                },
   727                "required": [
   728                  "token",
   729                  "logprob",
   730                  "bytes"
   731                ],
   732                "type": "object"
   733              },
   734              "type": "array"
   735            }
   736          },
   737          "required": [
   738            "token",
   739            "logprob",
   740            "bytes",
   741            "top_logprobs"
   742          ],
   743          "type": "object"
   744        },
   745        "ChatCompletionTool": {
   746          "properties": {
   747            "function": {
   748              "$ref": "#/components/schemas/FunctionObject"
   749            },
   750            "type": {
   751              "description": "The type of the tool. Currently, only `function` is supported.",
   752              "enum": [
   753                "function"
   754              ],
   755              "type": "string"
   756            }
   757          },
   758          "required": [
   759            "type",
   760            "function"
   761          ],
   762          "type": "object"
   763        },
   764        "ChatCompletionToolChoiceOption": {
   765          "description": "Controls which (if any) function is called by the model.\n`none` means the model will not call a function and instead generates a message.\n`auto` means the model can pick between generating a message or calling a function.\nSpecifying a particular function via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that function.\n\n`none` is the default when no functions are present. `auto` is the default if functions are present.\n",
   766          "oneOf": [
   767            {
   768              "description": "`none` means the model will not call a function and instead generates a message. `auto` means the model can pick between generating a message or calling a function.\n",
   769              "enum": [
   770                "none",
   771                "auto"
   772              ],
   773              "type": "string"
   774            },
   775            {
   776              "$ref": "#/components/schemas/ChatCompletionNamedToolChoice"
   777            }
   778          ],
   779          "x-oaiExpandable": true
   780        },
   781        "CompletionUsage": {
   782          "description": "Usage statistics for the completion request.",
   783          "properties": {
   784            "completion_tokens": {
   785              "description": "Number of tokens in the generated completion.",
   786              "type": "integer"
   787            },
   788            "prompt_tokens": {
   789              "description": "Number of tokens in the prompt.",
   790              "type": "integer"
   791            },
   792            "total_tokens": {
   793              "description": "Total number of tokens used in the request (prompt + completion).",
   794              "type": "integer"
   795            }
   796          },
   797          "required": [
   798            "prompt_tokens",
   799            "completion_tokens",
   800            "total_tokens"
   801          ],
   802          "type": "object"
   803        },
   804        "CreateAssistantFileRequest": {
   805          "additionalProperties": false,
   806          "properties": {
   807            "file_id": {
   808              "description": "A [File](/docs/api-reference/files) ID (with `purpose=\"assistants\"`) that the assistant should use. Useful for tools like `retrieval` and `code_interpreter` that can access files.",
   809              "type": "string"
   810            }
   811          },
   812          "required": [
   813            "file_id"
   814          ],
   815          "type": "object"
   816        },
   817        "CreateAssistantRequest": {
   818          "additionalProperties": false,
   819          "properties": {
   820            "description": {
   821              "description": "The description of the assistant. The maximum length is 512 characters.\n",
   822              "maxLength": 512,
   823              "nullable": true,
   824              "type": "string"
   825            },
   826            "file_ids": {
   827              "default": [],
   828              "description": "A list of [file](/docs/api-reference/files) IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order.\n",
   829              "items": {
   830                "type": "string"
   831              },
   832              "maxItems": 20,
   833              "type": "array"
   834            },
   835            "instructions": {
   836              "description": "The system instructions that the assistant uses. The maximum length is 32768 characters.\n",
   837              "maxLength": 32768,
   838              "nullable": true,
   839              "type": "string"
   840            },
   841            "metadata": {
   842              "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.\n",
   843              "nullable": true,
   844              "type": "object",
   845              "x-oaiTypeLabel": "map"
   846            },
   847            "model": {
   848              "anyOf": [
   849                {
   850                  "type": "string"
   851                }
   852              ],
   853              "description": "ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.\n"
   854            },
   855            "name": {
   856              "description": "The name of the assistant. The maximum length is 256 characters.\n",
   857              "maxLength": 256,
   858              "nullable": true,
   859              "type": "string"
   860            },
   861            "tools": {
   862              "default": [],
   863              "description": "A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`.\n",
   864              "items": {
   865                "oneOf": [
   866                  {
   867                    "$ref": "#/components/schemas/AssistantToolsCode"
   868                  },
   869                  {
   870                    "$ref": "#/components/schemas/AssistantToolsRetrieval"
   871                  },
   872                  {
   873                    "$ref": "#/components/schemas/AssistantToolsFunction"
   874                  }
   875                ],
   876                "x-oaiExpandable": true
   877              },
   878              "maxItems": 128,
   879              "type": "array"
   880            }
   881          },
   882          "required": [
   883            "model"
   884          ],
   885          "type": "object"
   886        },
   887        "CreateChatCompletionFunctionResponse": {
   888          "description": "Represents a chat completion response returned by model, based on the provided input.",
   889          "properties": {
   890            "choices": {
   891              "description": "A list of chat completion choices. Can be more than one if `n` is greater than 1.",
   892              "items": {
   893                "properties": {
   894                  "finish_reason": {
   895                    "description": "The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, or `function_call` if the model called a function.\n",
   896                    "enum": [
   897                      "stop",
   898                      "length",
   899                      "function_call",
   900                      "content_filter"
   901                    ],
   902                    "type": "string"
   903                  },
   904                  "index": {
   905                    "description": "The index of the choice in the list of choices.",
   906                    "type": "integer"
   907                  },
   908                  "message": {
   909                    "$ref": "#/components/schemas/ChatCompletionResponseMessage"
   910                  }
   911                },
   912                "required": [
   913                  "finish_reason",
   914                  "index",
   915                  "message",
   916                  "logprobs"
   917                ],
   918                "type": "object"
   919              },
   920              "type": "array"
   921            },
   922            "created": {
   923              "description": "The Unix timestamp (in seconds) of when the chat completion was created.",
   924              "type": "integer"
   925            },
   926            "id": {
   927              "description": "A unique identifier for the chat completion.",
   928              "type": "string"
   929            },
   930            "model": {
   931              "description": "The model used for the chat completion.",
   932              "type": "string"
   933            },
   934            "object": {
   935              "description": "The object type, which is always `chat.completion`.",
   936              "enum": [
   937                "chat.completion"
   938              ],
   939              "type": "string"
   940            },
   941            "system_fingerprint": {
   942              "description": "This fingerprint represents the backend configuration that the model runs with.\n\nCan be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.\n",
   943              "type": "string"
   944            },
   945            "usage": {
   946              "$ref": "#/components/schemas/CompletionUsage"
   947            }
   948          },
   949          "required": [
   950            "choices",
   951            "created",
   952            "id",
   953            "model",
   954            "object"
   955          ],
   956          "type": "object",
   957          "x-oaiMeta": {
   958            "example": "{\n  \"id\": \"chatcmpl-abc123\",\n  \"object\": \"chat.completion\",\n  \"created\": 1699896916,\n  \"model\": \"gpt-3.5-turbo-0613\",\n  \"choices\": [\n    {\n      \"index\": 0,\n      \"message\": {\n        \"role\": \"assistant\",\n        \"content\": null,\n        \"tool_calls\": [\n          {\n            \"id\": \"call_abc123\",\n            \"type\": \"function\",\n            \"function\": {\n              \"name\": \"get_current_weather\",\n              \"arguments\": \"{\\n\\\"location\\\": \\\"Boston, MA\\\"\\n}\"\n            }\n          }\n        ]\n      },\n      \"logprobs\": null,\n      \"finish_reason\": \"tool_calls\"\n    }\n  ],\n  \"usage\": {\n    \"prompt_tokens\": 82,\n    \"completion_tokens\": 17,\n    \"total_tokens\": 99\n  }\n}\n",
   959            "group": "chat",
   960            "name": "The chat completion object"
   961          }
   962        },
   963        "CreateChatCompletionImageResponse": {
   964          "description": "Represents a streamed chunk of a chat completion response returned by model, based on the provided input.",
   965          "type": "object",
   966          "x-oaiMeta": {
   967            "example": "{\n  \"id\": \"chatcmpl-123\",\n  \"object\": \"chat.completion\",\n  \"created\": 1677652288,\n  \"model\": \"gpt-3.5-turbo-0613\",\n  \"system_fingerprint\": \"fp_44709d6fcb\",\n  \"choices\": [{\n    \"index\": 0,\n    \"message\": {\n      \"role\": \"assistant\",\n      \"content\": \"\\n\\nHello there, how may I assist you today?\",\n    },\n    \"logprobs\": null,\n    \"finish_reason\": \"stop\"\n  }],\n  \"usage\": {\n    \"prompt_tokens\": 9,\n    \"completion_tokens\": 12,\n    \"total_tokens\": 21\n  }\n}\n",
   968            "group": "chat",
   969            "name": "The chat completion chunk object"
   970          }
   971        },
   972        "CreateChatCompletionRequest": {
   973          "properties": {
   974            "frequency_penalty": {
   975              "default": 0,
   976              "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.\n\n[See more information about frequency and presence penalties.](/docs/guides/text-generation/parameter-details)\n",
   977              "maximum": 2,
   978              "minimum": -2,
   979              "nullable": true,
   980              "type": "number"
   981            },
   982            "function_call": {
   983              "deprecated": true,
   984              "description": "Deprecated in favor of `tool_choice`.\n\nControls which (if any) function is called by the model.\n`none` means the model will not call a function and instead generates a message.\n`auto` means the model can pick between generating a message or calling a function.\nSpecifying a particular function via `{\"name\": \"my_function\"}` forces the model to call that function.\n\n`none` is the default when no functions are present. `auto` is the default if functions are present.\n",
   985              "oneOf": [
   986                {
   987                  "description": "`none` means the model will not call a function and instead generates a message. `auto` means the model can pick between generating a message or calling a function.\n",
   988                  "enum": [
   989                    "none",
   990                    "auto"
   991                  ],
   992                  "type": "string"
   993                },
   994                {
   995                  "$ref": "#/components/schemas/ChatCompletionFunctionCallOption"
   996                }
   997              ],
   998              "x-oaiExpandable": true
   999            },
  1000            "functions": {
  1001              "deprecated": true,
  1002              "description": "Deprecated in favor of `tools`.\n\nA list of functions the model may generate JSON inputs for.\n",
  1003              "items": {
  1004                "$ref": "#/components/schemas/ChatCompletionFunctions"
  1005              },
  1006              "maxItems": 128,
  1007              "minItems": 1,
  1008              "type": "array"
  1009            },
  1010            "logit_bias": {
  1011              "additionalProperties": {
  1012                "type": "integer"
  1013              },
  1014              "default": null,
  1015              "description": "Modify the likelihood of specified tokens appearing in the completion.\n\nAccepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.\n",
  1016              "nullable": true,
  1017              "type": "object",
  1018              "x-oaiTypeLabel": "map"
  1019            },
  1020            "logprobs": {
  1021              "default": false,
  1022              "description": "Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`. This option is currently not available on the `gpt-4-vision-preview` model.",
  1023              "nullable": true,
  1024              "type": "boolean"
  1025            },
  1026            "max_tokens": {
  1027              "description": "The maximum number of [tokens](/tokenizer) that can be generated in the chat completion.\n\nThe total length of input tokens and generated tokens is limited by the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.\n",
  1028              "nullable": true,
  1029              "type": "integer"
  1030            },
  1031            "messages": {
  1032              "description": "A list of messages comprising the conversation so far. [Example Python code](https://cookbook.openai.com/examples/how_to_format_inputs_to_chatgpt_models).",
  1033              "items": {
  1034                "$ref": "#/components/schemas/ChatCompletionRequestMessage"
  1035              },
  1036              "minItems": 1,
  1037              "type": "array"
  1038            },
  1039            "model": {
  1040              "description": "ID of the model to use. See the [model endpoint compatibility](/docs/models/model-endpoint-compatibility) table for details on which models work with the Chat API.",
  1041              "enum": [
  1042                "gpt-4-0125-preview",
  1043                "gpt-4-turbo-preview",
  1044                "gpt-4-1106-preview",
  1045                "gpt-4-vision-preview",
  1046                "gpt-4",
  1047                "gpt-4-0314",
  1048                "gpt-4-0613",
  1049                "gpt-4-32k",
  1050                "gpt-4-32k-0314",
  1051                "gpt-4-32k-0613",
  1052                "gpt-3.5-turbo",
  1053                "gpt-3.5-turbo-16k",
  1054                "gpt-3.5-turbo-0301",
  1055                "gpt-3.5-turbo-0613",
  1056                "gpt-3.5-turbo-1106",
  1057                "gpt-3.5-turbo-16k-0613"
  1058              ],
  1059              "example": "gpt-3.5-turbo",
  1060              "type": "string",
  1061              "x-oaiTypeLabel": "string"
  1062            },
  1063            "n": {
  1064              "default": 1,
  1065              "description": "How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs.",
  1066              "example": 1,
  1067              "maximum": 128,
  1068              "minimum": 1,
  1069              "nullable": true,
  1070              "type": "integer"
  1071            },
  1072            "presence_penalty": {
  1073              "default": 0,
  1074              "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.\n\n[See more information about frequency and presence penalties.](/docs/guides/text-generation/parameter-details)\n",
  1075              "maximum": 2,
  1076              "minimum": -2,
  1077              "nullable": true,
  1078              "type": "number"
  1079            },
  1080            "response_format": {
  1081              "description": "An object specifying the format that the model must output. Compatible with [GPT-4 Turbo](/docs/models/gpt-4-and-gpt-4-turbo) and `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n",
  1082              "properties": {
  1083                "type": {
  1084                  "default": "text",
  1085                  "description": "Must be one of `text` or `json_object`.",
  1086                  "enum": [
  1087                    "text",
  1088                    "json_object"
  1089                  ],
  1090                  "example": "json_object",
  1091                  "type": "string"
  1092                }
  1093              },
  1094              "type": "object"
  1095            },
  1096            "seed": {
  1097              "description": "This feature is in Beta.\nIf specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\nDeterminism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.\n",
  1098              "maximum": 9223372036854776000,
  1099              "minimum": -9223372036854776000,
  1100              "nullable": true,
  1101              "type": "integer",
  1102              "x-oaiMeta": {
  1103                "beta": true
  1104              }
  1105            },
  1106            "stop": {
  1107              "default": null,
  1108              "description": "Up to 4 sequences where the API will stop generating further tokens.\n",
  1109              "oneOf": [
  1110                {
  1111                  "nullable": true,
  1112                  "type": "string"
  1113                },
  1114                {
  1115                  "items": {
  1116                    "type": "string"
  1117                  },
  1118                  "maxItems": 4,
  1119                  "minItems": 1,
  1120                  "type": "array"
  1121                }
  1122              ]
  1123            },
  1124            "stream": {
  1125              "default": false,
  1126              "description": "If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).\n",
  1127              "nullable": true,
  1128              "type": "boolean"
  1129            },
  1130            "temperature": {
  1131              "default": 1,
  1132              "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.\n\nWe generally recommend altering this or `top_p` but not both.\n",
  1133              "example": 1,
  1134              "maximum": 2,
  1135              "minimum": 0,
  1136              "nullable": true,
  1137              "type": "number"
  1138            },
  1139            "tool_choice": {
  1140              "$ref": "#/components/schemas/ChatCompletionToolChoiceOption"
  1141            },
  1142            "tools": {
  1143              "description": "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.\n",
  1144              "items": {
  1145                "$ref": "#/components/schemas/ChatCompletionTool"
  1146              },
  1147              "type": "array"
  1148            },
  1149            "top_logprobs": {
  1150              "description": "An integer between 0 and 5 specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used.",
  1151              "maximum": 5,
  1152              "minimum": 0,
  1153              "nullable": true,
  1154              "type": "integer"
  1155            },
  1156            "top_p": {
  1157              "default": 1,
  1158              "description": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.\n\nWe generally recommend altering this or `temperature` but not both.\n",
  1159              "example": 1,
  1160              "maximum": 1,
  1161              "minimum": 0,
  1162              "nullable": true,
  1163              "type": "number"
  1164            },
  1165            "user": {
  1166              "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).\n",
  1167              "example": "user-1234",
  1168              "type": "string"
  1169            }
  1170          },
  1171          "required": [
  1172            "model",
  1173            "messages"
  1174          ],
  1175          "type": "object"
  1176        },
  1177        "CreateChatCompletionResponse": {
  1178          "description": "Represents a chat completion response returned by model, based on the provided input.",
  1179          "properties": {
  1180            "choices": {
  1181              "description": "A list of chat completion choices. Can be more than one if `n` is greater than 1.",
  1182              "items": {
  1183                "properties": {
  1184                  "finish_reason": {
  1185                    "description": "The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,\n`length` if the maximum number of tokens specified in the request was reached,\n`content_filter` if content was omitted due to a flag from our content filters,\n`tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.\n",
  1186                    "enum": [
  1187                      "stop",
  1188                      "length",
  1189                      "tool_calls",
  1190                      "content_filter",
  1191                      "function_call"
  1192                    ],
  1193                    "type": "string"
  1194                  },
  1195                  "index": {
  1196                    "description": "The index of the choice in the list of choices.",
  1197                    "type": "integer"
  1198                  },
  1199                  "logprobs": {
  1200                    "description": "Log probability information for the choice.",
  1201                    "nullable": true,
  1202                    "properties": {
  1203                      "content": {
  1204                        "description": "A list of message content tokens with log probability information.",
  1205                        "items": {
  1206                          "$ref": "#/components/schemas/ChatCompletionTokenLogprob"
  1207                        },
  1208                        "nullable": true,
  1209                        "type": "array"
  1210                      }
  1211                    },
  1212                    "required": [
  1213                      "content"
  1214                    ],
  1215                    "type": "object"
  1216                  },
  1217                  "message": {
  1218                    "$ref": "#/components/schemas/ChatCompletionResponseMessage"
  1219                  }
  1220                },
  1221                "required": [
  1222                  "finish_reason",
  1223                  "index",
  1224                  "message",
  1225                  "logprobs"
  1226                ],
  1227                "type": "object"
  1228              },
  1229              "type": "array"
  1230            },
  1231            "created": {
  1232              "description": "The Unix timestamp (in seconds) of when the chat completion was created.",
  1233              "type": "integer"
  1234            },
  1235            "id": {
  1236              "description": "A unique identifier for the chat completion.",
  1237              "type": "string"
  1238            },
  1239            "model": {
  1240              "description": "The model used for the chat completion.",
  1241              "type": "string"
  1242            },
  1243            "object": {
  1244              "description": "The object type, which is always `chat.completion`.",
  1245              "enum": [
  1246                "chat.completion"
  1247              ],
  1248              "type": "string"
  1249            },
  1250            "system_fingerprint": {
  1251              "description": "This fingerprint represents the backend configuration that the model runs with.\n\nCan be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.\n",
  1252              "type": "string"
  1253            },
  1254            "usage": {
  1255              "$ref": "#/components/schemas/CompletionUsage"
  1256            }
  1257          },
  1258          "required": [
  1259            "choices",
  1260            "created",
  1261            "id",
  1262            "model",
  1263            "object"
  1264          ],
  1265          "type": "object",
  1266          "x-oaiMeta": {
  1267            "example": "{\n  \"id\": \"chatcmpl-123\",\n  \"object\": \"chat.completion\",\n  \"created\": 1677652288,\n  \"model\": \"gpt-3.5-turbo-0613\",\n  \"system_fingerprint\": \"fp_44709d6fcb\",\n  \"choices\": [{\n    \"index\": 0,\n    \"message\": {\n      \"role\": \"assistant\",\n      \"content\": \"\\n\\nHello there, how may I assist you today?\",\n    },\n    \"logprobs\": null,\n    \"finish_reason\": \"stop\"\n  }],\n  \"usage\": {\n    \"prompt_tokens\": 9,\n    \"completion_tokens\": 12,\n    \"total_tokens\": 21\n  }\n}\n",
  1268            "group": "chat",
  1269            "name": "The chat completion object"
  1270          }
  1271        },
  1272        "CreateChatCompletionStreamResponse": {
  1273          "description": "Represents a streamed chunk of a chat completion response returned by model, based on the provided input.",
  1274          "properties": {
  1275            "choices": {
  1276              "description": "A list of chat completion choices. Can be more than one if `n` is greater than 1.",
  1277              "items": {
  1278                "properties": {
  1279                  "delta": {
  1280                    "$ref": "#/components/schemas/ChatCompletionStreamResponseDelta"
  1281                  },
  1282                  "finish_reason": {
  1283                    "description": "The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,\n`length` if the maximum number of tokens specified in the request was reached,\n`content_filter` if content was omitted due to a flag from our content filters,\n`tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.\n",
  1284                    "enum": [
  1285                      "stop",
  1286                      "length",
  1287                      "tool_calls",
  1288                      "content_filter",
  1289                      "function_call"
  1290                    ],
  1291                    "nullable": true,
  1292                    "type": "string"
  1293                  },
  1294                  "index": {
  1295                    "description": "The index of the choice in the list of choices.",
  1296                    "type": "integer"
  1297                  },
  1298                  "logprobs": {
  1299                    "description": "Log probability information for the choice.",
  1300                    "nullable": true,
  1301                    "properties": {
  1302                      "content": {
  1303                        "description": "A list of message content tokens with log probability information.",
  1304                        "items": {
  1305                          "$ref": "#/components/schemas/ChatCompletionTokenLogprob"
  1306                        },
  1307                        "nullable": true,
  1308                        "type": "array"
  1309                      }
  1310                    },
  1311                    "required": [
  1312                      "content"
  1313                    ],
  1314                    "type": "object"
  1315                  }
  1316                },
  1317                "required": [
  1318                  "delta",
  1319                  "finish_reason",
  1320                  "index"
  1321                ],
  1322                "type": "object"
  1323              },
  1324              "type": "array"
  1325            },
  1326            "created": {
  1327              "description": "The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.",
  1328              "type": "integer"
  1329            },
  1330            "id": {
  1331              "description": "A unique identifier for the chat completion. Each chunk has the same ID.",
  1332              "type": "string"
  1333            },
  1334            "model": {
  1335              "description": "The model to generate the completion.",
  1336              "type": "string"
  1337            },
  1338            "object": {
  1339              "description": "The object type, which is always `chat.completion.chunk`.",
  1340              "enum": [
  1341                "chat.completion.chunk"
  1342              ],
  1343              "type": "string"
  1344            },
  1345            "system_fingerprint": {
  1346              "description": "This fingerprint represents the backend configuration that the model runs with.\nCan be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.\n",
  1347              "type": "string"
  1348            }
  1349          },
  1350          "required": [
  1351            "choices",
  1352            "created",
  1353            "id",
  1354            "model",
  1355            "object"
  1356          ],
  1357          "type": "object",
  1358          "x-oaiMeta": {
  1359            "example": "{\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1694268190,\"model\":\"gpt-3.5-turbo-0613\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":\"\"},\"logprobs\":null,\"finish_reason\":null}]}\n\n{\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1694268190,\"model\":\"gpt-3.5-turbo-0613\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\":[{\"index\":0,\"delta\":{\"content\":\"Hello\"},\"logprobs\":null,\"finish_reason\":null}]}\n\n{\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1694268190,\"model\":\"gpt-3.5-turbo-0613\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\":[{\"index\":0,\"delta\":{\"content\":\"!\"},\"logprobs\":null,\"finish_reason\":null}]}\n\n....\n\n{\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1694268190,\"model\":\"gpt-3.5-turbo-0613\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\":[{\"index\":0,\"delta\":{\"content\":\" today\"},\"logprobs\":null,\"finish_reason\":null}]}\n\n{\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1694268190,\"model\":\"gpt-3.5-turbo-0613\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\":[{\"index\":0,\"delta\":{\"content\":\"?\"},\"logprobs\":null,\"finish_reason\":null}]}\n\n{\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1694268190,\"model\":\"gpt-3.5-turbo-0613\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n",
  1360            "group": "chat",
  1361            "name": "The chat completion chunk object"
  1362          }
  1363        },
  1364        "CreateCompletionRequest": {
  1365          "properties": {
  1366            "best_of": {
  1367              "default": 1,
  1368              "description": "Generates `best_of` completions server-side and returns the \"best\" (the one with the highest log probability per token). Results cannot be streamed.\n\nWhen used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return \u2013 `best_of` must be greater than `n`.\n\n**Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.\n",
  1369              "maximum": 20,
  1370              "minimum": 0,
  1371              "nullable": true,
  1372              "type": "integer"
  1373            },
  1374            "echo": {
  1375              "default": false,
  1376              "description": "Echo back the prompt in addition to the completion\n",
  1377              "nullable": true,
  1378              "type": "boolean"
  1379            },
  1380            "frequency_penalty": {
  1381              "default": 0,
  1382              "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.\n\n[See more information about frequency and presence penalties.](/docs/guides/text-generation/parameter-details)\n",
  1383              "maximum": 2,
  1384              "minimum": -2,
  1385              "nullable": true,
  1386              "type": "number"
  1387            },
  1388            "logit_bias": {
  1389              "additionalProperties": {
  1390                "type": "integer"
  1391              },
  1392              "default": null,
  1393              "description": "Modify the likelihood of specified tokens appearing in the completion.\n\nAccepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.\n\nAs an example, you can pass `{\"50256\": -100}` to prevent the <|endoftext|> token from being generated.\n",
  1394              "nullable": true,
  1395              "type": "object",
  1396              "x-oaiTypeLabel": "map"
  1397            },
  1398            "logprobs": {
  1399              "default": null,
  1400              "description": "Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response.\n\nThe maximum value for `logprobs` is 5.\n",
  1401              "maximum": 5,
  1402              "minimum": 0,
  1403              "nullable": true,
  1404              "type": "integer"
  1405            },
  1406            "max_tokens": {
  1407              "default": 16,
  1408              "description": "The maximum number of [tokens](/tokenizer) that can be generated in the completion.\n\nThe token count of your prompt plus `max_tokens` cannot exceed the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.\n",
  1409              "example": 16,
  1410              "minimum": 0,
  1411              "nullable": true,
  1412              "type": "integer"
  1413            },
  1414            "model": {
  1415              "anyOf": [
  1416                {
  1417                  "type": "string"
  1418                },
  1419                {
  1420                  "enum": [
  1421                    "gpt-3.5-turbo-instruct",
  1422                    "davinci-002",
  1423                    "babbage-002"
  1424                  ],
  1425                  "type": "string"
  1426                }
  1427              ],
  1428              "description": "ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.\n",
  1429              "x-oaiTypeLabel": "string"
  1430            },
  1431            "n": {
  1432              "default": 1,
  1433              "description": "How many completions to generate for each prompt.\n\n**Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.\n",
  1434              "example": 1,
  1435              "maximum": 128,
  1436              "minimum": 1,
  1437              "nullable": true,
  1438              "type": "integer"
  1439            },
  1440            "presence_penalty": {
  1441              "default": 0,
  1442              "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.\n\n[See more information about frequency and presence penalties.](/docs/guides/text-generation/parameter-details)\n",
  1443              "maximum": 2,
  1444              "minimum": -2,
  1445              "nullable": true,
  1446              "type": "number"
  1447            },
  1448            "prompt": {
  1449              "default": "<|endoftext|>",
  1450              "description": "The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.\n\nNote that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.\n",
  1451              "nullable": true,
  1452              "oneOf": [
  1453                {
  1454                  "default": "",
  1455                  "example": "This is a test.",
  1456                  "type": "string"
  1457                },
  1458                {
  1459                  "items": {
  1460                    "default": "",
  1461                    "example": "This is a test.",
  1462                    "type": "string"
  1463                  },
  1464                  "type": "array"
  1465                },
  1466                {
  1467                  "example": "[1212, 318, 257, 1332, 13]",
  1468                  "items": {
  1469                    "type": "integer"
  1470                  },
  1471                  "minItems": 1,
  1472                  "type": "array"
  1473                },
  1474                {
  1475                  "example": "[[1212, 318, 257, 1332, 13]]",
  1476                  "items": {
  1477                    "items": {
  1478                      "type": "integer"
  1479                    },
  1480                    "minItems": 1,
  1481                    "type": "array"
  1482                  },
  1483                  "minItems": 1,
  1484                  "type": "array"
  1485                }
  1486              ]
  1487            },
  1488            "seed": {
  1489              "description": "If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\n\nDeterminism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.\n",
  1490              "maximum": 9223372036854776000,
  1491              "minimum": -9223372036854776000,
  1492              "nullable": true,
  1493              "type": "integer"
  1494            },
  1495            "stop": {
  1496              "default": null,
  1497              "description": "Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.\n",
  1498              "nullable": true,
  1499              "oneOf": [
  1500                {
  1501                  "default": "<|endoftext|>",
  1502                  "example": "\n",
  1503                  "nullable": true,
  1504                  "type": "string"
  1505                },
  1506                {
  1507                  "items": {
  1508                    "example": "[\"\\n\"]",
  1509                    "type": "string"
  1510                  },
  1511                  "maxItems": 4,
  1512                  "minItems": 1,
  1513                  "type": "array"
  1514                }
  1515              ]
  1516            },
  1517            "stream": {
  1518              "default": false,
  1519              "description": "Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).\n",
  1520              "nullable": true,
  1521              "type": "boolean"
  1522            },
  1523            "suffix": {
  1524              "default": null,
  1525              "description": "The suffix that comes after a completion of inserted text.",
  1526              "example": "test.",
  1527              "nullable": true,
  1528              "type": "string"
  1529            },
  1530            "temperature": {
  1531              "default": 1,
  1532              "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.\n\nWe generally recommend altering this or `top_p` but not both.\n",
  1533              "example": 1,
  1534              "maximum": 2,
  1535              "minimum": 0,
  1536              "nullable": true,
  1537              "type": "number"
  1538            },
  1539            "top_p": {
  1540              "default": 1,
  1541              "description": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.\n\nWe generally recommend altering this or `temperature` but not both.\n",
  1542              "example": 1,
  1543              "maximum": 1,
  1544              "minimum": 0,
  1545              "nullable": true,
  1546              "type": "number"
  1547            },
  1548            "user": {
  1549              "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).\n",
  1550              "example": "user-1234",
  1551              "type": "string"
  1552            }
  1553          },
  1554          "required": [
  1555            "model",
  1556            "prompt"
  1557          ],
  1558          "type": "object"
  1559        },
  1560        "CreateCompletionResponse": {
  1561          "description": "Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint).\n",
  1562          "properties": {
  1563            "choices": {
  1564              "description": "The list of completion choices the model generated for the input prompt.",
  1565              "items": {
  1566                "properties": {
  1567                  "finish_reason": {
  1568                    "description": "The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,\n`length` if the maximum number of tokens specified in the request was reached,\nor `content_filter` if content was omitted due to a flag from our content filters.\n",
  1569                    "enum": [
  1570                      "stop",
  1571                      "length",
  1572                      "content_filter"
  1573                    ],
  1574                    "type": "string"
  1575                  },
  1576                  "index": {
  1577                    "type": "integer"
  1578                  },
  1579                  "logprobs": {
  1580                    "nullable": true,
  1581                    "properties": {
  1582                      "text_offset": {
  1583                        "items": {
  1584                          "type": "integer"
  1585                        },
  1586                        "type": "array"
  1587                      },
  1588                      "token_logprobs": {
  1589                        "items": {
  1590                          "type": "number"
  1591                        },
  1592                        "type": "array"
  1593                      },
  1594                      "tokens": {
  1595                        "items": {
  1596                          "type": "string"
  1597                        },
  1598                        "type": "array"
  1599                      },
  1600                      "top_logprobs": {
  1601                        "items": {
  1602                          "additionalProperties": {
  1603                            "type": "number"
  1604                          },
  1605                          "type": "object"
  1606                        },
  1607                        "type": "array"
  1608                      }
  1609                    },
  1610                    "type": "object"
  1611                  },
  1612                  "text": {
  1613                    "type": "string"
  1614                  }
  1615                },
  1616                "required": [
  1617                  "finish_reason",
  1618                  "index",
  1619                  "logprobs",
  1620                  "text"
  1621                ],
  1622                "type": "object"
  1623              },
  1624              "type": "array"
  1625            },
  1626            "created": {
  1627              "description": "The Unix timestamp (in seconds) of when the completion was created.",
  1628              "type": "integer"
  1629            },
  1630            "id": {
  1631              "description": "A unique identifier for the completion.",
  1632              "type": "string"
  1633            },
  1634            "model": {
  1635              "description": "The model used for completion.",
  1636              "type": "string"
  1637            },
  1638            "object": {
  1639              "description": "The object type, which is always \"text_completion\"",
  1640              "enum": [
  1641                "text_completion"
  1642              ],
  1643              "type": "string"
  1644            },
  1645            "system_fingerprint": {
  1646              "description": "This fingerprint represents the backend configuration that the model runs with.\n\nCan be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.\n",
  1647              "type": "string"
  1648            },
  1649            "usage": {
  1650              "$ref": "#/components/schemas/CompletionUsage"
  1651            }
  1652          },
  1653          "required": [
  1654            "id",
  1655            "object",
  1656            "created",
  1657            "model",
  1658            "choices"
  1659          ],
  1660          "type": "object",
  1661          "x-oaiMeta": {
  1662            "example": "{\n  \"id\": \"cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7\",\n  \"object\": \"text_completion\",\n  \"created\": 1589478378,\n  \"model\": \"gpt-3.5-turbo\",\n  \"choices\": [\n    {\n      \"text\": \"\\n\\nThis is indeed a test\",\n      \"index\": 0,\n      \"logprobs\": null,\n      \"finish_reason\": \"length\"\n    }\n  ],\n  \"usage\": {\n    \"prompt_tokens\": 5,\n    \"completion_tokens\": 7,\n    \"total_tokens\": 12\n  }\n}\n",
  1663            "legacy": true,
  1664            "name": "The completion object"
  1665          }
  1666        },
  1667        "CreateEmbeddingRequest": {
  1668          "additionalProperties": false,
  1669          "properties": {
  1670            "dimensions": {
  1671              "description": "The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models.\n",
  1672              "minimum": 1,
  1673              "type": "integer"
  1674            },
  1675            "encoding_format": {
  1676              "default": "float",
  1677              "description": "The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/).",
  1678              "enum": [
  1679                "float",
  1680                "base64"
  1681              ],
  1682              "example": "float",
  1683              "type": "string"
  1684            },
  1685            "input": {
  1686              "description": "Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for `text-embedding-ada-002`), cannot be an empty string, and any array must be 2048 dimensions or less. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.\n",
  1687              "example": "The quick brown fox jumped over the lazy dog",
  1688              "oneOf": [
  1689                {
  1690                  "default": "",
  1691                  "description": "The string that will be turned into an embedding.",
  1692                  "example": "This is a test.",
  1693                  "title": "string",
  1694                  "type": "string"
  1695                },
  1696                {
  1697                  "description": "The array of strings that will be turned into an embedding.",
  1698                  "items": {
  1699                    "default": "",
  1700                    "example": "['This is a test.']",
  1701                    "type": "string"
  1702                  },
  1703                  "maxItems": 2048,
  1704                  "minItems": 1,
  1705                  "title": "array",
  1706                  "type": "array"
  1707                },
  1708                {
  1709                  "description": "The array of integers that will be turned into an embedding.",
  1710                  "example": "[1212, 318, 257, 1332, 13]",
  1711                  "items": {
  1712                    "type": "integer"
  1713                  },
  1714                  "maxItems": 2048,
  1715                  "minItems": 1,
  1716                  "title": "array",
  1717                  "type": "array"
  1718                },
  1719                {
  1720                  "description": "The array of arrays containing integers that will be turned into an embedding.",
  1721                  "example": "[[1212, 318, 257, 1332, 13]]",
  1722                  "items": {
  1723                    "items": {
  1724                      "type": "integer"
  1725                    },
  1726                    "minItems": 1,
  1727                    "type": "array"
  1728                  },
  1729                  "maxItems": 2048,
  1730                  "minItems": 1,
  1731                  "title": "array",
  1732                  "type": "array"
  1733                }
  1734              ],
  1735              "x-oaiExpandable": true
  1736            },
  1737            "model": {
  1738              "description": "ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.\n",
  1739              "enum": [
  1740                "text-embedding-ada-002",
  1741                "text-embedding-3-small",
  1742                "text-embedding-3-large"
  1743              ],
  1744              "example": "text-embedding-3-small",
  1745              "type": "string",
  1746              "x-oaiTypeLabel": "string"
  1747            },
  1748            "user": {
  1749              "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).\n",
  1750              "example": "user-1234",
  1751              "type": "string"
  1752            }
  1753          },
  1754          "required": [
  1755            "model",
  1756            "input"
  1757          ],
  1758          "type": "object"
  1759        },
  1760        "CreateEmbeddingResponse": {
  1761          "properties": {
  1762            "data": {
  1763              "description": "The list of embeddings generated by the model.",
  1764              "items": {
  1765                "$ref": "#/components/schemas/Embedding"
  1766              },
  1767              "type": "array"
  1768            },
  1769            "model": {
  1770              "description": "The name of the model used to generate the embedding.",
  1771              "type": "string"
  1772            },
  1773            "object": {
  1774              "description": "The object type, which is always \"list\".",
  1775              "enum": [
  1776                "list"
  1777              ],
  1778              "type": "string"
  1779            },
  1780            "usage": {
  1781              "description": "The usage information for the request.",
  1782              "properties": {
  1783                "prompt_tokens": {
  1784                  "description": "The number of tokens used by the prompt.",
  1785                  "type": "integer"
  1786                },
  1787                "total_tokens": {
  1788                  "description": "The total number of tokens used by the request.",
  1789                  "type": "integer"
  1790                }
  1791              },
  1792              "required": [
  1793                "prompt_tokens",
  1794                "total_tokens"
  1795              ],
  1796              "type": "object"
  1797            }
  1798          },
  1799          "required": [
  1800            "object",
  1801            "model",
  1802            "data",
  1803            "usage"
  1804          ],
  1805          "type": "object"
  1806        },
  1807        "CreateFileRequest": {
  1808          "additionalProperties": false,
  1809          "properties": {
  1810            "file": {
  1811              "description": "The File object (not file name) to be uploaded.\n",
  1812              "format": "binary",
  1813              "type": "string"
  1814            },
  1815            "purpose": {
  1816              "description": "The intended purpose of the uploaded file.\n\nUse \"fine-tune\" for [Fine-tuning](/docs/api-reference/fine-tuning) and \"assistants\" for [Assistants](/docs/api-reference/assistants) and [Messages](/docs/api-reference/messages). This allows us to validate the format of the uploaded file is correct for fine-tuning.\n",
  1817              "enum": [
  1818                "fine-tune",
  1819                "assistants"
  1820              ],
  1821              "type": "string"
  1822            }
  1823          },
  1824          "required": [
  1825            "file",
  1826            "purpose"
  1827          ],
  1828          "type": "object"
  1829        },
  1830        "CreateFineTuningJobRequest": {
  1831          "properties": {
  1832            "hyperparameters": {
  1833              "description": "The hyperparameters used for the fine-tuning job.",
  1834              "properties": {
  1835                "batch_size": {
  1836                  "default": "auto",
  1837                  "description": "Number of examples in each batch. A larger batch size means that model parameters\nare updated less frequently, but with lower variance.\n",
  1838                  "oneOf": [
  1839                    {
  1840                      "enum": [
  1841                        "auto"
  1842                      ],
  1843                      "type": "string"
  1844                    },
  1845                    {
  1846                      "maximum": 256,
  1847                      "minimum": 1,
  1848                      "type": "integer"
  1849                    }
  1850                  ]
  1851                },
  1852                "learning_rate_multiplier": {
  1853                  "default": "auto",
  1854                  "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid\noverfitting.\n",
  1855                  "oneOf": [
  1856                    {
  1857                      "enum": [
  1858                        "auto"
  1859                      ],
  1860                      "type": "string"
  1861                    },
  1862                    {
  1863                      "exclusiveMinimum": true,
  1864                      "minimum": 0,
  1865                      "type": "number"
  1866                    }
  1867                  ]
  1868                },
  1869                "n_epochs": {
  1870                  "default": "auto",
  1871                  "description": "The number of epochs to train the model for. An epoch refers to one full cycle\nthrough the training dataset.\n",
  1872                  "oneOf": [
  1873                    {
  1874                      "enum": [
  1875                        "auto"
  1876                      ],
  1877                      "type": "string"
  1878                    },
  1879                    {
  1880                      "maximum": 50,
  1881                      "minimum": 1,
  1882                      "type": "integer"
  1883                    }
  1884                  ]
  1885                }
  1886              },
  1887              "type": "object"
  1888            },
  1889            "model": {
  1890              "anyOf": [
  1891                {
  1892                  "type": "string"
  1893                },
  1894                {
  1895                  "enum": [
  1896                    "babbage-002",
  1897                    "davinci-002",
  1898                    "gpt-3.5-turbo"
  1899                  ],
  1900                  "type": "string"
  1901                }
  1902              ],
  1903              "description": "The name of the model to fine-tune. You can select one of the\n[supported models](/docs/guides/fine-tuning/what-models-can-be-fine-tuned).\n",
  1904              "example": "gpt-3.5-turbo",
  1905              "x-oaiTypeLabel": "string"
  1906            },
  1907            "suffix": {
  1908              "default": null,
  1909              "description": "A string of up to 18 characters that will be added to your fine-tuned model name.\n\nFor example, a `suffix` of \"custom-model-name\" would produce a model name like `ft:gpt-3.5-turbo:openai:custom-model-name:7p4lURel`.\n",
  1910              "maxLength": 40,
  1911              "minLength": 1,
  1912              "nullable": true,
  1913              "type": "string"
  1914            },
  1915            "training_file": {
  1916              "description": "The ID of an uploaded file that contains training data.\n\nSee [upload file](/docs/api-reference/files/upload) for how to upload a file.\n\nYour dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`.\n\nSee the [fine-tuning guide](/docs/guides/fine-tuning) for more details.\n",
  1917              "example": "file-abc123",
  1918              "type": "string"
  1919            },
  1920            "validation_file": {
  1921              "description": "The ID of an uploaded file that contains validation data.\n\nIf you provide this file, the data is used to generate validation\nmetrics periodically during fine-tuning. These metrics can be viewed in\nthe fine-tuning results file.\nThe same data should not be present in both train and validation files.\n\nYour dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`.\n\nSee the [fine-tuning guide](/docs/guides/fine-tuning) for more details.\n",
  1922              "example": "file-abc123",
  1923              "nullable": true,
  1924              "type": "string"
  1925            }
  1926          },
  1927          "required": [
  1928            "model",
  1929            "training_file"
  1930          ],
  1931          "type": "object"
  1932        },
  1933        "CreateImageEditRequest": {
  1934          "properties": {
  1935            "image": {
  1936              "description": "The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.",
  1937              "format": "binary",
  1938              "type": "string"
  1939            },
  1940            "mask": {
  1941              "description": "An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`.",
  1942              "format": "binary",
  1943              "type": "string"
  1944            },
  1945            "model": {
  1946              "anyOf": [
  1947                {
  1948                  "type": "string"
  1949                },
  1950                {
  1951                  "enum": [
  1952                    "dall-e-2"
  1953                  ],
  1954                  "type": "string"
  1955                }
  1956              ],
  1957              "default": "dall-e-2",
  1958              "description": "The model to use for image generation. Only `dall-e-2` is supported at this time.",
  1959              "example": "dall-e-2",
  1960              "nullable": true,
  1961              "x-oaiTypeLabel": "string"
  1962            },
  1963            "n": {
  1964              "default": 1,
  1965              "description": "The number of images to generate. Must be between 1 and 10.",
  1966              "example": 1,
  1967              "maximum": 10,
  1968              "minimum": 1,
  1969              "nullable": true,
  1970              "type": "integer"
  1971            },
  1972            "prompt": {
  1973              "description": "A text description of the desired image(s). The maximum length is 1000 characters.",
  1974              "example": "A cute baby sea otter wearing a beret",
  1975              "type": "string"
  1976            },
  1977            "response_format": {
  1978              "default": "url",
  1979              "description": "The format in which the generated images are returned. Must be one of `url` or `b64_json`.",
  1980              "enum": [
  1981                "url",
  1982                "b64_json"
  1983              ],
  1984              "example": "url",
  1985              "nullable": true,
  1986              "type": "string"
  1987            },
  1988            "size": {
  1989              "default": "1024x1024",
  1990              "description": "The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.",
  1991              "enum": [
  1992                "256x256",
  1993                "512x512",
  1994                "1024x1024"
  1995              ],
  1996              "example": "1024x1024",
  1997              "nullable": true,
  1998              "type": "string"
  1999            },
  2000            "user": {
  2001              "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).\n",
  2002              "example": "user-1234",
  2003              "type": "string"
  2004            }
  2005          },
  2006          "required": [
  2007            "prompt",
  2008            "image"
  2009          ],
  2010          "type": "object"
  2011        },
  2012        "CreateImageRequest": {
  2013          "properties": {
  2014            "model": {
  2015              "default": "dall-e-2",
  2016              "description": "The model to use for image generation.",
  2017              "enum": [
  2018                "dall-e-2",
  2019                "dall-e-3"
  2020              ],
  2021              "example": "dall-e-3",
  2022              "nullable": true,
  2023              "type": "string",
  2024              "x-oaiTypeLabel": "string"
  2025            },
  2026            "n": {
  2027              "default": 1,
  2028              "description": "The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.",
  2029              "example": 1,
  2030              "maximum": 10,
  2031              "minimum": 1,
  2032              "nullable": true,
  2033              "type": "integer"
  2034            },
  2035            "prompt": {
  2036              "description": "A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.",
  2037              "example": "A cute baby sea otter",
  2038              "type": "string"
  2039            },
  2040            "quality": {
  2041              "default": "standard",
  2042              "description": "The quality of the image that will be generated. `hd` creates images with finer details and greater consistency across the image. This param is only supported for `dall-e-3`.",
  2043              "enum": [
  2044                "standard",
  2045                "hd"
  2046              ],
  2047              "example": "standard",
  2048              "type": "string"
  2049            },
  2050            "response_format": {
  2051              "default": "url",
  2052              "description": "The format in which the generated images are returned. Must be one of `url` or `b64_json`.",
  2053              "enum": [
  2054                "url",
  2055                "b64_json"
  2056              ],
  2057              "example": "url",
  2058              "nullable": true,
  2059              "type": "string"
  2060            },
  2061            "size": {
  2062              "default": "1024x1024",
  2063              "description": "The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3` models.",
  2064              "enum": [
  2065                "256x256",
  2066                "512x512",
  2067                "1024x1024",
  2068                "1792x1024",
  2069                "1024x1792"
  2070              ],
  2071              "example": "1024x1024",
  2072              "nullable": true,
  2073              "type": "string"
  2074            },
  2075            "style": {
  2076              "default": "vivid",
  2077              "description": "The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`.",
  2078              "enum": [
  2079                "vivid",
  2080                "natural"
  2081              ],
  2082              "example": "vivid",
  2083              "nullable": true,
  2084              "type": "string"
  2085            },
  2086            "user": {
  2087              "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).\n",
  2088              "example": "user-1234",
  2089              "type": "string"
  2090            }
  2091          },
  2092          "required": [
  2093            "prompt"
  2094          ],
  2095          "type": "object"
  2096        },
  2097        "CreateImageVariationRequest": {
  2098          "properties": {
  2099            "image": {
  2100              "description": "The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.",
  2101              "format": "binary",
  2102              "type": "string"
  2103            },
  2104            "model": {
  2105              "anyOf": [
  2106                {
  2107                  "type": "string"
  2108                },
  2109                {
  2110                  "enum": [
  2111                    "dall-e-2"
  2112                  ],
  2113                  "type": "string"
  2114                }
  2115              ],
  2116              "default": "dall-e-2",
  2117              "description": "The model to use for image generation. Only `dall-e-2` is supported at this time.",
  2118              "example": "dall-e-2",
  2119              "nullable": true,
  2120              "x-oaiTypeLabel": "string"
  2121            },
  2122            "n": {
  2123              "default": 1,
  2124              "description": "The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.",
  2125              "example": 1,
  2126              "maximum": 10,
  2127              "minimum": 1,
  2128              "nullable": true,
  2129              "type": "integer"
  2130            },
  2131            "response_format": {
  2132              "default": "url",
  2133              "description": "The format in which the generated images are returned. Must be one of `url` or `b64_json`.",
  2134              "enum": [
  2135                "url",
  2136                "b64_json"
  2137              ],
  2138              "example": "url",
  2139              "nullable": true,
  2140              "type": "string"
  2141            },
  2142            "size": {
  2143              "default": "1024x1024",
  2144              "description": "The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.",
  2145              "enum": [
  2146                "256x256",
  2147                "512x512",
  2148                "1024x1024"
  2149              ],
  2150              "example": "1024x1024",
  2151              "nullable": true,
  2152              "type": "string"
  2153            },
  2154            "user": {
  2155              "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).\n",
  2156              "example": "user-1234",
  2157              "type": "string"
  2158            }
  2159          },
  2160          "required": [
  2161            "image"
  2162          ],
  2163          "type": "object"
  2164        },
  2165        "CreateMessageRequest": {
  2166          "additionalProperties": false,
  2167          "properties": {
  2168            "content": {
  2169              "description": "The content of the message.",
  2170              "maxLength": 32768,
  2171              "minLength": 1,
  2172              "type": "string"
  2173            },
  2174            "file_ids": {
  2175              "default": [],
  2176              "description": "A list of [File](/docs/api-reference/files) IDs that the message should use. There can be a maximum of 10 files attached to a message. Useful for tools like `retrieval` and `code_interpreter` that can access and use files.",
  2177              "items": {
  2178                "type": "string"
  2179              },
  2180              "maxItems": 10,
  2181              "minItems": 1,
  2182              "type": "array"
  2183            },
  2184            "metadata": {
  2185              "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.\n",
  2186              "nullable": true,
  2187              "type": "object",
  2188              "x-oaiTypeLabel": "map"
  2189            },
  2190            "role": {
  2191              "description": "The role of the entity that is creating the message. Currently only `user` is supported.",
  2192              "enum": [
  2193                "user"
  2194              ],
  2195              "type": "string"
  2196            }
  2197          },
  2198          "required": [
  2199            "role",
  2200            "content"
  2201          ],
  2202          "type": "object"
  2203        },
  2204        "CreateModerationRequest": {
  2205          "properties": {
  2206            "input": {
  2207              "description": "The input text to classify",
  2208              "oneOf": [
  2209                {
  2210                  "default": "",
  2211                  "example": "I want to kill them.",
  2212                  "type": "string"
  2213                },
  2214                {
  2215                  "items": {
  2216                    "default": "",
  2217                    "example": "I want to kill them.",
  2218                    "type": "string"
  2219                  },
  2220                  "type": "array"
  2221                }
  2222              ]
  2223            },
  2224            "model": {
  2225              "anyOf": [
  2226                {
  2227                  "type": "string"
  2228                },
  2229                {
  2230                  "enum": [
  2231                    "text-moderation-latest",
  2232                    "text-moderation-stable"
  2233                  ],
  2234                  "type": "string"
  2235                }
  2236              ],
  2237              "default": "text-moderation-latest",
  2238              "description": "Two content moderations models are available: `text-moderation-stable` and `text-moderation-latest`.\n\nThe default is `text-moderation-latest` which will be automatically upgraded over time. This ensures you are always using our most accurate model. If you use `text-moderation-stable`, we will provide advanced notice before updating the model. Accuracy of `text-moderation-stable` may be slightly lower than for `text-moderation-latest`.\n",
  2239              "example": "text-moderation-stable",
  2240              "nullable": false,
  2241              "x-oaiTypeLabel": "string"
  2242            }
  2243          },
  2244          "required": [
  2245            "input"
  2246          ],
  2247          "type": "object"
  2248        },
  2249        "CreateModerationResponse": {
  2250          "description": "Represents policy compliance report by OpenAI's content moderation model against a given input.",
  2251          "properties": {
  2252            "id": {
  2253              "description": "The unique identifier for the moderation request.",
  2254              "type": "string"
  2255            },
  2256            "model": {
  2257              "description": "The model used to generate the moderation results.",
  2258              "type": "string"
  2259            },
  2260            "results": {
  2261              "description": "A list of moderation objects.",
  2262              "items": {
  2263                "properties": {
  2264                  "categories": {
  2265                    "description": "A list of the categories, and whether they are flagged or not.",
  2266                    "properties": {
  2267                      "harassment": {
  2268                        "description": "Content that expresses, incites, or promotes harassing language towards any target.",
  2269                        "type": "boolean"
  2270                      },
  2271                      "harassment/threatening": {
  2272                        "description": "Harassment content that also includes violence or serious harm towards any target.",
  2273                        "type": "boolean"
  2274                      },
  2275                      "hate": {
  2276                        "description": "Content that expresses, incites, or promotes hate based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. Hateful content aimed at non-protected groups (e.g., chess players) is harassment.",
  2277                        "type": "boolean"
  2278                      },
  2279                      "hate/threatening": {
  2280                        "description": "Hateful content that also includes violence or serious harm towards the targeted group based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste.",
  2281                        "type": "boolean"
  2282                      },
  2283                      "self-harm": {
  2284                        "description": "Content that promotes, encourages, or depicts acts of self-harm, such as suicide, cutting, and eating disorders.",
  2285                        "type": "boolean"
  2286                      },
  2287                      "self-harm/instructions": {
  2288                        "description": "Content that encourages performing acts of self-harm, such as suicide, cutting, and eating disorders, or that gives instructions or advice on how to commit such acts.",
  2289                        "type": "boolean"
  2290                      },
  2291                      "self-harm/intent": {
  2292                        "description": "Content where the speaker expresses that they are engaging or intend to engage in acts of self-harm, such as suicide, cutting, and eating disorders.",
  2293                        "type": "boolean"
  2294                      },
  2295                      "sexual": {
  2296                        "description": "Content meant to arouse sexual excitement, such as the description of sexual activity, or that promotes sexual services (excluding sex education and wellness).",
  2297                        "type": "boolean"
  2298                      },
  2299                      "sexual/minors": {
  2300                        "description": "Sexual content that includes an individual who is under 18 years old.",
  2301                        "type": "boolean"
  2302                      },
  2303                      "violence": {
  2304                        "description": "Content that depicts death, violence, or physical injury.",
  2305                        "type": "boolean"
  2306                      },
  2307                      "violence/graphic": {
  2308                        "description": "Content that depicts death, violence, or physical injury in graphic detail.",
  2309                        "type": "boolean"
  2310                      }
  2311                    },
  2312                    "required": [
  2313                      "hate",
  2314                      "hate/threatening",
  2315                      "harassment",
  2316                      "harassment/threatening",
  2317                      "self-harm",
  2318                      "self-harm/intent",
  2319                      "self-harm/instructions",
  2320                      "sexual",
  2321                      "sexual/minors",
  2322                      "violence",
  2323                      "violence/graphic"
  2324                    ],
  2325                    "type": "object"
  2326                  },
  2327                  "category_scores": {
  2328                    "description": "A list of the categories along with their scores as predicted by model.",
  2329                    "properties": {
  2330                      "harassment": {
  2331                        "description": "The score for the category 'harassment'.",
  2332                        "type": "number"
  2333                      },
  2334                      "harassment/threatening": {
  2335                        "description": "The score for the category 'harassment/threatening'.",
  2336                        "type": "number"
  2337                      },
  2338                      "hate": {
  2339                        "description": "The score for the category 'hate'.",
  2340                        "type": "number"
  2341                      },
  2342                      "hate/threatening": {
  2343                        "description": "The score for the category 'hate/threatening'.",
  2344                        "type": "number"
  2345                      },
  2346                      "self-harm": {
  2347                        "description": "The score for the category 'self-harm'.",
  2348                        "type": "number"
  2349                      },
  2350                      "self-harm/instructions": {
  2351                        "description": "The score for the category 'self-harm/instructions'.",
  2352                        "type": "number"
  2353                      },
  2354                      "self-harm/intent": {
  2355                        "description": "The score for the category 'self-harm/intent'.",
  2356                        "type": "number"
  2357                      },
  2358                      "sexual": {
  2359                        "description": "The score for the category 'sexual'.",
  2360                        "type": "number"
  2361                      },
  2362                      "sexual/minors": {
  2363                        "description": "The score for the category 'sexual/minors'.",
  2364                        "type": "number"
  2365                      },
  2366                      "violence": {
  2367                        "description": "The score for the category 'violence'.",
  2368                        "type": "number"
  2369                      },
  2370                      "violence/graphic": {
  2371                        "description": "The score for the category 'violence/graphic'.",
  2372                        "type": "number"
  2373                      }
  2374                    },
  2375                    "required": [
  2376                      "hate",
  2377                      "hate/threatening",
  2378                      "harassment",
  2379                      "harassment/threatening",
  2380                      "self-harm",
  2381                      "self-harm/intent",
  2382                      "self-harm/instructions",
  2383                      "sexual",
  2384                      "sexual/minors",
  2385                      "violence",
  2386                      "violence/graphic"
  2387                    ],
  2388                    "type": "object"
  2389                  },
  2390                  "flagged": {
  2391                    "description": "Whether the content violates [OpenAI's usage policies](/policies/usage-policies).",
  2392                    "type": "boolean"
  2393                  }
  2394                },
  2395                "required": [
  2396                  "flagged",
  2397                  "categories",
  2398                  "category_scores"
  2399                ],
  2400                "type": "object"
  2401              },
  2402              "type": "array"
  2403            }
  2404          },
  2405          "required": [
  2406            "id",
  2407            "model",
  2408            "results"
  2409          ],
  2410          "type": "object",
  2411          "x-oaiMeta": {
  2412            "example": "{\n  \"id\": \"modr-XXXXX\",\n  \"model\": \"text-moderation-005\",\n  \"results\": [\n    {\n      \"flagged\": true,\n      \"categories\": {\n        \"sexual\": false,\n        \"hate\": false,\n        \"harassment\": false,\n        \"self-harm\": false,\n        \"sexual/minors\": false,\n        \"hate/threatening\": false,\n        \"violence/graphic\": false,\n        \"self-harm/intent\": false,\n        \"self-harm/instructions\": false,\n        \"harassment/threatening\": true,\n        \"violence\": true,\n      },\n      \"category_scores\": {\n        \"sexual\": 1.2282071e-06,\n        \"hate\": 0.010696256,\n        \"harassment\": 0.29842457,\n        \"self-harm\": 1.5236925e-08,\n        \"sexual/minors\": 5.7246268e-08,\n        \"hate/threatening\": 0.0060676364,\n        \"violence/graphic\": 4.435014e-06,\n        \"self-harm/intent\": 8.098441e-10,\n        \"self-harm/instructions\": 2.8498655e-11,\n        \"harassment/threatening\": 0.63055265,\n        \"violence\": 0.99011886,\n      }\n    }\n  ]\n}\n",
  2413            "name": "The moderation object"
  2414          }
  2415        },
  2416        "CreateRunRequest": {
  2417          "additionalProperties": false,
  2418          "properties": {
  2419            "additional_instructions": {
  2420              "description": "Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions.",
  2421              "nullable": true,
  2422              "type": "string"
  2423            },
  2424            "assistant_id": {
  2425              "description": "The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run.",
  2426              "type": "string"
  2427            },
  2428            "instructions": {
  2429              "description": "Overrides the [instructions](/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis.",
  2430              "nullable": true,
  2431              "type": "string"
  2432            },
  2433            "metadata": {
  2434              "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.\n",
  2435              "nullable": true,
  2436              "type": "object",
  2437              "x-oaiTypeLabel": "map"
  2438            },
  2439            "model": {
  2440              "description": "The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.",
  2441              "nullable": true,
  2442              "type": "string"
  2443            },
  2444            "tools": {
  2445              "description": "Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.",
  2446              "items": {
  2447                "oneOf": [
  2448                  {
  2449                    "$ref": "#/components/schemas/AssistantToolsCode"
  2450                  },
  2451                  {
  2452                    "$ref": "#/components/schemas/AssistantToolsRetrieval"
  2453                  },
  2454                  {
  2455                    "$ref": "#/components/schemas/AssistantToolsFunction"
  2456                  }
  2457                ],
  2458                "x-oaiExpandable": true
  2459              },
  2460              "maxItems": 20,
  2461              "nullable": true,
  2462              "type": "array"
  2463            }
  2464          },
  2465          "required": [
  2466            "thread_id",
  2467            "assistant_id"
  2468          ],
  2469          "type": "object"
  2470        },
  2471        "CreateSpeechRequest": {
  2472          "additionalProperties": false,
  2473          "properties": {
  2474            "input": {
  2475              "description": "The text to generate audio for. The maximum length is 4096 characters.",
  2476              "maxLength": 4096,
  2477              "type": "string"
  2478            },
  2479            "model": {
  2480              "anyOf": [
  2481                {
  2482                  "type": "string"
  2483                },
  2484                {
  2485                  "enum": [
  2486                    "tts-1",
  2487                    "tts-1-hd"
  2488                  ],
  2489                  "type": "string"
  2490                }
  2491              ],
  2492              "description": "One of the available [TTS models](/docs/models/tts): `tts-1` or `tts-1-hd`\n",
  2493              "x-oaiTypeLabel": "string"
  2494            },
  2495            "response_format": {
  2496              "default": "mp3",
  2497              "description": "The format to audio in. Supported formats are `mp3`, `opus`, `aac`, and `flac`.",
  2498              "enum": [
  2499                "mp3",
  2500                "opus",
  2501                "aac",
  2502                "flac"
  2503              ],
  2504              "type": "string"
  2505            },
  2506            "speed": {
  2507              "default": 1,
  2508              "description": "The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default.",
  2509              "maximum": 4,
  2510              "minimum": 0.25,
  2511              "type": "number"
  2512            },
  2513            "voice": {
  2514              "description": "The voice to use when generating the audio. Supported voices are `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`. Previews of the voices are available in the [Text to speech guide](/docs/guides/text-to-speech/voice-options).",
  2515              "enum": [
  2516                "alloy",
  2517                "echo",
  2518                "fable",
  2519                "onyx",
  2520                "nova",
  2521                "shimmer"
  2522              ],
  2523              "type": "string"
  2524            }
  2525          },
  2526          "required": [
  2527            "model",
  2528            "input",
  2529            "voice"
  2530          ],
  2531          "type": "object"
  2532        },
  2533        "CreateThreadAndRunRequest": {
  2534          "additionalProperties": false,
  2535          "properties": {
  2536            "assistant_id": {
  2537              "description": "The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run.",
  2538              "type": "string"
  2539            },
  2540            "instructions": {
  2541              "description": "Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis.",
  2542              "nullable": true,
  2543              "type": "string"
  2544            },
  2545            "metadata": {
  2546              "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.\n",
  2547              "nullable": true,
  2548              "type": "object",
  2549              "x-oaiTypeLabel": "map"
  2550            },
  2551            "model": {
  2552              "description": "The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.",
  2553              "nullable": true,
  2554              "type": "string"
  2555            },
  2556            "thread": {
  2557              "$ref": "#/components/schemas/CreateThreadRequest",
  2558              "description": "If no thread is provided, an empty thread will be created."
  2559            },
  2560            "tools": {
  2561              "description": "Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.",
  2562              "items": {
  2563                "oneOf": [
  2564                  {
  2565                    "$ref": "#/components/schemas/AssistantToolsCode"
  2566                  },
  2567                  {
  2568                    "$ref": "#/components/schemas/AssistantToolsRetrieval"
  2569                  },
  2570                  {
  2571                    "$ref": "#/components/schemas/AssistantToolsFunction"
  2572                  }
  2573                ]
  2574              },
  2575              "maxItems": 20,
  2576              "nullable": true,
  2577              "type": "array"
  2578            }
  2579          },
  2580          "required": [
  2581            "thread_id",
  2582            "assistant_id"
  2583          ],
  2584          "type": "object"
  2585        },
  2586        "CreateThreadRequest": {
  2587          "additionalProperties": false,
  2588          "properties": {
  2589            "messages": {
  2590              "description": "A list of [messages](/docs/api-reference/messages) to start the thread with.",
  2591              "items": {
  2592                "$ref": "#/components/schemas/CreateMessageRequest"
  2593              },
  2594              "type": "array"
  2595            },
  2596            "metadata": {
  2597              "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.\n",
  2598              "nullable": true,
  2599              "type": "object",
  2600              "x-oaiTypeLabel": "map"
  2601            }
  2602          },
  2603          "type": "object"
  2604        },
  2605        "CreateTranscriptionRequest": {
  2606          "additionalProperties": false,
  2607          "properties": {
  2608            "file": {
  2609              "description": "The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.\n",
  2610              "format": "binary",
  2611              "type": "string",
  2612              "x-oaiTypeLabel": "file"
  2613            },
  2614            "language": {
  2615              "description": "The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format will improve accuracy and latency.\n",
  2616              "type": "string"
  2617            },
  2618            "model": {
  2619              "description": "ID of the model to use. Only `whisper-1` is currently available.\n",
  2620              "enum": [
  2621                "whisper-1"
  2622              ],
  2623              "example": "whisper-1",
  2624              "type": "string",
  2625              "x-oaiTypeLabel": "string"
  2626            },
  2627            "prompt": {
  2628              "description": "An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should match the audio language.\n",
  2629              "type": "string"
  2630            },
  2631            "response_format": {
  2632              "default": "json",
  2633              "description": "The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.\n",
  2634              "enum": [
  2635                "json",
  2636                "text",
  2637                "srt",
  2638                "verbose_json",
  2639                "vtt"
  2640              ],
  2641              "type": "string"
  2642            },
  2643            "temperature": {
  2644              "default": 0,
  2645              "description": "The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.\n",
  2646              "type": "number"
  2647            }
  2648          },
  2649          "required": [
  2650            "file",
  2651            "model"
  2652          ],
  2653          "type": "object"
  2654        },
  2655        "CreateTranscriptionResponse": {
  2656          "properties": {
  2657            "text": {
  2658              "type": "string"
  2659            }
  2660          },
  2661          "required": [
  2662            "text"
  2663          ],
  2664          "type": "object"
  2665        },
  2666        "CreateTranslationRequest": {
  2667          "additionalProperties": false,
  2668          "properties": {
  2669            "file": {
  2670              "description": "The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.\n",
  2671              "format": "binary",
  2672              "type": "string",
  2673              "x-oaiTypeLabel": "file"
  2674            },
  2675            "model": {
  2676              "anyOf": [
  2677                {
  2678                  "type": "string"
  2679                },
  2680                {
  2681                  "enum": [
  2682                    "whisper-1"
  2683                  ],
  2684                  "type": "string"
  2685                }
  2686              ],
  2687              "description": "ID of the model to use. Only `whisper-1` is currently available.\n",
  2688              "example": "whisper-1",
  2689              "x-oaiTypeLabel": "string"
  2690            },
  2691            "prompt": {
  2692              "description": "An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should be in English.\n",
  2693              "type": "string"
  2694            },
  2695            "response_format": {
  2696              "default": "json",
  2697              "description": "The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.\n",
  2698              "type": "string"
  2699            },
  2700            "temperature": {
  2701              "default": 0,
  2702              "description": "The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.\n",
  2703              "type": "number"
  2704            }
  2705          },
  2706          "required": [
  2707            "file",
  2708            "model"
  2709          ],
  2710          "type": "object"
  2711        },
  2712        "CreateTranslationResponse": {
  2713          "properties": {
  2714            "text": {
  2715              "type": "string"
  2716            }
  2717          },
  2718          "required": [
  2719            "text"
  2720          ],
  2721          "type": "object"
  2722        },
  2723        "DeleteAssistantFileResponse": {
  2724          "description": "Deletes the association between the assistant and the file, but does not delete the [File](/docs/api-reference/files) object itself.",
  2725          "properties": {
  2726            "deleted": {
  2727              "type": "boolean"
  2728            },
  2729            "id": {
  2730              "type": "string"
  2731            },
  2732            "object": {
  2733              "enum": [
  2734                "assistant.file.deleted"
  2735              ],
  2736              "type": "string"
  2737            }
  2738          },
  2739          "required": [
  2740            "id",
  2741            "object",
  2742            "deleted"
  2743          ],
  2744          "type": "object"
  2745        },
  2746        "DeleteAssistantResponse": {
  2747          "properties": {
  2748            "deleted": {
  2749              "type": "boolean"
  2750            },
  2751            "id": {
  2752              "type": "string"
  2753            },
  2754            "object": {
  2755              "enum": [
  2756                "assistant.deleted"
  2757              ],
  2758              "type": "string"
  2759            }
  2760          },
  2761          "required": [
  2762            "id",
  2763            "object",
  2764            "deleted"
  2765          ],
  2766          "type": "object"
  2767        },
  2768        "DeleteFileResponse": {
  2769          "properties": {
  2770            "deleted": {
  2771              "type": "boolean"
  2772            },
  2773            "id": {
  2774              "type": "string"
  2775            },
  2776            "object": {
  2777              "enum": [
  2778                "file"
  2779              ],
  2780              "type": "string"
  2781            }
  2782          },
  2783          "required": [
  2784            "id",
  2785            "object",
  2786            "deleted"
  2787          ],
  2788          "type": "object"
  2789        },
  2790        "DeleteMessageResponse": {
  2791          "properties": {
  2792            "deleted": {
  2793              "type": "boolean"
  2794            },
  2795            "id": {
  2796              "type": "string"
  2797            },
  2798            "object": {
  2799              "enum": [
  2800                "thread.message.deleted"
  2801              ],
  2802              "type": "string"
  2803            }
  2804          },
  2805          "required": [
  2806            "id",
  2807            "object",
  2808            "deleted"
  2809          ],
  2810          "type": "object"
  2811        },
  2812        "DeleteModelResponse": {
  2813          "properties": {
  2814            "deleted": {
  2815              "type": "boolean"
  2816            },
  2817            "id": {
  2818              "type": "string"
  2819            },
  2820            "object": {
  2821              "type": "string"
  2822            }
  2823          },
  2824          "required": [
  2825            "id",
  2826            "object",
  2827            "deleted"
  2828          ],
  2829          "type": "object"
  2830        },
  2831        "DeleteThreadResponse": {
  2832          "properties": {
  2833            "deleted": {
  2834              "type": "boolean"
  2835            },
  2836            "id": {
  2837              "type": "string"
  2838            },
  2839            "object": {
  2840              "enum": [
  2841                "thread.deleted"
  2842              ],
  2843              "type": "string"
  2844            }
  2845          },
  2846          "required": [
  2847            "id",
  2848            "object",
  2849            "deleted"
  2850          ],
  2851          "type": "object"
  2852        },
  2853        "Embedding": {
  2854          "description": "Represents an embedding vector returned by embedding endpoint.\n",
  2855          "properties": {
  2856            "embedding": {
  2857              "description": "The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](/docs/guides/embeddings).\n",
  2858              "items": {
  2859                "type": "number"
  2860              },
  2861              "type": "array"
  2862            },
  2863            "index": {
  2864              "description": "The index of the embedding in the list of embeddings.",
  2865              "type": "integer"
  2866            },
  2867            "object": {
  2868              "description": "The object type, which is always \"embedding\".",
  2869              "enum": [
  2870                "embedding"
  2871              ],
  2872              "type": "string"
  2873            }
  2874          },
  2875          "required": [
  2876            "index",
  2877            "object",
  2878            "embedding"
  2879          ],
  2880          "type": "object",
  2881          "x-oaiMeta": {
  2882            "example": "{\n  \"object\": \"embedding\",\n  \"embedding\": [\n    0.0023064255,\n    -0.009327292,\n    .... (1536 floats total for ada-002)\n    -0.0028842222,\n  ],\n  \"index\": 0\n}\n",
  2883            "name": "The embedding object"
  2884          }
  2885        },
  2886        "Error": {
  2887          "properties": {
  2888            "code": {
  2889              "nullable": true,
  2890              "type": "string"
  2891            },
  2892            "message": {
  2893              "nullable": false,
  2894              "type": "string"
  2895            },
  2896            "param": {
  2897              "nullable": true,
  2898              "type": "string"
  2899            },
  2900            "type": {
  2901              "nullable": false,
  2902              "type": "string"
  2903            }
  2904          },
  2905          "required": [
  2906            "type",
  2907            "message",
  2908            "param",
  2909            "code"
  2910          ],
  2911          "type": "object"
  2912        },
  2913        "ErrorResponse": {
  2914          "properties": {
  2915            "error": {
  2916              "$ref": "#/components/schemas/Error"
  2917            }
  2918          },
  2919          "required": [
  2920            "error"
  2921          ],
  2922          "type": "object"
  2923        },
  2924        "FineTuningJob": {
  2925          "description": "The `fine_tuning.job` object represents a fine-tuning job that has been created through the API.\n",
  2926          "properties": {
  2927            "created_at": {
  2928              "description": "The Unix timestamp (in seconds) for when the fine-tuning job was created.",
  2929              "type": "integer"
  2930            },
  2931            "error": {
  2932              "description": "For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure.",
  2933              "nullable": true,
  2934              "properties": {
  2935                "code": {
  2936                  "description": "A machine-readable error code.",
  2937                  "type": "string"
  2938                },
  2939                "message": {
  2940                  "description": "A human-readable error message.",
  2941                  "type": "string"
  2942                },
  2943                "param": {
  2944                  "description": "The parameter that was invalid, usually `training_file` or `validation_file`. This field will be null if the failure was not parameter-specific.",
  2945                  "nullable": true,
  2946                  "type": "string"
  2947                }
  2948              },
  2949              "required": [
  2950                "code",
  2951                "message",
  2952                "param"
  2953              ],
  2954              "type": "object"
  2955            },
  2956            "fine_tuned_model": {
  2957              "description": "The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.",
  2958              "nullable": true,
  2959              "type": "string"
  2960            },
  2961            "finished_at": {
  2962              "description": "The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running.",
  2963              "nullable": true,
  2964              "type": "integer"
  2965            },
  2966            "hyperparameters": {
  2967              "description": "The hyperparameters used for the fine-tuning job. See the [fine-tuning guide](/docs/guides/fine-tuning) for more details.",
  2968              "properties": {
  2969                "n_epochs": {
  2970                  "default": "auto",
  2971                  "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.\n\"auto\" decides the optimal number of epochs based on the size of the dataset. If setting the number manually, we support any number between 1 and 50 epochs.",
  2972                  "oneOf": [
  2973                    {
  2974                      "enum": [
  2975                        "auto"
  2976                      ],
  2977                      "type": "string"
  2978                    },
  2979                    {
  2980                      "maximum": 50,
  2981                      "minimum": 1,
  2982                      "type": "integer"
  2983                    }
  2984                  ]
  2985                }
  2986              },
  2987              "required": [
  2988                "n_epochs"
  2989              ],
  2990              "type": "object"
  2991            },
  2992            "id": {
  2993              "description": "The object identifier, which can be referenced in the API endpoints.",
  2994              "type": "string"
  2995            },
  2996            "model": {
  2997              "description": "The base model that is being fine-tuned.",
  2998              "type": "string"
  2999            },
  3000            "object": {
  3001              "description": "The object type, which is always \"fine_tuning.job\".",
  3002              "enum": [
  3003                "fine_tuning.job"
  3004              ],
  3005              "type": "string"
  3006            },
  3007            "organization_id": {
  3008              "description": "The organization that owns the fine-tuning job.",
  3009              "type": "string"
  3010            },
  3011            "result_files": {
  3012              "description": "The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/docs/api-reference/files/retrieve-contents).",
  3013              "items": {
  3014                "example": "file-abc123",
  3015                "type": "string"
  3016              },
  3017              "type": "array"
  3018            },
  3019            "status": {
  3020              "description": "The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`.",
  3021              "enum": [
  3022                "validating_files",
  3023                "queued",
  3024                "running",
  3025                "succeeded",
  3026                "failed",
  3027                "cancelled"
  3028              ],
  3029              "type": "string"
  3030            },
  3031            "trained_tokens": {
  3032              "description": "The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running.",
  3033              "nullable": true,
  3034              "type": "integer"
  3035            },
  3036            "training_file": {
  3037              "description": "The file ID used for training. You can retrieve the training data with the [Files API](/docs/api-reference/files/retrieve-contents).",
  3038              "type": "string"
  3039            },
  3040            "validation_file": {
  3041              "description": "The file ID used for validation. You can retrieve the validation results with the [Files API](/docs/api-reference/files/retrieve-contents).",
  3042              "nullable": true,
  3043              "type": "string"
  3044            }
  3045          },
  3046          "required": [
  3047            "created_at",
  3048            "error",
  3049            "finished_at",
  3050            "fine_tuned_model",
  3051            "hyperparameters",
  3052            "id",
  3053            "model",
  3054            "object",
  3055            "organization_id",
  3056            "result_files",
  3057            "status",
  3058            "trained_tokens",
  3059            "training_file",
  3060            "validation_file"
  3061          ],
  3062          "title": "FineTuningJob",
  3063          "type": "object",
  3064          "x-oaiMeta": {
  3065            "example": "{\n  \"object\": \"fine_tuning.job\",\n  \"id\": \"ftjob-abc123\",\n  \"model\": \"davinci-002\",\n  \"created_at\": 1692661014,\n  \"finished_at\": 1692661190,\n  \"fine_tuned_model\": \"ft:davinci-002:my-org:custom_suffix:7q8mpxmy\",\n  \"organization_id\": \"org-123\",\n  \"result_files\": [\n      \"file-abc123\"\n  ],\n  \"status\": \"succeeded\",\n  \"validation_file\": null,\n  \"training_file\": \"file-abc123\",\n  \"hyperparameters\": {\n      \"n_epochs\": 4,\n  },\n  \"trained_tokens\": 5768\n}\n",
  3066            "name": "The fine-tuning job object"
  3067          }
  3068        },
  3069        "FineTuningJobEvent": {
  3070          "description": "Fine-tuning job event object",
  3071          "properties": {
  3072            "created_at": {
  3073              "type": "integer"
  3074            },
  3075            "id": {
  3076              "type": "string"
  3077            },
  3078            "level": {
  3079              "enum": [
  3080                "info",
  3081                "warn",
  3082                "error"
  3083              ],
  3084              "type": "string"
  3085            },
  3086            "message": {
  3087              "type": "string"
  3088            },
  3089            "object": {
  3090              "enum": [
  3091                "fine_tuning.job.event"
  3092              ],
  3093              "type": "string"
  3094            }
  3095          },
  3096          "required": [
  3097            "id",
  3098            "object",
  3099            "created_at",
  3100            "level",
  3101            "message"
  3102          ],
  3103          "type": "object",
  3104          "x-oaiMeta": {
  3105            "example": "{\n  \"object\": \"fine_tuning.job.event\",\n  \"id\": \"ftevent-abc123\"\n  \"created_at\": 1677610602,\n  \"level\": \"info\",\n  \"message\": \"Created fine-tuning job\"\n}\n",
  3106            "name": "The fine-tuning job event object"
  3107          }
  3108        },
  3109        "FunctionObject": {
  3110          "properties": {
  3111            "description": {
  3112              "description": "A description of what the function does, used by the model to choose when and how to call the function.",
  3113              "type": "string"
  3114            },
  3115            "name": {
  3116              "description": "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.",
  3117              "type": "string"
  3118            },
  3119            "parameters": {
  3120              "$ref": "#/components/schemas/FunctionParameters"
  3121            }
  3122          },
  3123          "required": [
  3124            "name"
  3125          ],
  3126          "type": "object"
  3127        },
  3128        "FunctionParameters": {
  3129          "additionalProperties": true,
  3130          "description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/text-generation/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.",
  3131          "type": "object"
  3132        },
  3133        "Image": {
  3134          "description": "Represents the url or the content of an image generated by the OpenAI API.",
  3135          "properties": {
  3136            "b64_json": {
  3137              "description": "The base64-encoded JSON of the generated image, if `response_format` is `b64_json`.",
  3138              "type": "string"
  3139            },
  3140            "revised_prompt": {
  3141              "description": "The prompt that was used to generate the image, if there was any revision to the prompt.",
  3142              "type": "string"
  3143            },
  3144            "url": {
  3145              "description": "The URL of the generated image, if `response_format` is `url` (default).",
  3146              "type": "string"
  3147            }
  3148          },
  3149          "type": "object",
  3150          "x-oaiMeta": {
  3151            "example": "{\n  \"url\": \"...\",\n  \"revised_prompt\": \"...\"\n}\n",
  3152            "name": "The image object"
  3153          }
  3154        },
  3155        "ImagesResponse": {
  3156          "properties": {
  3157            "created": {
  3158              "type": "integer"
  3159            },
  3160            "data": {
  3161              "items": {
  3162                "$ref": "#/components/schemas/Image"
  3163              },
  3164              "type": "array"
  3165            }
  3166          },
  3167          "required": [
  3168            "created",
  3169            "data"
  3170          ]
  3171        },
  3172        "ListAssistantFilesResponse": {
  3173          "properties": {
  3174            "data": {
  3175              "items": {
  3176                "$ref": "#/components/schemas/AssistantFileObject"
  3177              },
  3178              "type": "array"
  3179            },
  3180            "first_id": {
  3181              "example": "file-abc123",
  3182              "type": "string"
  3183            },
  3184            "has_more": {
  3185              "example": false,
  3186              "type": "boolean"
  3187            },
  3188            "last_id": {
  3189              "example": "file-abc456",
  3190              "type": "string"
  3191            },
  3192            "object": {
  3193              "example": "list",
  3194              "type": "string"
  3195            }
  3196          },
  3197          "required": [
  3198            "object",
  3199            "data",
  3200            "items",
  3201            "first_id",
  3202            "last_id",
  3203            "has_more"
  3204          ]
  3205        },
  3206        "ListAssistantsResponse": {
  3207          "properties": {
  3208            "data": {
  3209              "items": {
  3210                "$ref": "#/components/schemas/AssistantObject"
  3211              },
  3212              "type": "array"
  3213            },
  3214            "first_id": {
  3215              "example": "asst_abc123",
  3216              "type": "string"
  3217            },
  3218            "has_more": {
  3219              "example": false,
  3220              "type": "boolean"
  3221            },
  3222            "last_id": {
  3223              "example": "asst_abc456",
  3224              "type": "string"
  3225            },
  3226            "object": {
  3227              "example": "list",
  3228              "type": "string"
  3229            }
  3230          },
  3231          "required": [
  3232            "object",
  3233            "data",
  3234            "first_id",
  3235            "last_id",
  3236            "has_more"
  3237          ],
  3238          "type": "object",
  3239          "x-oaiMeta": {
  3240            "example": "{\n  \"object\": \"list\",\n  \"data\": [\n    {\n      \"id\": \"asst_abc123\",\n      \"object\": \"assistant\",\n      \"created_at\": 1698982736,\n      \"name\": \"Coding Tutor\",\n      \"description\": null,\n      \"model\": \"gpt-4\",\n      \"instructions\": \"You are a helpful assistant designed to make me better at coding!\",\n      \"tools\": [],\n      \"file_ids\": [],\n      \"metadata\": {}\n    },\n    {\n      \"id\": \"asst_abc456\",\n      \"object\": \"assistant\",\n      \"created_at\": 1698982718,\n      \"name\": \"My Assistant\",\n      \"description\": null,\n      \"model\": \"gpt-4\",\n      \"instructions\": \"You are a helpful assistant designed to make me better at coding!\",\n      \"tools\": [],\n      \"file_ids\": [],\n      \"metadata\": {}\n    },\n    {\n      \"id\": \"asst_abc789\",\n      \"object\": \"assistant\",\n      \"created_at\": 1698982643,\n      \"name\": null,\n      \"description\": null,\n      \"model\": \"gpt-4\",\n      \"instructions\": null,\n      \"tools\": [],\n      \"file_ids\": [],\n      \"metadata\": {}\n    }\n  ],\n  \"first_id\": \"asst_abc123\",\n  \"last_id\": \"asst_abc789\",\n  \"has_more\": false\n}\n",
  3241            "group": "chat",
  3242            "name": "List assistants response object"
  3243          }
  3244        },
  3245        "ListFilesResponse": {
  3246          "properties": {
  3247            "data": {
  3248              "items": {
  3249                "$ref": "#/components/schemas/OpenAIFile"
  3250              },
  3251              "type": "array"
  3252            },
  3253            "object": {
  3254              "enum": [
  3255                "list"
  3256              ],
  3257              "type": "string"
  3258            }
  3259          },
  3260          "required": [
  3261            "object",
  3262            "data"
  3263          ],
  3264          "type": "object"
  3265        },
  3266        "ListFineTuningJobEventsResponse": {
  3267          "properties": {
  3268            "data": {
  3269              "items": {
  3270                "$ref": "#/components/schemas/FineTuningJobEvent"
  3271              },
  3272              "type": "array"
  3273            },
  3274            "object": {
  3275              "enum": [
  3276                "list"
  3277              ],
  3278              "type": "string"
  3279            }
  3280          },
  3281          "required": [
  3282            "object",
  3283            "data"
  3284          ],
  3285          "type": "object"
  3286        },
  3287        "ListMessageFilesResponse": {
  3288          "properties": {
  3289            "data": {
  3290              "items": {
  3291                "$ref": "#/components/schemas/MessageFileObject"
  3292              },
  3293              "type": "array"
  3294            },
  3295            "first_id": {
  3296              "example": "file-abc123",
  3297              "type": "string"
  3298            },
  3299            "has_more": {
  3300              "example": false,
  3301              "type": "boolean"
  3302            },
  3303            "last_id": {
  3304              "example": "file-abc456",
  3305              "type": "string"
  3306            },
  3307            "object": {
  3308              "example": "list",
  3309              "type": "string"
  3310            }
  3311          },
  3312          "required": [
  3313            "object",
  3314            "data",
  3315            "items",
  3316            "first_id",
  3317            "last_id",
  3318            "has_more"
  3319          ]
  3320        },
  3321        "ListMessagesResponse": {
  3322          "properties": {
  3323            "data": {
  3324              "items": {
  3325                "$ref": "#/components/schemas/MessageObject"
  3326              },
  3327              "type": "array"
  3328            },
  3329            "first_id": {
  3330              "example": "msg_abc123",
  3331              "type": "string"
  3332            },
  3333            "has_more": {
  3334              "example": false,
  3335              "type": "boolean"
  3336            },
  3337            "last_id": {
  3338              "example": "msg_abc123",
  3339              "type": "string"
  3340            },
  3341            "object": {
  3342              "example": "list",
  3343              "type": "string"
  3344            }
  3345          },
  3346          "required": [
  3347            "object",
  3348            "data",
  3349            "first_id",
  3350            "last_id",
  3351            "has_more"
  3352          ]
  3353        },
  3354        "ListModelsResponse": {
  3355          "properties": {
  3356            "data": {
  3357              "items": {
  3358                "$ref": "#/components/schemas/Model"
  3359              },
  3360              "type": "array"
  3361            },
  3362            "object": {
  3363              "enum": [
  3364                "list"
  3365              ],
  3366              "type": "string"
  3367            }
  3368          },
  3369          "required": [
  3370            "object",
  3371            "data"
  3372          ],
  3373          "type": "object"
  3374        },
  3375        "ListPaginatedFineTuningJobsResponse": {
  3376          "properties": {
  3377            "data": {
  3378              "items": {
  3379                "$ref": "#/components/schemas/FineTuningJob"
  3380              },
  3381              "type": "array"
  3382            },
  3383            "has_more": {
  3384              "type": "boolean"
  3385            },
  3386            "object": {
  3387              "enum": [
  3388                "list"
  3389              ],
  3390              "type": "string"
  3391            }
  3392          },
  3393          "required": [
  3394            "object",
  3395            "data",
  3396            "has_more"
  3397          ],
  3398          "type": "object"
  3399        },
  3400        "ListRunsResponse": {
  3401          "properties": {
  3402            "data": {
  3403              "items": {
  3404                "$ref": "#/components/schemas/RunObject"
  3405              },
  3406              "type": "array"
  3407            },
  3408            "first_id": {
  3409              "example": "run_abc123",
  3410              "type": "string"
  3411            },
  3412            "has_more": {
  3413              "example": false,
  3414              "type": "boolean"
  3415            },
  3416            "last_id": {
  3417              "example": "run_abc456",
  3418              "type": "string"
  3419            },
  3420            "object": {
  3421              "example": "list",
  3422              "type": "string"
  3423            }
  3424          },
  3425          "required": [
  3426            "object",
  3427            "data",
  3428            "first_id",
  3429            "last_id",
  3430            "has_more"
  3431          ],
  3432          "type": "object"
  3433        },
  3434        "ListRunStepsResponse": {
  3435          "properties": {
  3436            "data": {
  3437              "items": {
  3438                "$ref": "#/components/schemas/RunStepObject"
  3439              },
  3440              "type": "array"
  3441            },
  3442            "first_id": {
  3443              "example": "step_abc123",
  3444              "type": "string"
  3445            },
  3446            "has_more": {
  3447              "example": false,
  3448              "type": "boolean"
  3449            },
  3450            "last_id": {
  3451              "example": "step_abc456",
  3452              "type": "string"
  3453            },
  3454            "object": {
  3455              "example": "list",
  3456              "type": "string"
  3457            }
  3458          },
  3459          "required": [
  3460            "object",
  3461            "data",
  3462            "first_id",
  3463            "last_id",
  3464            "has_more"
  3465          ]
  3466        },
  3467        "ListThreadsResponse": {
  3468          "properties": {
  3469            "data": {
  3470              "items": {
  3471                "$ref": "#/components/schemas/ThreadObject"
  3472              },
  3473              "type": "array"
  3474            },
  3475            "first_id": {
  3476              "example": "asst_abc123",
  3477              "type": "string"
  3478            },
  3479            "has_more": {
  3480              "example": false,
  3481              "type": "boolean"
  3482            },
  3483            "last_id": {
  3484              "example": "asst_abc456",
  3485              "type": "string"
  3486            },
  3487            "object": {
  3488              "example": "list",
  3489              "type": "string"
  3490            }
  3491          },
  3492          "required": [
  3493            "object",
  3494            "data",
  3495            "first_id",
  3496            "last_id",
  3497            "has_more"
  3498          ]
  3499        },
  3500        "MessageContentImageFileObject": {
  3501          "description": "References an image [File](/docs/api-reference/files) in the content of a message.",
  3502          "properties": {
  3503            "image_file": {
  3504              "properties": {
  3505                "file_id": {
  3506                  "description": "The [File](/docs/api-reference/files) ID of the image in the message content.",
  3507                  "type": "string"
  3508                }
  3509              },
  3510              "required": [
  3511                "file_id"
  3512              ],
  3513              "type": "object"
  3514            },
  3515            "type": {
  3516              "description": "Always `image_file`.",
  3517              "enum": [
  3518                "image_file"
  3519              ],
  3520              "type": "string"
  3521            }
  3522          },
  3523          "required": [
  3524            "type",
  3525            "image_file"
  3526          ],
  3527          "title": "Image file",
  3528          "type": "object"
  3529        },
  3530        "MessageContentTextAnnotationsFileCitationObject": {
  3531          "description": "A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the \"retrieval\" tool to search files.",
  3532          "properties": {
  3533            "end_index": {
  3534              "minimum": 0,
  3535              "type": "integer"
  3536            },
  3537            "file_citation": {
  3538              "properties": {
  3539                "file_id": {
  3540                  "description": "The ID of the specific File the citation is from.",
  3541                  "type": "string"
  3542                },
  3543                "quote": {
  3544                  "description": "The specific quote in the file.",
  3545                  "type": "string"
  3546                }
  3547              },
  3548              "required": [
  3549                "file_id",
  3550                "quote"
  3551              ],
  3552              "type": "object"
  3553            },
  3554            "start_index": {
  3555              "minimum": 0,
  3556              "type": "integer"
  3557            },
  3558            "text": {
  3559              "description": "The text in the message content that needs to be replaced.",
  3560              "type": "string"
  3561            },
  3562            "type": {
  3563              "description": "Always `file_citation`.",
  3564              "enum": [
  3565                "file_citation"
  3566              ],
  3567              "type": "string"
  3568            }
  3569          },
  3570          "required": [
  3571            "type",
  3572            "text",
  3573            "file_citation",
  3574            "start_index",
  3575            "end_index"
  3576          ],
  3577          "title": "File citation",
  3578          "type": "object"
  3579        },
  3580        "MessageContentTextAnnotationsFilePathObject": {
  3581          "description": "A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.",
  3582          "properties": {
  3583            "end_index": {
  3584              "minimum": 0,
  3585              "type": "integer"
  3586            },
  3587            "file_path": {
  3588              "properties": {
  3589                "file_id": {
  3590                  "description": "The ID of the file that was generated.",
  3591                  "type": "string"
  3592                }
  3593              },
  3594              "required": [
  3595                "file_id"
  3596              ],
  3597              "type": "object"
  3598            },
  3599            "start_index": {
  3600              "minimum": 0,
  3601              "type": "integer"
  3602            },
  3603            "text": {
  3604              "description": "The text in the message content that needs to be replaced.",
  3605              "type": "string"
  3606            },
  3607            "type": {
  3608              "description": "Always `file_path`.",
  3609              "enum": [
  3610                "file_path"
  3611              ],
  3612              "type": "string"
  3613            }
  3614          },
  3615          "required": [
  3616            "type",
  3617            "text",
  3618            "file_path",
  3619            "start_index",
  3620            "end_index"
  3621          ],
  3622          "title": "File path",
  3623          "type": "object"
  3624        },
  3625        "MessageContentTextObject": {
  3626          "description": "The text content that is part of a message.",
  3627          "properties": {
  3628            "text": {
  3629              "properties": {
  3630                "annotations": {
  3631                  "items": {
  3632                    "oneOf": [
  3633                      {
  3634                        "$ref": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject"
  3635                      },
  3636                      {
  3637                        "$ref": "#/components/schemas/MessageContentTextAnnotationsFilePathObject"
  3638                      }
  3639                    ],
  3640                    "x-oaiExpandable": true
  3641                  },
  3642                  "type": "array"
  3643                },
  3644                "value": {
  3645                  "description": "The data that makes up the text.",
  3646                  "type": "string"
  3647                }
  3648              },
  3649              "required": [
  3650                "value",
  3651                "annotations"
  3652              ],
  3653              "type": "object"
  3654            },
  3655            "type": {
  3656              "description": "Always `text`.",
  3657              "enum": [
  3658                "text"
  3659              ],
  3660              "type": "string"
  3661            }
  3662          },
  3663          "required": [
  3664            "type",
  3665            "text"
  3666          ],
  3667          "title": "Text",
  3668          "type": "object"
  3669        },
  3670        "MessageFileObject": {
  3671          "description": "A list of files attached to a `message`.",
  3672          "properties": {
  3673            "created_at": {
  3674              "description": "The Unix timestamp (in seconds) for when the message file was created.",
  3675              "type": "integer"
  3676            },
  3677            "id": {
  3678              "description": "The identifier, which can be referenced in API endpoints.",
  3679              "type": "string"
  3680            },
  3681            "message_id": {
  3682              "description": "The ID of the [message](/docs/api-reference/messages) that the [File](/docs/api-reference/files) is attached to.",
  3683              "type": "string"
  3684            },
  3685            "object": {
  3686              "description": "The object type, which is always `thread.message.file`.",
  3687              "enum": [
  3688                "thread.message.file"
  3689              ],
  3690              "type": "string"
  3691            }
  3692          },
  3693          "required": [
  3694            "id",
  3695            "object",
  3696            "created_at",
  3697            "message_id"
  3698          ],
  3699          "title": "Message files",
  3700          "type": "object",
  3701          "x-oaiMeta": {
  3702            "beta": true,
  3703            "example": "{\n  \"id\": \"file-abc123\",\n  \"object\": \"thread.message.file\",\n  \"created_at\": 1698107661,\n  \"message_id\": \"message_QLoItBbqwyAJEzlTy4y9kOMM\",\n  \"file_id\": \"file-abc123\"\n}\n",
  3704            "name": "The message file object"
  3705          }
  3706        },
  3707        "MessageObject": {
  3708          "description": "Represents a message within a [thread](/docs/api-reference/threads).",
  3709          "properties": {
  3710            "assistant_id": {
  3711              "description": "If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message.",
  3712              "nullable": true,
  3713              "type": "string"
  3714            },
  3715            "content": {
  3716              "description": "The content of the message in array of text and/or images.",
  3717              "items": {
  3718                "oneOf": [
  3719                  {
  3720                    "$ref": "#/components/schemas/MessageContentImageFileObject"
  3721                  },
  3722                  {
  3723                    "$ref": "#/components/schemas/MessageContentTextObject"
  3724                  }
  3725                ],
  3726                "x-oaiExpandable": true
  3727              },
  3728              "type": "array"
  3729            },
  3730            "created_at": {
  3731              "description": "The Unix timestamp (in seconds) for when the message was created.",
  3732              "type": "integer"
  3733            },
  3734            "file_ids": {
  3735              "default": [],
  3736              "description": "A list of [file](/docs/api-reference/files) IDs that the assistant should use. Useful for tools like retrieval and code_interpreter that can access files. A maximum of 10 files can be attached to a message.",
  3737              "items": {
  3738                "type": "string"
  3739              },
  3740              "maxItems": 10,
  3741              "type": "array"
  3742            },
  3743            "id": {
  3744              "description": "The identifier, which can be referenced in API endpoints.",
  3745              "type": "string"
  3746            },
  3747            "metadata": {
  3748              "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.\n",
  3749              "nullable": true,
  3750              "type": "object",
  3751              "x-oaiTypeLabel": "map"
  3752            },
  3753            "object": {
  3754              "description": "The object type, which is always `thread.message`.",
  3755              "enum": [
  3756                "thread.message"
  3757              ],
  3758              "type": "string"
  3759            },
  3760            "role": {
  3761              "description": "The entity that produced the message. One of `user` or `assistant`.",
  3762              "enum": [
  3763                "user",
  3764                "assistant"
  3765              ],
  3766              "type": "string"
  3767            },
  3768            "run_id": {
  3769              "description": "If applicable, the ID of the [run](/docs/api-reference/runs) associated with the authoring of this message.",
  3770              "nullable": true,
  3771              "type": "string"
  3772            },
  3773            "thread_id": {
  3774              "description": "The [thread](/docs/api-reference/threads) ID that this message belongs to.",
  3775              "type": "string"
  3776            }
  3777          },
  3778          "required": [
  3779            "id",
  3780            "object",
  3781            "created_at",
  3782            "thread_id",
  3783            "role",
  3784            "content",
  3785            "assistant_id",
  3786            "run_id",
  3787            "file_ids",
  3788            "metadata"
  3789          ],
  3790          "title": "The message object",
  3791          "type": "object",
  3792          "x-oaiMeta": {
  3793            "beta": true,
  3794            "example": "{\n  \"id\": \"msg_abc123\",\n  \"object\": \"thread.message\",\n  \"created_at\": 1698983503,\n  \"thread_id\": \"thread_abc123\",\n  \"role\": \"assistant\",\n  \"content\": [\n    {\n      \"type\": \"text\",\n      \"text\": {\n        \"value\": \"Hi! How can I help you today?\",\n        \"annotations\": []\n      }\n    }\n  ],\n  \"file_ids\": [],\n  \"assistant_id\": \"asst_abc123\",\n  \"run_id\": \"run_abc123\",\n  \"metadata\": {}\n}\n",
  3795            "name": "The message object"
  3796          }
  3797        },
  3798        "Model": {
  3799          "description": "Describes an OpenAI model offering that can be used with the API.",
  3800          "properties": {
  3801            "created": {
  3802              "description": "The Unix timestamp (in seconds) when the model was created.",
  3803              "type": "integer"
  3804            },
  3805            "id": {
  3806              "description": "The model identifier, which can be referenced in the API endpoints.",
  3807              "type": "string"
  3808            },
  3809            "object": {
  3810              "description": "The object type, which is always \"model\".",
  3811              "enum": [
  3812                "model"
  3813              ],
  3814              "type": "string"
  3815            },
  3816            "owned_by": {
  3817              "description": "The organization that owns the model.",
  3818              "type": "string"
  3819            }
  3820          },
  3821          "required": [
  3822            "id",
  3823            "object",
  3824            "created",
  3825            "owned_by"
  3826          ],
  3827          "title": "Model",
  3828          "x-oaiMeta": {
  3829            "example": "{\n  \"id\": \"VAR_model_id\",\n  \"object\": \"model\",\n  \"created\": 1686935002,\n  \"owned_by\": \"openai\"\n}\n",
  3830            "name": "The model object"
  3831          }
  3832        },
  3833        "ModifyAssistantRequest": {
  3834          "additionalProperties": false,
  3835          "properties": {
  3836            "description": {
  3837              "description": "The description of the assistant. The maximum length is 512 characters.\n",
  3838              "maxLength": 512,
  3839              "nullable": true,
  3840              "type": "string"
  3841            },
  3842            "file_ids": {
  3843              "default": [],
  3844              "description": "A list of [File](/docs/api-reference/files) IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order. If a file was previously attached to the list but does not show up in the list, it will be deleted from the assistant.\n",
  3845              "items": {
  3846                "type": "string"
  3847              },
  3848              "maxItems": 20,
  3849              "type": "array"
  3850            },
  3851            "instructions": {
  3852              "description": "The system instructions that the assistant uses. The maximum length is 32768 characters.\n",
  3853              "maxLength": 32768,
  3854              "nullable": true,
  3855              "type": "string"
  3856            },
  3857            "metadata": {
  3858              "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.\n",
  3859              "nullable": true,
  3860              "type": "object",
  3861              "x-oaiTypeLabel": "map"
  3862            },
  3863            "model": {
  3864              "anyOf": [
  3865                {
  3866                  "type": "string"
  3867                }
  3868              ],
  3869              "description": "ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.\n"
  3870            },
  3871            "name": {
  3872              "description": "The name of the assistant. The maximum length is 256 characters.\n",
  3873              "maxLength": 256,
  3874              "nullable": true,
  3875              "type": "string"
  3876            },
  3877            "tools": {
  3878              "default": [],
  3879              "description": "A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`.\n",
  3880              "items": {
  3881                "oneOf": [
  3882                  {
  3883                    "$ref": "#/components/schemas/AssistantToolsCode"
  3884                  },
  3885                  {
  3886                    "$ref": "#/components/schemas/AssistantToolsRetrieval"
  3887                  },
  3888                  {
  3889                    "$ref": "#/components/schemas/AssistantToolsFunction"
  3890                  }
  3891                ],
  3892                "x-oaiExpandable": true
  3893              },
  3894              "maxItems": 128,
  3895              "type": "array"
  3896            }
  3897          },
  3898          "type": "object"
  3899        },
  3900        "ModifyMessageRequest": {
  3901          "additionalProperties": false,
  3902          "properties": {
  3903            "metadata": {
  3904              "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.\n",
  3905              "nullable": true,
  3906              "type": "object",
  3907              "x-oaiTypeLabel": "map"
  3908            }
  3909          },
  3910          "type": "object"
  3911        },
  3912        "ModifyRunRequest": {
  3913          "additionalProperties": false,
  3914          "properties": {
  3915            "metadata": {
  3916              "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.\n",
  3917              "nullable": true,
  3918              "type": "object",
  3919              "x-oaiTypeLabel": "map"
  3920            }
  3921          },
  3922          "type": "object"
  3923        },
  3924        "ModifyThreadRequest": {
  3925          "additionalProperties": false,
  3926          "properties": {
  3927            "metadata": {
  3928              "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.\n",
  3929              "nullable": true,
  3930              "type": "object",
  3931              "x-oaiTypeLabel": "map"
  3932            }
  3933          },
  3934          "type": "object"
  3935        },
  3936        "OpenAIFile": {
  3937          "description": "The `File` object represents a document that has been uploaded to OpenAI.",
  3938          "properties": {
  3939            "bytes": {
  3940              "description": "The size of the file, in bytes.",
  3941              "type": "integer"
  3942            },
  3943            "created_at": {
  3944              "description": "The Unix timestamp (in seconds) for when the file was created.",
  3945              "type": "integer"
  3946            },
  3947            "filename": {
  3948              "description": "The name of the file.",
  3949              "type": "string"
  3950            },
  3951            "id": {
  3952              "description": "The file identifier, which can be referenced in the API endpoints.",
  3953              "type": "string"
  3954            },
  3955            "object": {
  3956              "description": "The object type, which is always `file`.",
  3957              "enum": [
  3958                "file"
  3959              ],
  3960              "type": "string"
  3961            },
  3962            "purpose": {
  3963              "description": "The intended purpose of the file. Supported values are `fine-tune`, `fine-tune-results`, `assistants`, and `assistants_output`.",
  3964              "enum": [
  3965                "fine-tune",
  3966                "fine-tune-results",
  3967                "assistants",
  3968                "assistants_output"
  3969              ],
  3970              "type": "string"
  3971            },
  3972            "status": {
  3973              "deprecated": true,
  3974              "description": "Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.",
  3975              "enum": [
  3976                "uploaded",
  3977                "processed",
  3978                "error"
  3979              ],
  3980              "type": "string"
  3981            },
  3982            "status_details": {
  3983              "deprecated": true,
  3984              "description": "Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.",
  3985              "type": "string"
  3986            }
  3987          },
  3988          "required": [
  3989            "id",
  3990            "object",
  3991            "bytes",
  3992            "created_at",
  3993            "filename",
  3994            "purpose",
  3995            "status"
  3996          ],
  3997          "title": "OpenAIFile",
  3998          "x-oaiMeta": {
  3999            "example": "{\n  \"id\": \"file-abc123\",\n  \"object\": \"file\",\n  \"bytes\": 120000,\n  \"created_at\": 1677610602,\n  \"filename\": \"salesOverview.pdf\",\n  \"purpose\": \"assistants\",\n}\n",
  4000            "name": "The file object"
  4001          }
  4002        },
  4003        "RunCompletionUsage": {
  4004          "description": "Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.).",
  4005          "nullable": true,
  4006          "properties": {
  4007            "completion_tokens": {
  4008              "description": "Number of completion tokens used over the course of the run.",
  4009              "type": "integer"
  4010            },
  4011            "prompt_tokens": {
  4012              "description": "Number of prompt tokens used over the course of the run.",
  4013              "type": "integer"
  4014            },
  4015            "total_tokens": {
  4016              "description": "Total number of tokens used (prompt + completion).",
  4017              "type": "integer"
  4018            }
  4019          },
  4020          "required": [
  4021            "prompt_tokens",
  4022            "completion_tokens",
  4023            "total_tokens"
  4024          ],
  4025          "type": "object"
  4026        },
  4027        "RunObject": {
  4028          "description": "Represents an execution run on a [thread](/docs/api-reference/threads).",
  4029          "properties": {
  4030            "assistant_id": {
  4031              "description": "The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run.",
  4032              "type": "string"
  4033            },
  4034            "cancelled_at": {
  4035              "description": "The Unix timestamp (in seconds) for when the run was cancelled.",
  4036              "nullable": true,
  4037              "type": "integer"
  4038            },
  4039            "completed_at": {
  4040              "description": "The Unix timestamp (in seconds) for when the run was completed.",
  4041              "nullable": true,
  4042              "type": "integer"
  4043            },
  4044            "created_at": {
  4045              "description": "The Unix timestamp (in seconds) for when the run was created.",
  4046              "type": "integer"
  4047            },
  4048            "expires_at": {
  4049              "description": "The Unix timestamp (in seconds) for when the run will expire.",
  4050              "type": "integer"
  4051            },
  4052            "failed_at": {
  4053              "description": "The Unix timestamp (in seconds) for when the run failed.",
  4054              "nullable": true,
  4055              "type": "integer"
  4056            },
  4057            "file_ids": {
  4058              "default": [],
  4059              "description": "The list of [File](/docs/api-reference/files) IDs the [assistant](/docs/api-reference/assistants) used for this run.",
  4060              "items": {
  4061                "type": "string"
  4062              },
  4063              "type": "array"
  4064            },
  4065            "id": {
  4066              "description": "The identifier, which can be referenced in API endpoints.",
  4067              "type": "string"
  4068            },
  4069            "instructions": {
  4070              "description": "The instructions that the [assistant](/docs/api-reference/assistants) used for this run.",
  4071              "type": "string"
  4072            },
  4073            "last_error": {
  4074              "description": "The last error associated with this run. Will be `null` if there are no errors.",
  4075              "nullable": true,
  4076              "properties": {
  4077                "code": {
  4078                  "description": "One of `server_error` or `rate_limit_exceeded`.",
  4079                  "enum": [
  4080                    "server_error",
  4081                    "rate_limit_exceeded"
  4082                  ],
  4083                  "type": "string"
  4084                },
  4085                "message": {
  4086                  "description": "A human-readable description of the error.",
  4087                  "type": "string"
  4088                }
  4089              },
  4090              "required": [
  4091                "code",
  4092                "message"
  4093              ],
  4094              "type": "object"
  4095            },
  4096            "metadata": {
  4097              "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.\n",
  4098              "nullable": true,
  4099              "type": "object",
  4100              "x-oaiTypeLabel": "map"
  4101            },
  4102            "model": {
  4103              "description": "The model that the [assistant](/docs/api-reference/assistants) used for this run.",
  4104              "type": "string"
  4105            },
  4106            "object": {
  4107              "description": "The object type, which is always `thread.run`.",
  4108              "enum": [
  4109                "thread.run"
  4110              ],
  4111              "type": "string"
  4112            },
  4113            "required_action": {
  4114              "description": "Details on the action required to continue the run. Will be `null` if no action is required.",
  4115              "nullable": true,
  4116              "properties": {
  4117                "submit_tool_outputs": {
  4118                  "description": "Details on the tool outputs needed for this run to continue.",
  4119                  "properties": {
  4120                    "tool_calls": {
  4121                      "description": "A list of the relevant tool calls.",
  4122                      "items": {
  4123                        "$ref": "#/components/schemas/RunToolCallObject"
  4124                      },
  4125                      "type": "array"
  4126                    }
  4127                  },
  4128                  "required": [
  4129                    "tool_calls"
  4130                  ],
  4131                  "type": "object"
  4132                },
  4133                "type": {
  4134                  "description": "For now, this is always `submit_tool_outputs`.",
  4135                  "enum": [
  4136                    "submit_tool_outputs"
  4137                  ],
  4138                  "type": "string"
  4139                }
  4140              },
  4141              "required": [
  4142                "type",
  4143                "submit_tool_outputs"
  4144              ],
  4145              "type": "object"
  4146            },
  4147            "started_at": {
  4148              "description": "The Unix timestamp (in seconds) for when the run was started.",
  4149              "nullable": true,
  4150              "type": "integer"
  4151            },
  4152            "status": {
  4153              "description": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, or `expired`.",
  4154              "enum": [
  4155                "queued",
  4156                "in_progress",
  4157                "requires_action",
  4158                "cancelling",
  4159                "cancelled",
  4160                "failed",
  4161                "completed",
  4162                "expired"
  4163              ],
  4164              "type": "string"
  4165            },
  4166            "thread_id": {
  4167              "description": "The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run.",
  4168              "type": "string"
  4169            },
  4170            "tools": {
  4171              "default": [],
  4172              "description": "The list of tools that the [assistant](/docs/api-reference/assistants) used for this run.",
  4173              "items": {
  4174                "oneOf": [
  4175                  {
  4176                    "$ref": "#/components/schemas/AssistantToolsCode"
  4177                  },
  4178                  {
  4179                    "$ref": "#/components/schemas/AssistantToolsRetrieval"
  4180                  },
  4181                  {
  4182                    "$ref": "#/components/schemas/AssistantToolsFunction"
  4183                  }
  4184                ],
  4185                "x-oaiExpandable": true
  4186              },
  4187              "maxItems": 20,
  4188              "type": "array"
  4189            },
  4190            "usage": {
  4191              "$ref": "#/components/schemas/RunCompletionUsage"
  4192            }
  4193          },
  4194          "required": [
  4195            "id",
  4196            "object",
  4197            "created_at",
  4198            "thread_id",
  4199            "assistant_id",
  4200            "status",
  4201            "required_action",
  4202            "last_error",
  4203            "expires_at",
  4204            "started_at",
  4205            "cancelled_at",
  4206            "failed_at",
  4207            "completed_at",
  4208            "model",
  4209            "instructions",
  4210            "tools",
  4211            "file_ids",
  4212            "metadata",
  4213            "usage"
  4214          ],
  4215          "title": "A run on a thread",
  4216          "type": "object",
  4217          "x-oaiMeta": {
  4218            "beta": true,
  4219            "example": "{\n  \"id\": \"run_abc123\",\n  \"object\": \"thread.run\",\n  \"created_at\": 1698107661,\n  \"assistant_id\": \"asst_abc123\",\n  \"thread_id\": \"thread_abc123\",\n  \"status\": \"completed\",\n  \"started_at\": 1699073476,\n  \"expires_at\": null,\n  \"cancelled_at\": null,\n  \"failed_at\": null,\n  \"completed_at\": 1699073498,\n  \"last_error\": null,\n  \"model\": \"gpt-4\",\n  \"instructions\": null,\n  \"tools\": [{\"type\": \"retrieval\"}, {\"type\": \"code_interpreter\"}],\n  \"file_ids\": [],\n  \"metadata\": {},\n  \"usage\": {\n    \"prompt_tokens\": 123,\n    \"completion_tokens\": 456,\n    \"total_tokens\": 579\n  }\n}\n",
  4220            "name": "The run object"
  4221          }
  4222        },
  4223        "RunStepCompletionUsage": {
  4224          "description": "Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`.",
  4225          "nullable": true,
  4226          "properties": {
  4227            "completion_tokens": {
  4228              "description": "Number of completion tokens used over the course of the run step.",
  4229              "type": "integer"
  4230            },
  4231            "prompt_tokens": {
  4232              "description": "Number of prompt tokens used over the course of the run step.",
  4233              "type": "integer"
  4234            },
  4235            "total_tokens": {
  4236              "description": "Total number of tokens used (prompt + completion).",
  4237              "type": "integer"
  4238            }
  4239          },
  4240          "required": [
  4241            "prompt_tokens",
  4242            "completion_tokens",
  4243            "total_tokens"
  4244          ],
  4245          "type": "object"
  4246        },
  4247        "RunStepDetailsMessageCreationObject": {
  4248          "description": "Details of the message creation by the run step.",
  4249          "properties": {
  4250            "message_creation": {
  4251              "properties": {
  4252                "message_id": {
  4253                  "description": "The ID of the message that was created by this run step.",
  4254                  "type": "string"
  4255                }
  4256              },
  4257              "required": [
  4258                "message_id"
  4259              ],
  4260              "type": "object"
  4261            },
  4262            "type": {
  4263              "description": "Always `message_creation`.",
  4264              "enum": [
  4265                "message_creation"
  4266              ],
  4267              "type": "string"
  4268            }
  4269          },
  4270          "required": [
  4271            "type",
  4272            "message_creation"
  4273          ],
  4274          "title": "Message creation",
  4275          "type": "object"
  4276        },
  4277        "RunStepDetailsToolCallsCodeObject": {
  4278          "description": "Details of the Code Interpreter tool call the run step was involved in.",
  4279          "properties": {
  4280            "code_interpreter": {
  4281              "description": "The Code Interpreter tool call definition.",
  4282              "properties": {
  4283                "input": {
  4284                  "description": "The input to the Code Interpreter tool call.",
  4285                  "type": "string"
  4286                },
  4287                "outputs": {
  4288                  "description": "The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type.",
  4289                  "items": {
  4290                    "oneOf": [
  4291                      {
  4292                        "$ref": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject"
  4293                      },
  4294                      {
  4295                        "$ref": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject"
  4296                      }
  4297                    ],
  4298                    "type": "object",
  4299                    "x-oaiExpandable": true
  4300                  },
  4301                  "type": "array"
  4302                }
  4303              },
  4304              "required": [
  4305                "input",
  4306                "outputs"
  4307              ],
  4308              "type": "object"
  4309            },
  4310            "id": {
  4311              "description": "The ID of the tool call.",
  4312              "type": "string"
  4313            },
  4314            "type": {
  4315              "description": "The type of tool call. This is always going to be `code_interpreter` for this type of tool call.",
  4316              "enum": [
  4317                "code_interpreter"
  4318              ],
  4319              "type": "string"
  4320            }
  4321          },
  4322          "required": [
  4323            "id",
  4324            "type",
  4325            "code_interpreter"
  4326          ],
  4327          "title": "Code interpreter tool call",
  4328          "type": "object"
  4329        },
  4330        "RunStepDetailsToolCallsCodeOutputImageObject": {
  4331          "properties": {
  4332            "image": {
  4333              "properties": {
  4334                "file_id": {
  4335                  "description": "The [file](/docs/api-reference/files) ID of the image.",
  4336                  "type": "string"
  4337                }
  4338              },
  4339              "required": [
  4340                "file_id"
  4341              ],
  4342              "type": "object"
  4343            },
  4344            "type": {
  4345              "description": "Always `image`.",
  4346              "enum": [
  4347                "image"
  4348              ],
  4349              "type": "string"
  4350            }
  4351          },
  4352          "required": [
  4353            "type",
  4354            "image"
  4355          ],
  4356          "title": "Code interpreter image output",
  4357          "type": "object"
  4358        },
  4359        "RunStepDetailsToolCallsCodeOutputLogsObject": {
  4360          "description": "Text output from the Code Interpreter tool call as part of a run step.",
  4361          "properties": {
  4362            "logs": {
  4363              "description": "The text output from the Code Interpreter tool call.",
  4364              "type": "string"
  4365            },
  4366            "type": {
  4367              "description": "Always `logs`.",
  4368              "enum": [
  4369                "logs"
  4370              ],
  4371              "type": "string"
  4372            }
  4373          },
  4374          "required": [
  4375            "type",
  4376            "logs"
  4377          ],
  4378          "title": "Code interpreter log output",
  4379          "type": "object"
  4380        },
  4381        "RunStepDetailsToolCallsFunctionObject": {
  4382          "properties": {
  4383            "function": {
  4384              "description": "The definition of the function that was called.",
  4385              "properties": {
  4386                "arguments": {
  4387                  "description": "The arguments passed to the function.",
  4388                  "type": "string"
  4389                },
  4390                "name": {
  4391                  "description": "The name of the function.",
  4392                  "type": "string"
  4393                },
  4394                "output": {
  4395                  "description": "The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet.",
  4396                  "nullable": true,
  4397                  "type": "string"
  4398                }
  4399              },
  4400              "required": [
  4401                "name",
  4402                "arguments",
  4403                "output"
  4404              ],
  4405              "type": "object"
  4406            },
  4407            "id": {
  4408              "description": "The ID of the tool call object.",
  4409              "type": "string"
  4410            },
  4411            "type": {
  4412              "description": "The type of tool call. This is always going to be `function` for this type of tool call.",
  4413              "enum": [
  4414                "function"
  4415              ],
  4416              "type": "string"
  4417            }
  4418          },
  4419          "required": [
  4420            "id",
  4421            "type",
  4422            "function"
  4423          ],
  4424          "title": "Function tool call",
  4425          "type": "object"
  4426        },
  4427        "RunStepDetailsToolCallsObject": {
  4428          "description": "Details of the tool call.",
  4429          "properties": {
  4430            "tool_calls": {
  4431              "description": "An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `retrieval`, or `function`.\n",
  4432              "items": {
  4433                "oneOf": [
  4434                  {
  4435                    "$ref": "#/components/schemas/RunStepDetailsToolCallsCodeObject"
  4436                  },
  4437                  {
  4438                    "$ref": "#/components/schemas/RunStepDetailsToolCallsRetrievalObject"
  4439                  },
  4440                  {
  4441                    "$ref": "#/components/schemas/RunStepDetailsToolCallsFunctionObject"
  4442                  }
  4443                ],
  4444                "type": "object",
  4445                "x-oaiExpandable": true
  4446              },
  4447              "type": "array"
  4448            },
  4449            "type": {
  4450              "description": "Always `tool_calls`.",
  4451              "enum": [
  4452                "tool_calls"
  4453              ],
  4454              "type": "string"
  4455            }
  4456          },
  4457          "required": [
  4458            "type",
  4459            "tool_calls"
  4460          ],
  4461          "title": "Tool calls",
  4462          "type": "object"
  4463        },
  4464        "RunStepDetailsToolCallsRetrievalObject": {
  4465          "properties": {
  4466            "id": {
  4467              "description": "The ID of the tool call object.",
  4468              "type": "string"
  4469            },
  4470            "retrieval": {
  4471              "description": "For now, this is always going to be an empty object.",
  4472              "type": "object",
  4473              "x-oaiTypeLabel": "map"
  4474            },
  4475            "type": {
  4476              "description": "The type of tool call. This is always going to be `retrieval` for this type of tool call.",
  4477              "enum": [
  4478                "retrieval"
  4479              ],
  4480              "type": "string"
  4481            }
  4482          },
  4483          "required": [
  4484            "id",
  4485            "type",
  4486            "retrieval"
  4487          ],
  4488          "title": "Retrieval tool call",
  4489          "type": "object"
  4490        },
  4491        "RunStepObject": {
  4492          "description": "Represents a step in execution of a run.\n",
  4493          "properties": {
  4494            "assistant_id": {
  4495              "description": "The ID of the [assistant](/docs/api-reference/assistants) associated with the run step.",
  4496              "type": "string"
  4497            },
  4498            "cancelled_at": {
  4499              "description": "The Unix timestamp (in seconds) for when the run step was cancelled.",
  4500              "nullable": true,
  4501              "type": "integer"
  4502            },
  4503            "completed_at": {
  4504              "description": "The Unix timestamp (in seconds) for when the run step completed.",
  4505              "nullable": true,
  4506              "type": "integer"
  4507            },
  4508            "created_at": {
  4509              "description": "The Unix timestamp (in seconds) for when the run step was created.",
  4510              "type": "integer"
  4511            },
  4512            "expired_at": {
  4513              "description": "The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired.",
  4514              "nullable": true,
  4515              "type": "integer"
  4516            },
  4517            "failed_at": {
  4518              "description": "The Unix timestamp (in seconds) for when the run step failed.",
  4519              "nullable": true,
  4520              "type": "integer"
  4521            },
  4522            "id": {
  4523              "description": "The identifier of the run step, which can be referenced in API endpoints.",
  4524              "type": "string"
  4525            },
  4526            "last_error": {
  4527              "description": "The last error associated with this run step. Will be `null` if there are no errors.",
  4528              "nullable": true,
  4529              "properties": {
  4530                "code": {
  4531                  "description": "One of `server_error` or `rate_limit_exceeded`.",
  4532                  "enum": [
  4533                    "server_error",
  4534                    "rate_limit_exceeded"
  4535                  ],
  4536                  "type": "string"
  4537                },
  4538                "message": {
  4539                  "description": "A human-readable description of the error.",
  4540                  "type": "string"
  4541                }
  4542              },
  4543              "required": [
  4544                "code",
  4545                "message"
  4546              ],
  4547              "type": "object"
  4548            },
  4549            "metadata": {
  4550              "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.\n",
  4551              "nullable": true,
  4552              "type": "object",
  4553              "x-oaiTypeLabel": "map"
  4554            },
  4555            "object": {
  4556              "description": "The object type, which is always `thread.run.step`.",
  4557              "enum": [
  4558                "thread.run.step"
  4559              ],
  4560              "type": "string"
  4561            },
  4562            "run_id": {
  4563              "description": "The ID of the [run](/docs/api-reference/runs) that this run step is a part of.",
  4564              "type": "string"
  4565            },
  4566            "status": {
  4567              "description": "The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`.",
  4568              "enum": [
  4569                "in_progress",
  4570                "cancelled",
  4571                "failed",
  4572                "completed",
  4573                "expired"
  4574              ],
  4575              "type": "string"
  4576            },
  4577            "step_details": {
  4578              "description": "The details of the run step.",
  4579              "oneOf": [
  4580                {
  4581                  "$ref": "#/components/schemas/RunStepDetailsMessageCreationObject"
  4582                },
  4583                {
  4584                  "$ref": "#/components/schemas/RunStepDetailsToolCallsObject"
  4585                }
  4586              ],
  4587              "type": "object",
  4588              "x-oaiExpandable": true
  4589            },
  4590            "thread_id": {
  4591              "description": "The ID of the [thread](/docs/api-reference/threads) that was run.",
  4592              "type": "string"
  4593            },
  4594            "type": {
  4595              "description": "The type of run step, which can be either `message_creation` or `tool_calls`.",
  4596              "enum": [
  4597                "message_creation",
  4598                "tool_calls"
  4599              ],
  4600              "type": "string"
  4601            },
  4602            "usage": {
  4603              "$ref": "#/components/schemas/RunStepCompletionUsage"
  4604            }
  4605          },
  4606          "required": [
  4607            "id",
  4608            "object",
  4609            "created_at",
  4610            "assistant_id",
  4611            "thread_id",
  4612            "run_id",
  4613            "type",
  4614            "status",
  4615            "step_details",
  4616            "last_error",
  4617            "expired_at",
  4618            "cancelled_at",
  4619            "failed_at",
  4620            "completed_at",
  4621            "metadata",
  4622            "usage"
  4623          ],
  4624          "title": "Run steps",
  4625          "type": "object",
  4626          "x-oaiMeta": {
  4627            "beta": true,
  4628            "example": "{\n  \"id\": \"step_abc123\",\n  \"object\": \"thread.run.step\",\n  \"created_at\": 1699063291,\n  \"run_id\": \"run_abc123\",\n  \"assistant_id\": \"asst_abc123\",\n  \"thread_id\": \"thread_abc123\",\n  \"type\": \"message_creation\",\n  \"status\": \"completed\",\n  \"cancelled_at\": null,\n  \"completed_at\": 1699063291,\n  \"expired_at\": null,\n  \"failed_at\": null,\n  \"last_error\": null,\n  \"step_details\": {\n    \"type\": \"message_creation\",\n    \"message_creation\": {\n      \"message_id\": \"msg_abc123\"\n    }\n  },\n  \"usage\": {\n    \"prompt_tokens\": 123,\n    \"completion_tokens\": 456,\n    \"total_tokens\": 579\n  }\n}\n",
  4629            "name": "The run step object"
  4630          }
  4631        },
  4632        "RunToolCallObject": {
  4633          "description": "Tool call objects",
  4634          "properties": {
  4635            "function": {
  4636              "description": "The function definition.",
  4637              "properties": {
  4638                "arguments": {
  4639                  "description": "The arguments that the model expects you to pass to the function.",
  4640                  "type": "string"
  4641                },
  4642                "name": {
  4643                  "description": "The name of the function.",
  4644                  "type": "string"
  4645                }
  4646              },
  4647              "required": [
  4648                "name",
  4649                "arguments"
  4650              ],
  4651              "type": "object"
  4652            },
  4653            "id": {
  4654              "description": "The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint.",
  4655              "type": "string"
  4656            },
  4657            "type": {
  4658              "description": "The type of tool call the output is required for. For now, this is always `function`.",
  4659              "enum": [
  4660                "function"
  4661              ],
  4662              "type": "string"
  4663            }
  4664          },
  4665          "required": [
  4666            "id",
  4667            "type",
  4668            "function"
  4669          ],
  4670          "type": "object"
  4671        },
  4672        "SubmitToolOutputsRunRequest": {
  4673          "additionalProperties": false,
  4674          "properties": {
  4675            "tool_outputs": {
  4676              "description": "A list of tools for which the outputs are being submitted.",
  4677              "items": {
  4678                "properties": {
  4679                  "output": {
  4680                    "description": "The output of the tool call to be submitted to continue the run.",
  4681                    "type": "string"
  4682                  },
  4683                  "tool_call_id": {
  4684                    "description": "The ID of the tool call in the `required_action` object within the run object the output is being submitted for.",
  4685                    "type": "string"
  4686                  }
  4687                },
  4688                "type": "object"
  4689              },
  4690              "type": "array"
  4691            }
  4692          },
  4693          "required": [
  4694            "tool_outputs"
  4695          ],
  4696          "type": "object"
  4697        },
  4698        "ThreadObject": {
  4699          "description": "Represents a thread that contains [messages](/docs/api-reference/messages).",
  4700          "properties": {
  4701            "created_at": {
  4702              "description": "The Unix timestamp (in seconds) for when the thread was created.",
  4703              "type": "integer"
  4704            },
  4705            "id": {
  4706              "description": "The identifier, which can be referenced in API endpoints.",
  4707              "type": "string"
  4708            },
  4709            "metadata": {
  4710              "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.\n",
  4711              "nullable": true,
  4712              "type": "object",
  4713              "x-oaiTypeLabel": "map"
  4714            },
  4715            "object": {
  4716              "description": "The object type, which is always `thread`.",
  4717              "enum": [
  4718                "thread"
  4719              ],
  4720              "type": "string"
  4721            }
  4722          },
  4723          "required": [
  4724            "id",
  4725            "object",
  4726            "created_at",
  4727            "metadata"
  4728          ],
  4729          "title": "Thread",
  4730          "type": "object",
  4731          "x-oaiMeta": {
  4732            "beta": true,
  4733            "example": "{\n  \"id\": \"thread_abc123\",\n  \"object\": \"thread\",\n  \"created_at\": 1698107661,\n  \"metadata\": {}\n}\n",
  4734            "name": "The thread object"
  4735          }
  4736        }
  4737      },
  4738      "securitySchemes": {
  4739        "ApiKeyAuth": {
  4740          "scheme": "bearer",
  4741          "type": "http"
  4742        }
  4743      }
  4744    },
  4745    "info": {
  4746      "contact": {
  4747        "name": "OpenAI Support",
  4748        "url": "https://help.openai.com/"
  4749      },
  4750      "description": "The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.",
  4751      "license": {
  4752        "name": "MIT",
  4753        "url": "https://github.com/openai/openai-openapi/blob/master/LICENSE"
  4754      },
  4755      "termsOfService": "https://openai.com/policies/terms-of-use",
  4756      "title": "OpenAI API",
  4757      "version": "2.0.0"
  4758    },
  4759    "openapi": "3.0.0",
  4760    "paths": {
  4761      "/assistants": {
  4762        "get": {
  4763          "operationId": "listAssistants",
  4764          "parameters": [
  4765            {
  4766              "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n",
  4767              "in": "query",
  4768              "name": "limit",
  4769              "required": false,
  4770              "schema": {
  4771                "default": 20,
  4772                "type": "integer"
  4773              }
  4774            },
  4775            {
  4776              "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.\n",
  4777              "in": "query",
  4778              "name": "order",
  4779              "schema": {
  4780                "default": "desc",
  4781                "enum": [
  4782                  "asc",
  4783                  "desc"
  4784                ],
  4785                "type": "string"
  4786              }
  4787            },
  4788            {
  4789              "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.\n",
  4790              "in": "query",
  4791              "name": "after",
  4792              "schema": {
  4793                "type": "string"
  4794              }
  4795            },
  4796            {
  4797              "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.\n",
  4798              "in": "query",
  4799              "name": "before",
  4800              "schema": {
  4801                "type": "string"
  4802              }
  4803            }
  4804          ],
  4805          "responses": {
  4806            "200": {
  4807              "content": {
  4808                "application/json": {
  4809                  "schema": {
  4810                    "$ref": "#/components/schemas/ListAssistantsResponse"
  4811                  }
  4812                }
  4813              },
  4814              "description": "OK"
  4815            }
  4816          },
  4817          "summary": "Returns a list of assistants.",
  4818          "tags": [
  4819            "Assistants"
  4820          ],
  4821          "x-oaiMeta": {
  4822            "beta": true,
  4823            "examples": {
  4824              "request": {
  4825                "curl": "curl \"https://api.openai.com/v1/assistants?order=desc&limit=20\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"OpenAI-Beta: assistants=v1\"\n",
  4826                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const myAssistants = await openai.beta.assistants.list({\n    order: \"desc\",\n    limit: \"20\",\n  });\n\n  console.log(myAssistants.data);\n}\n\nmain();",
  4827                "python": "from openai import OpenAI\nclient = OpenAI()\n\nmy_assistants = client.beta.assistants.list(\n    order=\"desc\",\n    limit=\"20\",\n)\nprint(my_assistants.data)\n"
  4828              },
  4829              "response": "{\n  \"object\": \"list\",\n  \"data\": [\n    {\n      \"id\": \"asst_abc123\",\n      \"object\": \"assistant\",\n      \"created_at\": 1698982736,\n      \"name\": \"Coding Tutor\",\n      \"description\": null,\n      \"model\": \"gpt-4\",\n      \"instructions\": \"You are a helpful assistant designed to make me better at coding!\",\n      \"tools\": [],\n      \"file_ids\": [],\n      \"metadata\": {}\n    },\n    {\n      \"id\": \"asst_abc456\",\n      \"object\": \"assistant\",\n      \"created_at\": 1698982718,\n      \"name\": \"My Assistant\",\n      \"description\": null,\n      \"model\": \"gpt-4\",\n      \"instructions\": \"You are a helpful assistant designed to make me better at coding!\",\n      \"tools\": [],\n      \"file_ids\": [],\n      \"metadata\": {}\n    },\n    {\n      \"id\": \"asst_abc789\",\n      \"object\": \"assistant\",\n      \"created_at\": 1698982643,\n      \"name\": null,\n      \"description\": null,\n      \"model\": \"gpt-4\",\n      \"instructions\": null,\n      \"tools\": [],\n      \"file_ids\": [],\n      \"metadata\": {}\n    }\n  ],\n  \"first_id\": \"asst_abc123\",\n  \"last_id\": \"asst_abc789\",\n  \"has_more\": false\n}\n"
  4830            },
  4831            "group": "assistants",
  4832            "name": "List assistants",
  4833            "returns": "A list of [assistant](/docs/api-reference/assistants/object) objects."
  4834          }
  4835        },
  4836        "post": {
  4837          "operationId": "createAssistant",
  4838          "requestBody": {
  4839            "content": {
  4840              "application/json": {
  4841                "schema": {
  4842                  "$ref": "#/components/schemas/CreateAssistantRequest"
  4843                }
  4844              }
  4845            },
  4846            "required": true
  4847          },
  4848          "responses": {
  4849            "200": {
  4850              "content": {
  4851                "application/json": {
  4852                  "schema": {
  4853                    "$ref": "#/components/schemas/AssistantObject"
  4854                  }
  4855                }
  4856              },
  4857              "description": "OK"
  4858            }
  4859          },
  4860          "summary": "Create an assistant with a model and instructions.",
  4861          "tags": [
  4862            "Assistants"
  4863          ],
  4864          "x-oaiMeta": {
  4865            "beta": true,
  4866            "examples": [
  4867              {
  4868                "request": {
  4869                  "curl": "curl \"https://api.openai.com/v1/assistants\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"OpenAI-Beta: assistants=v1\" \\\n  -d '{\n    \"instructions\": \"You are a personal math tutor. When asked a question, write and run Python code to answer the question.\",\n    \"name\": \"Math Tutor\",\n    \"tools\": [{\"type\": \"code_interpreter\"}],\n    \"model\": \"gpt-4\"\n  }'\n",
  4870                  "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const myAssistant = await openai.beta.assistants.create({\n    instructions:\n      \"You are a personal math tutor. When asked a question, write and run Python code to answer the question.\",\n    name: \"Math Tutor\",\n    tools: [{ type: \"code_interpreter\" }],\n    model: \"gpt-4\",\n  });\n\n  console.log(myAssistant);\n}\n\nmain();",
  4871                  "python": "from openai import OpenAI\nclient = OpenAI()\n\nmy_assistant = client.beta.assistants.create(\n    instructions=\"You are a personal math tutor. When asked a question, write and run Python code to answer the question.\",\n    name=\"Math Tutor\",\n    tools=[{\"type\": \"code_interpreter\"}],\n    model=\"gpt-4\",\n)\nprint(my_assistant)\n"
  4872                },
  4873                "response": "{\n  \"id\": \"asst_abc123\",\n  \"object\": \"assistant\",\n  \"created_at\": 1698984975,\n  \"name\": \"Math Tutor\",\n  \"description\": null,\n  \"model\": \"gpt-4\",\n  \"instructions\": \"You are a personal math tutor. When asked a question, write and run Python code to answer the question.\",\n  \"tools\": [\n    {\n      \"type\": \"code_interpreter\"\n    }\n  ],\n  \"file_ids\": [],\n  \"metadata\": {}\n}\n",
  4874                "title": "Code Interpreter"
  4875              },
  4876              {
  4877                "request": {
  4878                  "curl": "curl https://api.openai.com/v1/assistants \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"OpenAI-Beta: assistants=v1\" \\\n  -d '{\n    \"instructions\": \"You are an HR bot, and you have access to files to answer employee questions about company policies.\",\n    \"tools\": [{\"type\": \"retrieval\"}],\n    \"model\": \"gpt-4\",\n    \"file_ids\": [\"file-abc123\"]\n  }'\n",
  4879                  "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const myAssistant = await openai.beta.assistants.create({\n    instructions:\n      \"You are an HR bot, and you have access to files to answer employee questions about company policies.\",\n    name: \"HR Helper\",\n    tools: [{ type: \"retrieval\" }],\n    model: \"gpt-4\",\n    file_ids: [\"file-abc123\"],\n  });\n\n  console.log(myAssistant);\n}\n\nmain();",
  4880                  "python": "from openai import OpenAI\nclient = OpenAI()\n\nmy_assistant = client.beta.assistants.create(\n    instructions=\"You are an HR bot, and you have access to files to answer employee questions about company policies.\",\n    name=\"HR Helper\",\n    tools=[{\"type\": \"retrieval\"}],\n    model=\"gpt-4\",\n    file_ids=[\"file-abc123\"],\n)\nprint(my_assistant)\n"
  4881                },
  4882                "response": "{\n  \"id\": \"asst_abc123\",\n  \"object\": \"assistant\",\n  \"created_at\": 1699009403,\n  \"name\": \"HR Helper\",\n  \"description\": null,\n  \"model\": \"gpt-4\",\n  \"instructions\": \"You are an HR bot, and you have access to files to answer employee questions about company policies.\",\n  \"tools\": [\n    {\n      \"type\": \"retrieval\"\n    }\n  ],\n  \"file_ids\": [\n    \"file-abc123\"\n  ],\n  \"metadata\": {}\n}\n",
  4883                "title": "Files"
  4884              }
  4885            ],
  4886            "group": "assistants",
  4887            "name": "Create assistant",
  4888            "returns": "An [assistant](/docs/api-reference/assistants/object) object."
  4889          }
  4890        }
  4891      },
  4892      "/assistants/{assistant_id}": {
  4893        "delete": {
  4894          "operationId": "deleteAssistant",
  4895          "parameters": [
  4896            {
  4897              "description": "The ID of the assistant to delete.",
  4898              "in": "path",
  4899              "name": "assistant_id",
  4900              "required": true,
  4901              "schema": {
  4902                "type": "string"
  4903              }
  4904            }
  4905          ],
  4906          "responses": {
  4907            "200": {
  4908              "content": {
  4909                "application/json": {
  4910                  "schema": {
  4911                    "$ref": "#/components/schemas/DeleteAssistantResponse"
  4912                  }
  4913                }
  4914              },
  4915              "description": "OK"
  4916            }
  4917          },
  4918          "summary": "Delete an assistant.",
  4919          "tags": [
  4920            "Assistants"
  4921          ],
  4922          "x-oaiMeta": {
  4923            "beta": true,
  4924            "examples": {
  4925              "request": {
  4926                "curl": "curl https://api.openai.com/v1/assistants/asst_abc123 \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"OpenAI-Beta: assistants=v1\" \\\n  -X DELETE\n",
  4927                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const response = await openai.beta.assistants.del(\"asst_abc123\");\n\n  console.log(response);\n}\nmain();",
  4928                "python": "from openai import OpenAI\nclient = OpenAI()\n\nresponse = client.beta.assistants.delete(\"asst_abc123\")\nprint(response)\n"
  4929              },
  4930              "response": "{\n  \"id\": \"asst_abc123\",\n  \"object\": \"assistant.deleted\",\n  \"deleted\": true\n}\n"
  4931            },
  4932            "group": "assistants",
  4933            "name": "Delete assistant",
  4934            "returns": "Deletion status"
  4935          }
  4936        },
  4937        "get": {
  4938          "operationId": "getAssistant",
  4939          "parameters": [
  4940            {
  4941              "description": "The ID of the assistant to retrieve.",
  4942              "in": "path",
  4943              "name": "assistant_id",
  4944              "required": true,
  4945              "schema": {
  4946                "type": "string"
  4947              }
  4948            }
  4949          ],
  4950          "responses": {
  4951            "200": {
  4952              "content": {
  4953                "application/json": {
  4954                  "schema": {
  4955                    "$ref": "#/components/schemas/AssistantObject"
  4956                  }
  4957                }
  4958              },
  4959              "description": "OK"
  4960            }
  4961          },
  4962          "summary": "Retrieves an assistant.",
  4963          "tags": [
  4964            "Assistants"
  4965          ],
  4966          "x-oaiMeta": {
  4967            "beta": true,
  4968            "examples": {
  4969              "request": {
  4970                "curl": "curl https://api.openai.com/v1/assistants/asst_abc123 \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"OpenAI-Beta: assistants=v1\"\n",
  4971                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const myAssistant = await openai.beta.assistants.retrieve(\n    \"asst_abc123\"\n  );\n\n  console.log(myAssistant);\n}\n\nmain();",
  4972                "python": "from openai import OpenAI\nclient = OpenAI()\n\nmy_assistant = client.beta.assistants.retrieve(\"asst_abc123\")\nprint(my_assistant)\n"
  4973              },
  4974              "response": "{\n  \"id\": \"asst_abc123\",\n  \"object\": \"assistant\",\n  \"created_at\": 1699009709,\n  \"name\": \"HR Helper\",\n  \"description\": null,\n  \"model\": \"gpt-4\",\n  \"instructions\": \"You are an HR bot, and you have access to files to answer employee questions about company policies.\",\n  \"tools\": [\n    {\n      \"type\": \"retrieval\"\n    }\n  ],\n  \"file_ids\": [\n    \"file-abc123\"\n  ],\n  \"metadata\": {}\n}\n"
  4975            },
  4976            "group": "assistants",
  4977            "name": "Retrieve assistant",
  4978            "returns": "The [assistant](/docs/api-reference/assistants/object) object matching the specified ID."
  4979          }
  4980        },
  4981        "post": {
  4982          "operationId": "modifyAssistant",
  4983          "parameters": [
  4984            {
  4985              "description": "The ID of the assistant to modify.",
  4986              "in": "path",
  4987              "name": "assistant_id",
  4988              "required": true,
  4989              "schema": {
  4990                "type": "string"
  4991              }
  4992            }
  4993          ],
  4994          "requestBody": {
  4995            "content": {
  4996              "application/json": {
  4997                "schema": {
  4998                  "$ref": "#/components/schemas/ModifyAssistantRequest"
  4999                }
  5000              }
  5001            },
  5002            "required": true
  5003          },
  5004          "responses": {
  5005            "200": {
  5006              "content": {
  5007                "application/json": {
  5008                  "schema": {
  5009                    "$ref": "#/components/schemas/AssistantObject"
  5010                  }
  5011                }
  5012              },
  5013              "description": "OK"
  5014            }
  5015          },
  5016          "summary": "Modifies an assistant.",
  5017          "tags": [
  5018            "Assistants"
  5019          ],
  5020          "x-oaiMeta": {
  5021            "beta": true,
  5022            "examples": {
  5023              "request": {
  5024                "curl": "curl https://api.openai.com/v1/assistants/asst_abc123 \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"OpenAI-Beta: assistants=v1\" \\\n  -d '{\n      \"instructions\": \"You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.\",\n      \"tools\": [{\"type\": \"retrieval\"}],\n      \"model\": \"gpt-4\",\n      \"file_ids\": [\"file-abc123\", \"file-abc456\"]\n    }'\n",
  5025                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const myUpdatedAssistant = await openai.beta.assistants.update(\n    \"asst_abc123\",\n    {\n      instructions:\n        \"You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.\",\n      name: \"HR Helper\",\n      tools: [{ type: \"retrieval\" }],\n      model: \"gpt-4\",\n      file_ids: [\n        \"file-abc123\",\n        \"file-abc456\",\n      ],\n    }\n  );\n\n  console.log(myUpdatedAssistant);\n}\n\nmain();",
  5026                "python": "from openai import OpenAI\nclient = OpenAI()\n\nmy_updated_assistant = client.beta.assistants.update(\n  \"asst_abc123\",\n  instructions=\"You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.\",\n  name=\"HR Helper\",\n  tools=[{\"type\": \"retrieval\"}],\n  model=\"gpt-4\",\n  file_ids=[\"file-abc123\", \"file-abc456\"],\n)\n\nprint(my_updated_assistant)\n"
  5027              },
  5028              "response": "{\n  \"id\": \"asst_abc123\",\n  \"object\": \"assistant\",\n  \"created_at\": 1699009709,\n  \"name\": \"HR Helper\",\n  \"description\": null,\n  \"model\": \"gpt-4\",\n  \"instructions\": \"You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.\",\n  \"tools\": [\n    {\n      \"type\": \"retrieval\"\n    }\n  ],\n  \"file_ids\": [\n    \"file-abc123\",\n    \"file-abc456\"\n  ],\n  \"metadata\": {}\n}\n"
  5029            },
  5030            "group": "assistants",
  5031            "name": "Modify assistant",
  5032            "returns": "The modified [assistant](/docs/api-reference/assistants/object) object."
  5033          }
  5034        }
  5035      },
  5036      "/assistants/{assistant_id}/files": {
  5037        "get": {
  5038          "operationId": "listAssistantFiles",
  5039          "parameters": [
  5040            {
  5041              "description": "The ID of the assistant the file belongs to.",
  5042              "in": "path",
  5043              "name": "assistant_id",
  5044              "required": true,
  5045              "schema": {
  5046                "type": "string"
  5047              }
  5048            },
  5049            {
  5050              "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n",
  5051              "in": "query",
  5052              "name": "limit",
  5053              "required": false,
  5054              "schema": {
  5055                "default": 20,
  5056                "type": "integer"
  5057              }
  5058            },
  5059            {
  5060              "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.\n",
  5061              "in": "query",
  5062              "name": "order",
  5063              "schema": {
  5064                "default": "desc",
  5065                "enum": [
  5066                  "asc",
  5067                  "desc"
  5068                ],
  5069                "type": "string"
  5070              }
  5071            },
  5072            {
  5073              "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.\n",
  5074              "in": "query",
  5075              "name": "after",
  5076              "schema": {
  5077                "type": "string"
  5078              }
  5079            },
  5080            {
  5081              "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.\n",
  5082              "in": "query",
  5083              "name": "before",
  5084              "schema": {
  5085                "type": "string"
  5086              }
  5087            }
  5088          ],
  5089          "responses": {
  5090            "200": {
  5091              "content": {
  5092                "application/json": {
  5093                  "schema": {
  5094                    "$ref": "#/components/schemas/ListAssistantFilesResponse"
  5095                  }
  5096                }
  5097              },
  5098              "description": "OK"
  5099            }
  5100          },
  5101          "summary": "Returns a list of assistant files.",
  5102          "tags": [
  5103            "Assistants"
  5104          ],
  5105          "x-oaiMeta": {
  5106            "beta": true,
  5107            "examples": {
  5108              "request": {
  5109                "curl": "curl https://api.openai.com/v1/assistants/asst_abc123/files \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"OpenAI-Beta: assistants=v1\"\n",
  5110                "node.js": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n  const assistantFiles = await openai.beta.assistants.files.list(\n    \"asst_abc123\"\n  );\n  console.log(assistantFiles);\n}\n\nmain();\n",
  5111                "python": "from openai import OpenAI\nclient = OpenAI()\n\nassistant_files = client.beta.assistants.files.list(\n  assistant_id=\"asst_abc123\"\n)\nprint(assistant_files)\n"
  5112              },
  5113              "response": "{\n  \"object\": \"list\",\n  \"data\": [\n    {\n      \"id\": \"file-abc123\",\n      \"object\": \"assistant.file\",\n      \"created_at\": 1699060412,\n      \"assistant_id\": \"asst_abc123\"\n    },\n    {\n      \"id\": \"file-abc456\",\n      \"object\": \"assistant.file\",\n      \"created_at\": 1699060412,\n      \"assistant_id\": \"asst_abc123\"\n    }\n  ],\n  \"first_id\": \"file-abc123\",\n  \"last_id\": \"file-abc456\",\n  \"has_more\": false\n}\n"
  5114            },
  5115            "group": "assistants",
  5116            "name": "List assistant files",
  5117            "returns": "A list of [assistant file](/docs/api-reference/assistants/file-object) objects."
  5118          }
  5119        },
  5120        "post": {
  5121          "operationId": "createAssistantFile",
  5122          "parameters": [
  5123            {
  5124              "description": "The ID of the assistant for which to create a File.\n",
  5125              "in": "path",
  5126              "name": "assistant_id",
  5127              "required": true,
  5128              "schema": {
  5129                "example": "file-abc123",
  5130                "type": "string"
  5131              }
  5132            }
  5133          ],
  5134          "requestBody": {
  5135            "content": {
  5136              "application/json": {
  5137                "schema": {
  5138                  "$ref": "#/components/schemas/CreateAssistantFileRequest"
  5139                }
  5140              }
  5141            },
  5142            "required": true
  5143          },
  5144          "responses": {
  5145            "200": {
  5146              "content": {
  5147                "application/json": {
  5148                  "schema": {
  5149                    "$ref": "#/components/schemas/AssistantFileObject"
  5150                  }
  5151                }
  5152              },
  5153              "description": "OK"
  5154            }
  5155          },
  5156          "summary": "Create an assistant file by attaching a [File](/docs/api-reference/files) to an [assistant](/docs/api-reference/assistants).",
  5157          "tags": [
  5158            "Assistants"
  5159          ],
  5160          "x-oaiMeta": {
  5161            "beta": true,
  5162            "examples": {
  5163              "request": {
  5164                "curl": "curl https://api.openai.com/v1/assistants/asst_abc123/files \\\n    -H 'Authorization: Bearer $OPENAI_API_KEY\"' \\\n    -H 'Content-Type: application/json' \\\n    -H 'OpenAI-Beta: assistants=v1' \\\n    -d '{\n      \"file_id\": \"file-abc123\"\n    }'\n",
  5165                "node.js": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n  const myAssistantFile = await openai.beta.assistants.files.create(\n    \"asst_abc123\",\n    {\n      file_id: \"file-abc123\"\n    }\n  );\n  console.log(myAssistantFile);\n}\n\nmain();\n",
  5166                "python": "from openai import OpenAI\nclient = OpenAI()\n\nassistant_file = client.beta.assistants.files.create(\n  assistant_id=\"asst_abc123\",\n  file_id=\"file-abc123\"\n)\nprint(assistant_file)\n"
  5167              },
  5168              "response": "{\n  \"id\": \"file-abc123\",\n  \"object\": \"assistant.file\",\n  \"created_at\": 1699055364,\n  \"assistant_id\": \"asst_abc123\"\n}\n"
  5169            },
  5170            "group": "assistants",
  5171            "name": "Create assistant file",
  5172            "returns": "An [assistant file](/docs/api-reference/assistants/file-object) object."
  5173          }
  5174        }
  5175      },
  5176      "/assistants/{assistant_id}/files/{file_id}": {
  5177        "delete": {
  5178          "operationId": "deleteAssistantFile",
  5179          "parameters": [
  5180            {
  5181              "description": "The ID of the assistant that the file belongs to.",
  5182              "in": "path",
  5183              "name": "assistant_id",
  5184              "required": true,
  5185              "schema": {
  5186                "type": "string"
  5187              }
  5188            },
  5189            {
  5190              "description": "The ID of the file to delete.",
  5191              "in": "path",
  5192              "name": "file_id",
  5193              "required": true,
  5194              "schema": {
  5195                "type": "string"
  5196              }
  5197            }
  5198          ],
  5199          "responses": {
  5200            "200": {
  5201              "content": {
  5202                "application/json": {
  5203                  "schema": {
  5204                    "$ref": "#/components/schemas/DeleteAssistantFileResponse"
  5205                  }
  5206                }
  5207              },
  5208              "description": "OK"
  5209            }
  5210          },
  5211          "summary": "Delete an assistant file.",
  5212          "tags": [
  5213            "Assistants"
  5214          ],
  5215          "x-oaiMeta": {
  5216            "beta": true,
  5217            "examples": {
  5218              "request": {
  5219                "curl": "curl https://api.openai.com/v1/assistants/asst_abc123/files/file-abc123 \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"OpenAI-Beta: assistants=v1\" \\\n  -X DELETE\n",
  5220                "node.js": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n  const deletedAssistantFile = await openai.beta.assistants.files.del(\n    \"asst_abc123\",\n    \"file-abc123\"\n  );\n  console.log(deletedAssistantFile);\n}\n\nmain();\n",
  5221                "python": "from openai import OpenAI\nclient = OpenAI()\n\ndeleted_assistant_file = client.beta.assistants.files.delete(\n    assistant_id=\"asst_abc123\",\n    file_id=\"file-abc123\"\n)\nprint(deleted_assistant_file)\n"
  5222              },
  5223              "response": "{\n  id: \"file-abc123\",\n  object: \"assistant.file.deleted\",\n  deleted: true\n}\n"
  5224            },
  5225            "group": "assistants",
  5226            "name": "Delete assistant file",
  5227            "returns": "Deletion status"
  5228          }
  5229        },
  5230        "get": {
  5231          "operationId": "getAssistantFile",
  5232          "parameters": [
  5233            {
  5234              "description": "The ID of the assistant who the file belongs to.",
  5235              "in": "path",
  5236              "name": "assistant_id",
  5237              "required": true,
  5238              "schema": {
  5239                "type": "string"
  5240              }
  5241            },
  5242            {
  5243              "description": "The ID of the file we're getting.",
  5244              "in": "path",
  5245              "name": "file_id",
  5246              "required": true,
  5247              "schema": {
  5248                "type": "string"
  5249              }
  5250            }
  5251          ],
  5252          "responses": {
  5253            "200": {
  5254              "content": {
  5255                "application/json": {
  5256                  "schema": {
  5257                    "$ref": "#/components/schemas/AssistantFileObject"
  5258                  }
  5259                }
  5260              },
  5261              "description": "OK"
  5262            }
  5263          },
  5264          "summary": "Retrieves an AssistantFile.",
  5265          "tags": [
  5266            "Assistants"
  5267          ],
  5268          "x-oaiMeta": {
  5269            "beta": true,
  5270            "examples": {
  5271              "request": {
  5272                "curl": "curl https://api.openai.com/v1/assistants/asst_abc123/files/file-abc123 \\\n  -H 'Authorization: Bearer $OPENAI_API_KEY\"' \\\n  -H 'Content-Type: application/json' \\\n  -H 'OpenAI-Beta: assistants=v1'\n",
  5273                "node.js": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n  const myAssistantFile = await openai.beta.assistants.files.retrieve(\n    \"asst_abc123\",\n    \"file-abc123\"\n  );\n  console.log(myAssistantFile);\n}\n\nmain();\n",
  5274                "python": "from openai import OpenAI\nclient = OpenAI()\n\nassistant_file = client.beta.assistants.files.retrieve(\n  assistant_id=\"asst_abc123\",\n  file_id=\"file-abc123\"\n)\nprint(assistant_file)\n"
  5275              },
  5276              "response": "{\n  \"id\": \"file-abc123\",\n  \"object\": \"assistant.file\",\n  \"created_at\": 1699055364,\n  \"assistant_id\": \"asst_abc123\"\n}\n"
  5277            },
  5278            "group": "assistants",
  5279            "name": "Retrieve assistant file",
  5280            "returns": "The [assistant file](/docs/api-reference/assistants/file-object) object matching the specified ID."
  5281          }
  5282        }
  5283      },
  5284      "/audio/speech": {
  5285        "post": {
  5286          "operationId": "createSpeech",
  5287          "requestBody": {
  5288            "content": {
  5289              "application/json": {
  5290                "schema": {
  5291                  "$ref": "#/components/schemas/CreateSpeechRequest"
  5292                }
  5293              }
  5294            },
  5295            "required": true
  5296          },
  5297          "responses": {
  5298            "200": {
  5299              "content": {
  5300                "application/octet-stream": {
  5301                  "schema": {
  5302                    "format": "binary",
  5303                    "type": "string"
  5304                  }
  5305                }
  5306              },
  5307              "description": "OK",
  5308              "headers": {
  5309                "Transfer-Encoding": {
  5310                  "description": "chunked",
  5311                  "schema": {
  5312                    "type": "string"
  5313                  }
  5314                }
  5315              }
  5316            }
  5317          },
  5318          "summary": "Generates audio from the input text.",
  5319          "tags": [
  5320            "Audio"
  5321          ],
  5322          "x-oaiMeta": {
  5323            "examples": {
  5324              "request": {
  5325                "curl": "curl https://api.openai.com/v1/audio/speech \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"tts-1\",\n    \"input\": \"The quick brown fox jumped over the lazy dog.\",\n    \"voice\": \"alloy\"\n  }' \\\n  --output speech.mp3\n",
  5326                "node": "import fs from \"fs\";\nimport path from \"path\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst speechFile = path.resolve(\"./speech.mp3\");\n\nasync function main() {\n  const mp3 = await openai.audio.speech.create({\n    model: \"tts-1\",\n    voice: \"alloy\",\n    input: \"Today is a wonderful day to build something people love!\",\n  });\n  console.log(speechFile);\n  const buffer = Buffer.from(await mp3.arrayBuffer());\n  await fs.promises.writeFile(speechFile, buffer);\n}\nmain();\n",
  5327                "python": "from pathlib import Path\nimport openai\n\nspeech_file_path = Path(__file__).parent / \"speech.mp3\"\nresponse = openai.audio.speech.create(\n  model=\"tts-1\",\n  voice=\"alloy\",\n  input=\"The quick brown fox jumped over the lazy dog.\"\n)\nresponse.stream_to_file(speech_file_path)\n"
  5328              }
  5329            },
  5330            "group": "audio",
  5331            "name": "Create speech",
  5332            "returns": "The audio file content."
  5333          }
  5334        }
  5335      },
  5336      "/audio/transcriptions": {
  5337        "post": {
  5338          "operationId": "createTranscription",
  5339          "requestBody": {
  5340            "content": {
  5341              "multipart/form-data": {
  5342                "schema": {
  5343                  "$ref": "#/components/schemas/CreateTranscriptionRequest"
  5344                }
  5345              }
  5346            },
  5347            "required": true
  5348          },
  5349          "responses": {
  5350            "200": {
  5351              "content": {
  5352                "application/json": {
  5353                  "schema": {
  5354                    "$ref": "#/components/schemas/CreateTranscriptionResponse"
  5355                  }
  5356                }
  5357              },
  5358              "description": "OK"
  5359            }
  5360          },
  5361          "summary": "Transcribes audio into the input language.",
  5362          "tags": [
  5363            "Audio"
  5364          ],
  5365          "x-oaiMeta": {
  5366            "examples": {
  5367              "request": {
  5368                "curl": "curl https://api.openai.com/v1/audio/transcriptions \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"Content-Type: multipart/form-data\" \\\n  -F file=\"@/path/to/file/audio.mp3\" \\\n  -F model=\"whisper-1\"\n",
  5369                "node": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const transcription = await openai.audio.transcriptions.create({\n    file: fs.createReadStream(\"audio.mp3\"),\n    model: \"whisper-1\",\n  });\n\n  console.log(transcription.text);\n}\nmain();\n",
  5370                "python": "from openai import OpenAI\nclient = OpenAI()\n\naudio_file = open(\"speech.mp3\", \"rb\")\ntranscript = client.audio.transcriptions.create(\n  model=\"whisper-1\",\n  file=audio_file\n)\n"
  5371              },
  5372              "response": "{\n  \"text\": \"Imagine the wildest idea that you've ever had, and you're curious about how it might scale to something that's a 100, a 1,000 times bigger. This is a place where you can get to do that.\"\n}\n"
  5373            },
  5374            "group": "audio",
  5375            "name": "Create transcription",
  5376            "returns": "The transcribed text."
  5377          }
  5378        }
  5379      },
  5380      "/audio/translations": {
  5381        "post": {
  5382          "operationId": "createTranslation",
  5383          "requestBody": {
  5384            "content": {
  5385              "multipart/form-data": {
  5386                "schema": {
  5387                  "$ref": "#/components/schemas/CreateTranslationRequest"
  5388                }
  5389              }
  5390            },
  5391            "required": true
  5392          },
  5393          "responses": {
  5394            "200": {
  5395              "content": {
  5396                "application/json": {
  5397                  "schema": {
  5398                    "$ref": "#/components/schemas/CreateTranslationResponse"
  5399                  }
  5400                }
  5401              },
  5402              "description": "OK"
  5403            }
  5404          },
  5405          "summary": "Translates audio into English.",
  5406          "tags": [
  5407            "Audio"
  5408          ],
  5409          "x-oaiMeta": {
  5410            "examples": {
  5411              "request": {
  5412                "curl": "curl https://api.openai.com/v1/audio/translations \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"Content-Type: multipart/form-data\" \\\n  -F file=\"@/path/to/file/german.m4a\" \\\n  -F model=\"whisper-1\"\n",
  5413                "node": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n    const translation = await openai.audio.translations.create({\n        file: fs.createReadStream(\"speech.mp3\"),\n        model: \"whisper-1\",\n    });\n\n    console.log(translation.text);\n}\nmain();\n",
  5414                "python": "from openai import OpenAI\nclient = OpenAI()\n\naudio_file = open(\"speech.mp3\", \"rb\")\ntranscript = client.audio.translations.create(\n  model=\"whisper-1\",\n  file=audio_file\n)\n"
  5415              },
  5416              "response": "{\n  \"text\": \"Hello, my name is Wolfgang and I come from Germany. Where are you heading today?\"\n}\n"
  5417            },
  5418            "group": "audio",
  5419            "name": "Create translation",
  5420            "returns": "The translated text."
  5421          }
  5422        }
  5423      },
  5424      "/chat/completions": {
  5425        "post": {
  5426          "operationId": "createChatCompletion",
  5427          "requestBody": {
  5428            "content": {
  5429              "application/json": {
  5430                "schema": {
  5431                  "$ref": "#/components/schemas/CreateChatCompletionRequest"
  5432                }
  5433              }
  5434            },
  5435            "required": true
  5436          },
  5437          "responses": {
  5438            "200": {
  5439              "content": {
  5440                "application/json": {
  5441                  "schema": {
  5442                    "$ref": "#/components/schemas/CreateChatCompletionResponse"
  5443                  }
  5444                }
  5445              },
  5446              "description": "OK"
  5447            }
  5448          },
  5449          "summary": "Creates a model response for the given chat conversation.",
  5450          "tags": [
  5451            "Chat"
  5452          ],
  5453          "x-oaiMeta": {
  5454            "examples": [
  5455              {
  5456                "request": {
  5457                  "curl": "curl https://api.openai.com/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -d '{\n    \"model\": \"VAR_model_id\",\n    \"messages\": [\n      {\n        \"role\": \"system\",\n        \"content\": \"You are a helpful assistant.\"\n      },\n      {\n        \"role\": \"user\",\n        \"content\": \"Hello!\"\n      }\n    ]\n  }'\n",
  5458                  "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const completion = await openai.chat.completions.create({\n    messages: [{ role: \"system\", content: \"You are a helpful assistant.\" }],\n    model: \"VAR_model_id\",\n  });\n\n  console.log(completion.choices[0]);\n}\n\nmain();",
  5459                  "python": "from openai import OpenAI\nclient = OpenAI()\n\ncompletion = client.chat.completions.create(\n  model=\"VAR_model_id\",\n  messages=[\n    {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n    {\"role\": \"user\", \"content\": \"Hello!\"}\n  ]\n)\n\nprint(completion.choices[0].message)\n"
  5460                },
  5461                "response": "{\n  \"id\": \"chatcmpl-123\",\n  \"object\": \"chat.completion\",\n  \"created\": 1677652288,\n  \"model\": \"gpt-3.5-turbo-0613\",\n  \"system_fingerprint\": \"fp_44709d6fcb\",\n  \"choices\": [{\n    \"index\": 0,\n    \"message\": {\n      \"role\": \"assistant\",\n      \"content\": \"\\n\\nHello there, how may I assist you today?\",\n    },\n    \"logprobs\": null,\n    \"finish_reason\": \"stop\"\n  }],\n  \"usage\": {\n    \"prompt_tokens\": 9,\n    \"completion_tokens\": 12,\n    \"total_tokens\": 21\n  }\n}\n",
  5462                "title": "Default"
  5463              },
  5464              {
  5465                "request": {
  5466                  "curl": "curl https://api.openai.com/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -d '{\n    \"model\": \"gpt-4-vision-preview\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"What\u2019s in this image?\"\n          },\n          {\n            \"type\": \"image_url\",\n            \"image_url\": {\n              \"url\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\"\n            }\n          }\n        ]\n      }\n    ],\n    \"max_tokens\": 300\n  }'\n",
  5467                  "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const response = await openai.chat.completions.create({\n    model: \"gpt-4-vision-preview\",\n    messages: [\n      {\n        role: \"user\",\n        content: [\n          { type: \"text\", text: \"What\u2019s in this image?\" },\n          {\n            type: \"image_url\",\n            image_url:\n              \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\",\n          },\n        ],\n      },\n    ],\n  });\n  console.log(response.choices[0]);\n}\nmain();",
  5468                  "python": "from openai import OpenAI\n\nclient = OpenAI()\n\nresponse = client.chat.completions.create(\n    model=\"gpt-4-vision-preview\",\n    messages=[\n        {\n            \"role\": \"user\",\n            \"content\": [\n                {\"type\": \"text\", \"text\": \"What\u2019s in this image?\"},\n                {\n                    \"type\": \"image_url\",\n                    \"image_url\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\",\n                },\n            ],\n        }\n    ],\n    max_tokens=300,\n)\n\nprint(response.choices[0])\n"
  5469                },
  5470                "response": "{\n  \"id\": \"chatcmpl-123\",\n  \"object\": \"chat.completion\",\n  \"created\": 1677652288,\n  \"model\": \"gpt-3.5-turbo-0613\",\n  \"system_fingerprint\": \"fp_44709d6fcb\",\n  \"choices\": [{\n    \"index\": 0,\n    \"message\": {\n      \"role\": \"assistant\",\n      \"content\": \"\\n\\nHello there, how may I assist you today?\",\n    },\n    \"logprobs\": null,\n    \"finish_reason\": \"stop\"\n  }],\n  \"usage\": {\n    \"prompt_tokens\": 9,\n    \"completion_tokens\": 12,\n    \"total_tokens\": 21\n  }\n}\n",
  5471                "title": "Image input"
  5472              },
  5473              {
  5474                "request": {
  5475                  "curl": "curl https://api.openai.com/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -d '{\n    \"model\": \"VAR_model_id\",\n    \"messages\": [\n      {\n        \"role\": \"system\",\n        \"content\": \"You are a helpful assistant.\"\n      },\n      {\n        \"role\": \"user\",\n        \"content\": \"Hello!\"\n      }\n    ],\n    \"stream\": true\n  }'\n",
  5476                  "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const completion = await openai.chat.completions.create({\n    model: \"VAR_model_id\",\n    messages: [\n      {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n      {\"role\": \"user\", \"content\": \"Hello!\"}\n    ],\n    stream: true,\n  });\n\n  for await (const chunk of completion) {\n    console.log(chunk.choices[0].delta.content);\n  }\n}\n\nmain();",
  5477                  "python": "from openai import OpenAI\nclient = OpenAI()\n\ncompletion = client.chat.completions.create(\n  model=\"VAR_model_id\",\n  messages=[\n    {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n    {\"role\": \"user\", \"content\": \"Hello!\"}\n  ],\n  stream=True\n)\n\nfor chunk in completion:\n  print(chunk.choices[0].delta)\n"
  5478                },
  5479                "response": "{\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1694268190,\"model\":\"gpt-3.5-turbo-0613\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":\"\"},\"logprobs\":null,\"finish_reason\":null}]}\n\n{\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1694268190,\"model\":\"gpt-3.5-turbo-0613\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\":[{\"index\":0,\"delta\":{\"content\":\"Hello\"},\"logprobs\":null,\"finish_reason\":null}]}\n\n{\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1694268190,\"model\":\"gpt-3.5-turbo-0613\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\":[{\"index\":0,\"delta\":{\"content\":\"!\"},\"logprobs\":null,\"finish_reason\":null}]}\n\n....\n\n{\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1694268190,\"model\":\"gpt-3.5-turbo-0613\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\":[{\"index\":0,\"delta\":{\"content\":\" today\"},\"logprobs\":null,\"finish_reason\":null}]}\n\n{\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1694268190,\"model\":\"gpt-3.5-turbo-0613\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\":[{\"index\":0,\"delta\":{\"content\":\"?\"},\"logprobs\":null,\"finish_reason\":null}]}\n\n{\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1694268190,\"model\":\"gpt-3.5-turbo-0613\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n",
  5480                "title": "Streaming"
  5481              },
  5482              {
  5483                "request": {
  5484                  "curl": "curl https://api.openai.com/v1/chat/completions \\\n-H \"Content-Type: application/json\" \\\n-H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n-d '{\n  \"model\": \"gpt-3.5-turbo\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"What is the weather like in Boston?\"\n    }\n  ],\n  \"tools\": [\n    {\n      \"type\": \"function\",\n      \"function\": {\n        \"name\": \"get_current_weather\",\n        \"description\": \"Get the current weather in a given location\",\n        \"parameters\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"location\": {\n              \"type\": \"string\",\n              \"description\": \"The city and state, e.g. San Francisco, CA\"\n            },\n            \"unit\": {\n              \"type\": \"string\",\n              \"enum\": [\"celsius\", \"fahrenheit\"]\n            }\n          },\n          \"required\": [\"location\"]\n        }\n      }\n    }\n  ],\n  \"tool_choice\": \"auto\"\n}'\n",
  5485                  "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const messages = [{\"role\": \"user\", \"content\": \"What's the weather like in Boston today?\"}];\n  const tools = [\n      {\n        \"type\": \"function\",\n        \"function\": {\n          \"name\": \"get_current_weather\",\n          \"description\": \"Get the current weather in a given location\",\n          \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"location\": {\n                \"type\": \"string\",\n                \"description\": \"The city and state, e.g. San Francisco, CA\",\n              },\n              \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n            },\n            \"required\": [\"location\"],\n          },\n        }\n      }\n  ];\n\n  const response = await openai.chat.completions.create({\n    model: \"gpt-3.5-turbo\",\n    messages: messages,\n    tools: tools,\n    tool_choice: \"auto\",\n  });\n\n  console.log(response);\n}\n\nmain();",
  5486                  "python": "from openai import OpenAI\nclient = OpenAI()\n\ntools = [\n  {\n    \"type\": \"function\",\n    \"function\": {\n      \"name\": \"get_current_weather\",\n      \"description\": \"Get the current weather in a given location\",\n      \"parameters\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"location\": {\n            \"type\": \"string\",\n            \"description\": \"The city and state, e.g. San Francisco, CA\",\n          },\n          \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n        },\n        \"required\": [\"location\"],\n      },\n    }\n  }\n]\nmessages = [{\"role\": \"user\", \"content\": \"What's the weather like in Boston today?\"}]\ncompletion = client.chat.completions.create(\n  model=\"VAR_model_id\",\n  messages=messages,\n  tools=tools,\n  tool_choice=\"auto\"\n)\n\nprint(completion)\n"
  5487                },
  5488                "response": "{\n  \"id\": \"chatcmpl-abc123\",\n  \"object\": \"chat.completion\",\n  \"created\": 1699896916,\n  \"model\": \"gpt-3.5-turbo-0613\",\n  \"choices\": [\n    {\n      \"index\": 0,\n      \"message\": {\n        \"role\": \"assistant\",\n        \"content\": null,\n        \"tool_calls\": [\n          {\n            \"id\": \"call_abc123\",\n            \"type\": \"function\",\n            \"function\": {\n              \"name\": \"get_current_weather\",\n              \"arguments\": \"{\\n\\\"location\\\": \\\"Boston, MA\\\"\\n}\"\n            }\n          }\n        ]\n      },\n      \"logprobs\": null,\n      \"finish_reason\": \"tool_calls\"\n    }\n  ],\n  \"usage\": {\n    \"prompt_tokens\": 82,\n    \"completion_tokens\": 17,\n    \"total_tokens\": 99\n  }\n}\n",
  5489                "title": "Functions"
  5490              },
  5491              {
  5492                "request": {
  5493                  "curl": "curl https://api.openai.com/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -d '{\n    \"model\": \"VAR_model_id\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Hello!\"\n      }\n    ],\n    \"logprobs\": true,\n    \"top_logprobs\": 2\n  }'\n",
  5494                  "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const completion = await openai.chat.completions.create({\n    messages: [{ role: \"user\", content: \"Hello!\" }],\n    model: \"VAR_model_id\",\n    logprobs: true,\n    top_logprobs: 2,\n  });\n\n  console.log(completion.choices[0]);\n}\n\nmain();",
  5495                  "python": "from openai import OpenAI\nclient = OpenAI()\n\ncompletion = client.chat.completions.create(\n  model=\"VAR_model_id\",\n  messages=[\n    {\"role\": \"user\", \"content\": \"Hello!\"}\n  ],\n  logprobs=True,\n  top_logprobs=2\n)\n\nprint(completion.choices[0].message)\nprint(completion.choices[0].logprobs)\n"
  5496                },
  5497                "response": "{\n  \"id\": \"chatcmpl-123\",\n  \"object\": \"chat.completion\",\n  \"created\": 1702685778,\n  \"model\": \"gpt-3.5-turbo-0613\",\n  \"choices\": [\n    {\n      \"index\": 0,\n      \"message\": {\n        \"role\": \"assistant\",\n        \"content\": \"Hello! How can I assist you today?\"\n      },\n      \"logprobs\": {\n        \"content\": [\n          {\n            \"token\": \"Hello\",\n            \"logprob\": -0.31725305,\n            \"bytes\": [72, 101, 108, 108, 111],\n            \"top_logprobs\": [\n              {\n                \"token\": \"Hello\",\n                \"logprob\": -0.31725305,\n                \"bytes\": [72, 101, 108, 108, 111]\n              },\n              {\n                \"token\": \"Hi\",\n                \"logprob\": -1.3190403,\n                \"bytes\": [72, 105]\n              }\n            ]\n          },\n          {\n            \"token\": \"!\",\n            \"logprob\": -0.02380986,\n            \"bytes\": [\n              33\n            ],\n            \"top_logprobs\": [\n              {\n                \"token\": \"!\",\n                \"logprob\": -0.02380986,\n                \"bytes\": [33]\n              },\n              {\n                \"token\": \" there\",\n                \"logprob\": -3.787621,\n                \"bytes\": [32, 116, 104, 101, 114, 101]\n              }\n            ]\n          },\n          {\n            \"token\": \" How\",\n            \"logprob\": -0.000054669687,\n            \"bytes\": [32, 72, 111, 119],\n            \"top_logprobs\": [\n              {\n                \"token\": \" How\",\n                \"logprob\": -0.000054669687,\n                \"bytes\": [32, 72, 111, 119]\n              },\n              {\n                \"token\": \"<|end|>\",\n                \"logprob\": -10.953937,\n                \"bytes\": null\n              }\n            ]\n          },\n          {\n            \"token\": \" can\",\n            \"logprob\": -0.015801601,\n            \"bytes\": [32, 99, 97, 110],\n            \"top_logprobs\": [\n              {\n                \"token\": \" can\",\n                \"logprob\": -0.015801601,\n                \"bytes\": [32, 99, 97, 110]\n              },\n              {\n                \"token\": \" may\",\n                \"logprob\": -4.161023,\n                \"bytes\": [32, 109, 97, 121]\n              }\n            ]\n          },\n          {\n            \"token\": \" I\",\n            \"logprob\": -3.7697225e-6,\n            \"bytes\": [\n              32,\n              73\n            ],\n            \"top_logprobs\": [\n              {\n                \"token\": \" I\",\n                \"logprob\": -3.7697225e-6,\n                \"bytes\": [32, 73]\n              },\n              {\n                \"token\": \" assist\",\n                \"logprob\": -13.596657,\n                \"bytes\": [32, 97, 115, 115, 105, 115, 116]\n              }\n            ]\n          },\n          {\n            \"token\": \" assist\",\n            \"logprob\": -0.04571125,\n            \"bytes\": [32, 97, 115, 115, 105, 115, 116],\n            \"top_logprobs\": [\n              {\n                \"token\": \" assist\",\n                \"logprob\": -0.04571125,\n                \"bytes\": [32, 97, 115, 115, 105, 115, 116]\n              },\n              {\n                \"token\": \" help\",\n                \"logprob\": -3.1089056,\n                \"bytes\": [32, 104, 101, 108, 112]\n              }\n            ]\n          },\n          {\n            \"token\": \" you\",\n            \"logprob\": -5.4385737e-6,\n            \"bytes\": [32, 121, 111, 117],\n            \"top_logprobs\": [\n              {\n                \"token\": \" you\",\n                \"logprob\": -5.4385737e-6,\n                \"bytes\": [32, 121, 111, 117]\n              },\n              {\n                \"token\": \" today\",\n                \"logprob\": -12.807695,\n                \"bytes\": [32, 116, 111, 100, 97, 121]\n              }\n            ]\n          },\n          {\n            \"token\": \" today\",\n            \"logprob\": -0.0040071653,\n            \"bytes\": [32, 116, 111, 100, 97, 121],\n            \"top_logprobs\": [\n              {\n                \"token\": \" today\",\n                \"logprob\": -0.0040071653,\n                \"bytes\": [32, 116, 111, 100, 97, 121]\n              },\n              {\n                \"token\": \"?\",\n                \"logprob\": -5.5247097,\n                \"bytes\": [63]\n              }\n            ]\n          },\n          {\n            \"token\": \"?\",\n            \"logprob\": -0.0008108172,\n            \"bytes\": [63],\n            \"top_logprobs\": [\n              {\n                \"token\": \"?\",\n                \"logprob\": -0.0008108172,\n                \"bytes\": [63]\n              },\n              {\n                \"token\": \"?\\n\",\n                \"logprob\": -7.184561,\n                \"bytes\": [63, 10]\n              }\n            ]\n          }\n        ]\n      },\n      \"finish_reason\": \"stop\"\n    }\n  ],\n  \"usage\": {\n    \"prompt_tokens\": 9,\n    \"completion_tokens\": 9,\n    \"total_tokens\": 18\n  },\n  \"system_fingerprint\": null\n}\n",
  5498                "title": "Logprobs"
  5499              }
  5500            ],
  5501            "group": "chat",
  5502            "name": "Create chat completion",
  5503            "path": "create",
  5504            "returns": "Returns a [chat completion](/docs/api-reference/chat/object) object, or a streamed sequence of [chat completion chunk](/docs/api-reference/chat/streaming) objects if the request is streamed.\n"
  5505          }
  5506        }
  5507      },
  5508      "/completions": {
  5509        "post": {
  5510          "operationId": "createCompletion",
  5511          "requestBody": {
  5512            "content": {
  5513              "application/json": {
  5514                "schema": {
  5515                  "$ref": "#/components/schemas/CreateCompletionRequest"
  5516                }
  5517              }
  5518            },
  5519            "required": true
  5520          },
  5521          "responses": {
  5522            "200": {
  5523              "content": {
  5524                "application/json": {
  5525                  "schema": {
  5526                    "$ref": "#/components/schemas/CreateCompletionResponse"
  5527                  }
  5528                }
  5529              },
  5530              "description": "OK"
  5531            }
  5532          },
  5533          "summary": "Creates a completion for the provided prompt and parameters.",
  5534          "tags": [
  5535            "Completions"
  5536          ],
  5537          "x-oaiMeta": {
  5538            "examples": [
  5539              {
  5540                "request": {
  5541                  "curl": "curl https://api.openai.com/v1/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -d '{\n    \"model\": \"VAR_model_id\",\n    \"prompt\": \"Say this is a test\",\n    \"max_tokens\": 7,\n    \"temperature\": 0\n  }'\n",
  5542                  "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const completion = await openai.completions.create({\n    model: \"VAR_model_id\",\n    prompt: \"Say this is a test.\",\n    max_tokens: 7,\n    temperature: 0,\n  });\n\n  console.log(completion);\n}\nmain();",
  5543                  "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.completions.create(\n  model=\"VAR_model_id\",\n  prompt=\"Say this is a test\",\n  max_tokens=7,\n  temperature=0\n)\n"
  5544                },
  5545                "response": "{\n  \"id\": \"cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7\",\n  \"object\": \"text_completion\",\n  \"created\": 1589478378,\n  \"model\": \"VAR_model_id\",\n  \"system_fingerprint\": \"fp_44709d6fcb\",\n  \"choices\": [\n    {\n      \"text\": \"\\n\\nThis is indeed a test\",\n      \"index\": 0,\n      \"logprobs\": null,\n      \"finish_reason\": \"length\"\n    }\n  ],\n  \"usage\": {\n    \"prompt_tokens\": 5,\n    \"completion_tokens\": 7,\n    \"total_tokens\": 12\n  }\n}\n",
  5546                "title": "No streaming"
  5547              },
  5548              {
  5549                "request": {
  5550                  "curl": "curl https://api.openai.com/v1/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -d '{\n    \"model\": \"VAR_model_id\",\n    \"prompt\": \"Say this is a test\",\n    \"max_tokens\": 7,\n    \"temperature\": 0,\n    \"stream\": true\n  }'\n",
  5551                  "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const stream = await openai.completions.create({\n    model: \"VAR_model_id\",\n    prompt: \"Say this is a test.\",\n    stream: true,\n  });\n\n  for await (const chunk of stream) {\n    console.log(chunk.choices[0].text)\n  }\n}\nmain();",
  5552                  "python": "from openai import OpenAI\nclient = OpenAI()\n\nfor chunk in client.completions.create(\n  model=\"VAR_model_id\",\n  prompt=\"Say this is a test\",\n  max_tokens=7,\n  temperature=0,\n  stream=True\n):\n  print(chunk.choices[0].text)\n"
  5553                },
  5554                "response": "{\n  \"id\": \"cmpl-7iA7iJjj8V2zOkCGvWF2hAkDWBQZe\",\n  \"object\": \"text_completion\",\n  \"created\": 1690759702,\n  \"choices\": [\n    {\n      \"text\": \"This\",\n      \"index\": 0,\n      \"logprobs\": null,\n      \"finish_reason\": null\n    }\n  ],\n  \"model\": \"gpt-3.5-turbo-instruct\"\n  \"system_fingerprint\": \"fp_44709d6fcb\",\n}\n",
  5555                "title": "Streaming"
  5556              }
  5557            ],
  5558            "group": "completions",
  5559            "legacy": true,
  5560            "name": "Create completion",
  5561            "returns": "Returns a [completion](/docs/api-reference/completions/object) object, or a sequence of completion objects if the request is streamed.\n"
  5562          }
  5563        }
  5564      },
  5565      "/embeddings": {
  5566        "post": {
  5567          "operationId": "createEmbedding",
  5568          "requestBody": {
  5569            "content": {
  5570              "application/json": {
  5571                "schema": {
  5572                  "$ref": "#/components/schemas/CreateEmbeddingRequest"
  5573                }
  5574              }
  5575            },
  5576            "required": true
  5577          },
  5578          "responses": {
  5579            "200": {
  5580              "content": {
  5581                "application/json": {
  5582                  "schema": {
  5583                    "$ref": "#/components/schemas/CreateEmbeddingResponse"
  5584                  }
  5585                }
  5586              },
  5587              "description": "OK"
  5588            }
  5589          },
  5590          "summary": "Creates an embedding vector representing the input text.",
  5591          "tags": [
  5592            "Embeddings"
  5593          ],
  5594          "x-oaiMeta": {
  5595            "examples": {
  5596              "request": {
  5597                "curl": "curl https://api.openai.com/v1/embeddings \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"input\": \"The food was delicious and the waiter...\",\n    \"model\": \"text-embedding-ada-002\",\n    \"encoding_format\": \"float\"\n  }'\n",
  5598                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const embedding = await openai.embeddings.create({\n    model: \"text-embedding-ada-002\",\n    input: \"The quick brown fox jumped over the lazy dog\",\n    encoding_format: \"float\",\n  });\n\n  console.log(embedding);\n}\n\nmain();",
  5599                "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.embeddings.create(\n  model=\"text-embedding-ada-002\",\n  input=\"The food was delicious and the waiter...\",\n  encoding_format=\"float\"\n)\n"
  5600              },
  5601              "response": "{\n  \"object\": \"list\",\n  \"data\": [\n    {\n      \"object\": \"embedding\",\n      \"embedding\": [\n        0.0023064255,\n        -0.009327292,\n        .... (1536 floats total for ada-002)\n        -0.0028842222,\n      ],\n      \"index\": 0\n    }\n  ],\n  \"model\": \"text-embedding-ada-002\",\n  \"usage\": {\n    \"prompt_tokens\": 8,\n    \"total_tokens\": 8\n  }\n}\n"
  5602            },
  5603            "group": "embeddings",
  5604            "name": "Create embeddings",
  5605            "returns": "A list of [embedding](/docs/api-reference/embeddings/object) objects."
  5606          }
  5607        }
  5608      },
  5609      "/files": {
  5610        "get": {
  5611          "operationId": "listFiles",
  5612          "parameters": [
  5613            {
  5614              "description": "Only return files with the given purpose.",
  5615              "in": "query",
  5616              "name": "purpose",
  5617              "required": false,
  5618              "schema": {
  5619                "type": "string"
  5620              }
  5621            }
  5622          ],
  5623          "responses": {
  5624            "200": {
  5625              "content": {
  5626                "application/json": {
  5627                  "schema": {
  5628                    "$ref": "#/components/schemas/ListFilesResponse"
  5629                  }
  5630                }
  5631              },
  5632              "description": "OK"
  5633            }
  5634          },
  5635          "summary": "Returns a list of files that belong to the user's organization.",
  5636          "tags": [
  5637            "Files"
  5638          ],
  5639          "x-oaiMeta": {
  5640            "examples": {
  5641              "request": {
  5642                "curl": "curl https://api.openai.com/v1/files \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
  5643                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const list = await openai.files.list();\n\n  for await (const file of list) {\n    console.log(file);\n  }\n}\n\nmain();",
  5644                "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.files.list()\n"
  5645              },
  5646              "response": "{\n  \"data\": [\n    {\n      \"id\": \"file-abc123\",\n      \"object\": \"file\",\n      \"bytes\": 175,\n      \"created_at\": 1613677385,\n      \"filename\": \"salesOverview.pdf\",\n      \"purpose\": \"assistants\",\n    },\n    {\n      \"id\": \"file-abc123\",\n      \"object\": \"file\",\n      \"bytes\": 140,\n      \"created_at\": 1613779121,\n      \"filename\": \"puppy.jsonl\",\n      \"purpose\": \"fine-tune\",\n    }\n  ],\n  \"object\": \"list\"\n}\n"
  5647            },
  5648            "group": "files",
  5649            "name": "List files",
  5650            "returns": "A list of [File](/docs/api-reference/files/object) objects."
  5651          }
  5652        },
  5653        "post": {
  5654          "operationId": "createFile",
  5655          "requestBody": {
  5656            "content": {
  5657              "multipart/form-data": {
  5658                "schema": {
  5659                  "$ref": "#/components/schemas/CreateFileRequest"
  5660                }
  5661              }
  5662            },
  5663            "required": true
  5664          },
  5665          "responses": {
  5666            "200": {
  5667              "content": {
  5668                "application/json": {
  5669                  "schema": {
  5670                    "$ref": "#/components/schemas/OpenAIFile"
  5671                  }
  5672                }
  5673              },
  5674              "description": "OK"
  5675            }
  5676          },
  5677          "summary": "Upload a file that can be used across various endpoints. The size of all the files uploaded by one organization can be up to 100 GB.\n\nThe size of individual files can be a maximum of 512 MB or 2 million tokens for Assistants. See the [Assistants Tools guide](/docs/assistants/tools) to learn more about the types of files supported. The Fine-tuning API only supports `.jsonl` files.\n\nPlease [contact us](https://help.openai.com/) if you need to increase these storage limits.\n",
  5678          "tags": [
  5679            "Files"
  5680          ],
  5681          "x-oaiMeta": {
  5682            "examples": {
  5683              "request": {
  5684                "curl": "curl https://api.openai.com/v1/files \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -F purpose=\"fine-tune\" \\\n  -F file=\"@mydata.jsonl\"\n",
  5685                "node.js": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const file = await openai.files.create({\n    file: fs.createReadStream(\"mydata.jsonl\"),\n    purpose: \"fine-tune\",\n  });\n\n  console.log(file);\n}\n\nmain();",
  5686                "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.files.create(\n  file=open(\"mydata.jsonl\", \"rb\"),\n  purpose=\"fine-tune\"\n)\n"
  5687              },
  5688              "response": "{\n  \"id\": \"file-abc123\",\n  \"object\": \"file\",\n  \"bytes\": 120000,\n  \"created_at\": 1677610602,\n  \"filename\": \"mydata.jsonl\",\n  \"purpose\": \"fine-tune\",\n}\n"
  5689            },
  5690            "group": "files",
  5691            "name": "Upload file",
  5692            "returns": "The uploaded [File](/docs/api-reference/files/object) object."
  5693          }
  5694        }
  5695      },
  5696      "/files/{file_id}": {
  5697        "delete": {
  5698          "operationId": "deleteFile",
  5699          "parameters": [
  5700            {
  5701              "description": "The ID of the file to use for this request.",
  5702              "in": "path",
  5703              "name": "file_id",
  5704              "required": true,
  5705              "schema": {
  5706                "type": "string"
  5707              }
  5708            }
  5709          ],
  5710          "responses": {
  5711            "200": {
  5712              "content": {
  5713                "application/json": {
  5714                  "schema": {
  5715                    "$ref": "#/components/schemas/DeleteFileResponse"
  5716                  }
  5717                }
  5718              },
  5719              "description": "OK"
  5720            }
  5721          },
  5722          "summary": "Delete a file.",
  5723          "tags": [
  5724            "Files"
  5725          ],
  5726          "x-oaiMeta": {
  5727            "examples": {
  5728              "request": {
  5729                "curl": "curl https://api.openai.com/v1/files/file-abc123 \\\n  -X DELETE \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
  5730                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const file = await openai.files.del(\"file-abc123\");\n\n  console.log(file);\n}\n\nmain();",
  5731                "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.files.delete(\"file-abc123\")\n"
  5732              },
  5733              "response": "{\n  \"id\": \"file-abc123\",\n  \"object\": \"file\",\n  \"deleted\": true\n}\n"
  5734            },
  5735            "group": "files",
  5736            "name": "Delete file",
  5737            "returns": "Deletion status."
  5738          }
  5739        },
  5740        "get": {
  5741          "operationId": "retrieveFile",
  5742          "parameters": [
  5743            {
  5744              "description": "The ID of the file to use for this request.",
  5745              "in": "path",
  5746              "name": "file_id",
  5747              "required": true,
  5748              "schema": {
  5749                "type": "string"
  5750              }
  5751            }
  5752          ],
  5753          "responses": {
  5754            "200": {
  5755              "content": {
  5756                "application/json": {
  5757                  "schema": {
  5758                    "$ref": "#/components/schemas/OpenAIFile"
  5759                  }
  5760                }
  5761              },
  5762              "description": "OK"
  5763            }
  5764          },
  5765          "summary": "Returns information about a specific file.",
  5766          "tags": [
  5767            "Files"
  5768          ],
  5769          "x-oaiMeta": {
  5770            "examples": {
  5771              "request": {
  5772                "curl": "curl https://api.openai.com/v1/files/file-abc123 \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
  5773                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const file = await openai.files.retrieve(\"file-abc123\");\n\n  console.log(file);\n}\n\nmain();",
  5774                "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.files.retrieve(\"file-abc123\")\n"
  5775              },
  5776              "response": "{\n  \"id\": \"file-abc123\",\n  \"object\": \"file\",\n  \"bytes\": 120000,\n  \"created_at\": 1677610602,\n  \"filename\": \"mydata.jsonl\",\n  \"purpose\": \"fine-tune\",\n}\n"
  5777            },
  5778            "group": "files",
  5779            "name": "Retrieve file",
  5780            "returns": "The [File](/docs/api-reference/files/object) object matching the specified ID."
  5781          }
  5782        }
  5783      },
  5784      "/files/{file_id}/content": {
  5785        "get": {
  5786          "operationId": "downloadFile",
  5787          "parameters": [
  5788            {
  5789              "description": "The ID of the file to use for this request.",
  5790              "in": "path",
  5791              "name": "file_id",
  5792              "required": true,
  5793              "schema": {
  5794                "type": "string"
  5795              }
  5796            }
  5797          ],
  5798          "responses": {
  5799            "200": {
  5800              "content": {
  5801                "application/json": {
  5802                  "schema": {
  5803                    "type": "string"
  5804                  }
  5805                }
  5806              },
  5807              "description": "OK"
  5808            }
  5809          },
  5810          "summary": "Returns the contents of the specified file.",
  5811          "tags": [
  5812            "Files"
  5813          ],
  5814          "x-oaiMeta": {
  5815            "examples": {
  5816              "request": {
  5817                "curl": "curl https://api.openai.com/v1/files/file-abc123/content \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" > file.jsonl\n",
  5818                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const file = await openai.files.retrieveContent(\"file-abc123\");\n\n  console.log(file);\n}\n\nmain();\n",
  5819                "python": "from openai import OpenAI\nclient = OpenAI()\n\ncontent = client.files.retrieve_content(\"file-abc123\")\n"
  5820              }
  5821            },
  5822            "group": "files",
  5823            "name": "Retrieve file content",
  5824            "returns": "The file content."
  5825          }
  5826        }
  5827      },
  5828      "/fine_tuning/jobs": {
  5829        "get": {
  5830          "operationId": "listPaginatedFineTuningJobs",
  5831          "parameters": [
  5832            {
  5833              "description": "Identifier for the last job from the previous pagination request.",
  5834              "in": "query",
  5835              "name": "after",
  5836              "required": false,
  5837              "schema": {
  5838                "type": "string"
  5839              }
  5840            },
  5841            {
  5842              "description": "Number of fine-tuning jobs to retrieve.",
  5843              "in": "query",
  5844              "name": "limit",
  5845              "required": false,
  5846              "schema": {
  5847                "default": 20,
  5848                "type": "integer"
  5849              }
  5850            }
  5851          ],
  5852          "responses": {
  5853            "200": {
  5854              "content": {
  5855                "application/json": {
  5856                  "schema": {
  5857                    "$ref": "#/components/schemas/ListPaginatedFineTuningJobsResponse"
  5858                  }
  5859                }
  5860              },
  5861              "description": "OK"
  5862            }
  5863          },
  5864          "summary": "List your organization's fine-tuning jobs\n",
  5865          "tags": [
  5866            "Fine-tuning"
  5867          ],
  5868          "x-oaiMeta": {
  5869            "examples": {
  5870              "request": {
  5871                "curl": "curl https://api.openai.com/v1/fine_tuning/jobs?limit=2 \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
  5872                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const list = await openai.fineTuning.jobs.list();\n\n  for await (const fineTune of list) {\n    console.log(fineTune);\n  }\n}\n\nmain();",
  5873                "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.fine_tuning.jobs.list()\n"
  5874              },
  5875              "response": "{\n  \"object\": \"list\",\n  \"data\": [\n    {\n      \"object\": \"fine_tuning.job.event\",\n      \"id\": \"ft-event-TjX0lMfOniCZX64t9PUQT5hn\",\n      \"created_at\": 1689813489,\n      \"level\": \"warn\",\n      \"message\": \"Fine tuning process stopping due to job cancellation\",\n      \"data\": null,\n      \"type\": \"message\"\n    },\n    { ... },\n    { ... }\n  ], \"has_more\": true\n}\n"
  5876            },
  5877            "group": "fine-tuning",
  5878            "name": "List fine-tuning jobs",
  5879            "returns": "A list of paginated [fine-tuning job](/docs/api-reference/fine-tuning/object) objects."
  5880          }
  5881        },
  5882        "post": {
  5883          "operationId": "createFineTuningJob",
  5884          "requestBody": {
  5885            "content": {
  5886              "application/json": {
  5887                "schema": {
  5888                  "$ref": "#/components/schemas/CreateFineTuningJobRequest"
  5889                }
  5890              }
  5891            },
  5892            "required": true
  5893          },
  5894          "responses": {
  5895            "200": {
  5896              "content": {
  5897                "application/json": {
  5898                  "schema": {
  5899                    "$ref": "#/components/schemas/FineTuningJob"
  5900                  }
  5901                }
  5902              },
  5903              "description": "OK"
  5904            }
  5905          },
  5906          "summary": "Creates a fine-tuning job which begins the process of creating a new model from a given dataset.\n\nResponse includes details of the enqueued job including job status and the name of the fine-tuned models once complete.\n\n[Learn more about fine-tuning](/docs/guides/fine-tuning)\n",
  5907          "tags": [
  5908            "Fine-tuning"
  5909          ],
  5910          "x-oaiMeta": {
  5911            "examples": [
  5912              {
  5913                "request": {
  5914                  "curl": "curl https://api.openai.com/v1/fine_tuning/jobs \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -d '{\n    \"training_file\": \"file-BK7bzQj3FfZFXr7DbL6xJwfo\",\n    \"model\": \"gpt-3.5-turbo\"\n  }'\n",
  5915                  "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const fineTune = await openai.fineTuning.jobs.create({\n    training_file: \"file-abc123\"\n  });\n\n  console.log(fineTune);\n}\n\nmain();\n",
  5916                  "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.fine_tuning.jobs.create(\n  training_file=\"file-abc123\",\n  model=\"gpt-3.5-turbo\"\n)\n"
  5917                },
  5918                "response": "{\n  \"object\": \"fine_tuning.job\",\n  \"id\": \"ftjob-abc123\",\n  \"model\": \"gpt-3.5-turbo-0613\",\n  \"created_at\": 1614807352,\n  \"fine_tuned_model\": null,\n  \"organization_id\": \"org-123\",\n  \"result_files\": [],\n  \"status\": \"queued\",\n  \"validation_file\": null,\n  \"training_file\": \"file-abc123\",\n}\n",
  5919                "title": "Default"
  5920              },
  5921              {
  5922                "request": {
  5923                  "curl": "curl https://api.openai.com/v1/fine_tuning/jobs \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -d '{\n    \"training_file\": \"file-abc123\",\n    \"model\": \"gpt-3.5-turbo\",\n    \"hyperparameters\": {\n      \"n_epochs\": 2\n    }\n  }'\n",
  5924                  "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const fineTune = await openai.fineTuning.jobs.create({\n    training_file: \"file-abc123\",\n    model: \"gpt-3.5-turbo\",\n    hyperparameters: { n_epochs: 2 }\n  });\n\n  console.log(fineTune);\n}\n\nmain();\n",
  5925                  "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.fine_tuning.jobs.create(\n  training_file=\"file-abc123\",\n  model=\"gpt-3.5-turbo\",\n  hyperparameters={\n    \"n_epochs\":2\n  }\n)\n"
  5926                },
  5927                "response": "{\n  \"object\": \"fine_tuning.job\",\n  \"id\": \"ftjob-abc123\",\n  \"model\": \"gpt-3.5-turbo-0613\",\n  \"created_at\": 1614807352,\n  \"fine_tuned_model\": null,\n  \"organization_id\": \"org-123\",\n  \"result_files\": [],\n  \"status\": \"queued\",\n  \"validation_file\": null,\n  \"training_file\": \"file-abc123\",\n  \"hyperparameters\": {\"n_epochs\": 2},\n}\n",
  5928                "title": "Epochs"
  5929              },
  5930              {
  5931                "request": {
  5932                  "curl": "curl https://api.openai.com/v1/fine_tuning/jobs \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -d '{\n    \"training_file\": \"file-abc123\",\n    \"validation_file\": \"file-abc123\",\n    \"model\": \"gpt-3.5-turbo\"\n  }'\n",
  5933                  "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const fineTune = await openai.fineTuning.jobs.create({\n    training_file: \"file-abc123\",\n    validation_file: \"file-abc123\"\n  });\n\n  console.log(fineTune);\n}\n\nmain();\n",
  5934                  "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.fine_tuning.jobs.create(\n  training_file=\"file-abc123\",\n  validation_file=\"file-def456\",\n  model=\"gpt-3.5-turbo\"\n)\n"
  5935                },
  5936                "response": "{\n  \"object\": \"fine_tuning.job\",\n  \"id\": \"ftjob-abc123\",\n  \"model\": \"gpt-3.5-turbo-0613\",\n  \"created_at\": 1614807352,\n  \"fine_tuned_model\": null,\n  \"organization_id\": \"org-123\",\n  \"result_files\": [],\n  \"status\": \"queued\",\n  \"validation_file\": \"file-abc123\",\n  \"training_file\": \"file-abc123\",\n}\n",
  5937                "title": "Validation file"
  5938              }
  5939            ],
  5940            "group": "fine-tuning",
  5941            "name": "Create fine-tuning job",
  5942            "returns": "A [fine-tuning.job](/docs/api-reference/fine-tuning/object) object."
  5943          }
  5944        }
  5945      },
  5946      "/fine_tuning/jobs/{fine_tuning_job_id}": {
  5947        "get": {
  5948          "operationId": "retrieveFineTuningJob",
  5949          "parameters": [
  5950            {
  5951              "description": "The ID of the fine-tuning job.\n",
  5952              "in": "path",
  5953              "name": "fine_tuning_job_id",
  5954              "required": true,
  5955              "schema": {
  5956                "example": "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
  5957                "type": "string"
  5958              }
  5959            }
  5960          ],
  5961          "responses": {
  5962            "200": {
  5963              "content": {
  5964                "application/json": {
  5965                  "schema": {
  5966                    "$ref": "#/components/schemas/FineTuningJob"
  5967                  }
  5968                }
  5969              },
  5970              "description": "OK"
  5971            }
  5972          },
  5973          "summary": "Get info about a fine-tuning job.\n\n[Learn more about fine-tuning](/docs/guides/fine-tuning)\n",
  5974          "tags": [
  5975            "Fine-tuning"
  5976          ],
  5977          "x-oaiMeta": {
  5978            "examples": {
  5979              "request": {
  5980                "curl": "curl https://api.openai.com/v1/fine_tuning/jobs/ft-AF1WoRqd3aJAHsqc9NY7iL8F \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
  5981                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const fineTune = await openai.fineTuning.jobs.retrieve(\"ftjob-abc123\");\n\n  console.log(fineTune);\n}\n\nmain();\n",
  5982                "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.fine_tuning.jobs.retrieve(\"ftjob-abc123\")\n"
  5983              },
  5984              "response": "{\n  \"object\": \"fine_tuning.job\",\n  \"id\": \"ftjob-abc123\",\n  \"model\": \"davinci-002\",\n  \"created_at\": 1692661014,\n  \"finished_at\": 1692661190,\n  \"fine_tuned_model\": \"ft:davinci-002:my-org:custom_suffix:7q8mpxmy\",\n  \"organization_id\": \"org-123\",\n  \"result_files\": [\n      \"file-abc123\"\n  ],\n  \"status\": \"succeeded\",\n  \"validation_file\": null,\n  \"training_file\": \"file-abc123\",\n  \"hyperparameters\": {\n      \"n_epochs\": 4,\n  },\n  \"trained_tokens\": 5768\n}\n"
  5985            },
  5986            "group": "fine-tuning",
  5987            "name": "Retrieve fine-tuning job",
  5988            "returns": "The [fine-tuning](/docs/api-reference/fine-tuning/object) object with the given ID."
  5989          }
  5990        }
  5991      },
  5992      "/fine_tuning/jobs/{fine_tuning_job_id}/cancel": {
  5993        "post": {
  5994          "operationId": "cancelFineTuningJob",
  5995          "parameters": [
  5996            {
  5997              "description": "The ID of the fine-tuning job to cancel.\n",
  5998              "in": "path",
  5999              "name": "fine_tuning_job_id",
  6000              "required": true,
  6001              "schema": {
  6002                "example": "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
  6003                "type": "string"
  6004              }
  6005            }
  6006          ],
  6007          "responses": {
  6008            "200": {
  6009              "content": {
  6010                "application/json": {
  6011                  "schema": {
  6012                    "$ref": "#/components/schemas/FineTuningJob"
  6013                  }
  6014                }
  6015              },
  6016              "description": "OK"
  6017            }
  6018          },
  6019          "summary": "Immediately cancel a fine-tune job.\n",
  6020          "tags": [
  6021            "Fine-tuning"
  6022          ],
  6023          "x-oaiMeta": {
  6024            "examples": {
  6025              "request": {
  6026                "curl": "curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/cancel \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
  6027                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const fineTune = await openai.fineTuning.jobs.cancel(\"ftjob-abc123\");\n\n  console.log(fineTune);\n}\nmain();",
  6028                "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.fine_tuning.jobs.cancel(\"ftjob-abc123\")\n"
  6029              },
  6030              "response": "{\n  \"object\": \"fine_tuning.job\",\n  \"id\": \"ftjob-abc123\",\n  \"model\": \"gpt-3.5-turbo-0613\",\n  \"created_at\": 1689376978,\n  \"fine_tuned_model\": null,\n  \"organization_id\": \"org-123\",\n  \"result_files\": [],\n  \"hyperparameters\": {\n    \"n_epochs\":  \"auto\"\n  },\n  \"status\": \"cancelled\",\n  \"validation_file\": \"file-abc123\",\n  \"training_file\": \"file-abc123\"\n}\n"
  6031            },
  6032            "group": "fine-tuning",
  6033            "name": "Cancel fine-tuning",
  6034            "returns": "The cancelled [fine-tuning](/docs/api-reference/fine-tuning/object) object."
  6035          }
  6036        }
  6037      },
  6038      "/fine_tuning/jobs/{fine_tuning_job_id}/events": {
  6039        "get": {
  6040          "operationId": "listFineTuningEvents",
  6041          "parameters": [
  6042            {
  6043              "description": "The ID of the fine-tuning job to get events for.\n",
  6044              "in": "path",
  6045              "name": "fine_tuning_job_id",
  6046              "required": true,
  6047              "schema": {
  6048                "example": "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
  6049                "type": "string"
  6050              }
  6051            },
  6052            {
  6053              "description": "Identifier for the last event from the previous pagination request.",
  6054              "in": "query",
  6055              "name": "after",
  6056              "required": false,
  6057              "schema": {
  6058                "type": "string"
  6059              }
  6060            },
  6061            {
  6062              "description": "Number of events to retrieve.",
  6063              "in": "query",
  6064              "name": "limit",
  6065              "required": false,
  6066              "schema": {
  6067                "default": 20,
  6068                "type": "integer"
  6069              }
  6070            }
  6071          ],
  6072          "responses": {
  6073            "200": {
  6074              "content": {
  6075                "application/json": {
  6076                  "schema": {
  6077                    "$ref": "#/components/schemas/ListFineTuningJobEventsResponse"
  6078                  }
  6079                }
  6080              },
  6081              "description": "OK"
  6082            }
  6083          },
  6084          "summary": "Get status updates for a fine-tuning job.\n",
  6085          "tags": [
  6086            "Fine-tuning"
  6087          ],
  6088          "x-oaiMeta": {
  6089            "examples": {
  6090              "request": {
  6091                "curl": "curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/events \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
  6092                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const list = await openai.fineTuning.list_events(id=\"ftjob-abc123\", limit=2);\n\n  for await (const fineTune of list) {\n    console.log(fineTune);\n  }\n}\n\nmain();",
  6093                "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.fine_tuning.jobs.list_events(\n  fine_tuning_job_id=\"ftjob-abc123\",\n  limit=2\n)\n"
  6094              },
  6095              "response": "{\n  \"object\": \"list\",\n  \"data\": [\n    {\n      \"object\": \"fine_tuning.job.event\",\n      \"id\": \"ft-event-ddTJfwuMVpfLXseO0Am0Gqjm\",\n      \"created_at\": 1692407401,\n      \"level\": \"info\",\n      \"message\": \"Fine tuning job successfully completed\",\n      \"data\": null,\n      \"type\": \"message\"\n    },\n    {\n      \"object\": \"fine_tuning.job.event\",\n      \"id\": \"ft-event-tyiGuB72evQncpH87xe505Sv\",\n      \"created_at\": 1692407400,\n      \"level\": \"info\",\n      \"message\": \"New fine-tuned model created: ft:gpt-3.5-turbo:openai::7p4lURel\",\n      \"data\": null,\n      \"type\": \"message\"\n    }\n  ],\n  \"has_more\": true\n}\n"
  6096            },
  6097            "group": "fine-tuning",
  6098            "name": "List fine-tuning events",
  6099            "returns": "A list of fine-tuning event objects."
  6100          }
  6101        }
  6102      },
  6103      "/images/edits": {
  6104        "post": {
  6105          "operationId": "createImageEdit",
  6106          "requestBody": {
  6107            "content": {
  6108              "multipart/form-data": {
  6109                "schema": {
  6110                  "$ref": "#/components/schemas/CreateImageEditRequest"
  6111                }
  6112              }
  6113            },
  6114            "required": true
  6115          },
  6116          "responses": {
  6117            "200": {
  6118              "content": {
  6119                "application/json": {
  6120                  "schema": {
  6121                    "$ref": "#/components/schemas/ImagesResponse"
  6122                  }
  6123                }
  6124              },
  6125              "description": "OK"
  6126            }
  6127          },
  6128          "summary": "Creates an edited or extended image given an original image and a prompt.",
  6129          "tags": [
  6130            "Images"
  6131          ],
  6132          "x-oaiMeta": {
  6133            "examples": {
  6134              "request": {
  6135                "curl": "curl https://api.openai.com/v1/images/edits \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -F image=\"@otter.png\" \\\n  -F mask=\"@mask.png\" \\\n  -F prompt=\"A cute baby sea otter wearing a beret\" \\\n  -F n=2 \\\n  -F size=\"1024x1024\"\n",
  6136                "node.js": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const image = await openai.images.edit({\n    image: fs.createReadStream(\"otter.png\"),\n    mask: fs.createReadStream(\"mask.png\"),\n    prompt: \"A cute baby sea otter wearing a beret\",\n  });\n\n  console.log(image.data);\n}\nmain();",
  6137                "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.images.edit(\n  image=open(\"otter.png\", \"rb\"),\n  mask=open(\"mask.png\", \"rb\"),\n  prompt=\"A cute baby sea otter wearing a beret\",\n  n=2,\n  size=\"1024x1024\"\n)\n"
  6138              },
  6139              "response": "{\n  \"created\": 1589478378,\n  \"data\": [\n    {\n      \"url\": \"https://...\"\n    },\n    {\n      \"url\": \"https://...\"\n    }\n  ]\n}\n"
  6140            },
  6141            "group": "images",
  6142            "name": "Create image edit",
  6143            "returns": "Returns a list of [image](/docs/api-reference/images/object) objects."
  6144          }
  6145        }
  6146      },
  6147      "/images/generations": {
  6148        "post": {
  6149          "operationId": "createImage",
  6150          "requestBody": {
  6151            "content": {
  6152              "application/json": {
  6153                "schema": {
  6154                  "$ref": "#/components/schemas/CreateImageRequest"
  6155                }
  6156              }
  6157            },
  6158            "required": true
  6159          },
  6160          "responses": {
  6161            "200": {
  6162              "content": {
  6163                "application/json": {
  6164                  "schema": {
  6165                    "$ref": "#/components/schemas/ImagesResponse"
  6166                  }
  6167                }
  6168              },
  6169              "description": "OK"
  6170            }
  6171          },
  6172          "summary": "Creates an image given a prompt.",
  6173          "tags": [
  6174            "Images"
  6175          ],
  6176          "x-oaiMeta": {
  6177            "examples": {
  6178              "request": {
  6179                "curl": "curl https://api.openai.com/v1/images/generations \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -d '{\n    \"model\": \"dall-e-3\",\n    \"prompt\": \"A cute baby sea otter\",\n    \"n\": 1,\n    \"size\": \"1024x1024\"\n  }'\n",
  6180                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const image = await openai.images.generate({ model: \"dall-e-3\", prompt: \"A cute baby sea otter\" });\n\n  console.log(image.data);\n}\nmain();",
  6181                "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.images.generate(\n  model=\"dall-e-3\",\n  prompt=\"A cute baby sea otter\",\n  n=1,\n  size=\"1024x1024\"\n)\n"
  6182              },
  6183              "response": "{\n  \"created\": 1589478378,\n  \"data\": [\n    {\n      \"url\": \"https://...\"\n    },\n    {\n      \"url\": \"https://...\"\n    }\n  ]\n}\n"
  6184            },
  6185            "group": "images",
  6186            "name": "Create image",
  6187            "returns": "Returns a list of [image](/docs/api-reference/images/object) objects."
  6188          }
  6189        }
  6190      },
  6191      "/images/variations": {
  6192        "post": {
  6193          "operationId": "createImageVariation",
  6194          "requestBody": {
  6195            "content": {
  6196              "multipart/form-data": {
  6197                "schema": {
  6198                  "$ref": "#/components/schemas/CreateImageVariationRequest"
  6199                }
  6200              }
  6201            },
  6202            "required": true
  6203          },
  6204          "responses": {
  6205            "200": {
  6206              "content": {
  6207                "application/json": {
  6208                  "schema": {
  6209                    "$ref": "#/components/schemas/ImagesResponse"
  6210                  }
  6211                }
  6212              },
  6213              "description": "OK"
  6214            }
  6215          },
  6216          "summary": "Creates a variation of a given image.",
  6217          "tags": [
  6218            "Images"
  6219          ],
  6220          "x-oaiMeta": {
  6221            "examples": {
  6222              "request": {
  6223                "curl": "curl https://api.openai.com/v1/images/variations \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -F image=\"@otter.png\" \\\n  -F n=2 \\\n  -F size=\"1024x1024\"\n",
  6224                "node.js": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const image = await openai.images.createVariation({\n    image: fs.createReadStream(\"otter.png\"),\n  });\n\n  console.log(image.data);\n}\nmain();",
  6225                "python": "from openai import OpenAI\nclient = OpenAI()\n\nresponse = client.images.create_variation(\n  image=open(\"image_edit_original.png\", \"rb\"),\n  n=2,\n  size=\"1024x1024\"\n)\n"
  6226              },
  6227              "response": "{\n  \"created\": 1589478378,\n  \"data\": [\n    {\n      \"url\": \"https://...\"\n    },\n    {\n      \"url\": \"https://...\"\n    }\n  ]\n}\n"
  6228            },
  6229            "group": "images",
  6230            "name": "Create image variation",
  6231            "returns": "Returns a list of [image](/docs/api-reference/images/object) objects."
  6232          }
  6233        }
  6234      },
  6235      "/models": {
  6236        "get": {
  6237          "operationId": "listModels",
  6238          "responses": {
  6239            "200": {
  6240              "content": {
  6241                "application/json": {
  6242                  "schema": {
  6243                    "$ref": "#/components/schemas/ListModelsResponse"
  6244                  }
  6245                }
  6246              },
  6247              "description": "OK"
  6248            }
  6249          },
  6250          "summary": "Lists the currently available models, and provides basic information about each one such as the owner and availability.",
  6251          "tags": [
  6252            "Models"
  6253          ],
  6254          "x-oaiMeta": {
  6255            "examples": {
  6256              "request": {
  6257                "curl": "curl https://api.openai.com/v1/models \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
  6258                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const list = await openai.models.list();\n\n  for await (const model of list) {\n    console.log(model);\n  }\n}\nmain();",
  6259                "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.models.list()\n"
  6260              },
  6261              "response": "{\n  \"object\": \"list\",\n  \"data\": [\n    {\n      \"id\": \"model-id-0\",\n      \"object\": \"model\",\n      \"created\": 1686935002,\n      \"owned_by\": \"organization-owner\"\n    },\n    {\n      \"id\": \"model-id-1\",\n      \"object\": \"model\",\n      \"created\": 1686935002,\n      \"owned_by\": \"organization-owner\",\n    },\n    {\n      \"id\": \"model-id-2\",\n      \"object\": \"model\",\n      \"created\": 1686935002,\n      \"owned_by\": \"openai\"\n    },\n  ],\n  \"object\": \"list\"\n}\n"
  6262            },
  6263            "group": "models",
  6264            "name": "List models",
  6265            "returns": "A list of [model](/docs/api-reference/models/object) objects."
  6266          }
  6267        }
  6268      },
  6269      "/models/{model}": {
  6270        "delete": {
  6271          "operationId": "deleteModel",
  6272          "parameters": [
  6273            {
  6274              "description": "The model to delete",
  6275              "in": "path",
  6276              "name": "model",
  6277              "required": true,
  6278              "schema": {
  6279                "example": "ft:gpt-3.5-turbo:acemeco:suffix:abc123",
  6280                "type": "string"
  6281              }
  6282            }
  6283          ],
  6284          "responses": {
  6285            "200": {
  6286              "content": {
  6287                "application/json": {
  6288                  "schema": {
  6289                    "$ref": "#/components/schemas/DeleteModelResponse"
  6290                  }
  6291                }
  6292              },
  6293              "description": "OK"
  6294            }
  6295          },
  6296          "summary": "Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.",
  6297          "tags": [
  6298            "Models"
  6299          ],
  6300          "x-oaiMeta": {
  6301            "examples": {
  6302              "request": {
  6303                "curl": "curl https://api.openai.com/v1/models/ft:gpt-3.5-turbo:acemeco:suffix:abc123 \\\n  -X DELETE \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
  6304                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const model = await openai.models.del(\"ft:gpt-3.5-turbo:acemeco:suffix:abc123\");\n\n  console.log(model);\n}\nmain();",
  6305                "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.models.delete(\"ft:gpt-3.5-turbo:acemeco:suffix:abc123\")\n"
  6306              },
  6307              "response": "{\n  \"id\": \"ft:gpt-3.5-turbo:acemeco:suffix:abc123\",\n  \"object\": \"model\",\n  \"deleted\": true\n}\n"
  6308            },
  6309            "group": "models",
  6310            "name": "Delete a fine-tuned model",
  6311            "returns": "Deletion status."
  6312          }
  6313        },
  6314        "get": {
  6315          "operationId": "retrieveModel",
  6316          "parameters": [
  6317            {
  6318              "description": "The ID of the model to use for this request",
  6319              "in": "path",
  6320              "name": "model",
  6321              "required": true,
  6322              "schema": {
  6323                "example": "gpt-3.5-turbo",
  6324                "type": "string"
  6325              }
  6326            }
  6327          ],
  6328          "responses": {
  6329            "200": {
  6330              "content": {
  6331                "application/json": {
  6332                  "schema": {
  6333                    "$ref": "#/components/schemas/Model"
  6334                  }
  6335                }
  6336              },
  6337              "description": "OK"
  6338            }
  6339          },
  6340          "summary": "Retrieves a model instance, providing basic information about the model such as the owner and permissioning.",
  6341          "tags": [
  6342            "Models"
  6343          ],
  6344          "x-oaiMeta": {
  6345            "examples": {
  6346              "request": {
  6347                "curl": "curl https://api.openai.com/v1/models/VAR_model_id \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
  6348                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const model = await openai.models.retrieve(\"gpt-3.5-turbo\");\n\n  console.log(model);\n}\n\nmain();",
  6349                "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.models.retrieve(\"VAR_model_id\")\n"
  6350              },
  6351              "response": "{\n  \"id\": \"VAR_model_id\",\n  \"object\": \"model\",\n  \"created\": 1686935002,\n  \"owned_by\": \"openai\"\n}\n"
  6352            },
  6353            "group": "models",
  6354            "name": "Retrieve model",
  6355            "returns": "The [model](/docs/api-reference/models/object) object matching the specified ID."
  6356          }
  6357        }
  6358      },
  6359      "/moderations": {
  6360        "post": {
  6361          "operationId": "createModeration",
  6362          "requestBody": {
  6363            "content": {
  6364              "application/json": {
  6365                "schema": {
  6366                  "$ref": "#/components/schemas/CreateModerationRequest"
  6367                }
  6368              }
  6369            },
  6370            "required": true
  6371          },
  6372          "responses": {
  6373            "200": {
  6374              "content": {
  6375                "application/json": {
  6376                  "schema": {
  6377                    "$ref": "#/components/schemas/CreateModerationResponse"
  6378                  }
  6379                }
  6380              },
  6381              "description": "OK"
  6382            }
  6383          },
  6384          "summary": "Classifies if text violates OpenAI's Content Policy",
  6385          "tags": [
  6386            "Moderations"
  6387          ],
  6388          "x-oaiMeta": {
  6389            "examples": {
  6390              "request": {
  6391                "curl": "curl https://api.openai.com/v1/moderations \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -d '{\n    \"input\": \"I want to kill them.\"\n  }'\n",
  6392                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const moderation = await openai.moderations.create({ input: \"I want to kill them.\" });\n\n  console.log(moderation);\n}\nmain();\n",
  6393                "python": "from openai import OpenAI\nclient = OpenAI()\n\nclient.moderations.create(input=\"I want to kill them.\")\n"
  6394              },
  6395              "response": "{\n  \"id\": \"modr-XXXXX\",\n  \"model\": \"text-moderation-005\",\n  \"results\": [\n    {\n      \"flagged\": true,\n      \"categories\": {\n        \"sexual\": false,\n        \"hate\": false,\n        \"harassment\": false,\n        \"self-harm\": false,\n        \"sexual/minors\": false,\n        \"hate/threatening\": false,\n        \"violence/graphic\": false,\n        \"self-harm/intent\": false,\n        \"self-harm/instructions\": false,\n        \"harassment/threatening\": true,\n        \"violence\": true,\n      },\n      \"category_scores\": {\n        \"sexual\": 1.2282071e-06,\n        \"hate\": 0.010696256,\n        \"harassment\": 0.29842457,\n        \"self-harm\": 1.5236925e-08,\n        \"sexual/minors\": 5.7246268e-08,\n        \"hate/threatening\": 0.0060676364,\n        \"violence/graphic\": 4.435014e-06,\n        \"self-harm/intent\": 8.098441e-10,\n        \"self-harm/instructions\": 2.8498655e-11,\n        \"harassment/threatening\": 0.63055265,\n        \"violence\": 0.99011886,\n      }\n    }\n  ]\n}\n"
  6396            },
  6397            "group": "moderations",
  6398            "name": "Create moderation",
  6399            "returns": "A [moderation](/docs/api-reference/moderations/object) object."
  6400          }
  6401        }
  6402      },
  6403      "/threads": {
  6404        "post": {
  6405          "operationId": "createThread",
  6406          "requestBody": {
  6407            "content": {
  6408              "application/json": {
  6409                "schema": {
  6410                  "$ref": "#/components/schemas/CreateThreadRequest"
  6411                }
  6412              }
  6413            }
  6414          },
  6415          "responses": {
  6416            "200": {
  6417              "content": {
  6418                "application/json": {
  6419                  "schema": {
  6420                    "$ref": "#/components/schemas/ThreadObject"
  6421                  }
  6422                }
  6423              },
  6424              "description": "OK"
  6425            }
  6426          },
  6427          "summary": "Create a thread.",
  6428          "tags": [
  6429            "Assistants"
  6430          ],
  6431          "x-oaiMeta": {
  6432            "beta": true,
  6433            "examples": [
  6434              {
  6435                "request": {
  6436                  "curl": "curl https://api.openai.com/v1/threads \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"OpenAI-Beta: assistants=v1\" \\\n  -d ''\n",
  6437                  "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const emptyThread = await openai.beta.threads.create();\n\n  console.log(emptyThread);\n}\n\nmain();",
  6438                  "python": "from openai import OpenAI\nclient = OpenAI()\n\nempty_thread = client.beta.threads.create()\nprint(empty_thread)\n"
  6439                },
  6440                "response": "{\n  \"id\": \"thread_abc123\",\n  \"object\": \"thread\",\n  \"created_at\": 1699012949,\n  \"metadata\": {}\n}\n",
  6441                "title": "Empty"
  6442              },
  6443              {
  6444                "request": {
  6445                  "curl": "curl https://api.openai.com/v1/threads \\\n-H \"Content-Type: application/json\" \\\n-H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n-H \"OpenAI-Beta: assistants=v1\" \\\n-d '{\n    \"messages\": [{\n      \"role\": \"user\",\n      \"content\": \"Hello, what is AI?\",\n      \"file_ids\": [\"file-abc123\"]\n    }, {\n      \"role\": \"user\",\n      \"content\": \"How does AI work? Explain it in simple terms.\"\n    }]\n  }'\n",
  6446                  "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const messageThread = await openai.beta.threads.create({\n    messages: [\n      {\n        role: \"user\",\n        content: \"Hello, what is AI?\",\n        file_ids: [\"file-abc123\"],\n      },\n      {\n        role: \"user\",\n        content: \"How does AI work? Explain it in simple terms.\",\n      },\n    ],\n  });\n\n  console.log(messageThread);\n}\n\nmain();",
  6447                  "python": "from openai import OpenAI\nclient = OpenAI()\n\nmessage_thread = client.beta.threads.create(\n  messages=[\n    {\n      \"role\": \"user\",\n      \"content\": \"Hello, what is AI?\",\n      \"file_ids\": [\"file-abc123\"],\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"How does AI work? Explain it in simple terms.\"\n    },\n  ]\n)\n\nprint(message_thread)\n"
  6448                },
  6449                "response": "{\n  id: 'thread_abc123',\n  object: 'thread',\n  created_at: 1699014083,\n  metadata: {}\n}\n",
  6450                "title": "Messages"
  6451              }
  6452            ],
  6453            "group": "threads",
  6454            "name": "Create thread",
  6455            "returns": "A [thread](/docs/api-reference/threads) object."
  6456          }
  6457        }
  6458      },
  6459      "/threads/runs": {
  6460        "post": {
  6461          "operationId": "createThreadAndRun",
  6462          "requestBody": {
  6463            "content": {
  6464              "application/json": {
  6465                "schema": {
  6466                  "$ref": "#/components/schemas/CreateThreadAndRunRequest"
  6467                }
  6468              }
  6469            },
  6470            "required": true
  6471          },
  6472          "responses": {
  6473            "200": {
  6474              "content": {
  6475                "application/json": {
  6476                  "schema": {
  6477                    "$ref": "#/components/schemas/RunObject"
  6478                  }
  6479                }
  6480              },
  6481              "description": "OK"
  6482            }
  6483          },
  6484          "summary": "Create a thread and run it in one request.",
  6485          "tags": [
  6486            "Assistants"
  6487          ],
  6488          "x-oaiMeta": {
  6489            "beta": true,
  6490            "examples": {
  6491              "request": {
  6492                "curl": "curl https://api.openai.com/v1/threads/runs \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"OpenAI-Beta: assistants=v1\" \\\n  -d '{\n      \"assistant_id\": \"asst_abc123\",\n      \"thread\": {\n        \"messages\": [\n          {\"role\": \"user\", \"content\": \"Explain deep learning to a 5 year old.\"}\n        ]\n      }\n    }'\n",
  6493                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const run = await openai.beta.threads.createAndRun({\n    assistant_id: \"asst_abc123\",\n    thread: {\n      messages: [\n        { role: \"user\", content: \"Explain deep learning to a 5 year old.\" },\n      ],\n    },\n  });\n\n  console.log(run);\n}\n\nmain();\n",
  6494                "python": "from openai import OpenAI\nclient = OpenAI()\n\nrun = client.beta.threads.create_and_run(\n  assistant_id=\"asst_abc123\",\n  thread={\n    \"messages\": [\n      {\"role\": \"user\", \"content\": \"Explain deep learning to a 5 year old.\"}\n    ]\n  }\n)\n"
  6495              },
  6496              "response": "{\n  \"id\": \"run_abc123\",\n  \"object\": \"thread.run\",\n  \"created_at\": 1699076792,\n  \"assistant_id\": \"asst_abc123\",\n  \"thread_id\": \"thread_abc123\",\n  \"status\": \"queued\",\n  \"started_at\": null,\n  \"expires_at\": 1699077392,\n  \"cancelled_at\": null,\n  \"failed_at\": null,\n  \"completed_at\": null,\n  \"last_error\": null,\n  \"model\": \"gpt-4\",\n  \"instructions\": \"You are a helpful assistant.\",\n  \"tools\": [],\n  \"file_ids\": [],\n  \"metadata\": {},\n  \"usage\": null\n}\n"
  6497            },
  6498            "group": "threads",
  6499            "name": "Create thread and run",
  6500            "returns": "A [run](/docs/api-reference/runs/object) object."
  6501          }
  6502        }
  6503      },
  6504      "/threads/{thread_id}": {
  6505        "delete": {
  6506          "operationId": "deleteThread",
  6507          "parameters": [
  6508            {
  6509              "description": "The ID of the thread to delete.",
  6510              "in": "path",
  6511              "name": "thread_id",
  6512              "required": true,
  6513              "schema": {
  6514                "type": "string"
  6515              }
  6516            }
  6517          ],
  6518          "responses": {
  6519            "200": {
  6520              "content": {
  6521                "application/json": {
  6522                  "schema": {
  6523                    "$ref": "#/components/schemas/DeleteThreadResponse"
  6524                  }
  6525                }
  6526              },
  6527              "description": "OK"
  6528            }
  6529          },
  6530          "summary": "Delete a thread.",
  6531          "tags": [
  6532            "Assistants"
  6533          ],
  6534          "x-oaiMeta": {
  6535            "beta": true,
  6536            "examples": {
  6537              "request": {
  6538                "curl": "curl https://api.openai.com/v1/threads/thread_abc123 \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"OpenAI-Beta: assistants=v1\" \\\n  -X DELETE\n",
  6539                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const response = await openai.beta.threads.del(\"thread_abc123\");\n\n  console.log(response);\n}\nmain();",
  6540                "python": "from openai import OpenAI\nclient = OpenAI()\n\nresponse = client.beta.threads.delete(\"thread_abc123\")\nprint(response)\n"
  6541              },
  6542              "response": "{\n  \"id\": \"thread_abc123\",\n  \"object\": \"thread.deleted\",\n  \"deleted\": true\n}\n"
  6543            },
  6544            "group": "threads",
  6545            "name": "Delete thread",
  6546            "returns": "Deletion status"
  6547          }
  6548        },
  6549        "get": {
  6550          "operationId": "getThread",
  6551          "parameters": [
  6552            {
  6553              "description": "The ID of the thread to retrieve.",
  6554              "in": "path",
  6555              "name": "thread_id",
  6556              "required": true,
  6557              "schema": {
  6558                "type": "string"
  6559              }
  6560            }
  6561          ],
  6562          "responses": {
  6563            "200": {
  6564              "content": {
  6565                "application/json": {
  6566                  "schema": {
  6567                    "$ref": "#/components/schemas/ThreadObject"
  6568                  }
  6569                }
  6570              },
  6571              "description": "OK"
  6572            }
  6573          },
  6574          "summary": "Retrieves a thread.",
  6575          "tags": [
  6576            "Assistants"
  6577          ],
  6578          "x-oaiMeta": {
  6579            "beta": true,
  6580            "examples": {
  6581              "request": {
  6582                "curl": "curl https://api.openai.com/v1/threads/thread_abc123 \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"OpenAI-Beta: assistants=v1\"\n",
  6583                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const myThread = await openai.beta.threads.retrieve(\n    \"thread_abc123\"\n  );\n\n  console.log(myThread);\n}\n\nmain();",
  6584                "python": "from openai import OpenAI\nclient = OpenAI()\n\nmy_thread = client.beta.threads.retrieve(\"thread_abc123\")\nprint(my_thread)\n"
  6585              },
  6586              "response": "{\n  \"id\": \"thread_abc123\",\n  \"object\": \"thread\",\n  \"created_at\": 1699014083,\n  \"metadata\": {}\n}\n"
  6587            },
  6588            "group": "threads",
  6589            "name": "Retrieve thread",
  6590            "returns": "The [thread](/docs/api-reference/threads/object) object matching the specified ID."
  6591          }
  6592        },
  6593        "post": {
  6594          "operationId": "modifyThread",
  6595          "parameters": [
  6596            {
  6597              "description": "The ID of the thread to modify. Only the `metadata` can be modified.",
  6598              "in": "path",
  6599              "name": "thread_id",
  6600              "required": true,
  6601              "schema": {
  6602                "type": "string"
  6603              }
  6604            }
  6605          ],
  6606          "requestBody": {
  6607            "content": {
  6608              "application/json": {
  6609                "schema": {
  6610                  "$ref": "#/components/schemas/ModifyThreadRequest"
  6611                }
  6612              }
  6613            },
  6614            "required": true
  6615          },
  6616          "responses": {
  6617            "200": {
  6618              "content": {
  6619                "application/json": {
  6620                  "schema": {
  6621                    "$ref": "#/components/schemas/ThreadObject"
  6622                  }
  6623                }
  6624              },
  6625              "description": "OK"
  6626            }
  6627          },
  6628          "summary": "Modifies a thread.",
  6629          "tags": [
  6630            "Assistants"
  6631          ],
  6632          "x-oaiMeta": {
  6633            "beta": true,
  6634            "examples": {
  6635              "request": {
  6636                "curl": "curl https://api.openai.com/v1/threads/thread_abc123 \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"OpenAI-Beta: assistants=v1\" \\\n  -d '{\n      \"metadata\": {\n        \"modified\": \"true\",\n        \"user\": \"abc123\"\n      }\n    }'\n",
  6637                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const updatedThread = await openai.beta.threads.update(\n    \"thread_abc123\",\n    {\n      metadata: { modified: \"true\", user: \"abc123\" },\n    }\n  );\n\n  console.log(updatedThread);\n}\n\nmain();",
  6638                "python": "from openai import OpenAI\nclient = OpenAI()\n\nmy_updated_thread = client.beta.threads.update(\n  \"thread_abc123\",\n  metadata={\n    \"modified\": \"true\",\n    \"user\": \"abc123\"\n  }\n)\nprint(my_updated_thread)\n"
  6639              },
  6640              "response": "{\n  \"id\": \"thread_abc123\",\n  \"object\": \"thread\",\n  \"created_at\": 1699014083,\n  \"metadata\": {\n    \"modified\": \"true\",\n    \"user\": \"abc123\"\n  }\n}\n"
  6641            },
  6642            "group": "threads",
  6643            "name": "Modify thread",
  6644            "returns": "The modified [thread](/docs/api-reference/threads/object) object matching the specified ID."
  6645          }
  6646        }
  6647      },
  6648      "/threads/{thread_id}/messages": {
  6649        "get": {
  6650          "operationId": "listMessages",
  6651          "parameters": [
  6652            {
  6653              "description": "The ID of the [thread](/docs/api-reference/threads) the messages belong to.",
  6654              "in": "path",
  6655              "name": "thread_id",
  6656              "required": true,
  6657              "schema": {
  6658                "type": "string"
  6659              }
  6660            },
  6661            {
  6662              "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n",
  6663              "in": "query",
  6664              "name": "limit",
  6665              "required": false,
  6666              "schema": {
  6667                "default": 20,
  6668                "type": "integer"
  6669              }
  6670            },
  6671            {
  6672              "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.\n",
  6673              "in": "query",
  6674              "name": "order",
  6675              "schema": {
  6676                "default": "desc",
  6677                "enum": [
  6678                  "asc",
  6679                  "desc"
  6680                ],
  6681                "type": "string"
  6682              }
  6683            },
  6684            {
  6685              "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.\n",
  6686              "in": "query",
  6687              "name": "after",
  6688              "schema": {
  6689                "type": "string"
  6690              }
  6691            },
  6692            {
  6693              "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.\n",
  6694              "in": "query",
  6695              "name": "before",
  6696              "schema": {
  6697                "type": "string"
  6698              }
  6699            }
  6700          ],
  6701          "responses": {
  6702            "200": {
  6703              "content": {
  6704                "application/json": {
  6705                  "schema": {
  6706                    "$ref": "#/components/schemas/ListMessagesResponse"
  6707                  }
  6708                }
  6709              },
  6710              "description": "OK"
  6711            }
  6712          },
  6713          "summary": "Returns a list of messages for a given thread.",
  6714          "tags": [
  6715            "Assistants"
  6716          ],
  6717          "x-oaiMeta": {
  6718            "beta": true,
  6719            "examples": {
  6720              "request": {
  6721                "curl": "curl https://api.openai.com/v1/threads/thread_abc123/messages \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"OpenAI-Beta: assistants=v1\"\n",
  6722                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const threadMessages = await openai.beta.threads.messages.list(\n    \"thread_abc123\"\n  );\n\n  console.log(threadMessages.data);\n}\n\nmain();",
  6723                "python": "from openai import OpenAI\nclient = OpenAI()\n\nthread_messages = client.beta.threads.messages.list(\"thread_abc123\")\nprint(thread_messages.data)\n"
  6724              },
  6725              "response": "{\n  \"object\": \"list\",\n  \"data\": [\n    {\n      \"id\": \"msg_abc123\",\n      \"object\": \"thread.message\",\n      \"created_at\": 1699016383,\n      \"thread_id\": \"thread_abc123\",\n      \"role\": \"user\",\n      \"content\": [\n        {\n          \"type\": \"text\",\n          \"text\": {\n            \"value\": \"How does AI work? Explain it in simple terms.\",\n            \"annotations\": []\n          }\n        }\n      ],\n      \"file_ids\": [],\n      \"assistant_id\": null,\n      \"run_id\": null,\n      \"metadata\": {}\n    },\n    {\n      \"id\": \"msg_abc456\",\n      \"object\": \"thread.message\",\n      \"created_at\": 1699016383,\n      \"thread_id\": \"thread_abc123\",\n      \"role\": \"user\",\n      \"content\": [\n        {\n          \"type\": \"text\",\n          \"text\": {\n            \"value\": \"Hello, what is AI?\",\n            \"annotations\": []\n          }\n        }\n      ],\n      \"file_ids\": [\n        \"file-abc123\"\n      ],\n      \"assistant_id\": null,\n      \"run_id\": null,\n      \"metadata\": {}\n    }\n  ],\n  \"first_id\": \"msg_abc123\",\n  \"last_id\": \"msg_abc456\",\n  \"has_more\": false\n}\n"
  6726            },
  6727            "group": "threads",
  6728            "name": "List messages",
  6729            "returns": "A list of [message](/docs/api-reference/messages) objects."
  6730          }
  6731        },
  6732        "post": {
  6733          "operationId": "createMessage",
  6734          "parameters": [
  6735            {
  6736              "description": "The ID of the [thread](/docs/api-reference/threads) to create a message for.",
  6737              "in": "path",
  6738              "name": "thread_id",
  6739              "required": true,
  6740              "schema": {
  6741                "type": "string"
  6742              }
  6743            }
  6744          ],
  6745          "requestBody": {
  6746            "content": {
  6747              "application/json": {
  6748                "schema": {
  6749                  "$ref": "#/components/schemas/CreateMessageRequest"
  6750                }
  6751              }
  6752            },
  6753            "required": true
  6754          },
  6755          "responses": {
  6756            "200": {
  6757              "content": {
  6758                "application/json": {
  6759                  "schema": {
  6760                    "$ref": "#/components/schemas/MessageObject"
  6761                  }
  6762                }
  6763              },
  6764              "description": "OK"
  6765            }
  6766          },
  6767          "summary": "Create a message.",
  6768          "tags": [
  6769            "Assistants"
  6770          ],
  6771          "x-oaiMeta": {
  6772            "beta": true,
  6773            "examples": {
  6774              "request": {
  6775                "curl": "curl https://api.openai.com/v1/threads/thread_abc123/messages \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"OpenAI-Beta: assistants=v1\" \\\n  -d '{\n      \"role\": \"user\",\n      \"content\": \"How does AI work? Explain it in simple terms.\"\n    }'\n",
  6776                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const threadMessages = await openai.beta.threads.messages.create(\n    \"thread_abc123\",\n    { role: \"user\", content: \"How does AI work? Explain it in simple terms.\" }\n  );\n\n  console.log(threadMessages);\n}\n\nmain();",
  6777                "python": "from openai import OpenAI\nclient = OpenAI()\n\nthread_message = client.beta.threads.messages.create(\n  \"thread_abc123\",\n  role=\"user\",\n  content=\"How does AI work? Explain it in simple terms.\",\n)\nprint(thread_message)\n"
  6778              },
  6779              "response": "{\n  \"id\": \"msg_abc123\",\n  \"object\": \"thread.message\",\n  \"created_at\": 1699017614,\n  \"thread_id\": \"thread_abc123\",\n  \"role\": \"user\",\n  \"content\": [\n    {\n      \"type\": \"text\",\n      \"text\": {\n        \"value\": \"How does AI work? Explain it in simple terms.\",\n        \"annotations\": []\n      }\n    }\n  ],\n  \"file_ids\": [],\n  \"assistant_id\": null,\n  \"run_id\": null,\n  \"metadata\": {}\n}\n"
  6780            },
  6781            "group": "threads",
  6782            "name": "Create message",
  6783            "returns": "A [message](/docs/api-reference/messages/object) object."
  6784          }
  6785        }
  6786      },
  6787      "/threads/{thread_id}/messages/{message_id}": {
  6788        "get": {
  6789          "operationId": "getMessage",
  6790          "parameters": [
  6791            {
  6792              "description": "The ID of the [thread](/docs/api-reference/threads) to which this message belongs.",
  6793              "in": "path",
  6794              "name": "thread_id",
  6795              "required": true,
  6796              "schema": {
  6797                "type": "string"
  6798              }
  6799            },
  6800            {
  6801              "description": "The ID of the message to retrieve.",
  6802              "in": "path",
  6803              "name": "message_id",
  6804              "required": true,
  6805              "schema": {
  6806                "type": "string"
  6807              }
  6808            }
  6809          ],
  6810          "responses": {
  6811            "200": {
  6812              "content": {
  6813                "application/json": {
  6814                  "schema": {
  6815                    "$ref": "#/components/schemas/MessageObject"
  6816                  }
  6817                }
  6818              },
  6819              "description": "OK"
  6820            }
  6821          },
  6822          "summary": "Retrieve a message.",
  6823          "tags": [
  6824            "Assistants"
  6825          ],
  6826          "x-oaiMeta": {
  6827            "beta": true,
  6828            "examples": {
  6829              "request": {
  6830                "curl": "curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"OpenAI-Beta: assistants=v1\"\n",
  6831                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const message = await openai.beta.threads.messages.retrieve(\n    \"thread_abc123\",\n    \"msg_abc123\"\n  );\n\n  console.log(message);\n}\n\nmain();",
  6832                "python": "from openai import OpenAI\nclient = OpenAI()\n\nmessage = client.beta.threads.messages.retrieve(\n  message_id=\"msg_abc123\",\n  thread_id=\"thread_abc123\",\n)\nprint(message)\n"
  6833              },
  6834              "response": "{\n  \"id\": \"msg_abc123\",\n  \"object\": \"thread.message\",\n  \"created_at\": 1699017614,\n  \"thread_id\": \"thread_abc123\",\n  \"role\": \"user\",\n  \"content\": [\n    {\n      \"type\": \"text\",\n      \"text\": {\n        \"value\": \"How does AI work? Explain it in simple terms.\",\n        \"annotations\": []\n      }\n    }\n  ],\n  \"file_ids\": [],\n  \"assistant_id\": null,\n  \"run_id\": null,\n  \"metadata\": {}\n}\n"
  6835            },
  6836            "group": "threads",
  6837            "name": "Retrieve message",
  6838            "returns": "The [message](/docs/api-reference/threads/messages/object) object matching the specified ID."
  6839          }
  6840        },
  6841        "post": {
  6842          "operationId": "modifyMessage",
  6843          "parameters": [
  6844            {
  6845              "description": "The ID of the thread to which this message belongs.",
  6846              "in": "path",
  6847              "name": "thread_id",
  6848              "required": true,
  6849              "schema": {
  6850                "type": "string"
  6851              }
  6852            },
  6853            {
  6854              "description": "The ID of the message to modify.",
  6855              "in": "path",
  6856              "name": "message_id",
  6857              "required": true,
  6858              "schema": {
  6859                "type": "string"
  6860              }
  6861            }
  6862          ],
  6863          "requestBody": {
  6864            "content": {
  6865              "application/json": {
  6866                "schema": {
  6867                  "$ref": "#/components/schemas/ModifyMessageRequest"
  6868                }
  6869              }
  6870            },
  6871            "required": true
  6872          },
  6873          "responses": {
  6874            "200": {
  6875              "content": {
  6876                "application/json": {
  6877                  "schema": {
  6878                    "$ref": "#/components/schemas/MessageObject"
  6879                  }
  6880                }
  6881              },
  6882              "description": "OK"
  6883            }
  6884          },
  6885          "summary": "Modifies a message.",
  6886          "tags": [
  6887            "Assistants"
  6888          ],
  6889          "x-oaiMeta": {
  6890            "beta": true,
  6891            "examples": {
  6892              "request": {
  6893                "curl": "curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"OpenAI-Beta: assistants=v1\" \\\n  -d '{\n      \"metadata\": {\n        \"modified\": \"true\",\n        \"user\": \"abc123\"\n      }\n    }'\n",
  6894                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const message = await openai.beta.threads.messages.update(\n    \"thread_abc123\",\n    \"msg_abc123\",\n    {\n      metadata: {\n        modified: \"true\",\n        user: \"abc123\",\n      },\n    }\n  }'",
  6895                "python": "from openai import OpenAI\nclient = OpenAI()\n\nmessage = client.beta.threads.messages.update(\n  message_id=\"msg_abc12\",\n  thread_id=\"thread_abc123\",\n  metadata={\n    \"modified\": \"true\",\n    \"user\": \"abc123\",\n  },\n)\nprint(message)\n"
  6896              },
  6897              "response": "{\n  \"id\": \"msg_abc123\",\n  \"object\": \"thread.message\",\n  \"created_at\": 1699017614,\n  \"thread_id\": \"thread_abc123\",\n  \"role\": \"user\",\n  \"content\": [\n    {\n      \"type\": \"text\",\n      \"text\": {\n        \"value\": \"How does AI work? Explain it in simple terms.\",\n        \"annotations\": []\n      }\n    }\n  ],\n  \"file_ids\": [],\n  \"assistant_id\": null,\n  \"run_id\": null,\n  \"metadata\": {\n    \"modified\": \"true\",\n    \"user\": \"abc123\"\n  }\n}\n"
  6898            },
  6899            "group": "threads",
  6900            "name": "Modify message",
  6901            "returns": "The modified [message](/docs/api-reference/threads/messages/object) object."
  6902          }
  6903        }
  6904      },
  6905      "/threads/{thread_id}/messages/{message_id}/files": {
  6906        "get": {
  6907          "operationId": "listMessageFiles",
  6908          "parameters": [
  6909            {
  6910              "description": "The ID of the thread that the message and files belong to.",
  6911              "in": "path",
  6912              "name": "thread_id",
  6913              "required": true,
  6914              "schema": {
  6915                "type": "string"
  6916              }
  6917            },
  6918            {
  6919              "description": "The ID of the message that the files belongs to.",
  6920              "in": "path",
  6921              "name": "message_id",
  6922              "required": true,
  6923              "schema": {
  6924                "type": "string"
  6925              }
  6926            },
  6927            {
  6928              "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n",
  6929              "in": "query",
  6930              "name": "limit",
  6931              "required": false,
  6932              "schema": {
  6933                "default": 20,
  6934                "type": "integer"
  6935              }
  6936            },
  6937            {
  6938              "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.\n",
  6939              "in": "query",
  6940              "name": "order",
  6941              "schema": {
  6942                "default": "desc",
  6943                "enum": [
  6944                  "asc",
  6945                  "desc"
  6946                ],
  6947                "type": "string"
  6948              }
  6949            },
  6950            {
  6951              "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.\n",
  6952              "in": "query",
  6953              "name": "after",
  6954              "schema": {
  6955                "type": "string"
  6956              }
  6957            },
  6958            {
  6959              "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.\n",
  6960              "in": "query",
  6961              "name": "before",
  6962              "schema": {
  6963                "type": "string"
  6964              }
  6965            }
  6966          ],
  6967          "responses": {
  6968            "200": {
  6969              "content": {
  6970                "application/json": {
  6971                  "schema": {
  6972                    "$ref": "#/components/schemas/ListMessageFilesResponse"
  6973                  }
  6974                }
  6975              },
  6976              "description": "OK"
  6977            }
  6978          },
  6979          "summary": "Returns a list of message files.",
  6980          "tags": [
  6981            "Assistants"
  6982          ],
  6983          "x-oaiMeta": {
  6984            "beta": true,
  6985            "examples": {
  6986              "request": {
  6987                "curl": "curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123/files \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"OpenAI-Beta: assistants=v1\"\n",
  6988                "node.js": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n  const messageFiles = await openai.beta.threads.messages.files.list(\n    \"thread_abc123\",\n    \"msg_abc123\"\n  );\n  console.log(messageFiles);\n}\n\nmain();\n",
  6989                "python": "from openai import OpenAI\nclient = OpenAI()\n\nmessage_files = client.beta.threads.messages.files.list(\n  thread_id=\"thread_abc123\",\n  message_id=\"msg_abc123\"\n)\nprint(message_files)\n"
  6990              },
  6991              "response": "{\n  \"object\": \"list\",\n  \"data\": [\n    {\n      \"id\": \"file-abc123\",\n      \"object\": \"thread.message.file\",\n      \"created_at\": 1699061776,\n      \"message_id\": \"msg_abc123\"\n    },\n    {\n      \"id\": \"file-abc123\",\n      \"object\": \"thread.message.file\",\n      \"created_at\": 1699061776,\n      \"message_id\": \"msg_abc123\"\n    }\n  ],\n  \"first_id\": \"file-abc123\",\n  \"last_id\": \"file-abc123\",\n  \"has_more\": false\n}\n"
  6992            },
  6993            "group": "threads",
  6994            "name": "List message files",
  6995            "returns": "A list of [message file](/docs/api-reference/messages/file-object) objects."
  6996          }
  6997        }
  6998      },
  6999      "/threads/{thread_id}/messages/{message_id}/files/{file_id}": {
  7000        "get": {
  7001          "operationId": "getMessageFile",
  7002          "parameters": [
  7003            {
  7004              "description": "The ID of the thread to which the message and File belong.",
  7005              "in": "path",
  7006              "name": "thread_id",
  7007              "required": true,
  7008              "schema": {
  7009                "example": "thread_abc123",
  7010                "type": "string"
  7011              }
  7012            },
  7013            {
  7014              "description": "The ID of the message the file belongs to.",
  7015              "in": "path",
  7016              "name": "message_id",
  7017              "required": true,
  7018              "schema": {
  7019                "example": "msg_abc123",
  7020                "type": "string"
  7021              }
  7022            },
  7023            {
  7024              "description": "The ID of the file being retrieved.",
  7025              "in": "path",
  7026              "name": "file_id",
  7027              "required": true,
  7028              "schema": {
  7029                "example": "file-abc123",
  7030                "type": "string"
  7031              }
  7032            }
  7033          ],
  7034          "responses": {
  7035            "200": {
  7036              "content": {
  7037                "application/json": {
  7038                  "schema": {
  7039                    "$ref": "#/components/schemas/MessageFileObject"
  7040                  }
  7041                }
  7042              },
  7043              "description": "OK"
  7044            }
  7045          },
  7046          "summary": "Retrieves a message file.",
  7047          "tags": [
  7048            "Assistants"
  7049          ],
  7050          "x-oaiMeta": {
  7051            "beta": true,
  7052            "examples": {
  7053              "request": {
  7054                "curl": "curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123/files/file-abc123 \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"OpenAI-Beta: assistants=v1\"\n",
  7055                "node.js": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n  const messageFile = await openai.beta.threads.messages.files.retrieve(\n    \"thread_abc123\",\n    \"msg_abc123\",\n    \"file-abc123\"\n  );\n  console.log(messageFile);\n}\n\nmain();\n",
  7056                "python": "from openai import OpenAI\nclient = OpenAI()\n\nmessage_files = client.beta.threads.messages.files.retrieve(\n    thread_id=\"thread_abc123\",\n    message_id=\"msg_abc123\",\n    file_id=\"file-abc123\"\n)\nprint(message_files)\n"
  7057              },
  7058              "response": "{\n  \"id\": \"file-abc123\",\n  \"object\": \"thread.message.file\",\n  \"created_at\": 1699061776,\n  \"message_id\": \"msg_abc123\"\n}\n"
  7059            },
  7060            "group": "threads",
  7061            "name": "Retrieve message file",
  7062            "returns": "The [message file](/docs/api-reference/messages/file-object) object."
  7063          }
  7064        }
  7065      },
  7066      "/threads/{thread_id}/runs": {
  7067        "get": {
  7068          "operationId": "listRuns",
  7069          "parameters": [
  7070            {
  7071              "description": "The ID of the thread the run belongs to.",
  7072              "in": "path",
  7073              "name": "thread_id",
  7074              "required": true,
  7075              "schema": {
  7076                "type": "string"
  7077              }
  7078            },
  7079            {
  7080              "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n",
  7081              "in": "query",
  7082              "name": "limit",
  7083              "required": false,
  7084              "schema": {
  7085                "default": 20,
  7086                "type": "integer"
  7087              }
  7088            },
  7089            {
  7090              "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.\n",
  7091              "in": "query",
  7092              "name": "order",
  7093              "schema": {
  7094                "default": "desc",
  7095                "enum": [
  7096                  "asc",
  7097                  "desc"
  7098                ],
  7099                "type": "string"
  7100              }
  7101            },
  7102            {
  7103              "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.\n",
  7104              "in": "query",
  7105              "name": "after",
  7106              "schema": {
  7107                "type": "string"
  7108              }
  7109            },
  7110            {
  7111              "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.\n",
  7112              "in": "query",
  7113              "name": "before",
  7114              "schema": {
  7115                "type": "string"
  7116              }
  7117            }
  7118          ],
  7119          "responses": {
  7120            "200": {
  7121              "content": {
  7122                "application/json": {
  7123                  "schema": {
  7124                    "$ref": "#/components/schemas/ListRunsResponse"
  7125                  }
  7126                }
  7127              },
  7128              "description": "OK"
  7129            }
  7130          },
  7131          "summary": "Returns a list of runs belonging to a thread.",
  7132          "tags": [
  7133            "Assistants"
  7134          ],
  7135          "x-oaiMeta": {
  7136            "beta": true,
  7137            "examples": {
  7138              "request": {
  7139                "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"OpenAI-Beta: assistants=v1\"\n",
  7140                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const runs = await openai.beta.threads.runs.list(\n    \"thread_abc123\"\n  );\n\n  console.log(runs);\n}\n\nmain();\n",
  7141                "python": "from openai import OpenAI\nclient = OpenAI()\n\nruns = client.beta.threads.runs.list(\n  \"thread_abc123\"\n)\nprint(runs)\n"
  7142              },
  7143              "response": "{\n  \"object\": \"list\",\n  \"data\": [\n    {\n      \"id\": \"run_abc123\",\n      \"object\": \"thread.run\",\n      \"created_at\": 1699075072,\n      \"assistant_id\": \"asst_abc123\",\n      \"thread_id\": \"thread_abc123\",\n      \"status\": \"completed\",\n      \"started_at\": 1699075072,\n      \"expires_at\": null,\n      \"cancelled_at\": null,\n      \"failed_at\": null,\n      \"completed_at\": 1699075073,\n      \"last_error\": null,\n      \"model\": \"gpt-3.5-turbo\",\n      \"instructions\": null,\n      \"tools\": [\n        {\n          \"type\": \"code_interpreter\"\n        }\n      ],\n      \"file_ids\": [\n        \"file-abc123\",\n        \"file-abc456\"\n      ],\n      \"metadata\": {},\n      \"usage\": {\n        \"prompt_tokens\": 123,\n        \"completion_tokens\": 456,\n        \"total_tokens\": 579\n      }\n    },\n    {\n      \"id\": \"run_abc456\",\n      \"object\": \"thread.run\",\n      \"created_at\": 1699063290,\n      \"assistant_id\": \"asst_abc123\",\n      \"thread_id\": \"thread_abc123\",\n      \"status\": \"completed\",\n      \"started_at\": 1699063290,\n      \"expires_at\": null,\n      \"cancelled_at\": null,\n      \"failed_at\": null,\n      \"completed_at\": 1699063291,\n      \"last_error\": null,\n      \"model\": \"gpt-3.5-turbo\",\n      \"instructions\": null,\n      \"tools\": [\n        {\n          \"type\": \"code_interpreter\"\n        }\n      ],\n      \"file_ids\": [\n        \"file-abc123\",\n        \"file-abc456\"\n      ],\n      \"metadata\": {},\n      \"usage\": {\n        \"prompt_tokens\": 123,\n        \"completion_tokens\": 456,\n        \"total_tokens\": 579\n      }\n    }\n  ],\n  \"first_id\": \"run_abc123\",\n  \"last_id\": \"run_abc456\",\n  \"has_more\": false\n}\n"
  7144            },
  7145            "group": "threads",
  7146            "name": "List runs",
  7147            "returns": "A list of [run](/docs/api-reference/runs/object) objects."
  7148          }
  7149        },
  7150        "post": {
  7151          "operationId": "createRun",
  7152          "parameters": [
  7153            {
  7154              "description": "The ID of the thread to run.",
  7155              "in": "path",
  7156              "name": "thread_id",
  7157              "required": true,
  7158              "schema": {
  7159                "type": "string"
  7160              }
  7161            }
  7162          ],
  7163          "requestBody": {
  7164            "content": {
  7165              "application/json": {
  7166                "schema": {
  7167                  "$ref": "#/components/schemas/CreateRunRequest"
  7168                }
  7169              }
  7170            },
  7171            "required": true
  7172          },
  7173          "responses": {
  7174            "200": {
  7175              "content": {
  7176                "application/json": {
  7177                  "schema": {
  7178                    "$ref": "#/components/schemas/RunObject"
  7179                  }
  7180                }
  7181              },
  7182              "description": "OK"
  7183            }
  7184          },
  7185          "summary": "Create a run.",
  7186          "tags": [
  7187            "Assistants"
  7188          ],
  7189          "x-oaiMeta": {
  7190            "beta": true,
  7191            "examples": {
  7192              "request": {
  7193                "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"OpenAI-Beta: assistants=v1\" \\\n  -d '{\n    \"assistant_id\": \"asst_abc123\"\n  }'\n",
  7194                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const run = await openai.beta.threads.runs.create(\n    \"thread_abc123\",\n    { assistant_id: \"asst_abc123\" }\n  );\n\n  console.log(run);\n}\n\nmain();\n",
  7195                "python": "from openai import OpenAI\nclient = OpenAI()\n\nrun = client.beta.threads.runs.create(\n  thread_id=\"thread_abc123\",\n  assistant_id=\"asst_abc123\"\n)\nprint(run)\n"
  7196              },
  7197              "response": "{\n  \"id\": \"run_abc123\",\n  \"object\": \"thread.run\",\n  \"created_at\": 1699063290,\n  \"assistant_id\": \"asst_abc123\",\n  \"thread_id\": \"thread_abc123\",\n  \"status\": \"queued\",\n  \"started_at\": 1699063290,\n  \"expires_at\": null,\n  \"cancelled_at\": null,\n  \"failed_at\": null,\n  \"completed_at\": 1699063291,\n  \"last_error\": null,\n  \"model\": \"gpt-4\",\n  \"instructions\": null,\n  \"tools\": [\n    {\n      \"type\": \"code_interpreter\"\n    }\n  ],\n  \"file_ids\": [\n    \"file-abc123\",\n    \"file-abc456\"\n  ],\n  \"metadata\": {},\n  \"usage\": null\n}\n"
  7198            },
  7199            "group": "threads",
  7200            "name": "Create run",
  7201            "returns": "A [run](/docs/api-reference/runs/object) object."
  7202          }
  7203        }
  7204      },
  7205      "/threads/{thread_id}/runs/{run_id}": {
  7206        "get": {
  7207          "operationId": "getRun",
  7208          "parameters": [
  7209            {
  7210              "description": "The ID of the [thread](/docs/api-reference/threads) that was run.",
  7211              "in": "path",
  7212              "name": "thread_id",
  7213              "required": true,
  7214              "schema": {
  7215                "type": "string"
  7216              }
  7217            },
  7218            {
  7219              "description": "The ID of the run to retrieve.",
  7220              "in": "path",
  7221              "name": "run_id",
  7222              "required": true,
  7223              "schema": {
  7224                "type": "string"
  7225              }
  7226            }
  7227          ],
  7228          "responses": {
  7229            "200": {
  7230              "content": {
  7231                "application/json": {
  7232                  "schema": {
  7233                    "$ref": "#/components/schemas/RunObject"
  7234                  }
  7235                }
  7236              },
  7237              "description": "OK"
  7238            }
  7239          },
  7240          "summary": "Retrieves a run.",
  7241          "tags": [
  7242            "Assistants"
  7243          ],
  7244          "x-oaiMeta": {
  7245            "beta": true,
  7246            "examples": {
  7247              "request": {
  7248                "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"OpenAI-Beta: assistants=v1\"\n",
  7249                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const run = await openai.beta.threads.runs.retrieve(\n    \"thread_abc123\",\n    \"run_abc123\"\n  );\n\n  console.log(run);\n}\n\nmain();\n",
  7250                "python": "from openai import OpenAI\nclient = OpenAI()\n\nrun = client.beta.threads.runs.retrieve(\n  thread_id=\"thread_abc123\",\n  run_id=\"run_abc123\"\n)\nprint(run)\n"
  7251              },
  7252              "response": "{\n  \"id\": \"run_abc123\",\n  \"object\": \"thread.run\",\n  \"created_at\": 1699075072,\n  \"assistant_id\": \"asst_abc123\",\n  \"thread_id\": \"thread_abc123\",\n  \"status\": \"completed\",\n  \"started_at\": 1699075072,\n  \"expires_at\": null,\n  \"cancelled_at\": null,\n  \"failed_at\": null,\n  \"completed_at\": 1699075073,\n  \"last_error\": null,\n  \"model\": \"gpt-3.5-turbo\",\n  \"instructions\": null,\n  \"tools\": [\n    {\n      \"type\": \"code_interpreter\"\n    }\n  ],\n  \"file_ids\": [\n    \"file-abc123\",\n    \"file-abc456\"\n  ],\n  \"metadata\": {},\n  \"usage\": {\n    \"prompt_tokens\": 123,\n    \"completion_tokens\": 456,\n    \"total_tokens\": 579\n  }\n}\n"
  7253            },
  7254            "group": "threads",
  7255            "name": "Retrieve run",
  7256            "returns": "The [run](/docs/api-reference/runs/object) object matching the specified ID."
  7257          }
  7258        },
  7259        "post": {
  7260          "operationId": "modifyRun",
  7261          "parameters": [
  7262            {
  7263              "description": "The ID of the [thread](/docs/api-reference/threads) that was run.",
  7264              "in": "path",
  7265              "name": "thread_id",
  7266              "required": true,
  7267              "schema": {
  7268                "type": "string"
  7269              }
  7270            },
  7271            {
  7272              "description": "The ID of the run to modify.",
  7273              "in": "path",
  7274              "name": "run_id",
  7275              "required": true,
  7276              "schema": {
  7277                "type": "string"
  7278              }
  7279            }
  7280          ],
  7281          "requestBody": {
  7282            "content": {
  7283              "application/json": {
  7284                "schema": {
  7285                  "$ref": "#/components/schemas/ModifyRunRequest"
  7286                }
  7287              }
  7288            },
  7289            "required": true
  7290          },
  7291          "responses": {
  7292            "200": {
  7293              "content": {
  7294                "application/json": {
  7295                  "schema": {
  7296                    "$ref": "#/components/schemas/RunObject"
  7297                  }
  7298                }
  7299              },
  7300              "description": "OK"
  7301            }
  7302          },
  7303          "summary": "Modifies a run.",
  7304          "tags": [
  7305            "Assistants"
  7306          ],
  7307          "x-oaiMeta": {
  7308            "beta": true,
  7309            "examples": {
  7310              "request": {
  7311                "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"OpenAI-Beta: assistants=v1\" \\\n  -d '{\n    \"metadata\": {\n      \"user_id\": \"user_abc123\"\n    }\n  }'\n",
  7312                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const run = await openai.beta.threads.runs.update(\n    \"thread_abc123\",\n    \"run_abc123\",\n    {\n      metadata: {\n        user_id: \"user_abc123\",\n      },\n    }\n  );\n\n  console.log(run);\n}\n\nmain();\n",
  7313                "python": "from openai import OpenAI\nclient = OpenAI()\n\nrun = client.beta.threads.runs.update(\n  thread_id=\"thread_abc123\",\n  run_id=\"run_abc123\",\n  metadata={\"user_id\": \"user_abc123\"},\n)\nprint(run)\n"
  7314              },
  7315              "response": "{\n  \"id\": \"run_abc123\",\n  \"object\": \"thread.run\",\n  \"created_at\": 1699075072,\n  \"assistant_id\": \"asst_abc123\",\n  \"thread_id\": \"thread_abc123\",\n  \"status\": \"completed\",\n  \"started_at\": 1699075072,\n  \"expires_at\": null,\n  \"cancelled_at\": null,\n  \"failed_at\": null,\n  \"completed_at\": 1699075073,\n  \"last_error\": null,\n  \"model\": \"gpt-3.5-turbo\",\n  \"instructions\": null,\n  \"tools\": [\n    {\n      \"type\": \"code_interpreter\"\n    }\n  ],\n  \"file_ids\": [\n    \"file-abc123\",\n    \"file-abc456\"\n  ],\n  \"metadata\": {\n    \"user_id\": \"user_abc123\"\n  },\n  \"usage\": {\n    \"prompt_tokens\": 123,\n    \"completion_tokens\": 456,\n    \"total_tokens\": 579\n  }\n}\n"
  7316            },
  7317            "group": "threads",
  7318            "name": "Modify run",
  7319            "returns": "The modified [run](/docs/api-reference/runs/object) object matching the specified ID."
  7320          }
  7321        }
  7322      },
  7323      "/threads/{thread_id}/runs/{run_id}/cancel": {
  7324        "post": {
  7325          "operationId": "cancelRun",
  7326          "parameters": [
  7327            {
  7328              "description": "The ID of the thread to which this run belongs.",
  7329              "in": "path",
  7330              "name": "thread_id",
  7331              "required": true,
  7332              "schema": {
  7333                "type": "string"
  7334              }
  7335            },
  7336            {
  7337              "description": "The ID of the run to cancel.",
  7338              "in": "path",
  7339              "name": "run_id",
  7340              "required": true,
  7341              "schema": {
  7342                "type": "string"
  7343              }
  7344            }
  7345          ],
  7346          "responses": {
  7347            "200": {
  7348              "content": {
  7349                "application/json": {
  7350                  "schema": {
  7351                    "$ref": "#/components/schemas/RunObject"
  7352                  }
  7353                }
  7354              },
  7355              "description": "OK"
  7356            }
  7357          },
  7358          "summary": "Cancels a run that is `in_progress`.",
  7359          "tags": [
  7360            "Assistants"
  7361          ],
  7362          "x-oaiMeta": {
  7363            "beta": true,
  7364            "examples": {
  7365              "request": {
  7366                "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/cancel \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"OpenAI-Beta: assistants=v1\" \\\n  -X POST\n",
  7367                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const run = await openai.beta.threads.runs.cancel(\n    \"thread_abc123\",\n    \"run_abc123\"\n  );\n\n  console.log(run);\n}\n\nmain();\n",
  7368                "python": "from openai import OpenAI\nclient = OpenAI()\n\nrun = client.beta.threads.runs.cancel(\n  thread_id=\"thread_abc123\",\n  run_id=\"run_abc123\"\n)\nprint(run)\n"
  7369              },
  7370              "response": "{\n  \"id\": \"run_abc123\",\n  \"object\": \"thread.run\",\n  \"created_at\": 1699076126,\n  \"assistant_id\": \"asst_abc123\",\n  \"thread_id\": \"thread_abc123\",\n  \"status\": \"cancelling\",\n  \"started_at\": 1699076126,\n  \"expires_at\": 1699076726,\n  \"cancelled_at\": null,\n  \"failed_at\": null,\n  \"completed_at\": null,\n  \"last_error\": null,\n  \"model\": \"gpt-4\",\n  \"instructions\": \"You summarize books.\",\n  \"tools\": [\n    {\n      \"type\": \"retrieval\"\n    }\n  ],\n  \"file_ids\": [],\n  \"metadata\": {},\n  \"usage\": null\n}\n"
  7371            },
  7372            "group": "threads",
  7373            "name": "Cancel a run",
  7374            "returns": "The modified [run](/docs/api-reference/runs/object) object matching the specified ID."
  7375          }
  7376        }
  7377      },
  7378      "/threads/{thread_id}/runs/{run_id}/steps": {
  7379        "get": {
  7380          "operationId": "listRunSteps",
  7381          "parameters": [
  7382            {
  7383              "description": "The ID of the thread the run and run steps belong to.",
  7384              "in": "path",
  7385              "name": "thread_id",
  7386              "required": true,
  7387              "schema": {
  7388                "type": "string"
  7389              }
  7390            },
  7391            {
  7392              "description": "The ID of the run the run steps belong to.",
  7393              "in": "path",
  7394              "name": "run_id",
  7395              "required": true,
  7396              "schema": {
  7397                "type": "string"
  7398              }
  7399            },
  7400            {
  7401              "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n",
  7402              "in": "query",
  7403              "name": "limit",
  7404              "required": false,
  7405              "schema": {
  7406                "default": 20,
  7407                "type": "integer"
  7408              }
  7409            },
  7410            {
  7411              "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.\n",
  7412              "in": "query",
  7413              "name": "order",
  7414              "schema": {
  7415                "default": "desc",
  7416                "enum": [
  7417                  "asc",
  7418                  "desc"
  7419                ],
  7420                "type": "string"
  7421              }
  7422            },
  7423            {
  7424              "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.\n",
  7425              "in": "query",
  7426              "name": "after",
  7427              "schema": {
  7428                "type": "string"
  7429              }
  7430            },
  7431            {
  7432              "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.\n",
  7433              "in": "query",
  7434              "name": "before",
  7435              "schema": {
  7436                "type": "string"
  7437              }
  7438            }
  7439          ],
  7440          "responses": {
  7441            "200": {
  7442              "content": {
  7443                "application/json": {
  7444                  "schema": {
  7445                    "$ref": "#/components/schemas/ListRunStepsResponse"
  7446                  }
  7447                }
  7448              },
  7449              "description": "OK"
  7450            }
  7451          },
  7452          "summary": "Returns a list of run steps belonging to a run.",
  7453          "tags": [
  7454            "Assistants"
  7455          ],
  7456          "x-oaiMeta": {
  7457            "beta": true,
  7458            "examples": {
  7459              "request": {
  7460                "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"OpenAI-Beta: assistants=v1\"\n",
  7461                "node.js": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n  const runStep = await openai.beta.threads.runs.steps.list(\n    \"thread_abc123\",\n    \"run_abc123\"\n  );\n  console.log(runStep);\n}\n\nmain();\n",
  7462                "python": "from openai import OpenAI\nclient = OpenAI()\n\nrun_steps = client.beta.threads.runs.steps.list(\n    thread_id=\"thread_abc123\",\n    run_id=\"run_abc123\"\n)\nprint(run_steps)\n"
  7463              },
  7464              "response": "{\n  \"object\": \"list\",\n  \"data\": [\n    {\n      \"id\": \"step_abc123\",\n      \"object\": \"thread.run.step\",\n      \"created_at\": 1699063291,\n      \"run_id\": \"run_abc123\",\n      \"assistant_id\": \"asst_abc123\",\n      \"thread_id\": \"thread_abc123\",\n      \"type\": \"message_creation\",\n      \"status\": \"completed\",\n      \"cancelled_at\": null,\n      \"completed_at\": 1699063291,\n      \"expired_at\": null,\n      \"failed_at\": null,\n      \"last_error\": null,\n      \"step_details\": {\n        \"type\": \"message_creation\",\n        \"message_creation\": {\n          \"message_id\": \"msg_abc123\"\n        }\n      },\n      \"usage\": {\n        \"prompt_tokens\": 123,\n        \"completion_tokens\": 456,\n        \"total_tokens\": 579\n      }\n    }\n  ],\n  \"first_id\": \"step_abc123\",\n  \"last_id\": \"step_abc456\",\n  \"has_more\": false\n}\n"
  7465            },
  7466            "group": "threads",
  7467            "name": "List run steps",
  7468            "returns": "A list of [run step](/docs/api-reference/runs/step-object) objects."
  7469          }
  7470        }
  7471      },
  7472      "/threads/{thread_id}/runs/{run_id}/steps/{step_id}": {
  7473        "get": {
  7474          "operationId": "getRunStep",
  7475          "parameters": [
  7476            {
  7477              "description": "The ID of the thread to which the run and run step belongs.",
  7478              "in": "path",
  7479              "name": "thread_id",
  7480              "required": true,
  7481              "schema": {
  7482                "type": "string"
  7483              }
  7484            },
  7485            {
  7486              "description": "The ID of the run to which the run step belongs.",
  7487              "in": "path",
  7488              "name": "run_id",
  7489              "required": true,
  7490              "schema": {
  7491                "type": "string"
  7492              }
  7493            },
  7494            {
  7495              "description": "The ID of the run step to retrieve.",
  7496              "in": "path",
  7497              "name": "step_id",
  7498              "required": true,
  7499              "schema": {
  7500                "type": "string"
  7501              }
  7502            }
  7503          ],
  7504          "responses": {
  7505            "200": {
  7506              "content": {
  7507                "application/json": {
  7508                  "schema": {
  7509                    "$ref": "#/components/schemas/RunStepObject"
  7510                  }
  7511                }
  7512              },
  7513              "description": "OK"
  7514            }
  7515          },
  7516          "summary": "Retrieves a run step.",
  7517          "tags": [
  7518            "Assistants"
  7519          ],
  7520          "x-oaiMeta": {
  7521            "beta": true,
  7522            "examples": {
  7523              "request": {
  7524                "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps/step_abc123 \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"OpenAI-Beta: assistants=v1\"\n",
  7525                "node.js": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n  const runStep = await openai.beta.threads.runs.steps.retrieve(\n    \"thread_abc123\",\n    \"run_abc123\",\n    \"step_abc123\"\n  );\n  console.log(runStep);\n}\n\nmain();\n",
  7526                "python": "from openai import OpenAI\nclient = OpenAI()\n\nrun_step = client.beta.threads.runs.steps.retrieve(\n    thread_id=\"thread_abc123\",\n    run_id=\"run_abc123\",\n    step_id=\"step_abc123\"\n)\nprint(run_step)\n"
  7527              },
  7528              "response": "{\n  \"id\": \"step_abc123\",\n  \"object\": \"thread.run.step\",\n  \"created_at\": 1699063291,\n  \"run_id\": \"run_abc123\",\n  \"assistant_id\": \"asst_abc123\",\n  \"thread_id\": \"thread_abc123\",\n  \"type\": \"message_creation\",\n  \"status\": \"completed\",\n  \"cancelled_at\": null,\n  \"completed_at\": 1699063291,\n  \"expired_at\": null,\n  \"failed_at\": null,\n  \"last_error\": null,\n  \"step_details\": {\n    \"type\": \"message_creation\",\n    \"message_creation\": {\n      \"message_id\": \"msg_abc123\"\n    }\n  },\n  \"usage\": {\n    \"prompt_tokens\": 123,\n    \"completion_tokens\": 456,\n    \"total_tokens\": 579\n  }\n}\n"
  7529            },
  7530            "group": "threads",
  7531            "name": "Retrieve run step",
  7532            "returns": "The [run step](/docs/api-reference/runs/step-object) object matching the specified ID."
  7533          }
  7534        }
  7535      },
  7536      "/threads/{thread_id}/runs/{run_id}/submit_tool_outputs": {
  7537        "post": {
  7538          "operationId": "submitToolOuputsToRun",
  7539          "parameters": [
  7540            {
  7541              "description": "The ID of the [thread](/docs/api-reference/threads) to which this run belongs.",
  7542              "in": "path",
  7543              "name": "thread_id",
  7544              "required": true,
  7545              "schema": {
  7546                "type": "string"
  7547              }
  7548            },
  7549            {
  7550              "description": "The ID of the run that requires the tool output submission.",
  7551              "in": "path",
  7552              "name": "run_id",
  7553              "required": true,
  7554              "schema": {
  7555                "type": "string"
  7556              }
  7557            }
  7558          ],
  7559          "requestBody": {
  7560            "content": {
  7561              "application/json": {
  7562                "schema": {
  7563                  "$ref": "#/components/schemas/SubmitToolOutputsRunRequest"
  7564                }
  7565              }
  7566            },
  7567            "required": true
  7568          },
  7569          "responses": {
  7570            "200": {
  7571              "content": {
  7572                "application/json": {
  7573                  "schema": {
  7574                    "$ref": "#/components/schemas/RunObject"
  7575                  }
  7576                }
  7577              },
  7578              "description": "OK"
  7579            }
  7580          },
  7581          "summary": "When a run has the `status: \"requires_action\"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request.\n",
  7582          "tags": [
  7583            "Assistants"
  7584          ],
  7585          "x-oaiMeta": {
  7586            "beta": true,
  7587            "examples": {
  7588              "request": {
  7589                "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/submit_tool_outputs \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"OpenAI-Beta: assistants=v1\" \\\n  -d '{\n    \"tool_outputs\": [\n      {\n        \"tool_call_id\": \"call_abc123\",\n        \"output\": \"28C\"\n      }\n    ]\n  }'\n",
  7590                "node.js": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n  const run = await openai.beta.threads.runs.submitToolOutputs(\n    \"thread_abc123\",\n    \"run_abc123\",\n    {\n      tool_outputs: [\n        {\n          tool_call_id: \"call_abc123\",\n          output: \"28C\",\n        },\n      ],\n    }\n  );\n\n  console.log(run);\n}\n\nmain();\n",
  7591                "python": "from openai import OpenAI\nclient = OpenAI()\n\nrun = client.beta.threads.runs.submit_tool_outputs(\n  thread_id=\"thread_abc123\",\n  run_id=\"run_abc123\",\n  tool_outputs=[\n    {\n      \"tool_call_id\": \"call_abc123\",\n      \"output\": \"28C\"\n    }\n  ]\n)\nprint(run)\n"
  7592              },
  7593              "response": "{\n  \"id\": \"run_abc123\",\n  \"object\": \"thread.run\",\n  \"created_at\": 1699075592,\n  \"assistant_id\": \"asst_abc123\",\n  \"thread_id\": \"thread_abc123\",\n  \"status\": \"queued\",\n  \"started_at\": 1699075592,\n  \"expires_at\": 1699076192,\n  \"cancelled_at\": null,\n  \"failed_at\": null,\n  \"completed_at\": null,\n  \"last_error\": null,\n  \"model\": \"gpt-4\",\n  \"instructions\": \"You tell the weather.\",\n  \"tools\": [\n    {\n      \"type\": \"function\",\n      \"function\": {\n        \"name\": \"get_weather\",\n        \"description\": \"Determine weather in my location\",\n        \"parameters\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"location\": {\n              \"type\": \"string\",\n              \"description\": \"The city and state e.g. San Francisco, CA\"\n            },\n            \"unit\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"c\",\n                \"f\"\n              ]\n            }\n          },\n          \"required\": [\n            \"location\"\n          ]\n        }\n      }\n    }\n  ],\n  \"file_ids\": [],\n  \"metadata\": {},\n  \"usage\": null\n}\n"
  7594            },
  7595            "group": "threads",
  7596            "name": "Submit tool outputs to run",
  7597            "returns": "The modified [run](/docs/api-reference/runs/object) object matching the specified ID."
  7598          }
  7599        }
  7600      }
  7601    },
  7602    "security": [
  7603      {
  7604        "ApiKeyAuth": []
  7605      }
  7606    ],
  7607    "servers": [
  7608      {
  7609        "url": "https://api.openai.com/v1"
  7610      }
  7611    ],
  7612    "tags": [
  7613      {
  7614        "description": "Build Assistants that can call models and use tools.",
  7615        "name": "Assistants"
  7616      },
  7617      {
  7618        "description": "Learn how to turn audio into text or text into audio.",
  7619        "name": "Audio"
  7620      },
  7621      {
  7622        "description": "Given a list of messages comprising a conversation, the model will return a response.",
  7623        "name": "Chat"
  7624      },
  7625      {
  7626        "description": "Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position.",
  7627        "name": "Completions"
  7628      },
  7629      {
  7630        "description": "Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.",
  7631        "name": "Embeddings"
  7632      },
  7633      {
  7634        "description": "Manage fine-tuning jobs to tailor a model to your specific training data.",
  7635        "name": "Fine-tuning"
  7636      },
  7637      {
  7638        "description": "Files are used to upload documents that can be used with features like Assistants and Fine-tuning.",
  7639        "name": "Files"
  7640      },
  7641      {
  7642        "description": "Given a prompt and/or an input image, the model will generate a new image.",
  7643        "name": "Images"
  7644      },
  7645      {
  7646        "description": "List and describe the various models available in the API.",
  7647        "name": "Models"
  7648      },
  7649      {
  7650        "description": "Given a input text, outputs if the model classifies it as violating OpenAI's content policy.",
  7651        "name": "Moderations"
  7652      }
  7653    ],
  7654    "x-oaiMeta": {
  7655      "groups": [
  7656        {
  7657          "description": "Learn how to turn audio into text or text into audio.\n\nRelated guide: [Speech to text](/docs/guides/speech-to-text)\n",
  7658          "id": "audio",
  7659          "sections": [
  7660            {
  7661              "key": "createSpeech",
  7662              "path": "createSpeech",
  7663              "type": "endpoint"
  7664            },
  7665            {
  7666              "key": "createTranscription",
  7667              "path": "createTranscription",
  7668              "type": "endpoint"
  7669            },
  7670            {
  7671              "key": "createTranslation",
  7672              "path": "createTranslation",
  7673              "type": "endpoint"
  7674            }
  7675          ],
  7676          "title": "Audio"
  7677        },
  7678        {
  7679          "description": "Given a list of messages comprising a conversation, the model will return a response.\n\nRelated guide: [Chat Completions](/docs/guides/text-generation)\n",
  7680          "id": "chat",
  7681          "sections": [
  7682            {
  7683              "key": "createChatCompletion",
  7684              "path": "create",
  7685              "type": "endpoint"
  7686            },
  7687            {
  7688              "key": "CreateChatCompletionResponse",
  7689              "path": "object",
  7690              "type": "object"
  7691            },
  7692            {
  7693              "key": "CreateChatCompletionStreamResponse",
  7694              "path": "streaming",
  7695              "type": "object"
  7696            }
  7697          ],
  7698          "title": "Chat"
  7699        },
  7700        {
  7701          "description": "Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.\n\nRelated guide: [Embeddings](/docs/guides/embeddings)\n",
  7702          "id": "embeddings",
  7703          "sections": [
  7704            {
  7705              "key": "createEmbedding",
  7706              "path": "create",
  7707              "type": "endpoint"
  7708            },
  7709            {
  7710              "key": "Embedding",
  7711              "path": "object",
  7712              "type": "object"
  7713            }
  7714          ],
  7715          "title": "Embeddings"
  7716        },
  7717        {
  7718          "description": "Manage fine-tuning jobs to tailor a model to your specific training data.\n\nRelated guide: [Fine-tune models](/docs/guides/fine-tuning)\n",
  7719          "id": "fine-tuning",
  7720          "sections": [
  7721            {
  7722              "key": "createFineTuningJob",
  7723              "path": "create",
  7724              "type": "endpoint"
  7725            },
  7726            {
  7727              "key": "listPaginatedFineTuningJobs",
  7728              "path": "list",
  7729              "type": "endpoint"
  7730            },
  7731            {
  7732              "key": "listFineTuningEvents",
  7733              "path": "list-events",
  7734              "type": "endpoint"
  7735            },
  7736            {
  7737              "key": "retrieveFineTuningJob",
  7738              "path": "retrieve",
  7739              "type": "endpoint"
  7740            },
  7741            {
  7742              "key": "cancelFineTuningJob",
  7743              "path": "cancel",
  7744              "type": "endpoint"
  7745            },
  7746            {
  7747              "key": "FineTuningJob",
  7748              "path": "object",
  7749              "type": "object"
  7750            },
  7751            {
  7752              "key": "FineTuningJobEvent",
  7753              "path": "event-object",
  7754              "type": "object"
  7755            }
  7756          ],
  7757          "title": "Fine-tuning"
  7758        },
  7759        {
  7760          "description": "Files are used to upload documents that can be used with features like [Assistants](/docs/api-reference/assistants) and [Fine-tuning](/docs/api-reference/fine-tuning).\n",
  7761          "id": "files",
  7762          "sections": [
  7763            {
  7764              "key": "createFile",
  7765              "path": "create",
  7766              "type": "endpoint"
  7767            },
  7768            {
  7769              "key": "listFiles",
  7770              "path": "list",
  7771              "type": "endpoint"
  7772            },
  7773            {
  7774              "key": "retrieveFile",
  7775              "path": "retrieve",
  7776              "type": "endpoint"
  7777            },
  7778            {
  7779              "key": "deleteFile",
  7780              "path": "delete",
  7781              "type": "endpoint"
  7782            },
  7783            {
  7784              "key": "downloadFile",
  7785              "path": "retrieve-contents",
  7786              "type": "endpoint"
  7787            },
  7788            {
  7789              "key": "OpenAIFile",
  7790              "path": "object",
  7791              "type": "object"
  7792            }
  7793          ],
  7794          "title": "Files"
  7795        },
  7796        {
  7797          "description": "Given a prompt and/or an input image, the model will generate a new image.\n\nRelated guide: [Image generation](/docs/guides/images)\n",
  7798          "id": "images",
  7799          "sections": [
  7800            {
  7801              "key": "createImage",
  7802              "path": "create",
  7803              "type": "endpoint"
  7804            },
  7805            {
  7806              "key": "createImageEdit",
  7807              "path": "createEdit",
  7808              "type": "endpoint"
  7809            },
  7810            {
  7811              "key": "createImageVariation",
  7812              "path": "createVariation",
  7813              "type": "endpoint"
  7814            },
  7815            {
  7816              "key": "Image",
  7817              "path": "object",
  7818              "type": "object"
  7819            }
  7820          ],
  7821          "title": "Images"
  7822        },
  7823        {
  7824          "description": "List and describe the various models available in the API. You can refer to the [Models](/docs/models) documentation to understand what models are available and the differences between them.\n",
  7825          "id": "models",
  7826          "sections": [
  7827            {
  7828              "key": "listModels",
  7829              "path": "list",
  7830              "type": "endpoint"
  7831            },
  7832            {
  7833              "key": "retrieveModel",
  7834              "path": "retrieve",
  7835              "type": "endpoint"
  7836            },
  7837            {
  7838              "key": "deleteModel",
  7839              "path": "delete",
  7840              "type": "endpoint"
  7841            },
  7842            {
  7843              "key": "Model",
  7844              "path": "object",
  7845              "type": "object"
  7846            }
  7847          ],
  7848          "title": "Models"
  7849        },
  7850        {
  7851          "description": "Given a input text, outputs if the model classifies it as violating OpenAI's content policy.\n\nRelated guide: [Moderations](/docs/guides/moderation)\n",
  7852          "id": "moderations",
  7853          "sections": [
  7854            {
  7855              "key": "createModeration",
  7856              "path": "create",
  7857              "type": "endpoint"
  7858            },
  7859            {
  7860              "key": "CreateModerationResponse",
  7861              "path": "object",
  7862              "type": "object"
  7863            }
  7864          ],
  7865          "title": "Moderations"
  7866        },
  7867        {
  7868          "beta": true,
  7869          "description": "Build assistants that can call models and use tools to perform tasks.\n\n[Get started with the Assistants API](/docs/assistants)\n",
  7870          "id": "assistants",
  7871          "sections": [
  7872            {
  7873              "key": "createAssistant",
  7874              "path": "createAssistant",
  7875              "type": "endpoint"
  7876            },
  7877            {
  7878              "key": "createAssistantFile",
  7879              "path": "createAssistantFile",
  7880              "type": "endpoint"
  7881            },
  7882            {
  7883              "key": "listAssistants",
  7884              "path": "listAssistants",
  7885              "type": "endpoint"
  7886            },
  7887            {
  7888              "key": "listAssistantFiles",
  7889              "path": "listAssistantFiles",
  7890              "type": "endpoint"
  7891            },
  7892            {
  7893              "key": "getAssistant",
  7894              "path": "getAssistant",
  7895              "type": "endpoint"
  7896            },
  7897            {
  7898              "key": "getAssistantFile",
  7899              "path": "getAssistantFile",
  7900              "type": "endpoint"
  7901            },
  7902            {
  7903              "key": "modifyAssistant",
  7904              "path": "modifyAssistant",
  7905              "type": "endpoint"
  7906            },
  7907            {
  7908              "key": "deleteAssistant",
  7909              "path": "deleteAssistant",
  7910              "type": "endpoint"
  7911            },
  7912            {
  7913              "key": "deleteAssistantFile",
  7914              "path": "deleteAssistantFile",
  7915              "type": "endpoint"
  7916            },
  7917            {
  7918              "key": "AssistantObject",
  7919              "path": "object",
  7920              "type": "object"
  7921            },
  7922            {
  7923              "key": "AssistantFileObject",
  7924              "path": "file-object",
  7925              "type": "object"
  7926            }
  7927          ],
  7928          "title": "Assistants"
  7929        },
  7930        {
  7931          "beta": true,
  7932          "description": "Create threads that assistants can interact with.\n\nRelated guide: [Assistants](/docs/assistants/overview)\n",
  7933          "id": "threads",
  7934          "sections": [
  7935            {
  7936              "key": "createThread",
  7937              "path": "createThread",
  7938              "type": "endpoint"
  7939            },
  7940            {
  7941              "key": "getThread",
  7942              "path": "getThread",
  7943              "type": "endpoint"
  7944            },
  7945            {
  7946              "key": "modifyThread",
  7947              "path": "modifyThread",
  7948              "type": "endpoint"
  7949            },
  7950            {
  7951              "key": "deleteThread",
  7952              "path": "deleteThread",
  7953              "type": "endpoint"
  7954            },
  7955            {
  7956              "key": "ThreadObject",
  7957              "path": "object",
  7958              "type": "object"
  7959            }
  7960          ],
  7961          "title": "Threads"
  7962        },
  7963        {
  7964          "beta": true,
  7965          "description": "Create messages within threads\n\nRelated guide: [Assistants](/docs/assistants/overview)\n",
  7966          "id": "messages",
  7967          "sections": [
  7968            {
  7969              "key": "createMessage",
  7970              "path": "createMessage",
  7971              "type": "endpoint"
  7972            },
  7973            {
  7974              "key": "listMessages",
  7975              "path": "listMessages",
  7976              "type": "endpoint"
  7977            },
  7978            {
  7979              "key": "listMessageFiles",
  7980              "path": "listMessageFiles",
  7981              "type": "endpoint"
  7982            },
  7983            {
  7984              "key": "getMessage",
  7985              "path": "getMessage",
  7986              "type": "endpoint"
  7987            },
  7988            {
  7989              "key": "getMessageFile",
  7990              "path": "getMessageFile",
  7991              "type": "endpoint"
  7992            },
  7993            {
  7994              "key": "modifyMessage",
  7995              "path": "modifyMessage",
  7996              "type": "endpoint"
  7997            },
  7998            {
  7999              "key": "MessageObject",
  8000              "path": "object",
  8001              "type": "object"
  8002            },
  8003            {
  8004              "key": "MessageFileObject",
  8005              "path": "file-object",
  8006              "type": "object"
  8007            }
  8008          ],
  8009          "title": "Messages"
  8010        },
  8011        {
  8012          "beta": true,
  8013          "description": "Represents an execution run on a thread.\n\nRelated guide: [Assistants](/docs/assistants/overview)\n",
  8014          "id": "runs",
  8015          "sections": [
  8016            {
  8017              "key": "createRun",
  8018              "path": "createRun",
  8019              "type": "endpoint"
  8020            },
  8021            {
  8022              "key": "createThreadAndRun",
  8023              "path": "createThreadAndRun",
  8024              "type": "endpoint"
  8025            },
  8026            {
  8027              "key": "listRuns",
  8028              "path": "listRuns",
  8029              "type": "endpoint"
  8030            },
  8031            {
  8032              "key": "listRunSteps",
  8033              "path": "listRunSteps",
  8034              "type": "endpoint"
  8035            },
  8036            {
  8037              "key": "getRun",
  8038              "path": "getRun",
  8039              "type": "endpoint"
  8040            },
  8041            {
  8042              "key": "getRunStep",
  8043              "path": "getRunStep",
  8044              "type": "endpoint"
  8045            },
  8046            {
  8047              "key": "modifyRun",
  8048              "path": "modifyRun",
  8049              "type": "endpoint"
  8050            },
  8051            {
  8052              "key": "submitToolOuputsToRun",
  8053              "path": "submitToolOutputs",
  8054              "type": "endpoint"
  8055            },
  8056            {
  8057              "key": "cancelRun",
  8058              "path": "cancelRun",
  8059              "type": "endpoint"
  8060            },
  8061            {
  8062              "key": "RunObject",
  8063              "path": "object",
  8064              "type": "object"
  8065            },
  8066            {
  8067              "key": "RunStepObject",
  8068              "path": "step-object",
  8069              "type": "object"
  8070            }
  8071          ],
  8072          "title": "Runs"
  8073        },
  8074        {
  8075          "description": "Given a prompt, the model will return one or more predicted completions along with the probabilities of alternative tokens at each position. Most developer should use our [Chat Completions API](/docs/guides/text-generation/text-generation-models) to leverage our best and newest models. Most models that support the legacy Completions endpoint [will be shut off on January 4th, 2024](/docs/deprecations/2023-07-06-gpt-and-embeddings).\n",
  8076          "id": "completions",
  8077          "legacy": true,
  8078          "sections": [
  8079            {
  8080              "key": "createCompletion",
  8081              "path": "create",
  8082              "type": "endpoint"
  8083            },
  8084            {
  8085              "key": "CreateCompletionResponse",
  8086              "path": "object",
  8087              "type": "object"
  8088            }
  8089          ],
  8090          "title": "Completions"
  8091        }
  8092      ]
  8093    }
  8094  }