{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/topxea-com/json-schema/topxea-com-messages-request-schema.json",
  "title": "MessagesRequest",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ai.topxea.com-openapi.json#/components/schemas/MessagesRequest",
  "type": "object",
  "required": [
    "model",
    "messages"
  ],
  "properties": {
    "model": {
      "$ref": "#/$defs/TextModel"
    },
    "max_tokens": {
      "type": "integer",
      "description": "Without it, Claude and DeepSeek get the model's output limit and the other models are sent no cap."
    },
    "messages": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant"
            ]
          },
          "content": {}
        },
        "additionalProperties": true
      }
    },
    "system": {
      "description": "A system prompt as a string or content blocks. TopxAI adds none of its own, except that a gpt-6.1-sol request without one is sent the instructions \"You are a helpful assistant.\" so the provider does not add its own longer prompt.",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true
          }
        }
      ]
    },
    "stream": {
      "type": "boolean"
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "temperature": {
      "type": "number"
    },
    "thinking": {
      "type": "object",
      "additionalProperties": true
    }
  },
  "additionalProperties": true,
  "$defs": {
    "TextModel": {
      "type": "string",
      "description": "A catalogue text model.",
      "enum": [
        "claude-fable-5-1",
        "claude-sonnet-5-5",
        "claude-opus-5-5",
        "gpt-6-astra",
        "gpt-6.1-sol",
        "grok-4.7",
        "GLM-5.3-Abliterated",
        "kimi-k3.1-pro",
        "deepseek-flash-Abliterated"
      ]
    }
  }
}