{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/clipia-ai/json-schema/clipia-ai-chat-completion-request-schema.json",
  "title": "ChatCompletionRequest",
  "description": "Подмножество OpenAI chat-запроса; остальные поля OpenAI-формата принимаются и игнорируются.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/clipia-ai-openapi.yml#/components/schemas/ChatCompletionRequest",
  "type": "object",
  "required": [
    "model",
    "messages"
  ],
  "additionalProperties": true,
  "properties": {
    "model": {
      "type": "string",
      "description": "Slug LLM-модели из `GET /v1/models`."
    },
    "messages": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "system",
              "user",
              "assistant",
              "tool"
            ]
          },
          "content": {
            "description": "Строка либо массив частей (text / image_url)."
          },
          "name": {
            "type": "string"
          },
          "tool_call_id": {
            "type": "string"
          }
        }
      }
    },
    "stream": {
      "type": "boolean",
      "default": false
    },
    "temperature": {
      "type": "number"
    },
    "top_p": {
      "type": "number"
    },
    "max_tokens": {
      "type": "integer"
    },
    "max_completion_tokens": {
      "type": "integer"
    },
    "n": {
      "type": "integer"
    },
    "seed": {
      "type": "integer"
    },
    "stop": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ]
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "tool_choice": {},
    "response_format": {
      "type": "object"
    },
    "reasoning_effort": {
      "type": "string"
    },
    "stream_options": {
      "type": "object",
      "properties": {
        "include_usage": {
          "type": "boolean"
        }
      }
    },
    "user": {
      "type": "string"
    }
  }
}