{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trajectory/json-schema/trajectory-chat-completion-request-schema.json",
  "title": "ChatCompletionRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trajectory-inference-api-openapi.yml#/components/schemas/ChatCompletionRequest",
  "properties": {
    "model": {
      "type": "string",
      "title": "Model"
    },
    "messages": {
      "items": {
        "$ref": "#/$defs/ChatMessage"
      },
      "type": "array",
      "title": "Messages"
    },
    "stream": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Stream",
      "default": false
    },
    "disable_thinking": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Disable Thinking"
    },
    "temperature": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Temperature"
    },
    "max_tokens": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Tokens",
      "description": "Maximum generated tokens, including reasoning tokens when emitted."
    },
    "top_p": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Top P"
    }
  },
  "additionalProperties": true,
  "type": "object",
  "required": [
    "model",
    "messages"
  ],
  "$defs": {
    "ChatMessage": {
      "properties": {
        "role": {
          "type": "string",
          "title": "Role"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "role"
      ],
      "title": "ChatMessage"
    }
  }
}