{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "CreateChatCompletionRequest", "type": "object", "properties": { "model": { "type": "string", "description": "ID of the model to use. See the model endpoint compatibility\ntable for details on which models work with the Chat Completions API.\n" }, "messages": { "type": "array", "description": "A list of messages comprising the conversation so far.\nDepending on the model, different message types (modalities)\nare supported, like text, images, and audio.\n" }, "frequency_penalty": { "type": "number", "description": "Number between -2.0 and 2.0. Positive values penalize new tokens\nbased on their existing frequency in the text so far, decreasing\nthe model's likelihood to repeat the same line verbatim.\n" }, "logit_bias": { "type": "object", "description": "Modify the likelihood of specified tokens appearing in the\ncompletion. Maps token IDs to bias values from -100 to 100.\n" }, "logprobs": { "type": "boolean", "description": "Whether to return log probabilities of the output tokens.\n" }, "top_logprobs": { "type": "integer", "description": "Number of most likely tokens to return at each position,\neach with an associated log probability. logprobs must be\nset to true if this parameter is used.\n" }, "max_completion_tokens": { "type": "integer", "description": "An upper bound for the number of tokens that can be generated\nfor a completion, including visible output tokens and reasoning\ntokens. Replaces the deprecated max_tokens parameter.\n" }, "n": { "type": "integer", "description": "How many chat completion choices to generate for each input\nmessage. Note that you will be charged based on the number\nof generated tokens across all choices.\n" }, "presence_penalty": { "type": "number", "description": "Number between -2.0 and 2.0. Positive values penalize new tokens\nbased on whether they appear in the text so far, increasing the\nmodel's likelihood to talk about new topics.\n" }, "seed": { "type": "integer", "description": "If specified, the system will make a best effort to sample\ndeterministically, such that repeated requests with the same\nseed and parameters should return the same result.\n" }, "stop": { "type": "string", "description": "Up to 4 sequences where the API will stop generating further\ntokens.\n" }, "stream": { "type": "boolean", "description": "If set, partial message deltas will be sent as server-sent\nevents as they become available. The stream is terminated by\na data: [DONE] message.\n" }, "stream_options": { "type": "object", "description": "Options for streaming responses." }, "temperature": { "type": "number", "description": "What sampling temperature to use, between 0 and 2. Higher\nvalues like 0.8 will make the output more random, while\nlower values like 0.2 will make it more focused and deterministic.\n" }, "top_p": { "type": "number", "description": "An alternative to sampling with temperature, called nucleus\nsampling, where the model considers the results of the tokens\nwith top_p probability mass.\n" }, "tools": { "type": "array", "description": "A list of tools the model may call. Currently, only functions\nare supported as a tool. Use this to provide a list of functions\nthe model may generate JSON inputs for.\n" }, "tool_choice": { "type": "string", "description": "Controls which (if any) tool is called by the model. \"none\"\nmeans the model will not call any tool. \"auto\" means the\nmodel can pick between generating a message or calling one\nor more tools. \"required\" means the model must call one or\nmore tools.\n" }, "parallel_tool_calls": { "type": "boolean", "description": "Whether to enable parallel function calling during tool use.\n" }, "user": { "type": "string", "description": "A unique identifier representing your end-user, which can\nhelp OpenAI to monitor and detect abuse.\n" }, "store": { "type": "boolean", "description": "Whether or not to store the output of this chat completion\nrequest for use in the model distillation or evals products.\n" }, "metadata": { "type": "object", "description": "Set of 16 key-value pairs that can be attached to an object.\nUseful for storing additional information in a structured format.\n" } } }