{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/api-stock-com/json-schema/api-stock-com-chat-completion-request-dto-schema.json",
  "title": "ChatCompletionRequestDto",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/api-stock-com-openapi.json#/components/schemas/ChatCompletionRequestDto",
  "type": "object",
  "properties": {
    "model": {
      "type": "string",
      "description": "Model id"
    },
    "messages": {
      "description": "Conversation messages",
      "type": "array",
      "items": {
        "$ref": "#/$defs/ChatMessageDto"
      }
    },
    "stream": {
      "type": "boolean",
      "description": "Stream partial deltas as server-sent events",
      "default": false
    },
    "temperature": {
      "type": "number",
      "description": "Sampling temperature (0-2)"
    },
    "top_p": {
      "type": "number",
      "description": "Nucleus sampling probability"
    },
    "max_tokens": {
      "type": "number",
      "description": "Maximum tokens to generate"
    },
    "max_completion_tokens": {
      "type": "number",
      "description": "Alias for max_tokens; capped by API Stock"
    },
    "n": {
      "type": "number",
      "description": "Number of completions. API Stock currently supports one.",
      "default": 1,
      "maximum": 1
    }
  },
  "required": [
    "model",
    "messages"
  ],
  "$defs": {
    "ChatMessageDto": {
      "type": "object",
      "properties": {
        "role": {
          "type": "string",
          "description": "Role of the message author"
        },
        "content": {
          "type": "object",
          "description": "Message content. Either a string or an array of content parts (multimodal)."
        },
        "name": {
          "type": "string",
          "description": "Optional author name"
        }
      },
      "required": [
        "role",
        "content"
      ]
    }
  }
}