{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sandbase-ai/json-schema/sandbase-ai-chat-completion-request-schema.json",
  "title": "ChatCompletionRequest",
  "description": "OpenAI-compatible request. Additional provider-compatible fields are forwarded when supported by the selected route.",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sandbase-ai-openapi.json#/components/schemas/ChatCompletionRequest",
  "type": "object",
  "required": [
    "model",
    "messages"
  ],
  "additionalProperties": true,
  "properties": {
    "model": {
      "type": "string",
      "description": "Model identifier"
    },
    "messages": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "role"
        ],
        "additionalProperties": true,
        "properties": {
          "role": {
            "type": "string",
            "description": "Message role supported by the selected provider, such as system, developer, user, assistant, or tool."
          },
          "content": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "tool_calls": {
            "type": "array"
          },
          "tool_call_id": {
            "type": "string"
          }
        }
      }
    },
    "temperature": {
      "type": "number",
      "minimum": 0,
      "maximum": 2,
      "default": 1
    },
    "top_p": {
      "type": "number"
    },
    "max_tokens": {
      "type": "integer"
    },
    "stream": {
      "type": "boolean",
      "default": false
    },
    "stop": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ]
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "mcp_servers": {
      "type": "array",
      "maxItems": 20,
      "items": {
        "$ref": "#/$defs/MCPServer"
      }
    },
    "tool_choice": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "object"
        }
      ]
    },
    "parallel_tool_calls": {
      "type": "boolean"
    },
    "user": {
      "type": "string"
    },
    "response_format": {
      "type": "object"
    },
    "reasoning_effort": {
      "type": "string",
      "description": "Provider-compatible reasoning effort setting."
    },
    "reasoning": {
      "type": "object",
      "additionalProperties": true,
      "description": "Reasoning configuration; common fields include effort and max_tokens."
    },
    "thinking": {
      "type": "object",
      "additionalProperties": true,
      "description": "Thinking configuration; common fields include type and budget_tokens."
    },
    "extra_body": {
      "type": "object",
      "additionalProperties": true,
      "description": "Provider-specific parameters used when SandBase translates the request between protocols."
    },
    "n": {
      "type": "integer",
      "default": 1
    },
    "presence_penalty": {
      "type": "number"
    },
    "frequency_penalty": {
      "type": "number"
    },
    "stream_options": {
      "type": "object",
      "properties": {
        "include_usage": {
          "type": "boolean"
        }
      }
    }
  },
  "$defs": {
    "MCPServer": {
      "type": "object",
      "required": [
        "name",
        "type",
        "url"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "type": {
          "type": "string",
          "enum": [
            "url"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  }
}