GET
/v1/schemas/openai/chat/chat%2Fcompletions
Accept:
Request body
0 properties · 0 required · 0 $defsThis schema isn’t a plain object with properties — showing the raw JSON instead.
application/json
{
"provider": "openai",
"activity": "chat",
"endpointId": "chat/completions",
"kind": "input",
"contentHash": "3e2639189221e53b091c1642b7ede7764a50bfaefd367fcb48a0ffe2d97bba89",
"specRevision": null,
"provenance": {
"sourceUrl": "https://raw.githubusercontent.com/openai/openai-openapi/master/openapi.yaml",
"sourceHash": "0e6756eca8e097e1738f273d0fa288dd745d75ee298c038a8bc9b8c6301f42d7",
"fetchedAt": 1784782802,
"extractorVersion": "1"
},
"createdAt": 1784782802,
"supersededAt": null,
"schema": {
"allOf": [
{
"$ref": "#/$defs/CreateModelResponseProperties"
},
{
"type": "object",
"properties": {
"messages": {
"description": "A list of messages comprising the conversation so far. Depending on the\n[model](/docs/models) you use, different message types (modalities) are\nsupported, like [text](/docs/guides/text-generation),\n[images](/docs/guides/vision), and [audio](/docs/guides/audio).\n",
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/$defs/ChatCompletionRequestMessage"
}
},
"model": {
"description": "Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI\noffers a wide range of models with different capabilities, performance\ncharacteristics, and price points. Refer to the [model guide](/docs/models)\nto browse and compare available models.\n",
"$ref": "#/$defs/ModelIdsShared"
},
"modalities": {
"$ref": "#/$defs/ResponseModalities"
},
"verbosity": {
"$ref": "#/$defs/Verbosity"
},
"reasoning_effort": {
"$ref": "#/$defs/ReasoningEffort"
},
"max_completion_tokens": {
"description": "An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](/docs/guides/reasoning).\n",
"type": "integer",
"nullable": true
},
"frequency_penalty": {
"type": "number",
"default": 0,
"minimum": -2,
"maximum": 2,
"nullable": true,
"description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\ntheir existing frequency in the text so far, decreasing the model's\nlikelihood to repeat the same line verbatim.\n"
},
"presence_penalty": {
"type": "number",
"default": 0,
"minimum": -2,
"maximum": 2,
"nullable": true,
"description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\nwhether they appear in the text so far, increasing the model's likelihood\nto talk about new topics.\n"
},
"web_search_options": {
"type": "object",
"title": "Web search",
"description": "This tool searches the web for relevant results to use in a response.\nLearn more about the [web search tool](/docs/guides/tools-web-search?api-mode=chat).\n",
"properties": {
"user_location": {
"type": "object",
"nullable": true,
"required": [
"type",
"approximate"
],
"description": "Approximate location parameters for the search.\n",
"properties": {
"type": {
"type": "string",
"description": "The type of location approximation. Always `approximate`.\n",
"enum": [
"approximate"
],
"x-stainless-const": true
},
"approximate": {
"$ref": "#/$defs/WebSearchLocation"
}
}
},
"search_context_size": {
"$ref": "#/$defs/WebSearchContextSize"
}
}
},
"top_logprobs": {
"description": "An integer between 0 and 20 specifying the maximum number of most likely\ntokens to return at each token position, each with an associated log\nprobability. In some cases, the number of returned tokens may be fewer than\nrequested.\n`logprobs` must be set to `true` if this parameter is used.\n",
"type": "integer",
"minimum": 0,
"maximum": 20,
"nullable": true
},
"response_format": {
"description": "An object specifying the format that the model must output.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables\nStructured Outputs which ensures the model will match your supplied JSON\nschema. Learn more in the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\nensures the message the model generates is valid JSON. Using `json_schema`\nis preferred for models that support it.\n",
"oneOf": [
{
"$ref": "#/$defs/ResponseFormatText"
},
{
"$ref": "#/$defs/ResponseFormatJsonSchema"
},
{
"$ref": "#/$defs/ResponseFormatJsonObject"
}
],
"discriminator": {
"propertyName": "type"
}
},
"audio": {
"type": "object",
"nullable": true,
"description": "Parameters for audio output. Required when audio output is requested with\n`modalities: [\"audio\"]`. [Learn more](/docs/guides/audio).\n",
"required": [
"voice",
"format"
],
"properties": {
"voice": {
"$ref": "#/$defs/VoiceIdsOrCustomVoice",
"description": "The voice the model uses to respond. Supported built-in voices are\n`alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`,\n`sage`, `shimmer`, `marin`, and `cedar`. You may also provide a\ncustom voice object with an `id`, for example `{ \"id\": \"voice_1234\" }`.\n"
},
"format": {
"type": "string",
"enum": [
"wav",
"aac",
"mp3",
"flac",
"opus",
"pcm16"
],
"description": "Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`,\n`opus`, or `pcm16`.\n"
}
}
},
"store": {
"type": "boolean",
"default": false,
"nullable": true,
"description": "Whether or not to store the output of this chat completion request for\nuse in our [model distillation](/docs/guides/distillation) or\n[evals](/docs/guides/evals) products.\n\nSupports text and image inputs. Note: image inputs over 8MB will be dropped.\n"
},
"moderation": {
"anyOf": [
{
"$ref": "#/$defs/ModerationParam",
"description": "Configuration for running moderation on the request input and generated output.\n"
},
{
"type": "null"
}
]
},
"stream": {
"description": "If set to true, the model response data will be streamed to the client\nas it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).\nSee the [Streaming section below](/docs/api-reference/chat/streaming)\nfor more information, along with the [streaming responses](/docs/guides/streaming-responses)\nguide for more information on how to handle the streaming events.\n",
"type": "boolean",
"nullable": true,
"default": false
},
"stop": {
"$ref": "#/$defs/StopConfiguration"
},
"logit_bias": {
"type": "object",
"x-oaiTypeLabel": "map",
"default": null,
"nullable": true,
"additionalProperties": {
"type": "integer"
},
"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\ntokenizer) to an associated bias value from -100 to 100. Mathematically,\nthe bias is added to the logits generated by the model prior to sampling.\nThe exact effect will vary per model, but values between -1 and 1 should\ndecrease or increase likelihood of selection; values like -100 or 100\nshould result in a ban or exclusive selection of the relevant token.\n"
},
"logprobs": {
"description": "Whether to return log probabilities of the output tokens or not. If true,\nreturns the log probabilities of each output token returned in the\n`content` of `message`.\n",
"type": "boolean",
"default": false,
"nullable": true
},
"max_tokens": {
"description": "The maximum number of [tokens](/tokenizer) that can be generated in the\nchat completion. This value can be used to control\n[costs](https://openai.com/api/pricing/) for text generated via API.\n\nThis value is now deprecated in favor of `max_completion_tokens`, and is\nnot compatible with [o-series models](/docs/guides/reasoning).\n",
"type": "integer",
"nullable": true,
"deprecated": true
},
"n": {
"type": "integer",
"minimum": 1,
"maximum": 128,
"default": 1,
"example": 1,
"nullable": true,
"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."
},
"prediction": {
"nullable": true,
"description": "Configuration for a [Predicted Output](/docs/guides/predicted-outputs),\nwhich can greatly improve response times when large parts of the model\nresponse are known ahead of time. This is most common when you are\nregenerating a file with only minor changes to most of the content.\n",
"oneOf": [
{
"$ref": "#/$defs/PredictionContent"
}
]
},
"seed": {
"type": "integer",
"minimum": -9223372036854776000,
"maximum": 9223372036854776000,
"nullable": true,
"deprecated": true,
"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",
"x-oaiMeta": {
"beta": true
}
},
"stream_options": {
"$ref": "#/$defs/ChatCompletionStreamOptions"
},
"tools": {
"type": "array",
"description": "A list of tools the model may call. You can provide either\n[custom tools](/docs/guides/function-calling#custom-tools) or\n[function tools](/docs/guides/function-calling).\n",
"items": {
"oneOf": [
{
"$ref": "#/$defs/ChatCompletionTool"
},
{
"$ref": "#/$defs/CustomToolChatCompletions"
}
]
}
},
"tool_choice": {
"$ref": "#/$defs/ChatCompletionToolChoiceOption"
},
"parallel_tool_calls": {
"$ref": "#/$defs/ParallelToolCalls"
},
"function_call": {
"deprecated": true,
"description": "Deprecated in favor of `tool_choice`.\n\nControls which (if any) function is called by the model.\n\n`none` means the model will not call a function and instead generates a\nmessage.\n\n`auto` means the model can pick between generating a message or calling a\nfunction.\n\nSpecifying a particular function via `{\"name\": \"my_function\"}` forces the\nmodel to call that function.\n\n`none` is the default when no functions are present. `auto` is the default\nif functions are present.\n",
"oneOf": [
{
"type": "string",
"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",
"enum": [
"none",
"auto"
]
},
{
"$ref": "#/$defs/ChatCompletionFunctionCallOption"
}
]
},
"functions": {
"deprecated": true,
"description": "Deprecated in favor of `tools`.\n\nA list of functions the model may generate JSON inputs for.\n",
"type": "array",
"minItems": 1,
"maxItems": 128,
"items": {
"$ref": "#/$defs/ChatCompletionFunctions"
}
}
},
"required": [
"model",
"messages"
]
}
],
"$defs": {
"ChatCompletionAllowedTools": {
"type": "object",
"title": "Allowed tools",
"description": "Constrains the tools available to the model to a pre-defined set.\n",
"properties": {
"mode": {
"type": "string",
"enum": [
"auto",
"required"
],
"description": "Constrains the tools available to the model to a pre-defined set.\n\n`auto` allows the model to pick from among the allowed tools and generate a\nmessage.\n\n`required` requires the model to call one or more of the allowed tools.\n"
},
"tools": {
"type": "array",
"description": "A list of tool definitions that the model should be allowed to call.\n\nFor the Chat Completions API, the list of tool definitions might look like:\n```json\n[\n { \"type\": \"function\", \"function\": { \"name\": \"get_weather\" } },\n { \"type\": \"function\", \"function\": { \"name\": \"get_time\" } }\n]\n```\n",
"items": {
"type": "object",
"x-oaiExpandable": false,
"description": "A tool definition that the model should be allowed to call.\n",
"additionalProperties": true
}
}
},
"required": [
"mode",
"tools"
]
},
"ChatCompletionAllowedToolsChoice": {
"type": "object",
"title": "Allowed tools",
"description": "Constrains the tools available to the model to a pre-defined set.\n",
"properties": {
"type": {
"type": "string",
"enum": [
"allowed_tools"
],
"description": "Allowed tool configuration type. Always `allowed_tools`.",
"x-stainless-const": true
},
"allowed_tools": {
"$ref": "#/$defs/ChatCompletionAllowedTools"
}
},
"required": [
"type",
"allowed_tools"
]
},
"ChatCompletionFunctionCallOption": {
"type": "object",
"description": "Specifying a particular function via `{\"name\": \"my_function\"}` forces the model to call that function.\n",
"properties": {
"name": {
"type": "string",
"description": "The name of the function to call."
}
},
"required": [
"name"
]
},
"ChatCompletionFunctions": {
"type": "object",
"deprecated": true,
"properties": {
"description": {
"type": "string",
"description": "A description of what the function does, used by the model to choose when and how to call the function."
},
"name": {
"type": "string",
"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."
},
"parameters": {
"$ref": "#/$defs/FunctionParameters"
}
},
"required": [
"name"
]
},
"ChatCompletionMessageCustomToolCall": {
"type": "object",
"title": "Custom tool call",
"description": "A call to a custom tool created by the model.\n",
"properties": {
"id": {
"type": "string",
"description": "The ID of the tool call."
},
"type": {
"type": "string",
"enum": [
"custom"
],
"description": "The type of the tool. Always `custom`.",
"x-stainless-const": true
},
"custom": {
"type": "object",
"description": "The custom tool that the model called.",
"properties": {
"name": {
"type": "string",
"description": "The name of the custom tool to call."
},
"input": {
"type": "string",
"description": "The input for the custom tool call generated by the model."
}
},
"required": [
"name",
"input"
]
}
},
"required": [
"id",
"type",
"custom"
]
},
"ChatCompletionMessageToolCall": {
"type": "object",
"title": "Function tool call",
"description": "A call to a function tool created by the model.\n",
"properties": {
"id": {
"type": "string",
"description": "The ID of the tool call."
},
"type": {
"type": "string",
"enum": [
"function"
],
"description": "The type of the tool. Currently, only `function` is supported.",
"x-stainless-const": true
},
"function": {
"type": "object",
"description": "The function that the model called.",
"properties": {
"name": {
"type": "string",
"description": "The name of the function to call."
},
"arguments": {
"type": "string",
"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."
}
},
"required": [
"name",
"arguments"
]
}
},
"required": [
"id",
"type",
"function"
]
},
"ChatCompletionMessageToolCalls": {
"type": "array",
"description": "The tool calls generated by the model, such as function calls.",
"items": {
"oneOf": [
{
"$ref": "#/$defs/ChatCompletionMessageToolCall"
},
{
"$ref": "#/$defs/ChatCompletionMessageCustomToolCall"
}
],
"discriminator": {
"propertyName": "type"
}
}
},
"ChatCompletionNamedToolChoice": {
"type": "object",
"title": "Function tool choice",
"description": "Specifies a tool the model should use. Use to force the model to call a specific function.",
"properties": {
"type": {
"type": "string",
"enum": [
"function"
],
"description": "For function calling, the type is always `function`.",
"x-stainless-const": true
},
"function": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the function to call."
}
},
"required": [
"name"
]
}
},
"required": [
"type",
"function"
]
},
"ChatCompletionNamedToolChoiceCustom": {
"type": "object",
"title": "Custom tool choice",
"description": "Specifies a tool the model should use. Use to force the model to call a specific custom tool.",
"properties": {
"type": {
"type": "string",
"enum": [
"custom"
],
"description": "For custom tool calling, the type is always `custom`.",
"x-stainless-const": true
},
"custom": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the custom tool to call."
}
},
"required": [
"name"
]
}
},
"required": [
"type",
"custom"
]
},
"ChatCompletionRequestAssistantMessage": {
"type": "object",
"title": "Assistant message",
"description": "Messages sent by the model in response to user messages.\n",
"properties": {
"content": {
"anyOf": [
{
"oneOf": [
{
"type": "string",
"description": "The contents of the assistant message.",
"title": "Text content"
},
{
"type": "array",
"description": "An array of content parts with a defined type. Can be one or more of type `text`, or exactly one of type `refusal`.",
"title": "Array of content parts",
"items": {
"$ref": "#/$defs/ChatCompletionRequestAssistantMessageContentPart"
},
"minItems": 1
}
],
"description": "The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.\n"
},
{
"type": "null"
}
]
},
"refusal": {
"anyOf": [
{
"type": "string",
"description": "The refusal message by the assistant."
},
{
"type": "null"
}
]
},
"role": {
"type": "string",
"enum": [
"assistant"
],
"description": "The role of the messages author, in this case `assistant`.",
"x-stainless-const": true
},
"name": {
"type": "string",
"description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role."
},
"audio": {
"anyOf": [
{
"type": "object",
"description": "Data about a previous audio response from the model.\n[Learn more](/docs/guides/audio).\n",
"required": [
"id"
],
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for a previous audio response from the model.\n"
}
}
},
{
"type": "null"
}
]
},
"tool_calls": {
"$ref": "#/$defs/ChatCompletionMessageToolCalls"
},
"function_call": {
"anyOf": [
{
"type": "object",
"deprecated": true,
"description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.",
"properties": {
"arguments": {
"type": "string",
"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."
},
"name": {
"type": "string",
"description": "The name of the function to call."
}
},
"required": [
"arguments",
"name"
]
},
{
"type": "null"
}
]
}
},
"required": [
"role"
]
},
"ChatCompletionRequestAssistantMessageContentPart": {
"oneOf": [
{
"$ref": "#/$defs/ChatCompletionRequestMessageContentPartText"
},
{
"$ref": "#/$defs/ChatCompletionRequestMessageContentPartRefusal"
}
],
"discriminator": {
"propertyName": "type"
}
},
"ChatCompletionRequestDeveloperMessage": {
"type": "object",
"title": "Developer message",
"description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, `developer` messages\nreplace the previous `system` messages.\n",
"properties": {
"content": {
"description": "The contents of the developer message.",
"oneOf": [
{
"type": "string",
"description": "The contents of the developer message.",
"title": "Text content"
},
{
"type": "array",
"description": "An array of content parts with a defined type. For developer messages, only type `text` is supported.",
"title": "Array of content parts",
"items": {
"$ref": "#/$defs/ChatCompletionRequestMessageContentPartText"
},
"minItems": 1
}
]
},
"role": {
"type": "string",
"enum": [
"developer"
],
"description": "The role of the messages author, in this case `developer`.",
"x-stainless-const": true
},
"name": {
"type": "string",
"description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role."
}
},
"required": [
"content",
"role"
]
},
"ChatCompletionRequestFunctionMessage": {
"type": "object",
"title": "Function message",
"deprecated": true,
"properties": {
"role": {
"type": "string",
"enum": [
"function"
],
"description": "The role of the messages author, in this case `function`.",
"x-stainless-const": true
},
"content": {
"anyOf": [
{
"type": "string",
"description": "The contents of the function message."
},
{
"type": "null"
}
]
},
"name": {
"type": "string",
"description": "The name of the function to call."
}
},
"required": [
"role",
"content",
"name"
]
},
"ChatCompletionRequestMessage": {
"oneOf": [
{
"$ref": "#/$defs/ChatCompletionRequestDeveloperMessage"
},
{
"$ref": "#/$defs/ChatCompletionRequestSystemMessage"
},
{
"$ref": "#/$defs/ChatCompletionRequestUserMessage"
},
{
"$ref": "#/$defs/ChatCompletionRequestAssistantMessage"
},
{
"$ref": "#/$defs/ChatCompletionRequestToolMessage"
},
{
"$ref": "#/$defs/ChatCompletionRequestFunctionMessage"
}
],
"discriminator": {
"propertyName": "role"
}
},
"ChatCompletionRequestMessageContentPartAudio": {
"type": "object",
"title": "Audio content part",
"description": "Learn about [audio inputs](/docs/guides/audio).\n",
"properties": {
"type": {
"type": "string",
"enum": [
"input_audio"
],
"description": "The type of the content part. Always `input_audio`.",
"x-stainless-const": true
},
"input_audio": {
"type": "object",
"properties": {
"data": {
"type": "string",
"description": "Base64 encoded audio data."
},
"format": {
"type": "string",
"enum": [
"wav",
"mp3"
],
"description": "The format of the encoded audio data. Currently supports \"wav\" and \"mp3\".\n"
}
},
"required": [
"data",
"format"
]
},
"prompt_cache_breakpoint": {
"$ref": "#/$defs/PromptCacheBreakpointParam"
}
},
"required": [
"type",
"input_audio"
]
},
"ChatCompletionRequestMessageContentPartFile": {
"type": "object",
"title": "File content part",
"description": "Learn about [file inputs](/docs/guides/text) for text generation.\n",
"properties": {
"type": {
"type": "string",
"enum": [
"file"
],
"description": "The type of the content part. Always `file`.",
"x-stainless-const": true
},
"file": {
"type": "object",
"properties": {
"filename": {
"type": "string",
"description": "The name of the file, used when passing the file to the model as a \nstring.\n"
},
"file_data": {
"type": "string",
"description": "The base64 encoded file data, used when passing the file to the model \nas a string.\n"
},
"file_id": {
"type": "string",
"description": "The ID of an uploaded file to use as input.\n"
}
}
},
"prompt_cache_breakpoint": {
"$ref": "#/$defs/PromptCacheBreakpointParam"
}
},
"required": [
"type",
"file"
]
},
"ChatCompletionRequestMessageContentPartImage": {
"type": "object",
"title": "Image content part",
"description": "Learn about [image inputs](/docs/guides/vision).\n",
"properties": {
"type": {
"type": "string",
"enum": [
"image_url"
],
"description": "The type of the content part.",
"x-stainless-const": true
},
"image_url": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "Either a URL of the image or the base64 encoded image data.",
"format": "uri"
},
"detail": {
"type": "string",
"description": "Specifies the detail level of the image. Learn more in the [Vision guide](/docs/guides/vision#low-or-high-fidelity-image-understanding).",
"enum": [
"auto",
"low",
"high"
],
"default": "auto"
}
},
"required": [
"url"
]
},
"prompt_cache_breakpoint": {
"$ref": "#/$defs/PromptCacheBreakpointParam"
}
},
"required": [
"type",
"image_url"
]
},
"ChatCompletionRequestMessageContentPartRefusal": {
"type": "object",
"title": "Refusal content part",
"properties": {
"type": {
"type": "string",
"enum": [
"refusal"
],
"description": "The type of the content part.",
"x-stainless-const": true
},
"refusal": {
"type": "string",
"description": "The refusal message generated by the model."
}
},
"required": [
"type",
"refusal"
]
},
"ChatCompletionRequestMessageContentPartText": {
"type": "object",
"title": "Text content part",
"description": "Learn about [text inputs](/docs/guides/text-generation).\n",
"properties": {
"type": {
"type": "string",
"enum": [
"text"
],
"description": "The type of the content part.",
"x-stainless-const": true
},
"text": {
"type": "string",
"description": "The text content."
},
"prompt_cache_breakpoint": {
"$ref": "#/$defs/PromptCacheBreakpointParam"
}
},
"required": [
"type",
"text"
]
},
"ChatCompletionRequestSystemMessage": {
"type": "object",
"title": "System message",
"description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, use `developer` messages\nfor this purpose instead.\n",
"properties": {
"content": {
"description": "The contents of the system message.",
"oneOf": [
{
"type": "string",
"description": "The contents of the system message.",
"title": "Text content"
},
{
"type": "array",
"description": "An array of content parts with a defined type. For system messages, only type `text` is supported.",
"title": "Array of content parts",
"items": {
"$ref": "#/$defs/ChatCompletionRequestSystemMessageContentPart"
},
"minItems": 1
}
]
},
"role": {
"type": "string",
"enum": [
"system"
],
"description": "The role of the messages author, in this case `system`.",
"x-stainless-const": true
},
"name": {
"type": "string",
"description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role."
}
},
"required": [
"content",
"role"
]
},
"ChatCompletionRequestSystemMessageContentPart": {
"oneOf": [
{
"$ref": "#/$defs/ChatCompletionRequestMessageContentPartText"
}
]
},
"ChatCompletionRequestToolMessage": {
"type": "object",
"title": "Tool message",
"properties": {
"role": {
"type": "string",
"enum": [
"tool"
],
"description": "The role of the messages author, in this case `tool`.",
"x-stainless-const": true
},
"content": {
"oneOf": [
{
"type": "string",
"description": "The contents of the tool message.",
"title": "Text content"
},
{
"type": "array",
"description": "An array of content parts with a defined type. For tool messages, only type `text` is supported.",
"title": "Array of content parts",
"items": {
"$ref": "#/$defs/ChatCompletionRequestToolMessageContentPart"
},
"minItems": 1
}
],
"description": "The contents of the tool message."
},
"tool_call_id": {
"type": "string",
"description": "Tool call that this message is responding to."
}
},
"required": [
"role",
"content",
"tool_call_id"
]
},
"ChatCompletionRequestToolMessageContentPart": {
"oneOf": [
{
"$ref": "#/$defs/ChatCompletionRequestMessageContentPartText"
}
]
},
"ChatCompletionRequestUserMessage": {
"type": "object",
"title": "User message",
"description": "Messages sent by an end user, containing prompts or additional context\ninformation.\n",
"properties": {
"content": {
"description": "The contents of the user message.\n",
"oneOf": [
{
"type": "string",
"description": "The text contents of the message.",
"title": "Text content"
},
{
"type": "array",
"description": "An array of content parts with a defined type. Supported options differ based on the [model](/docs/models) being used to generate the response. Can contain text, image, or audio inputs.",
"title": "Array of content parts",
"items": {
"$ref": "#/$defs/ChatCompletionRequestUserMessageContentPart"
},
"minItems": 1
}
]
},
"role": {
"type": "string",
"enum": [
"user"
],
"description": "The role of the messages author, in this case `user`.",
"x-stainless-const": true
},
"name": {
"type": "string",
"description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role."
}
},
"required": [
"content",
"role"
]
},
"ChatCompletionRequestUserMessageContentPart": {
"oneOf": [
{
"$ref": "#/$defs/ChatCompletionRequestMessageContentPartText"
},
{
"$ref": "#/$defs/ChatCompletionRequestMessageContentPartImage"
},
{
"$ref": "#/$defs/ChatCompletionRequestMessageContentPartAudio"
},
{
"$ref": "#/$defs/ChatCompletionRequestMessageContentPartFile"
}
]
},
"ChatCompletionStreamOptions": {
"anyOf": [
{
"description": "Options for streaming response. Only set this when you set `stream: true`.\n",
"type": "object",
"default": null,
"properties": {
"include_usage": {
"type": "boolean",
"description": "If set, an additional chunk will be streamed before the `data: [DONE]`\nmessage. The `usage` field on this chunk shows the token usage statistics\nfor the entire request, and the `choices` field will always be an empty\narray.\n\nAll other chunks will also include a `usage` field, but with a null\nvalue. **NOTE:** If the stream is interrupted, you may not receive the\nfinal usage chunk which contains the total token usage for the request.\n"
},
"include_obfuscation": {
"type": "boolean",
"description": "When true, stream obfuscation will be enabled. Stream obfuscation adds\nrandom characters to an `obfuscation` field on streaming delta events to\nnormalize payload sizes as a mitigation to certain side-channel attacks.\nThese obfuscation fields are included by default, but add a small amount\nof overhead to the data stream. You can set `include_obfuscation` to\nfalse to optimize for bandwidth if you trust the network links between\nyour application and the OpenAI API.\n"
}
}
},
{
"type": "null"
}
]
},
"ChatCompletionTool": {
"type": "object",
"title": "Function tool",
"description": "A function tool that can be used to generate a response.\n",
"properties": {
"type": {
"type": "string",
"enum": [
"function"
],
"description": "The type of the tool. Currently, only `function` is supported.",
"x-stainless-const": true
},
"function": {
"$ref": "#/$defs/FunctionObject"
}
},
"required": [
"type",
"function"
]
},
"ChatCompletionToolChoiceOption": {
"description": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tool and instead generates a message.\n`auto` means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools.\nSpecifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n\n`none` is the default when no tools are present. `auto` is the default if tools are present.\n",
"oneOf": [
{
"type": "string",
"title": "Tool choice mode",
"description": "`none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools.\n",
"enum": [
"none",
"auto",
"required"
]
},
{
"$ref": "#/$defs/ChatCompletionAllowedToolsChoice"
},
{
"$ref": "#/$defs/ChatCompletionNamedToolChoice"
},
{
"$ref": "#/$defs/ChatCompletionNamedToolChoiceCustom"
}
]
},
"CreateModelResponseProperties": {
"allOf": [
{
"$ref": "#/$defs/ModelResponseProperties"
},
{
"type": "object",
"properties": {
"prompt_cache_options": {
"$ref": "#/$defs/PromptCacheOptionsParam"
},
"top_logprobs": {
"description": "An integer between 0 and 20 specifying the maximum number of most likely\ntokens to return at each token position, each with an associated log\nprobability. In some cases, the number of returned tokens may be fewer than\nrequested.\n",
"type": "integer",
"minimum": 0,
"maximum": 20
}
}
}
]
},
"CustomToolChatCompletions": {
"type": "object",
"title": "Custom tool",
"description": "A custom tool that processes input using a specified format.\n",
"properties": {
"type": {
"type": "string",
"enum": [
"custom"
],
"description": "The type of the custom tool. Always `custom`.",
"x-stainless-const": true
},
"custom": {
"type": "object",
"title": "Custom tool properties",
"description": "Properties of the custom tool.\n",
"properties": {
"name": {
"type": "string",
"description": "The name of the custom tool, used to identify it in tool calls."
},
"description": {
"type": "string",
"description": "Optional description of the custom tool, used to provide more context.\n"
},
"format": {
"description": "The input format for the custom tool. Default is unconstrained text.\n",
"oneOf": [
{
"type": "object",
"title": "Text format",
"description": "Unconstrained free-form text.",
"properties": {
"type": {
"type": "string",
"enum": [
"text"
],
"description": "Unconstrained text format. Always `text`.",
"x-stainless-const": true
}
},
"required": [
"type"
],
"additionalProperties": false
},
{
"type": "object",
"title": "Grammar format",
"description": "A grammar defined by the user.",
"properties": {
"type": {
"type": "string",
"enum": [
"grammar"
],
"description": "Grammar format. Always `grammar`.",
"x-stainless-const": true
},
"grammar": {
"type": "object",
"title": "Grammar format",
"description": "Your chosen grammar.",
"properties": {
"definition": {
"type": "string",
"description": "The grammar definition."
},
"syntax": {
"type": "string",
"description": "The syntax of the grammar definition. One of `lark` or `regex`.",
"enum": [
"lark",
"regex"
]
}
},
"required": [
"definition",
"syntax"
]
}
},
"required": [
"type",
"grammar"
],
"additionalProperties": false
}
]
}
},
"required": [
"name"
]
}
},
"required": [
"type",
"custom"
]
},
"FunctionObject": {
"type": "object",
"properties": {
"description": {
"type": "string",
"description": "A description of what the function does, used by the model to choose when and how to call the function."
},
"name": {
"type": "string",
"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."
},
"parameters": {
"$ref": "#/$defs/FunctionParameters"
},
"strict": {
"anyOf": [
{
"type": "boolean",
"default": false,
"description": "Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling)."
},
{
"type": "null"
}
]
}
},
"required": [
"name"
]
},
"FunctionParameters": {
"type": "object",
"description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/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.",
"additionalProperties": true
},
"Metadata": {
"anyOf": [
{
"type": "object",
"description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n",
"additionalProperties": {
"type": "string"
},
"x-oaiTypeLabel": "map"
},
{
"type": "null"
}
]
},
"ModelIdsShared": {
"example": "gpt-5.4",
"anyOf": [
{
"type": "string"
},
{
"type": "string",
"enum": [
"gpt-5.6-sol",
"gpt-5.6-terra",
"gpt-5.6-luna",
"gpt-5.4",
"gpt-5.4-mini",
"gpt-5.4-nano",
"gpt-5.4-mini-2026-03-17",
"gpt-5.4-nano-2026-03-17",
"gpt-5.3-chat-latest",
"gpt-5.2",
"gpt-5.2-2025-12-11",
"gpt-5.2-chat-latest",
"gpt-5.2-pro",
"gpt-5.2-pro-2025-12-11",
"gpt-5.1",
"gpt-5.1-2025-11-13",
"gpt-5.1-codex",
"gpt-5.1-mini",
"gpt-5.1-chat-latest",
"gpt-5",
"gpt-5-mini",
"gpt-5-nano",
"gpt-5-2025-08-07",
"gpt-5-mini-2025-08-07",
"gpt-5-nano-2025-08-07",
"gpt-5-chat-latest",
"gpt-4.1",
"gpt-4.1-mini",
"gpt-4.1-nano",
"gpt-4.1-2025-04-14",
"gpt-4.1-mini-2025-04-14",
"gpt-4.1-nano-2025-04-14",
"o4-mini",
"o4-mini-2025-04-16",
"o3",
"o3-2025-04-16",
"o3-mini",
"o3-mini-2025-01-31",
"o1",
"o1-2024-12-17",
"o1-preview",
"o1-preview-2024-09-12",
"o1-mini",
"o1-mini-2024-09-12",
"gpt-4o",
"gpt-4o-2024-11-20",
"gpt-4o-2024-08-06",
"gpt-4o-2024-05-13",
"gpt-4o-audio-preview",
"gpt-4o-audio-preview-2024-10-01",
"gpt-4o-audio-preview-2024-12-17",
"gpt-4o-audio-preview-2025-06-03",
"gpt-4o-mini-audio-preview",
"gpt-4o-mini-audio-preview-2024-12-17",
"gpt-4o-search-preview",
"gpt-4o-mini-search-preview",
"gpt-4o-search-preview-2025-03-11",
"gpt-4o-mini-search-preview-2025-03-11",
"chatgpt-4o-latest",
"codex-mini-latest",
"gpt-4o-mini",
"gpt-4o-mini-2024-07-18",
"gpt-4-turbo",
"gpt-4-turbo-2024-04-09",
"gpt-4-0125-preview",
"gpt-4-turbo-preview",
"gpt-4-1106-preview",
"gpt-4-vision-preview",
"gpt-4",
"gpt-4-0314",
"gpt-4-0613",
"gpt-4-32k",
"gpt-4-32k-0314",
"gpt-4-32k-0613",
"gpt-3.5-turbo",
"gpt-3.5-turbo-16k",
"gpt-3.5-turbo-0301",
"gpt-3.5-turbo-0613",
"gpt-3.5-turbo-1106",
"gpt-3.5-turbo-0125",
"gpt-3.5-turbo-16k-0613"
]
}
]
},
"ModelResponseProperties": {
"type": "object",
"properties": {
"metadata": {
"$ref": "#/$defs/Metadata"
},
"top_logprobs": {
"anyOf": [
{
"description": "An integer between 0 and 20 specifying the maximum number of most likely\ntokens to return at each token position, each with an associated log\nprobability. In some cases, the number of returned tokens may be fewer than\nrequested.\n",
"type": "integer",
"minimum": 0,
"maximum": 20
},
{
"type": "null"
}
]
},
"temperature": {
"anyOf": [
{
"type": "number",
"minimum": 0,
"maximum": 2,
"default": 1,
"example": 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.\nWe generally recommend altering this or `top_p` but not both.\n"
},
{
"type": "null"
}
]
},
"top_p": {
"anyOf": [
{
"type": "number",
"minimum": 0,
"maximum": 1,
"default": 1,
"example": 1,
"description": "An alternative to sampling with temperature, called nucleus sampling,\nwhere the model considers the results of the tokens with top_p probability\nmass. So 0.1 means only the tokens comprising the top 10% probability mass\nare considered.\n\nWe generally recommend altering this or `temperature` but not both.\n"
},
{
"type": "null"
}
]
},
"user": {
"type": "string",
"example": "user-1234",
"deprecated": true,
"description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\nA stable identifier for your end-users.\nUsed to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).\n"
},
"safety_identifier": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"example": "safety-identifier-1234",
"description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\nThe IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).\n"
},
{
"type": "null"
}
]
},
"prompt_cache_key": {
"anyOf": [
{
"type": "string",
"example": "prompt-cache-key-1234",
"description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching).\n"
},
{
"type": "null"
}
]
},
"service_tier": {
"$ref": "#/$defs/ServiceTier"
},
"prompt_cache_retention": {
"deprecated": true,
"anyOf": [
{
"type": "string",
"enum": [
"in_memory",
"24h"
],
"description": "Deprecated. Use `prompt_cache_options.ttl` instead.\n\nThe retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](/docs/guides/prompt-caching#prompt-cache-retention).\nThis field expresses a maximum retention policy, while\n`prompt_cache_options.ttl` expresses a minimum cache lifetime. The two\nfields are independent and do not interact.\nFor `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported.\n\nFor older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy:\n - Organizations without ZDR enabled default to `24h`.\n - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified.\n"
},
{
"type": "null"
}
]
}
}
},
"ModerationConfigParam": {
"properties": {
"mode": {
"$ref": "#/$defs/ModerationMode"
}
},
"type": "object",
"required": [
"mode"
],
"description": "The moderation policy for the response input."
},
"ModerationMode": {
"type": "string",
"enum": [
"score",
"block"
]
},
"ModerationParam": {
"properties": {
"model": {
"type": "string",
"description": "The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'."
},
"policy": {
"anyOf": [
{
"$ref": "#/$defs/ModerationPolicyParam",
"description": "The policy to apply to moderated response input and output."
},
{
"type": "null"
}
]
}
},
"type": "object",
"required": [
"model"
],
"description": "Configuration for running moderation on the input and output of this response."
},
"ModerationPolicyParam": {
"properties": {
"input": {
"anyOf": [
{
"$ref": "#/$defs/ModerationConfigParam",
"description": "The moderation policy for the response input."
},
{
"type": "null"
}
]
},
"output": {
"anyOf": [
{
"$ref": "#/$defs/ModerationConfigParam",
"description": "The moderation policy for the response output."
},
{
"type": "null"
}
]
}
},
"type": "object",
"required": [],
"description": "The policy to apply to moderated response input and output."
},
"ParallelToolCalls": {
"description": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.",
"type": "boolean",
"default": true
},
"PredictionContent": {
"type": "object",
"title": "Static Content",
"description": "Static predicted output content, such as the content of a text file that is\nbeing regenerated.\n",
"required": [
"type",
"content"
],
"properties": {
"type": {
"type": "string",
"enum": [
"content"
],
"description": "The type of the predicted content you want to provide. This type is\ncurrently always `content`.\n",
"x-stainless-const": true
},
"content": {
"description": "The content that should be matched when generating a model response.\nIf generated tokens would match this content, the entire model response\ncan be returned much more quickly.\n",
"oneOf": [
{
"type": "string",
"title": "Text content",
"description": "The content used for a Predicted Output. This is often the\ntext of a file you are regenerating with minor changes.\n"
},
{
"type": "array",
"description": "An array of content parts with a defined type. Supported options differ based on the [model](/docs/models) being used to generate the response. Can contain text inputs.",
"title": "Array of content parts",
"items": {
"$ref": "#/$defs/ChatCompletionRequestMessageContentPartText"
},
"minItems": 1
}
]
}
}
},
"PromptCacheBreakpointParam": {
"properties": {
"mode": {
"type": "string",
"enum": [
"explicit"
],
"description": "The breakpoint mode. Always `explicit`.",
"default": "explicit",
"x-stainless-const": true
}
},
"type": "object",
"required": [
"mode"
],
"title": "Prompt cache breakpoint",
"description": "Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block."
},
"PromptCacheModeEnum": {
"type": "string",
"enum": [
"implicit",
"explicit"
]
},
"PromptCacheOptionsParam": {
"properties": {
"ttl": {
"$ref": "#/$defs/PromptCacheTTLEnum",
"description": "The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to `30m`, which is currently the only supported value. The backend may retain cache entries for longer."
},
"mode": {
"$ref": "#/$defs/PromptCacheModeEnum",
"description": "Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint and writes up to the latest three explicit breakpoints in the request. With `explicit`, OpenAI does not create an implicit breakpoint and writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request does not use prompt caching."
}
},
"type": "object",
"required": [],
"title": "Prompt cache options",
"description": "Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](/docs/guides/prompt-caching) for current details."
},
"PromptCacheTTLEnum": {
"type": "string",
"enum": [
"30m"
]
},
"ReasoningEffort": {
"anyOf": [
{
"type": "string",
"enum": [
"none",
"minimal",
"low",
"medium",
"high",
"xhigh",
"max"
],
"default": "medium",
"description": "Constrains effort on reasoning for reasoning models. Currently supported\nvalues are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.\nReducing reasoning effort can result in faster responses and fewer tokens\nused on reasoning in a response. Not all reasoning models support every\nvalue. See the\n[reasoning guide](https://platform.openai.com/docs/guides/reasoning)\nfor model-specific support.\n"
},
{
"type": "null"
}
]
},
"ResponseFormatJsonObject": {
"type": "object",
"title": "JSON object",
"description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.\n",
"properties": {
"type": {
"type": "string",
"description": "The type of response format being defined. Always `json_object`.",
"enum": [
"json_object"
],
"x-stainless-const": true
}
},
"required": [
"type"
]
},
"ResponseFormatJsonSchema": {
"type": "object",
"title": "JSON schema",
"description": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).\n",
"properties": {
"type": {
"type": "string",
"description": "The type of response format being defined. Always `json_schema`.",
"enum": [
"json_schema"
],
"x-stainless-const": true
},
"json_schema": {
"type": "object",
"title": "JSON schema",
"description": "Structured Outputs configuration options, including a JSON Schema.\n",
"properties": {
"description": {
"type": "string",
"description": "A description of what the response format is for, used by the model to\ndetermine how to respond in the format.\n"
},
"name": {
"type": "string",
"description": "The name of the response format. Must be a-z, A-Z, 0-9, or contain\nunderscores and dashes, with a maximum length of 64.\n"
},
"schema": {
"$ref": "#/$defs/ResponseFormatJsonSchemaSchema"
},
"strict": {
"anyOf": [
{
"type": "boolean",
"default": false,
"description": "Whether to enable strict schema adherence when generating the output.\nIf set to true, the model will always follow the exact schema defined\nin the `schema` field. Only a subset of JSON Schema is supported when\n`strict` is `true`. To learn more, read the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n"
},
{
"type": "null"
}
]
}
},
"required": [
"name"
]
}
},
"required": [
"type",
"json_schema"
]
},
"ResponseFormatJsonSchemaSchema": {
"type": "object",
"title": "JSON schema",
"description": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).\n",
"additionalProperties": true
},
"ResponseFormatText": {
"type": "object",
"title": "Text",
"description": "Default response format. Used to generate text responses.\n",
"properties": {
"type": {
"type": "string",
"description": "The type of response format being defined. Always `text`.",
"enum": [
"text"
],
"x-stainless-const": true
}
},
"required": [
"type"
]
},
"ResponseModalities": {
"anyOf": [
{
"type": "array",
"description": "Output types that you would like the model to generate.\nMost models are capable of generating text, which is the default:\n\n`[\"text\"]`\n\nThe `gpt-4o-audio-preview` model can also be used to\n[generate audio](/docs/guides/audio). To request that this model generate\nboth text and audio responses, you can use:\n\n`[\"text\", \"audio\"]`\n",
"items": {
"type": "string",
"enum": [
"text",
"audio"
]
}
},
{
"type": "null"
}
]
},
"ServiceTier": {
"anyOf": [
{
"type": "string",
"description": "Specifies the processing type used for serving the request.\n - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.\n - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.\n - If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier.\n - When not set, the default behavior is 'auto'.\n\n When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.\n",
"enum": [
"auto",
"default",
"flex",
"scale",
"priority"
],
"default": "auto"
},
{
"type": "null"
}
]
},
"StopConfiguration": {
"description": "Not supported with latest reasoning models `o3` and `o4-mini`.\n\nUp to 4 sequences where the API will stop generating further tokens. The\nreturned text will not contain the stop sequence.\n",
"default": null,
"nullable": true,
"oneOf": [
{
"type": "string",
"default": "<|endoftext|>",
"example": "\n",
"nullable": true
},
{
"type": "array",
"minItems": 1,
"maxItems": 4,
"items": {
"type": "string",
"example": "[\"\\n\"]"
}
}
]
},
"Verbosity": {
"anyOf": [
{
"type": "string",
"enum": [
"low",
"medium",
"high"
],
"default": "medium",
"description": "Constrains the verbosity of the model's response. Lower values will result in\nmore concise responses, while higher values will result in more verbose responses.\nCurrently supported values are `low`, `medium`, and `high`. The default is\n`medium`.\n"
},
{
"type": "null"
}
]
},
"VoiceIdsOrCustomVoice": {
"title": "Voice",
"description": "A built-in voice name or a custom voice reference.\n",
"anyOf": [
{
"$ref": "#/$defs/VoiceIdsShared"
},
{
"type": "object",
"description": "Custom voice reference.",
"additionalProperties": false,
"required": [
"id"
],
"properties": {
"id": {
"type": "string",
"description": "The custom voice ID, e.g. `voice_1234`.",
"example": "voice_1234"
}
}
}
]
},
"VoiceIdsShared": {
"example": "ash",
"anyOf": [
{
"type": "string"
},
{
"type": "string",
"enum": [
"alloy",
"ash",
"ballad",
"coral",
"echo",
"sage",
"shimmer",
"verse",
"marin",
"cedar"
]
}
]
},
"WebSearchContextSize": {
"type": "string",
"description": "High level guidance for the amount of context window space to use for the \nsearch. One of `low`, `medium`, or `high`. `medium` is the default.\n",
"enum": [
"low",
"medium",
"high"
],
"default": "medium"
},
"WebSearchLocation": {
"type": "object",
"title": "Web search location",
"description": "Approximate location parameters for the search.",
"properties": {
"country": {
"type": "string",
"description": "The two-letter \n[ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user,\ne.g. `US`.\n"
},
"region": {
"type": "string",
"description": "Free text input for the region of the user, e.g. `California`.\n"
},
"city": {
"type": "string",
"description": "Free text input for the city of the user, e.g. `San Francisco`.\n"
},
"timezone": {
"type": "string",
"description": "The [IANA timezone](https://timeapi.io/documentation/iana-timezones) \nof the user, e.g. `America/Los_Angeles`.\n"
}
}
}
}
}
}Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"openai","endpointId":"chat/completions","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}