{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/compoid-com/json-schema/compoid-com-anthropic-messages-request-schema.json",
  "title": "AnthropicMessagesRequest",
  "description": "Anthropic Messages API request.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/compoid-com-openapi.yml#/components/schemas/AnthropicMessagesRequest",
  "properties": {
    "model": {
      "type": "string",
      "title": "Model"
    },
    "messages": {
      "items": {
        "$ref": "#/$defs/AnthropicMessage"
      },
      "type": "array",
      "title": "Messages"
    },
    "max_tokens": {
      "type": "integer",
      "title": "Max Tokens"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Metadata"
    },
    "output_config": {
      "anyOf": [
        {
          "$ref": "#/$defs/AnthropicOutputConfig"
        },
        {
          "type": "null"
        }
      ]
    },
    "thinking": {
      "anyOf": [
        {
          "oneOf": [
            {
              "$ref": "#/$defs/AnthropicThinkingConfigEnabled"
            },
            {
              "$ref": "#/$defs/AnthropicThinkingConfigDisabled"
            },
            {
              "$ref": "#/$defs/AnthropicThinkingConfigAdaptive"
            }
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Thinking"
    },
    "stop_sequences": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 4
        },
        {
          "type": "null"
        }
      ],
      "title": "Stop Sequences"
    },
    "stream": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Stream",
      "default": false
    },
    "system": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "$ref": "#/$defs/AnthropicContentBlock"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "System"
    },
    "temperature": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Temperature"
    },
    "tool_choice": {
      "anyOf": [
        {
          "$ref": "#/$defs/AnthropicToolChoice"
        },
        {
          "type": "null"
        }
      ]
    },
    "tools": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/AnthropicTool"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Tools"
    },
    "top_k": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Top K"
    },
    "top_p": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Top P"
    },
    "mm_payload": {
      "type": "string",
      "enum": [
        "tensors",
        "none"
      ],
      "title": "Mm Payload",
      "description": "What the render response's `features` carry for multimodal items. 'tensors' serializes the processed tensors into `kwargs_data` and `mm_metadata`. 'none' sets both to null for callers that need only the token layout and item hashes, such as cache-aware routers. Do not send a 'none' response to `/inference/v1/generate` which reads a null `kwargs_data` as every item being cached. Only supported on the render endpoints. Ignored on regular generation endpoints.",
      "default": "tensors"
    },
    "return_mm_kwargs": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Return Mm Kwargs",
      "description": "Deprecated alias: false is the same as `mm_payload='none'`. Ignored when `mm_payload` is set.",
      "deprecated": true
    },
    "cache_salt": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 1024,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Cache Salt",
      "description": "If specified, the prefix cache will be salted with the provided string to prevent an attacker to guess prompts in multi-user environments. The salt should be random, protected from access by 3rd parties, and long enough to be unpredictable (e.g., 43 characters base64-encoded, corresponding to 256 bit)."
    },
    "watermarking": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Watermarking",
      "description": "Whether to apply the engine's configured watermark to this request."
    },
    "kv_transfer_params": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Kv Transfer Params",
      "description": "KVTransfer parameters used for disaggregated serving."
    },
    "ec_transfer_params": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Ec Transfer Params",
      "description": "ECTransfer parameters used for encoder-cache disaggregated serving."
    },
    "vllm_xargs": {
      "anyOf": [
        {
          "additionalProperties": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "integer"
                    },
                    {
                      "type": "number"
                    }
                  ]
                },
                "type": "array"
              }
            ]
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Vllm Xargs",
      "description": "Additional request parameters with (list of) string or numeric values, used by custom extensions."
    },
    "chat_template_kwargs": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Chat Template Kwargs",
      "description": "Additional keyword args to pass to the chat template renderer. Will be accessible by the template."
    }
  },
  "type": "object",
  "required": [
    "model",
    "messages",
    "max_tokens"
  ],
  "$defs": {
    "AnthropicContentBlock": {
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "text",
            "image",
            "tool_use",
            "tool_result",
            "tool_reference",
            "thinking",
            "redacted_thinking",
            "tool_addition",
            "tool_removal"
          ],
          "title": "Type"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Text"
        },
        "source": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Id"
        },
        "tool_use_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool Use Id"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name"
        },
        "input": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Input"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content"
        },
        "is_error": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Is Error"
        },
        "tool_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool Name"
        },
        "thinking": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Thinking"
        },
        "signature": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Signature"
        },
        "data": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Data"
        },
        "tool": {
          "anyOf": [
            {
              "oneOf": [
                {
                  "$ref": "#/$defs/AnthropicToolChangeReference"
                },
                {
                  "$ref": "#/$defs/AnthropicToolChangeDefinition"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool"
        }
      },
      "type": "object",
      "required": [
        "type"
      ],
      "title": "AnthropicContentBlock",
      "description": "Content block in message."
    },
    "AnthropicJsonOutputFormat": {
      "properties": {
        "schema": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Schema"
        },
        "type": {
          "type": "string",
          "const": "json_schema",
          "title": "Type",
          "default": "json_schema"
        }
      },
      "type": "object",
      "title": "AnthropicJsonOutputFormat",
      "description": "JSON output format configuration."
    },
    "AnthropicMessage": {
      "properties": {
        "role": {
          "type": "string",
          "enum": [
            "user",
            "assistant",
            "system"
          ],
          "title": "Role"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "$ref": "#/$defs/AnthropicContentBlock"
              },
              "type": "array"
            }
          ],
          "title": "Content"
        }
      },
      "type": "object",
      "required": [
        "role",
        "content"
      ],
      "title": "AnthropicMessage",
      "description": "Message structure."
    },
    "AnthropicOutputConfig": {
      "properties": {
        "effort": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "low",
                "medium",
                "high",
                "xhigh",
                "max"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Effort"
        },
        "format": {
          "anyOf": [
            {
              "$ref": "#/$defs/AnthropicJsonOutputFormat"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object",
      "title": "AnthropicOutputConfig",
      "description": "Configuration options for the model's output, such as the output format."
    },
    "AnthropicThinkingConfigAdaptive": {
      "properties": {
        "type": {
          "type": "string",
          "const": "adaptive",
          "title": "Type"
        },
        "display": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "summarized",
                "omitted",
                "updates"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Display"
        }
      },
      "type": "object",
      "required": [
        "type"
      ],
      "title": "AnthropicThinkingConfigAdaptive",
      "description": "Extended thinking whose depth the model chooses.\n\n``display`` is accepted but ignored: reasoning is always returned."
    },
    "AnthropicThinkingConfigDisabled": {
      "properties": {
        "type": {
          "type": "string",
          "const": "disabled",
          "title": "Type"
        }
      },
      "type": "object",
      "required": [
        "type"
      ],
      "title": "AnthropicThinkingConfigDisabled"
    },
    "AnthropicThinkingConfigEnabled": {
      "properties": {
        "type": {
          "type": "string",
          "const": "enabled",
          "title": "Type"
        },
        "budget_tokens": {
          "type": "integer",
          "minimum": 1024.0,
          "title": "Budget Tokens"
        },
        "display": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "summarized",
                "omitted",
                "updates"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Display"
        }
      },
      "type": "object",
      "required": [
        "type",
        "budget_tokens"
      ],
      "title": "AnthropicThinkingConfigEnabled",
      "description": "Extended thinking with a fixed token budget.\n\n``display`` is accepted but ignored: reasoning is always returned."
    },
    "AnthropicTool": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description"
        },
        "input_schema": {
          "additionalProperties": true,
          "type": "object",
          "title": "Input Schema"
        },
        "strict": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Strict"
        },
        "defer_loading": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Defer Loading"
        }
      },
      "type": "object",
      "required": [
        "name",
        "input_schema"
      ],
      "title": "AnthropicTool",
      "description": "Tool definition."
    },
    "AnthropicToolChangeDefinition": {
      "properties": {
        "type": {
          "type": "string",
          "const": "tool_definition",
          "title": "Type"
        },
        "definition": {
          "$ref": "#/$defs/AnthropicTool"
        }
      },
      "type": "object",
      "required": [
        "type",
        "definition"
      ],
      "title": "AnthropicToolChangeDefinition",
      "description": "A tool defined by value in a tool_addition block."
    },
    "AnthropicToolChangeReference": {
      "properties": {
        "type": {
          "type": "string",
          "const": "tool_reference",
          "title": "Type"
        },
        "name": {
          "type": "string",
          "title": "Name"
        }
      },
      "type": "object",
      "required": [
        "type",
        "name"
      ],
      "title": "AnthropicToolChangeReference",
      "description": "A tool named by a tool_addition or tool_removal block."
    },
    "AnthropicToolChoice": {
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "auto",
            "any",
            "tool",
            "none"
          ],
          "title": "Type"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name"
        },
        "disable_parallel_tool_use": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Disable Parallel Tool Use"
        }
      },
      "type": "object",
      "required": [
        "type"
      ],
      "title": "AnthropicToolChoice",
      "description": "Tool Choice definition."
    }
  }
}