{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/stremai-com/json-schema/stremai-com-chat-completion-request-schema.json",
  "title": "ChatCompletionRequest",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stremai-com-openapi.json#/components/schemas/ChatCompletionRequest",
  "properties": {
    "model": {
      "type": "string",
      "title": "Model"
    },
    "messages": {
      "items": {
        "$ref": "#/$defs/ChatMessage"
      },
      "type": "array",
      "title": "Messages"
    },
    "temperature": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Temperature"
    },
    "top_p": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Top P"
    },
    "n": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "N",
      "default": 1
    },
    "stream": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Stream",
      "default": false
    },
    "stop": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Stop"
    },
    "max_tokens": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Tokens"
    },
    "presence_penalty": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Presence Penalty"
    },
    "frequency_penalty": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Frequency Penalty"
    },
    "logit_bias": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "number"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Logit Bias"
    },
    "user": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "User"
    },
    "tools": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/ToolDef"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Tools"
    },
    "tool_choice": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Tool Choice"
    },
    "response_format": {
      "anyOf": [
        {
          "$ref": "#/$defs/ResponseFormat"
        },
        {
          "type": "null"
        }
      ]
    },
    "seed": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Seed"
    }
  },
  "additionalProperties": true,
  "type": "object",
  "required": [
    "model",
    "messages"
  ],
  "$defs": {
    "ChatMessage": {
      "properties": {
        "role": {
          "type": "string",
          "title": "Role"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {},
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name"
        },
        "tool_calls": {
          "anyOf": [
            {
              "items": {},
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool Calls"
        },
        "tool_call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool Call Id"
        }
      },
      "type": "object",
      "required": [
        "role"
      ],
      "title": "ChatMessage"
    },
    "FunctionDef": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description"
        },
        "parameters": {
          "anyOf": [
            {
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Parameters"
        }
      },
      "type": "object",
      "required": [
        "name"
      ],
      "title": "FunctionDef"
    },
    "ResponseFormat": {
      "properties": {
        "type": {
          "type": "string",
          "title": "Type",
          "default": "text"
        }
      },
      "type": "object",
      "title": "ResponseFormat"
    },
    "ToolDef": {
      "properties": {
        "type": {
          "type": "string",
          "title": "Type",
          "default": "function"
        },
        "function": {
          "$ref": "#/$defs/FunctionDef"
        }
      },
      "type": "object",
      "required": [
        "function"
      ],
      "title": "ToolDef"
    }
  }
}