{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hud-ai/json-schema/hud-ai-completion-request-schema.json",
  "title": "CompletionRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hud-ai-completions-api-openapi.yml#/components/schemas/CompletionRequest",
  "properties": {
    "model": {
      "type": "string",
      "title": "Model"
    },
    "messages": {
      "items": {
        "$ref": "#/$defs/ChatMessage"
      },
      "type": "array",
      "title": "Messages"
    },
    "max_tokens": {
      "type": "integer",
      "maximum": 16384.0,
      "minimum": 1.0,
      "title": "Max Tokens",
      "default": 4000
    }
  },
  "type": "object",
  "required": [
    "model",
    "messages"
  ],
  "$defs": {
    "ChatMessage": {
      "properties": {
        "role": {
          "type": "string",
          "title": "Role"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "type": "array"
            }
          ],
          "title": "Content"
        }
      },
      "type": "object",
      "required": [
        "role",
        "content"
      ],
      "title": "ChatMessage"
    }
  }
}