{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/secureai-one/json-schema/secureai-one-chat-request-schema.json",
  "title": "ChatRequest",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/secureai-one-openapi.json#/components/schemas/ChatRequest",
  "type": "object",
  "required": [
    "messages"
  ],
  "properties": {
    "model": {
      "type": "string",
      "description": "Required on the proxy; optional on /chat/completions."
    },
    "messages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "system",
              "developer",
              "user",
              "assistant",
              "tool"
            ]
          },
          "content": {
            "type": [
              "string",
              "null"
            ]
          },
          "tool_calls": {
            "type": "array",
            "description": "An assistant turn's earlier tool calls, as you received them.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "function"
                  ]
                },
                "function": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "arguments": {
                      "type": "string",
                      "description": "JSON"
                    }
                  }
                }
              }
            }
          },
          "tool_call_id": {
            "type": "string",
            "description": "On a role \"tool\" message: the call it answers."
          }
        }
      }
    },
    "stream": {
      "type": "boolean",
      "default": false
    },
    "map": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "allow": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "strict": {
      "type": "boolean",
      "default": false
    },
    "tools": {
      "type": "array",
      "description": "/chat/completions only. Functions the model may call; calls come back with real values in their arguments, decided by the account's policy.",
      "items": {
        "type": "object",
        "required": [
          "type",
          "function"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "function"
            ]
          },
          "function": {
            "type": "object",
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "pattern": "^[a-zA-Z0-9_-]{1,64}$"
              },
              "description": {
                "type": "string"
              },
              "parameters": {
                "type": "object",
                "description": "JSON Schema for the arguments"
              }
            }
          }
        }
      }
    },
    "tool_choice": {
      "description": "\"auto\", \"none\", \"required\", or {\"type\":\"function\",\"function\":{\"name\":...}}",
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "auto",
            "none",
            "required"
          ]
        },
        {
          "type": "object"
        }
      ]
    }
  }
}