Input Schema

The following section provides a detailed description of all request parameters in JSON Schema format.

{
    "definitions": {
        "ChatCompletionAssistantMessage": {
            "properties": {
                "cache_control": {
                    "additionalProperties": true,
                    "description": "Configuration options for prompt caching and cache reuse",
                    "title": "Prompt Cache Control",
                    "type": "object"
                },
                "role": {
                    "const": "assistant",
                    "default": "assistant",
                    "description": "The role of the message author",
                    "title": "Author Role",
                    "type": "string"
                },
                "content": {
                    "anyOf": [
                        {
                            "type": "string"
                        },
                        {
                            "items": {
                                "$ref": "#/definitions/ChatCompletionContentPartText"
                            },
                            "type": "array"
                        }
                    ],
                    "description": "the message content",
                    "title": "Content"
                },
                "reasoning_content": {
                    "description": "the reasoning content",
                    "title": "Reasoning Content",
                    "type": "string"
                },
                "name": {
                    "title": "Name",
                    "type": "string"
                },
                "tool_calls": {
                    "description": "Tool calls generated by the model",
                    "items": {
                        "$ref": "#/definitions/ChatCompletionMessageToolCall"
                    },
                    "title": "Model Tool Calls",
                    "type": "array"
                }
            },
            "title": "ChatCompletionAssistantMessage",
            "type": "object"
        },
        "ChatCompletionContentPartAudio": {
            "properties": {
                "type": {
                    "const": "input_audio",
                    "title": "Type",
                    "type": "string"
                },
                "input_audio": {
                    "$ref": "#/definitions/InputAudio"
                }
            },
            "required": [
                "type",
                "input_audio"
            ],
            "title": "ChatCompletionContentPartAudio",
            "type": "object"
        },
        "ChatCompletionContentPartImage": {
            "properties": {
                "type": {
                    "const": "image_url",
                    "title": "Type",
                    "type": "string"
                },
                "image_url": {
                    "$ref": "#/definitions/ImageURL"
                }
            },
            "required": [
                "type",
                "image_url"
            ],
            "title": "ChatCompletionContentPartImage",
            "type": "object"
        },
        "ChatCompletionContentPartText": {
            "properties": {
                "type": {
                    "const": "text",
                    "title": "Type",
                    "type": "string"
                },
                "text": {
                    "title": "Text",
                    "type": "string"
                }
            },
            "required": [
                "type",
                "text"
            ],
            "title": "ChatCompletionContentPartText",
            "type": "object"
        },
        "ChatCompletionContentPartVideo": {
            "properties": {
                "type": {
                    "const": "video_url",
                    "title": "Type",
                    "type": "string"
                },
                "video_url": {
                    "$ref": "#/definitions/VideoURL"
                }
            },
            "required": [
                "type",
                "video_url"
            ],
            "title": "ChatCompletionContentPartVideo",
            "type": "object"
        },
        "ChatCompletionMessageToolCall": {
            "properties": {
                "id": {
                    "description": "IDs of the tools call by Model",
                    "title": "Tools Id",
                    "type": "string"
                },
                "type": {
                    "description": "Types of the tool call, Only function is supported currently",
                    "title": "Tools Type",
                    "type": "string"
                },
                "function": {
                    "$ref": "#/definitions/Function",
                    "description": "The function that the model called"
                }
            },
            "required": [
                "id",
                "type",
                "function"
            ],
            "title": "ChatCompletionMessageToolCall",
            "type": "object"
        },
        "ChatCompletionSystemMessage": {
            "properties": {
                "cache_control": {
                    "additionalProperties": true,
                    "description": "Cache control for prompt caching",
                    "title": "Prompt Cache Control",
                    "type": "object"
                },
                "role": {
                    "const": "system",
                    "default": "system",
                    "description": "The role of the author of this message",
                    "title": "Author Role",
                    "type": "string"
                },
                "content": {
                    "anyOf": [
                        {
                            "type": "string"
                        },
                        {
                            "items": {
                                "$ref": "#/definitions/ChatCompletionContentPartText"
                            },
                            "type": "array"
                        }
                    ],
                    "description": "The message content",
                    "title": "Content"
                },
                "name": {
                    "title": "Name",
                    "type": "string"
                }
            },
            "required": [
                "content"
            ],
            "title": "ChatCompletionSystemMessage",
            "type": "object"
        },
        "ChatCompletionToolMessage": {
            "properties": {
                "cache_control": {
                    "additionalProperties": true,
                    "description": "Cache control for prompt caching",
                    "title": "Prompt Cache Control",
                    "type": "object"
                },
                "role": {
                    "const": "tool",
                    "default": "tool",
                    "description": "The role of the author of this message",
                    "title": "Role",
                    "type": "string"
                },
                "content": {
                    "anyOf": [
                        {
                            "type": "string"
                        },
                        {
                            "items": {
                                "$ref": "#/definitions/ChatCompletionContentPartText"
                            },
                            "type": "array"
                        }
                    ],
                    "description": "The message content",
                    "title": "Content"
                },
                "tool_call_id": {
                    "title": "Tools Called Ids",
                    "type": "string"
                }
            },
            "required": [
                "content",
                "tool_call_id"
            ],
            "title": "ChatCompletionToolMessage",
            "type": "object"
        },
        "ChatCompletionUserMessage": {
            "properties": {
                "cache_control": {
                    "additionalProperties": true,
                    "description": "Cache control for prompt caching",
                    "title": "Prompt Cache Control",
                    "type": "object"
                },
                "role": {
                    "const": "user",
                    "default": "user",
                    "description": "The role of the author of this message",
                    "title": "Author Role",
                    "type": "string"
                },
                "content": {
                    "anyOf": [
                        {
                            "type": "string"
                        },
                        {
                            "items": {
                                "anyOf": [
                                    {
                                        "$ref": "#/definitions/ChatCompletionContentPartText"
                                    },
                                    {
                                        "$ref": "#/definitions/ChatCompletionContentPartImage"
                                    },
                                    {
                                        "$ref": "#/definitions/ChatCompletionContentPartAudio"
                                    },
                                    {
                                        "$ref": "#/definitions/ChatCompletionContentPartVideo"
                                    }
                                ]
                            },
                            "type": "array"
                        }
                    ],
                    "description": "the message content",
                    "title": "Content"
                },
                "name": {
                    "title": "Name",
                    "type": "string"
                }
            },
            "required": [
                "content"
            ],
            "title": "ChatCompletionUserMessage",
            "type": "object"
        },
        "ChatReasoningSettings": {
            "properties": {
                "effort": {
                    "description": "Constrains effort on reasoning for reasoning models.",
                    "enum": [
                        "low",
                        "medium",
                        "high",
                        "xhigh"
                    ],
                    "title": "Effort",
                    "type": "string"
                },
                "enabled": {
                    "description": "Enable or disable reasoning with default parameters.",
                    "title": "Enabled",
                    "type": "boolean"
                }
            },
            "title": "ChatReasoningSettings",
            "type": "object"
        },
        "ChatTools": {
            "properties": {
                "cache_control": {
                    "additionalProperties": true,
                    "description": "Cache control for prompt caching",
                    "title": "Cache Control",
                    "type": "object"
                },
                "type": {
                    "default": "function",
                    "title": "Type",
                    "type": "string"
                },
                "function": {
                    "$ref": "#/definitions/FunctionDefinition"
                }
            },
            "required": [
                "function"
            ],
            "title": "ChatTools",
            "type": "object"
        },
        "Function": {
            "properties": {
                "name": {
                    "description": "the name of the function to call",
                    "title": "Name",
                    "type": "string"
                },
                "arguments": {
                    "description": "the function arguments, generated by the model in JSON format. the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema",
                    "title": "Arguments",
                    "type": "string"
                }
            },
            "required": [
                "name",
                "arguments"
            ],
            "title": "Function",
            "type": "object"
        },
        "FunctionDefinition": {
            "properties": {
                "name": {
                    "title": "Name",
                    "type": "string"
                },
                "description": {
                    "title": "Description",
                    "type": "string"
                },
                "parameters": {
                    "additionalProperties": true,
                    "title": "Parameters",
                    "type": "object"
                }
            },
            "required": [
                "name"
            ],
            "title": "FunctionDefinition",
            "type": "object"
        },
        "ImageURL": {
            "properties": {
                "url": {
                    "title": "Url",
                    "type": "string"
                },
                "detail": {
                    "default": "auto",
                    "enum": [
                        "auto",
                        "low",
                        "high"
                    ],
                    "title": "Detail",
                    "type": "string"
                }
            },
            "required": [
                "url"
            ],
            "title": "ImageURL",
            "type": "object"
        },
        "InputAudio": {
            "properties": {
                "data": {
                    "title": "Data",
                    "type": "string"
                },
                "format": {
                    "default": "wav",
                    "enum": [
                        "wav",
                        "mp3"
                    ],
                    "title": "Format",
                    "type": "string"
                }
            },
            "required": [
                "data"
            ],
            "title": "InputAudio",
            "type": "object"
        },
        "JsonObjectResponseFormat": {
            "properties": {
                "type": {
                    "const": "json_object",
                    "default": "json_object",
                    "title": "Type",
                    "type": "string"
                }
            },
            "title": "JsonObjectResponseFormat",
            "type": "object"
        },
        "JsonSchema": {
            "properties": {
                "name": {
                    "description": "Name identifier for the JSON schema",
                    "title": "Name",
                    "type": "string"
                },
                "schema": {
                    "additionalProperties": true,
                    "description": "The actual JSON schema definition",
                    "title": "Schema",
                    "type": "object"
                }
            },
            "required": [
                "name",
                "schema"
            ],
            "title": "JsonSchema",
            "type": "object"
        },
        "JsonSchemaResponseFormat": {
            "properties": {
                "type": {
                    "const": "json_schema",
                    "default": "json_schema",
                    "title": "Type",
                    "type": "string"
                },
                "json_schema": {
                    "$ref": "#/definitions/JsonSchema",
                    "description": "JSON schema for structured output when type is 'json_schema'"
                }
            },
            "required": [
                "json_schema"
            ],
            "title": "JsonSchemaResponseFormat",
            "type": "object"
        },
        "RegexResponseFormat": {
            "properties": {
                "type": {
                    "const": "regex",
                    "default": "regex",
                    "title": "Type",
                    "type": "string"
                },
                "regex": {
                    "description": "Regex pattern for structured output when type is 'regex'",
                    "title": "Regex",
                    "type": "string"
                }
            },
            "required": [
                "regex"
            ],
            "title": "RegexResponseFormat",
            "type": "object"
        },
        "ServiceTier": {
            "enum": [
                "default",
                "priority"
            ],
            "title": "ServiceTier",
            "type": "string"
        },
        "StreamOptions": {
            "properties": {
                "include_usage": {
                    "default": true,
                    "description": "whether to include usage data",
                    "title": "Include Usage",
                    "type": "boolean"
                },
                "continuous_usage_stats": {
                    "default": false,
                    "description": "whether to include usage stats continuously with each streaming event",
                    "title": "Continuous Usage Stats",
                    "type": "boolean"
                }
            },
            "title": "StreamOptions",
            "type": "object"
        },
        "TextResponseFormat": {
            "properties": {
                "type": {
                    "const": "text",
                    "default": "text",
                    "title": "Type",
                    "type": "string"
                }
            },
            "title": "TextResponseFormat",
            "type": "object"
        },
        "VideoURL": {
            "properties": {
                "url": {
                    "title": "Url",
                    "type": "string"
                }
            },
            "required": [
                "url"
            ],
            "title": "VideoURL",
            "type": "object"
        }
    },
    "required": [
        "model",
        "messages"
    ],
    "title": "OpenAIChatCompletionsIn",
    "type": "object",
    "properties": {
        "service_tier": {
            "$ref": "#/definitions/ServiceTier",
            "description": "The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it).",
            "type": "string",
            "title": "ServiceTier"
        },
        "model": {
            "description": "model name",
            "title": "Model",
            "type": "string",
            "example": "meta-llama/Llama-2-70b-chat-hf"
        },
        "messages": {
            "description": "conversation messages: (user,assistant,tool)*,user including one system message anywhere",
            "items": {
                "anyOf": [
                    {
                        "$ref": "#/definitions/ChatCompletionToolMessage"
                    },
                    {
                        "$ref": "#/definitions/ChatCompletionAssistantMessage"
                    },
                    {
                        "$ref": "#/definitions/ChatCompletionUserMessage"
                    },
                    {
                        "$ref": "#/definitions/ChatCompletionSystemMessage"
                    }
                ]
            },
            "title": "Messages",
            "type": "array"
        },
        "stream": {
            "default": false,
            "description": "whether to stream the output via SSE or return the full response",
            "title": "Stream",
            "type": "boolean"
        },
        "temperature": {
            "default": 1,
            "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",
            "maximum": 2,
            "minimum": 0,
            "title": "Temperature",
            "type": "number"
        },
        "top_p": {
            "default": 1,
            "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.",
            "exclusiveMinimum": 0,
            "maximum": 1,
            "title": "Top P",
            "type": "number"
        },
        "min_p": {
            "default": 0,
            "description": "Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.",
            "maximum": 1,
            "minimum": 0,
            "title": "Min P",
            "type": "number"
        },
        "top_k": {
            "default": 0,
            "description": "Sample from the best k (number of) tokens. 0 means off",
            "exclusiveMaximum": 1000,
            "minimum": 0,
            "title": "Top K",
            "type": "integer"
        },
        "max_tokens": {
            "description": "The maximum number of tokens to generate in the chat completion.\n\nThe total length of input tokens and generated tokens is limited by the model's context length. If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller.",
            "exclusiveMinimum": 0,
            "maximum": 10000000,
            "title": "Max Tokens",
            "type": "integer"
        },
        "stop": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                }
            ],
            "description": "up to 16 sequences where the API will stop generating further tokens",
            "title": "Stop"
        },
        "stop_token_ids": {
            "description": "Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments.",
            "items": {
                "type": "integer"
            },
            "title": "Stop Token Ids",
            "type": "array"
        },
        "n": {
            "default": 1,
            "description": "number of sequences to return",
            "maximum": 4,
            "minimum": 1,
            "title": "N",
            "type": "integer"
        },
        "presence_penalty": {
            "default": 0,
            "description": "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.",
            "maximum": 2,
            "minimum": -2,
            "title": "Presence Penalty",
            "type": "number"
        },
        "frequency_penalty": {
            "default": 0,
            "description": "Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.",
            "maximum": 2,
            "minimum": -2,
            "title": "Frequency Penalty",
            "type": "number"
        },
        "tools": {
            "description": "A list of tools the model may call. Currently, only functions are supported as a tool.",
            "items": {
                "$ref": "#/definitions/ChatTools"
            },
            "title": "Tools",
            "type": "array"
        },
        "tool_choice": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "$ref": "#/definitions/ChatTools"
                }
            ],
            "description": "Controls which (if any) function is called by the model. 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. required means the model must call a function. defined tool means the model must call that specific tool. none is the default when no functions are present. auto is the default if functions are present.",
            "title": "Tool Choice"
        },
        "response_format": {
            "anyOf": [
                {
                    "$ref": "#/definitions/TextResponseFormat"
                },
                {
                    "$ref": "#/definitions/JsonObjectResponseFormat"
                },
                {
                    "$ref": "#/definitions/JsonSchemaResponseFormat"
                },
                {
                    "$ref": "#/definitions/RegexResponseFormat"
                }
            ],
            "description": "The format of the response. Currently, only json is supported.",
            "title": "Response Format"
        },
        "repetition_penalty": {
            "default": 1,
            "description": "Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)",
            "maximum": 5,
            "minimum": 0.01,
            "title": "Repetition Penalty",
            "type": "number"
        },
        "user": {
            "description": "A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers.",
            "title": "User",
            "type": "string"
        },
        "seed": {
            "description": "Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed.",
            "exclusiveMaximum": 18446744073709552000,
            "minimum": -9223372036854776000,
            "title": "Seed",
            "type": "integer"
        },
        "logprobs": {
            "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`.",
            "title": "Logprobs",
            "type": "boolean"
        },
        "stream_options": {
            "$ref": "#/definitions/StreamOptions",
            "description": "streaming options",
            "type": "object",
            "title": "StreamOptions"
        },
        "reasoning_effort": {
            "description": "Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports.",
            "enum": [
                "low",
                "medium",
                "high",
                "xhigh",
                "none"
            ],
            "title": "Reasoning Effort",
            "type": "string"
        },
        "reasoning": {
            "$ref": "#/definitions/ChatReasoningSettings",
            "description": "Reasoning configuration.",
            "type": "object",
            "title": "ChatReasoningSettings"
        },
        "prompt_cache_key": {
            "description": "A unique key used to identify and reuse cached prompts across requests. When provided, the prompt may be cached and reused by subsequent requests that specify the same key.",
            "title": "Input Prompt Cache Key",
            "type": "string"
        },
        "chat_template_kwargs": {
            "additionalProperties": true,
            "description": "Chat template kwargs.",
            "title": "Chat Template Kwargs",
            "type": "object"
        },
        "continue_final_message": {
            "description": "If enabled, the model continues generating from the final assistant message instead of starting a new assistant response. This option only applies when the last message in the conversation has the assistant role.",
            "title": "Continue the final message thread",
            "type": "boolean"
        }
    }
}