﻿{
  "openapi": "3.1.1",
  "info": {
    "title": "LM-Kit One",
    "description": "The REST surface of LM-Kit One. How Search access works (clusters, tenants, collections, keys, and grants) is covered in the [guides](/guides).",
    "version": "2026.8.10"
  },
  "paths": {
    "/v1/chat/completions": {
      "post": {
        "tags": [
          "OpenAI · Chat"
        ],
        "summary": "Generates a chat completion based on the provided conversation history.",
        "description": "When streaming is enabled, the response will be sent as a server-sent event (SSE) stream of ChatCompletionChunkResponse objects; otherwise, a single JSON ChatCompletionResponse is returned. The endpoint produces two types of responses:\n\n• application/json: A non-streaming response containing a single ChatCompletionResponse object.\n\n• text/event-stream: A streaming response in which each event contains a ChatCompletionChunkResponse object.\n\nThis endpoint implements the OpenAI chat completion API specification, including tool/function calling support. For complete reference, please see the official OpenAI documentation: https://platform.openai.com/docs/api-reference/chat/create\n\nStructured output: response_format with type json_object or json_schema is enforced through grammar-constrained decoding, so the completion is guaranteed to match the requested shape. Usage: every non-streaming response carries a usage block (with a reasoning-token breakdown on reasoning models); streaming requests receive it in a final pre-[DONE] chunk when stream_options.include_usage is set.\n\nLM-Kit extensions: the request also accepts 'agent', 'skill', 'skill_inputs', 'server_tools', 'memory' and 'memory_store', adopting the server-defined assets the admin panel manages with the same semantics as the native lmkit/v1/chat contract. OpenAI SDKs pass them through extra_body; requests that omit them behave exactly as the plain OpenAI specification.",
        "requestBody": {
          "description": "The chat completion request containing conversation history and generation parameters.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenAI.ChatCompletionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/OpenAI.ChatCompletionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAI.ChatCompletionChunkResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAI.ChatCompletionChunkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { },
              "text/event-stream": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/completions": {
      "post": {
        "tags": [
          "OpenAI · Completions (Legacy)"
        ],
        "summary": "Generates a text completion based on the provided prompt.",
        "description": "When streaming is enabled, the response will be sent as a server-sent event (SSE) stream of CompletionChunkResponse objects; otherwise, a single JSON CompletionResponse is returned.\n\nThe endpoint produces two types of responses:\n\n• application/json: A non-streaming response containing a single CompletionResponse object.\n\n• text/event-stream: A streaming response in which each event contains a CompletionChunkResponse object.\n\nThis endpoint implements the OpenAI completions API specification. For complete reference, please see the official OpenAI documentation: https://platform.openai.com/docs/api-reference/completions/create",
        "requestBody": {
          "description": "The text completion request containing prompt and generation parameters.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenAI.CompletionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/OpenAI.CompletionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAI.CompletionChunkResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAI.CompletionChunkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { },
              "text/event-stream": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/embeddings": {
      "post": {
        "tags": [
          "OpenAI · Embeddings"
        ],
        "summary": "Creates an embedding for the provided input.",
        "description": "Generates embeddings for the given input text or array of texts and returns an EmbeddingResponse containing the generated embeddings.\n\nThis endpoint implements the OpenAI embeddings API specification. For complete reference, please see the official OpenAI documentation: https://platform.openai.com/docs/api-reference/embeddings/create\n\nIf processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The embedding request containing the input text or an array of texts.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenAI.EmbeddingRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/OpenAI.EmbeddingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAI.EmbeddingResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/models": {
      "get": {
        "tags": [
          "OpenAI · Models"
        ],
        "summary": "Lists all available models.",
        "description": "Lists the currently available models, providing basic information such as the owner and availability. \n\nThis endpoint implements the OpenAI models listing API specification.For complete reference, see: https://platform.openai.com/docs/api-reference/models/list",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OpenAI.Model"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/models/{modelId}": {
      "get": {
        "tags": [
          "OpenAI · Models"
        ],
        "summary": "Retrieves details for a specific model.",
        "description": "Retrieves a model instance, providing basic information.\n\nThis endpoint implements the OpenAI model retrieval API specification.For complete reference, see: https://platform.openai.com/docs/api-reference/models/retrieve",
        "parameters": [
          {
            "name": "modelId",
            "in": "path",
            "description": "The identifier of the model.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAI.Model"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/files": {
      "post": {
        "tags": [
          "OpenAI · Files"
        ],
        "summary": "Uploads a file.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "file": {
                        "$ref": "#/components/schemas/IFormFile"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "purpose": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/files/{fileId}": {
      "get": {
        "tags": [
          "OpenAI · Files"
        ],
        "summary": "Retrieves a file's metadata.",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/responses": {
      "post": {
        "tags": [
          "OpenAI · Responses"
        ],
        "summary": "Generates a model response using the OpenAI Responses API shape.",
        "description": "OpenAI Responses API endpoint, the wire protocol the newest agentic clients speak (Codex-class tools configure wire_api = \"responses\" and a base_url pointing here).\n\nServed in this version: string and item-array input (messages with input_text, input_image by data URL, http(s) URL or uploaded file_id, input_file by file_id or file_data with document text folded into context, function_call, function_call_output, reasoning passthrough), previous_response_id chaining against stored responses (instructions are not inherited, matching the upstream contract), instructions, flat function tools with tool_choice, the file_search tool against this server's vector stores, structured output through text.format (json_object and json_schema are enforced with grammar-constrained decoding), reasoning output items with real reasoning text on thinking models, usage with a reasoning-token breakdown, and response storage: store defaults to true, GET retrieves, DELETE removes, and GET /{id}/input_items lists a stored response's input.\n\nStreaming follows the documented event scaffold with a monotonic sequence_number: response.created, response.in_progress, response.output_item.added, response.content_part.added, response.output_text.delta*, response.output_text.done, response.content_part.done, response.output_item.done, response.completed.\n\nNot served yet, refused by name rather than silently misinterpreted: conversation objects, background execution, hosted tool types other than file_search, and item_reference.",
        "requestBody": {
          "description": "The Responses API request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenAI.ResponsesRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/OpenAI.ResponsesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAI.ResponsesResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAI.ResponsesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { },
              "text/event-stream": { }
            }
          }
        }
      }
    },
    "/v1/responses/{responseId}": {
      "get": {
        "tags": [
          "OpenAI · Responses"
        ],
        "summary": "Retrieves a stored response.",
        "parameters": [
          {
            "name": "responseId",
            "in": "path",
            "description": "The response identifier (resp_...).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAI.ResponsesResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "OpenAI · Responses"
        ],
        "summary": "Deletes a stored response.",
        "parameters": [
          {
            "name": "responseId",
            "in": "path",
            "description": "The response identifier (resp_...).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/responses/{responseId}/input_items": {
      "get": {
        "tags": [
          "OpenAI · Responses"
        ],
        "summary": "Lists the input items of a stored response.",
        "description": "Returns the effective input the stored response was generated from (a chained prelude already expanded), newest first by default. 'order' (asc|desc), 'after' (item id cursor) and 'limit' (1-100, default 20) page the list.",
        "parameters": [
          {
            "name": "responseId",
            "in": "path",
            "description": "The response identifier (resp_...).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Sort order by insertion position: asc or desc (default).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "Item id cursor: return items after this one.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1-100 (default 20).",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/vector_stores": {
      "post": {
        "tags": [
          "OpenAI · Vector Stores"
        ],
        "summary": "Creates a vector store.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VectorStoresController.CreateVectorStoreRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/VectorStoresController.CreateVectorStoreRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/VectorStoresController.CreateVectorStoreRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "get": {
        "tags": [
          "OpenAI · Vector Stores"
        ],
        "summary": "Lists the caller's vector stores.",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/vector_stores/{storeId}": {
      "get": {
        "tags": [
          "OpenAI · Vector Stores"
        ],
        "summary": "Retrieves a vector store.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "OpenAI · Vector Stores"
        ],
        "summary": "Deletes a vector store and everything indexed in it.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/vector_stores/{storeId}/files": {
      "post": {
        "tags": [
          "OpenAI · Vector Stores"
        ],
        "summary": "Attaches an uploaded file to a vector store, indexing it for retrieval.",
        "description": "The file (from POST /v1/files) is parsed, chunked, and indexed by the managed ingestion pipeline. Embedding runs in the background; a file whose status is still 'in_progress' is already full-text searchable and becomes semantically searchable when embedding completes.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VectorStoresController.AttachFileRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/VectorStoresController.AttachFileRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/VectorStoresController.AttachFileRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/blobs/{digest}": {
      "head": {
        "tags": [
          "Ollama · Models"
        ],
        "summary": "Checks whether a blob exists, by content digest.",
        "description": "Ollama-compatible blob probe. Clients (the ollama CLI included) HEAD each file digest before creating a model and push only the blobs this server lacks.",
        "parameters": [
          {
            "name": "digest",
            "in": "path",
            "description": "The content digest, sha256:<hex>.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Ollama · Models"
        ],
        "summary": "Uploads a blob under its content digest.",
        "description": "Ollama-compatible blob push: the raw request body streams into content-addressed storage and is hashed as it lands; a body whose SHA-256 does not match the declared digest is rejected and leaves nothing behind. Pushed blobs become model artifacts through POST /api/create's files and adapters maps. The request-size ceiling is the server's configured maximum upload size.",
        "parameters": [
          {
            "name": "digest",
            "in": "path",
            "description": "The content digest, sha256:<hex>.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/chat": {
      "post": {
        "tags": [
          "Ollama · Chat"
        ],
        "summary": "Generates a chat completion using the Ollama chat API shape.",
        "description": "Ollama-compatible chat endpoint. Designed to be a drop-in target for clients that speak the Ollama API (Open WebUI, JetBrains AI Assistant, the official Ollama SDKs, ...). Supports text, vision (base64 images), tool calling, structured output via the format field, and both streaming (newline-delimited JSON) and non-streaming responses. Streaming is the default, matching Ollama.\n\nAn empty message list preloads the model without generating; combined with keep_alive: 0 it unloads the model. Other keep_alive values are accepted but standing residency is governed by the server's memory-pressure policy.\n\nReference: https://docs.ollama.com/api#generate-a-chat-completion",
        "requestBody": {
          "description": "The chat request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ollama.OllamaChatRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Ollama.OllamaChatRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ollama.OllamaChatResponse"
                }
              },
              "application/x-ndjson": {
                "schema": {
                  "$ref": "#/components/schemas/Ollama.OllamaChatResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/x-ndjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/x-ndjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { },
              "application/x-ndjson": { }
            }
          }
        }
      }
    },
    "/api/embed": {
      "post": {
        "tags": [
          "Ollama · Embeddings"
        ],
        "summary": "Generates embeddings using the Ollama embed API shape.",
        "description": "Ollama-compatible embeddings endpoint. Accepts a single string or an array of strings and returns one vector per input. Over-long inputs are chunked and mean-pooled by the runtime, so the truncate flag is accepted and ignored.\n\nReference: https://docs.ollama.com/api#generate-embeddings",
        "requestBody": {
          "description": "The embed request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ollama.OllamaEmbedRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Ollama.OllamaEmbedRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ollama.OllamaEmbedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/api/embeddings": {
      "post": {
        "tags": [
          "Ollama · Embeddings"
        ],
        "summary": "Generates one embedding using the legacy Ollama embeddings API shape.",
        "description": "Legacy Ollama embeddings endpoint, superseded by /api/embed but still used by older clients. Takes a single prompt and returns a single vector. An empty prompt returns an empty vector, matching Ollama.",
        "requestBody": {
          "description": "The legacy embeddings request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ollama.OllamaLegacyEmbeddingsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Ollama.OllamaLegacyEmbeddingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ollama.OllamaLegacyEmbeddingsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/api/generate": {
      "post": {
        "tags": [
          "Ollama · Generate"
        ],
        "summary": "Generates a completion for a single prompt using the Ollama generate API shape.",
        "description": "Ollama-compatible generate endpoint: one prompt in, one completion out, with optional system message, base64 images, structured output via the format field, and streaming (newline-delimited JSON) or non-streaming responses. Streaming is the default, matching Ollama.\n\nAn empty prompt preloads the model without generating; combined with keep_alive: 0 it unloads the model. The raw, suffix, template and context fields are not supported and are rejected with a clear error; use /api/chat for multi-turn conversations.\n\nReference: https://docs.ollama.com/api#generate-a-completion",
        "requestBody": {
          "description": "The generate request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ollama.OllamaGenerateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Ollama.OllamaGenerateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ollama.OllamaGenerateResponse"
                }
              },
              "application/x-ndjson": {
                "schema": {
                  "$ref": "#/components/schemas/Ollama.OllamaGenerateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/x-ndjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/x-ndjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { },
              "application/x-ndjson": { }
            }
          }
        }
      }
    },
    "/api/tags": {
      "get": {
        "tags": [
          "Ollama · Models"
        ],
        "summary": "Lists the models this server can serve, in the Ollama tags shape.",
        "description": "Ollama-compatible model listing. Returns the same catalog the OpenAI-compatible /v1/models endpoint exposes, shaped as Ollama tags entries. Models are downloaded on demand at first use, so entries without a local copy are listed too; those omit modified_at.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ollama.OllamaTagsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/show": {
      "post": {
        "tags": [
          "Ollama · Models"
        ],
        "summary": "Describes one model, in the Ollama show shape.",
        "description": "Ollama-compatible model details: structural details, architecture metadata and the capability vocabulary (completion, tools, vision, embedding, thinking). The modelfile, parameters and template fields exist for wire compatibility; LM-Kit models are not built from Modelfiles.",
        "requestBody": {
          "description": "The show request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ollama.OllamaShowRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Ollama.OllamaShowRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ollama.OllamaShowResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/ps": {
      "get": {
        "tags": [
          "Ollama · Models"
        ],
        "summary": "Lists the models currently loaded in memory, in the Ollama ps shape.",
        "description": "Ollama-compatible running-model listing. expires_at is omitted: residency is governed by the server's memory-pressure policy, not a keep-alive timer.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ollama.OllamaPsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/version": {
      "get": {
        "tags": [
          "Ollama · Models"
        ],
        "summary": "Returns the server version, in the Ollama version shape.",
        "description": "Reports the LM-Kit One version. Clients use this endpoint as a liveness probe.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ollama.OllamaVersionResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/pull": {
      "post": {
        "tags": [
          "Ollama · Models"
        ],
        "summary": "Downloads a model, in the Ollama pull shape.",
        "description": "Ollama-compatible model download. Streams newline-delimited progress objects (status, digest, total, completed) and ends with {\"status\":\"success\"}; with stream: false, blocks and returns the terminal object. Pullable names are LM-Kit catalog models and Hugging Face references (hf.co/owner/repo[:quant]), which import as custom models through the server's egress policy with hub-declared digests verified while downloading. The download joins any in-flight download of the same model and continues server-side if the client disconnects.",
        "requestBody": {
          "description": "The pull request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ollama.OllamaPullRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Ollama.OllamaPullRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ollama.OllamaPullProgress"
                }
              },
              "application/x-ndjson": {
                "schema": {
                  "$ref": "#/components/schemas/Ollama.OllamaPullProgress"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/x-ndjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { },
              "application/x-ndjson": { }
            }
          }
        }
      }
    },
    "/api/delete": {
      "delete": {
        "tags": [
          "Ollama · Models"
        ],
        "summary": "Deletes a model's local files, in the Ollama delete shape.",
        "description": "Removes the model's downloaded files from local storage. The catalog entry remains, so the model can be pulled again. A model that is loaded is unloaded first; a model actively serving requests is refused.",
        "requestBody": {
          "description": "The delete request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ollama.OllamaDeleteRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Ollama.OllamaDeleteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/create": {
      "post": {
        "tags": [
          "Ollama · Models"
        ],
        "summary": "Creates a model, in the Ollama create shape.",
        "description": "Ollama-compatible model creation. 'from' derives from a catalog model or an existing custom model (already downloaded); 'files' builds from pushed blobs (a main GGUF plus an optional mmproj entry); 'adapters' attaches LoRA adapter blobs to either form; 'quantize' requantizes the source GGUF into the requested precision, streaming progress while the conversion runs. System/template/parameters/license become the new model's recorded profile, and the created model serves beside the catalog on every listing, marked Unverified.",
        "requestBody": {
          "description": "The create request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ollama.OllamaCreateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Ollama.OllamaCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { },
              "application/x-ndjson": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/x-ndjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/x-ndjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/copy": {
      "post": {
        "tags": [
          "Ollama · Models"
        ],
        "summary": "Copies a model under a new name.",
        "description": "Ollama-compatible model copy: the destination is a new custom model sharing the source's files and profile. Copying never duplicates artifacts on disk.",
        "requestBody": {
          "description": "The copy request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ollama.OllamaCopyRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Ollama.OllamaCopyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/push": {
      "post": {
        "tags": [
          "Ollama · Models"
        ],
        "summary": "Not supported: models cannot be pushed to a registry.",
        "description": "Exists so Ollama clients get a clear error instead of an opaque 404. Publishing runs the other way on this server: models are pulled FROM the hub (hf.co/owner/repo), imported from disk, or built with create; a custom model's artifact path is listed by the admin API for publishing with the hub's own tools.",
        "responses": {
          "501": {
            "description": "Not Implemented"
          }
        }
      }
    },
    "/lmkit/v1/voice-activity-detection": {
      "post": {
        "tags": [
          "Voice Activity Detection"
        ],
        "summary": "Detects the speech regions of an audio or video file (JSON: base64 or file identifier).",
        "description": "Runs the built-in Silero voice-activity-detection model over the audio and returns the time ranges that contain speech, with the total speech time and the audio duration. No transcription model is involved: the pass is CPU-only and needs nothing downloaded or loaded, so it is fast even on servers without a speech model. Typical uses: segmenting a recording before transcription, skipping silence in long audio, or measuring how much of a file is actually spoken. The optional 'vad' object tunes detection (threshold, minimum durations, padding).\n\nAccepts an audio or video file as base64 (input_format 'Base64EncodedFile') or as the identifier of a previously uploaded file (input_format 'FileIdentifier'). Decoding shares the transcription pipeline: the formats the server can decode are reported by GET /lmkit/v1/audio-transcription/capabilities, and a video's audio track is extracted. A video that declares no audio track answers 422 Unprocessable Content. If processing exceeds the configured timeout, returns 202 Accepted with a job_id; poll GET /lmkit/v1/jobs/{job_id} for status and results.\n\nLarge files: the base64 body is bounded by the configured \"Max upload size\" (default 100 MB), but base64 inflates a file by ~33% and is buffered whole in memory. For large or long recordings prefer either (a) POST the raw file to /lmkit/v1/voice-activity-detection/file (multipart, streamed to disk), or (b) POST it once to /lmkit/v1/files/upload and reference the returned fileId here with input_format 'FileIdentifier'. An oversized body is rejected with 413 Payload Too Large.",
        "requestBody": {
          "description": "The voice-activity-detection request containing an audio file and optional tuning.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceActivityDetectionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceActivityDetectionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceActivityDetectionResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/voice-activity-detection/file": {
      "post": {
        "tags": [
          "Voice Activity Detection"
        ],
        "summary": "Detects the speech regions of an uploaded audio or video file (multipart/form-data).",
        "description": "Accepts an audio or video file as a raw multipart/form-data upload (form field 'file'). This is the recommended path for large or long recordings: the file is streamed to disk rather than buffered whole in memory, and no base64 inflation applies. The upload is bounded by the configured \"Max upload size\" (default 100 MB); an oversized file is rejected with 413 Payload Too Large. Detection tuning is available on the JSON endpoint's 'vad' field. Behaves identically to the JSON endpoint otherwise: returns the speech segments with the total speech time, or 202 Accepted with a job_id when processing exceeds the configured timeout (poll GET /lmkit/v1/jobs/{job_id}).",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ContentType": {
                    "type": "string"
                  },
                  "ContentDisposition": {
                    "type": "string"
                  },
                  "Headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "Length": {
                    "pattern": "^-?(?:0|[1-9]\\d*)$",
                    "type": [
                      "integer",
                      "string"
                    ],
                    "format": "int64"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "FileName": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceActivityDetectionResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/video-frames/capabilities": {
      "get": {
        "tags": [
          "Video Frames"
        ],
        "summary": "Reports video frame-extraction capabilities.",
        "description": "Returns whether ffmpeg is available on the server (frame extraction requires it), the video container extensions accepted, and the image formats a frame can be encoded to. Clients should call this once at startup (cache the result) and use it to decide whether to request posters from the server or render them locally.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoFramesCapabilitiesResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/video-frames/{fileId}": {
      "get": {
        "tags": [
          "Video Frames"
        ],
        "summary": "Extracts one still frame from an uploaded video (poster / preview tile).",
        "description": "Decodes a single frame from a previously uploaded video file and returns it as an image. Without 'at', the automatic policy applies: the frame is taken ~10% into the clip and a histogram scan picks the most representative frame of the following moments, which skips black, single-color, and fade frames. With 'at' (seconds), the frame at that exact position is returned (clamped into the clip). The image never upscales beyond the source width. Stream facts ride response headers so one call yields the poster AND the technical properties: 'X-Video-Duration-Seconds', 'X-Video-Width', 'X-Video-Height', 'X-Video-Codec', 'X-Video-Has-Audio', plus 'X-Frame-Timestamp-Seconds' and 'X-Frame-Timestamp-Mode' ('exact' or 'auto') for the frame itself. Containers accepted: the inspection engine's media registry (mp4, m4v, m4b, mov, 3gp, 3g2, mkv, webm, avi - see the capabilities route). Requires ffmpeg on the server; without it this endpoint answers 501 Not Implemented (the capabilities route advertises availability). Returns 422 Unprocessable Content when the file has no decodable video stream.",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "description": "The file ID of a previously uploaded video file.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "at",
            "in": "query",
            "description": "Frame position in seconds. Omit for the automatic poster policy (~10% in, representative-frame scan).",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          },
          {
            "name": "width",
            "in": "query",
            "description": "Target width in pixels (16-3840); height follows the aspect ratio. The source is never upscaled. Default: 640.",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 640
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "Output image format: 'jpeg' (default), 'png', or 'webp'.",
            "schema": {
              "type": "string",
              "default": "jpeg"
            }
          },
          {
            "name": "quality",
            "in": "query",
            "description": "Compression quality (1-100). Applies to 'jpeg' and 'webp'. Default: 90.",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 90
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "501": {
            "description": "Not Implemented"
          }
        }
      }
    },
    "/lmkit/v1/translate": {
      "post": {
        "tags": [
          "Translation"
        ],
        "summary": "Translates the input text, PDF, HTML, EML, MBOX, MS Office document or image.",
        "description": "Translates the provided content using the specified or default translation model. You can optionally specify the target language (and source language if supported). Returns the translated text. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The text translation request containing the content to translate, target language, and optional model identifier.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranslationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TranslationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranslationResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/training/jobs": {
      "post": {
        "tags": [
          "Fine-Tuning"
        ],
        "summary": "Starts a LoRA fine-tuning job.",
        "description": "Fine-tunes a base model on the supplied conversations using LoRA and produces a GGUF artifact (a small adapter, or the base merged with the adapter). Training runs in the background, one job at a time; poll GET /lmkit/v1/training/jobs/{job_id} for live loss and status, and download the result from /lmkit/v1/training/jobs/{job_id}/artifact when complete.",
        "requestBody": {
          "description": "The fine-tuning request: base model, dataset, and LoRA hyperparameters.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingJobRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingJobRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Fine-Tuning"
        ],
        "summary": "Lists the caller's training jobs, newest first.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TrainingJobResponse"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/training/jobs/{jobId}": {
      "get": {
        "tags": [
          "Fine-Tuning"
        ],
        "summary": "Gets the status and live metrics of a training job.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "description": "The training job identifier.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingJobResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/training/jobs/{jobId}/cancel": {
      "post": {
        "tags": [
          "Fine-Tuning"
        ],
        "summary": "Requests cancellation of a training job.",
        "description": "Training halts after the current batch; the partially-trained adapter is still saved.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "description": "The training job identifier.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingJobResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/training/jobs/{jobId}/artifact": {
      "get": {
        "tags": [
          "Fine-Tuning"
        ],
        "summary": "Downloads a completed job's GGUF artifact (adapter or merged model).",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "description": "The training job identifier.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/octet-stream": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/rewrite": {
      "post": {
        "tags": [
          "Text Rewriter"
        ],
        "summary": "Rewrites the input text.",
        "description": "Rewrites the provided content using the specified or default rewriting model. You can optionally specify the target language and the desired communication style. Returns the rewritten text. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The text rewriting request containing the content to rewrite, target language, communication style, and optional model identifier.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TextRewriterRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TextRewriterRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TextRewriterResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/correct": {
      "post": {
        "tags": [
          "Text Correction"
        ],
        "summary": "Corrects the input text by checking for grammar and spelling errors.",
        "description": "Corrects the provided content using the specified or default text correction model. The correction process includes checking for grammar and spelling mistakes. Returns the corrected text. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The text correction request containing the content to correct and an optional model identifier.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TextCorrectionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TextCorrectionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TextCorrectionResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/summarize": {
      "post": {
        "tags": [
          "Summarization"
        ],
        "summary": "Summarizes the input text, PDF, HTML, EML, MBOX, MS Office document or image.",
        "description": "Analyzes the provided content to generate a summary using the specified or default summarization model. Optional summarization parameters, such as maximum content words, maximum title words, and overflow resolution strategy, can be provided to control the summarization process. Returns the summarized content and title as defined in the response model. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The summarization request containing text, PDF, HTML, EML, MBOX, MS Office document or image with optional summarization parameters.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SummarizationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SummarizationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SummarizationResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/extract-structured-data": {
      "post": {
        "tags": [
          "Structured Extraction"
        ],
        "summary": "Extract structured data from the input text, PDF, HTML, EML, MBOX, MS Office document or image.",
        "description": "Analyzes the provided content to extract structured data using the specified or default extraction model. Optional extraction parameters, such as additional guidance text and a JSON extraction scheme, can be provided. Returns the extracted structured data as a JSON representation defined in the response model. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The structured extraction request containing text, PDF, HTML, MS Office document, image or image + text with optional extraction parameters.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StructuredExtractionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/StructuredExtractionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StructuredExtractionResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/analyze-sentiment": {
      "post": {
        "tags": [
          "Sentiment Analysis"
        ],
        "summary": "Analyzes the input text for sentiment, emotion, and/or sarcasm.",
        "description": "Performs text analysis on the provided input using the specified or default model. Each analyser can be independently enabled: sentiment classification (Positive, Negative, or Neutral), emotion detection (Happiness, Anger, Sadness, Fear, or Neutral), and sarcasm detection (true/false). By default, only sentiment analysis is enabled. Each result includes an associated confidence score. At least one analyser must be enabled. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The analysis request containing the text to analyze and the analysers to enable.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SentimentAnalysisRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SentimentAnalysisRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SentimentAnalysisResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/answer": {
      "post": {
        "tags": [
          "Answers"
        ],
        "summary": "Answers a question from one or more collections, with citations.",
        "description": "The grounded-answer endpoint: retrieves the best-matching content from the selected collections (every retrieval control of the search endpoint applies: search_type, filters, rerank, query_mode, context expansion), generates an answer on a local chat model bound to those sources, and returns the answer with citations. Citations cover EVERY retrieved source: 'cited' marks the ones the answer references inline as [n], and semantic matches carry the exact character span of the supporting chunk within the document's stored page Markdown. 'grounding' controls strictness: 'Strict' (default) answers from the sources only and refuses a question that retrieves nothing without calling the model; 'Relaxed' lets clearly-flagged general knowledge fill gaps. Set 'stream' for Server-Sent Events (delta frames, a terminal frame with the full result, then 'data: [DONE]'). Search type degrades automatically: 'Hybrid' falls back to whichever mode the tenant has enabled.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnswerRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AnswerRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnswerResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/AnswerResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { },
              "text/event-stream": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/chat": {
      "post": {
        "tags": [
          "Grounded Chat"
        ],
        "summary": "Creates a grounded chat session over collections, or asks an existing session a question.",
        "description": "Multi-turn grounded chat: every turn retrieves supporting sources from the session's collections, answers bound to them with citations (like the answer endpoint), and the conversation keeps its full dialogue state on the server, so follow-up questions work naturally; a follow-up is contextually rewritten for retrieval by default when the tenant has a query model. Without 'session_id' the call creates a session (scope, model, and per-turn retrieval/grounding defaults are fixed at creation) and returns its id; with 'session_id' it runs one turn, optionally streamed as Server-Sent Events. Sessions are held server-side, expire after idling, and die with the process; idle session state is tiered out of device memory transparently, so long-lived sessions are cheap.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroundedChatRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/GroundedChatRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroundedChatResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/GroundedChatResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { },
              "text/event-stream": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/chat/{sessionId}/skip-thinking": {
      "post": {
        "tags": [
          "Grounded Chat"
        ],
        "summary": "Skips the current reasoning phase of a session's in-flight turn.",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/chat/{sessionId}/clear-history": {
      "post": {
        "tags": [
          "Grounded Chat"
        ],
        "summary": "Clears a session's conversation history, keeping the session and its scope.",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/chat/{sessionId}": {
      "delete": {
        "tags": [
          "Grounded Chat"
        ],
        "summary": "Deletes a grounded chat session.",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/clusters": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "summary": "Lists the search clusters the caller can reach.",
        "description": "Scoped to the caller's key: a cluster is listed when the key holds at least one tenant grant in it, or when the key was explicitly granted the cluster (so a new key can discover where it may provision before it holds any tenant). The listing never enumerates other clusters the server hosts. An empty list means this key has nothing to reach yet: grants are managed from the admin panel.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ClusterResponse"
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/collections": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "summary": "Lists every collection the caller can reach, across clusters and tenants.",
        "description": "One call answers 'what can I search?': each entry carries the cluster_id, tenant_id, and collection_id needed to address it. Produced under the same grant checks as every read and write, so it can never name a collection the caller could not otherwise use. An empty list means this key has no tenant grants yet.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AccessibleCollectionResponse"
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Collections"
        ],
        "summary": "Creates a collection with its initial settings, or confirms it already exists.",
        "description": "Ensures a collection exists. How it is searched (full-text / semantic), the embedding model, OCR, and text normalization are tenant-level settings shared by every collection; a collection only carries its display name and full-text language. Idempotent: returns 201 Created when the collection is newly created and 200 OK when it already exists (its settings are left untouched). Use PUT to change an existing collection's settings.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CollectionConfigRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CollectionConfigRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      },
      "put": {
        "tags": [
          "Collections"
        ],
        "summary": "Updates an existing collection's settings.",
        "description": "Changes a collection's display name and full-text language. Search mode, the embedding model, OCR, and text normalization are tenant-level settings (set on the tenant). Fails with 404 Not Found if the collection does not exist; use POST to create it. The language is optional; omit it to keep the current value. A language change is applied to existing documents in the background; track progress with the reindex endpoint.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CollectionConfigRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CollectionConfigRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/lmkit/v1/search/clusters/{clusterId}/tenants/{tenantId}/collections/{collectionId}/reindex": {
      "get": {
        "tags": [
          "Collections"
        ],
        "summary": "Returns the progress of applying a collection's settings change.",
        "description": "Reports how much of a recent settings change has been applied to documents already in the collection. When you change a collection's embedding model or language, the change is applied to existing documents in the background; this endpoint reports how many documents are still pending, reaching zero when the change is fully applied. Search keeps working throughout.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReindexProgressResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/documents": {
      "post": {
        "tags": [
          "Documents"
        ],
        "summary": "Adds or updates a document in a collection so it can be searched.",
        "description": "Indexes a document and makes its content searchable. Provide the document and the ids that identify it; how the collection is searched is decided by the collection's settings. Indexing an id that already exists replaces it in place; supplying the same content_hash that is already indexed is a no-op. The response 'outcome' field reports Created, Replaced, or Unchanged. Optionally set ttl_seconds to have the document expire automatically. If indexing takes longer than the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results. If the supplied input cannot be read as a supported file type, returns 415 Unsupported Media Type; other invalid or unreadable input returns 400 Bad Request.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IndexDocumentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IndexDocumentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IndexDocumentResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Documents"
        ],
        "summary": "Removes a document from a collection.",
        "description": "Removes the document from the collection so it no longer appears in search results. Returns 404 Not Found if the document or its collection does not exist.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteDocumentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteDocumentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/lmkit/v1/search/documents/all": {
      "delete": {
        "tags": [
          "Documents"
        ],
        "summary": "Removes every document from a collection (asynchronous job).",
        "description": "Deletes all documents indexed in the collection (full-text, vector, and registry rows). A large collection holds hundreds of thousands of rows, so the delete ALWAYS runs as a background job that outlives the HTTP request: this returns 202 Accepted with a job_id immediately, the deletion runs in bounded committed batches that cannot be cancelled by a client disconnect or proxy timeout, and GET /lmkit/v1/jobs/{job_id} reports progress (progress_current = documents deleted so far, progress_total = the collection's document count) and finally result { deleted }. Returns 404 Not Found when the collection does not exist.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurgeCollectionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PurgeCollectionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/documents/list": {
      "post": {
        "tags": [
          "Documents"
        ],
        "summary": "Lists the document ids a collection holds, for reconciliation.",
        "description": "Returns the public document ids currently indexed in the collection, ordered, one page at a time via 'offset' and 'limit' (a page shorter than 'limit' is the last). Lets a caller diff the server's contents against its own record of what it indexed, then delete documents the server still holds that the caller no longer tracks (orphans). Returns an empty list when the collection does not exist.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListDocumentsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ListDocumentsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListDocumentsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/documents/get": {
      "post": {
        "tags": [
          "Documents"
        ],
        "summary": "Fetches a single document by its id, with everything indexed for it.",
        "description": "Returns one document addressed by its id: its registry metadata (name, source, content hash, custom metadata, page count, and timestamps) and, by default, every page's Markdown and layout. Because a document can be large, the response can be trimmed: set 'include_pages' to false to get metadata only; set 'include_markdown' or 'include_page_layout' to false to drop those parts of each page (the omitted column is not even read from storage); and pass 'page_range' (a print-style string such as \"1-3,7,10-12\") to return only selected pages. 'page_count' is always the document's total page count, so a caller can page through a large document. Returns 404 Not Found when the document or its collection does not exist.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetDocumentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/GetDocumentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDocumentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/documents/similar": {
      "post": {
        "tags": [
          "Documents"
        ],
        "summary": "Lists the documents most similar to a given document.",
        "description": "Returns the documents whose content most resembles the given document, most similar first - the document itself is never returned. The comparison uses the document vectors maintained for semantic search (no text and no inference is involved), so it requires semantic search enabled for the tenant, otherwise 400 Bad Request. Because embedding is deferred by default, a freshly indexed document may not be comparable yet: the response 'state' reports 'embedding_pending' (transient - poll again shortly) or 'no_content' (the document has nothing to compare - permanent), with empty results; results are meaningful only when it is 'ready'. Scores are cosine similarity in 0..1: near-duplicates (the same document re-scanned, re-exported, or lightly edited) typically score above 0.9. Pass 'search_collection_ids' to look across several of the tenant's collections in one call (they always share one embedding model); by default only the document's own collection is searched. 'filters' / 'filter' narrow the candidates by custom metadata with the same algebra as the search endpoint. Returns 404 Not Found when the document or its collection does not exist.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SimilarDocumentsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SimilarDocumentsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimilarDocumentsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/golden-set": {
      "post": {
        "tags": [
          "Evaluation"
        ],
        "summary": "Adds golden-set entries to a collection.",
        "description": "A golden set is a collection's retrieval-quality reference data: (question, expected documents) pairs, optionally with a reference answer for future answer-quality metrics. The evaluation endpoint scores retrieval configurations against it with recall@k, MRR, and nDCG@k.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoldenSetAddRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/GoldenSetAddRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Evaluation"
        ],
        "summary": "Lists a collection's golden-set entries.",
        "parameters": [
          {
            "name": "tenant_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cluster_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoldenSetResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/golden-set/generate": {
      "post": {
        "tags": [
          "Evaluation"
        ],
        "summary": "Generates a golden set from a collection's own content.",
        "description": "Bootstraps evaluation data for a corpus that has none: pages are sampled from the collection (at most one per document, ordered by a seeded hash so a run is reproducible from its reported seed), a local chat model writes one self-contained question and reference answer per page, and what passes the quality gate is stored as golden entries whose expected document is the page's document. The gate rejects questions that only make sense beside their passage ('what does this document say about...') and near-duplicates, and the per-reason discard counts are returned: a low acceptance rate is a fact about the corpus or the model, not a silent failure. It deliberately does NOT check whether retrieval currently finds the source document, since keeping only the questions the engine already answers would make every later measurement self-fulfilling. Questions already in the set take part in duplicate detection, so repeated calls grow a set. Generation runs one page at a time and can download the model, so a slow call returns a job.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoldenSetGenerateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/GoldenSetGenerateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoldenSetGenerateResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/golden-set/{entryId}": {
      "delete": {
        "tags": [
          "Evaluation"
        ],
        "summary": "Deletes one golden-set entry.",
        "parameters": [
          {
            "name": "entryId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tenant_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "collection_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cluster_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/evaluate/answers": {
      "post": {
        "tags": [
          "Evaluation"
        ],
        "summary": "Evaluates the grounded-answer pipeline against a golden set.",
        "description": "Runs every golden question through the real answer path once per configuration and has a local judge model score the result: faithfulness (the fraction of the answer's atomic statements the retrieved context supports, so the hallucination measure), context recall (the fraction of the reference answer found in that context, which separates a retrieval bottleneck from a generation one), answer relevancy, and citation precision (whether the sources the answer cited actually support it). Supply 'unanswerable_questions' to measure refusal in both directions: refusal recall alone is gamed by a pipeline that declines everything, which is why the false-refusal rate is reported beside it. A metric whose judgement could not be read excludes that question rather than scoring it zero, and says so in 'warnings'. Runs persist beside retrieval runs, so this is the headless CI hook for answer quality. Cost: several judging passes per question per configuration, bounded by 'max_questions', so a call can take minutes and returns a job when it does.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnswerEvaluateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AnswerEvaluateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnswerEvaluateResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/evaluate": {
      "post": {
        "tags": [
          "Evaluation"
        ],
        "summary": "Evaluates retrieval configurations against a golden set.",
        "description": "Runs every golden question of the selected collections through the real search read path once per configuration, scores the ranked documents against each entry's expected documents, and returns mean recall@k, MRR, and mean nDCG@k per configuration. Each configuration is persisted as one run (grouped by a shared batch id), so quality can be compared across configurations and over time via the runs endpoint. Several configurations in one call is the A/B shape: for example 'fulltext baseline' versus 'hybrid + rerank'. This endpoint is the headless hook for eval-driven development: call it from CI with plain HTTP and assert on the returned metrics. Retrieval work per call is bounded: questions times configurations searches, each at depth max(ks).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvaluateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/EvaluateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvaluateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/evaluate/runs": {
      "get": {
        "tags": [
          "Evaluation"
        ],
        "summary": "Lists the tenant's persisted evaluation runs, newest first.",
        "parameters": [
          {
            "name": "tenant_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cluster_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalRunsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/search": {
      "post": {
        "tags": [
          "Query"
        ],
        "summary": "Searches one or more collections for matching documents.",
        "description": "Returns the documents that best match the query, most relevant first, across a single collection or a set of collections. Pass 'collection_ids' to span several collections in one query, or 'collection_id' to search one. Use 'search_type' to choose how matching works: full-text matches on the words a document contains, semantic matches on meaning, and hybrid combines both. Full-text search is always available; semantic and hybrid require every searched collection to have semantic search enabled, and when several collections are searched together they must share the same embedding model, otherwise the request returns 400 Bad Request. Pass 'filters' to return only documents whose metadata contains the given key/value pairs, or 'filter' for the full operator algebra (eq, ne, gt, gte, lt, lte, in, nin, exists with and/or composition over typed values); the two are mutually exclusive. Use 'offset' with 'top_k' to page through results, 'sort' to order by relevance (default) or recency (full-text only), and 'facets' to get document counts per metadata value over the whole match set (full-text only). Retrieval shaping: 'max_chunks_per_document' returns up to N matched pages per document instead of one, 'recency_bias' folds an exponential freshness decay into every search type's relevance score, 'context_expansion' attaches the matched chunk's neighborhood or the full page to each hit for RAG prompt assembly, 'mmr' re-selects semantic results for diversity, and 'rerank_alpha' blends the reranker's judgment with the first-stage retrieval score. Query understanding: 'query_mode' rewrites a follow-up into a standalone question ('Contextual', with 'chat_history'), expands the query into alternative phrasings fused by rank ('MultiQuery'), or embeds a generated hypothetical answer in place of the query ('Hyde', semantic/hybrid only); all run on the tenant's 'query_model' and degrade to the original query when it is unavailable, with the outcome reported in 'query_understanding'. Each result identifies the matching document, its collection, the page that matched, a highlighted snippet, and the document's details. Set 'include_page_layout' to true to also return each matched page's stored layout (the text blocks and their positions captured at index time); the layout is the largest part of a hit, so it is off by default and responses grow significantly when enabled.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/status": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Reports whether the Search feature is enabled and has a usable cluster.",
        "description": "Always returns 200. With no cluster_id, 'available' reflects the default cluster the server would use (the marked default, or the only configured cluster). With a cluster_id, 'available' reflects that specific cluster, so a client can verify the exact cluster it is configured to use and show a truthful health state - including 'cluster not configured' - instead of inferring it from a 503 on a write call. The cluster_id is optional: omit it to check the default.",
        "parameters": [
          {
            "name": "cluster_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/lmkit/v1/search/tenants": {
      "post": {
        "tags": [
          "Tenants"
        ],
        "summary": "Provisions a new tenant and returns its id.",
        "description": "The server generates the tenant id and returns it. Use it to create collections, index documents, and search on behalf of this tenant.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProvisionTenantRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProvisionTenantRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/clusters/{clusterId}/tenants": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "summary": "Lists the tenants in a cluster.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TenantResponse"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/clusters/{clusterId}/tenants/{tenantId}": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "summary": "Gets a tenant.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Tenants"
        ],
        "summary": "Offboards a tenant, deleting all of its indexed data.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      },
      "put": {
        "tags": [
          "Tenants"
        ],
        "summary": "Updates a tenant's configuration (embedding model, OCR, search modes, normalization).",
        "description": "Updates the tenant's settings in one call. Every setting is tenant-wide and shared by all the tenant's collections. This replaces the configuration as a whole, so send the full desired state. Changes that affect indexed documents are applied in the background and search keeps working: changing the embedding model (or turning semantic on) re-embeds documents, and changing normalization re-indexes full text. An empty embedding model clears semantic capability and drops vector data. A tenant must keep at least one search mode enabled.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTenantConfigRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTenantConfigRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/search/clusters/{clusterId}/tenants/{tenantId}/promote": {
      "post": {
        "tags": [
          "Tenants"
        ],
        "summary": "Gives a large tenant its own dedicated vector index partition.",
        "description": "Optional scaling step for high-volume tenants. By default a tenant's semantic-search vectors share a pooled index with other small tenants. This moves the tenant's vectors into a dedicated partition, so its vector (nearest-neighbor) index holds only its own data, which keeps semantic search fast and accurate as the tenant's document count grows. Apply it before bulk-indexing a large tenant. It has no effect on small tenants and is never required for correctness.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/lmkit/v1/search/clusters/{clusterId}/tenants/{tenantId}/demote": {
      "post": {
        "tags": [
          "Tenants"
        ],
        "summary": "Returns a tenant from its dedicated vector index partition to the shared pool.",
        "description": "Reverses promotion: moves the tenant's semantic-search vectors back into the shared pool and drops its dedicated partition. Vectors are preserved (no re-embedding). A no-op for a tenant that was never promoted.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/lmkit/v1/rerank/score": {
      "post": {
        "tags": [
          "Reranking"
        ],
        "summary": "Scores documents against a query using a reranking model.",
        "description": "Computes relevance scores for one or more documents against a query. Uses a cross-encoder or embedding-based reranking model to produce sigmoid-normalized similarity scores. Supports batch scoring. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The scoring request containing the query and documents.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RerankScoreRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RerankScoreRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RerankScoreResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/rerank/rerank": {
      "post": {
        "tags": [
          "Reranking"
        ],
        "summary": "Reranks search results with alpha-blended score fusion.",
        "description": "Takes caller-supplied search results (each carrying its raw similarity score) and applies a reranking model to produce blended scores. The final score is computed as: (alpha * raw_similarity) + ((1 - alpha) * reranker_score). Results are returned sorted by blended score descending. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The rerank request containing search results and blending parameters.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RerankRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RerankRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RerankResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/detect-pii": {
      "post": {
        "tags": [
          "PII Detection"
        ],
        "summary": "Detects PII in the input text, PDF, HTML, EML, MBOX, MS Office document or image.",
        "description": "Analyzes the provided content to detect personally identifiable information (PII) using the specified or default model. Optional parameters include guidance, and entity selection. Returns the detected entities with label, value, positions, and confidence. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The PII detection request containing text, PDF, HTML, EML, MBOX, MS Office document or image with optional parameters.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PIIDetectionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PIIDetectionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PIIDetectionResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/pdf-unlock": {
      "post": {
        "tags": [
          "PDF Unlock"
        ],
        "summary": "Unlocks a password-protected PDF and returns an unprotected copy.",
        "description": "Decrypts a password-protected PDF using the provided password and saves an unprotected copy on the server. The original file is not modified. Returns 422 if the password is incorrect ('password_required') or the file is not a valid PDF ('invalid_format').",
        "requestBody": {
          "description": "The PDF unlock request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfUnlockRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PdfUnlockRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfUnlockResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/pdf-to-pdfa": {
      "post": {
        "tags": [
          "PDF to PDF/A"
        ],
        "summary": "Converts a PDF or an image to the PDF/A archival format (ISO 19005).",
        "description": "Converts an existing PDF (or an image, laid out first as a one-page PDF) to PDF/A-1b, 2b or 3b. The conversion repairs the document in place: non-embedded fonts are replaced by embedded equivalents with reconciled metrics, device colours are calibrated through embedded ICC profiles, prohibited constructs and compression are removed or re-encoded, and archival metadata is rebuilt. Text, vector graphics, and layout are preserved. Every conversion applies every repair it can first; the 'fallback' setting governs only content that still cannot be made conforming afterwards. The default rebuilds just those residual pages from rendered images with an invisible text layer, guaranteeing a conforming output. The converted document is stored on the server and returned as a file ID, together with a report of detected features and applied fixes. This is a pure document processing operation that does not require an AI model. Returns 422 Unprocessable Entity with an ErrorResponse body if the input file cannot be processed. The 'error' field contains one of: 'password_required' (encrypted PDF), 'invalid_format' (not a valid PDF), 'unsupported_security' (unsupported encryption), 'page_error' (content error).",
        "requestBody": {
          "description": "The PDF to PDF/A conversion request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfToPdfARequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PdfToPdfARequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfToPdfAResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/pdf-to-images": {
      "post": {
        "tags": [
          "PDF to Images"
        ],
        "summary": "Converts PDF pages to images (JPEG, PNG or TIFF) and returns a ZIP archive, or a single multipage TIFF.",
        "description": "Renders each page of a PDF as an image at the specified DPI and format. The images are packaged in a ZIP archive stored on the server. Set 'multipage' to true with format 'tiff' to pack every selected page into ONE multipage TIFF file instead, which is what archival, fax and scanner pipelines expect; the response then carries the file ID of that single .tif. Multipage TIFF holds every rendered page in memory at once, so a job combining a high DPI with a long page range can exceed the server's limit and fail: lower the DPI, narrow 'page_range', or leave 'multipage' false to get a ZIP. This is a pure document processing operation that does not require an AI model. Returns 422 Unprocessable Entity with an ErrorResponse body if the input file cannot be processed. The 'error' field contains one of: 'password_required' (encrypted PDF), 'invalid_format' (not a valid PDF), 'unsupported_security' (unsupported encryption), 'page_error' (content error).",
        "requestBody": {
          "description": "The PDF to images conversion request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfToImagesRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PdfToImagesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfToImagesResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/pdf-timestamp": {
      "post": {
        "tags": [
          "PDF Signatures"
        ],
        "summary": "Appends an RFC 3161 document timestamp to a PDF.",
        "description": "Appends a cryptographic document timestamp (subfilter ETSI.RFC3161): an authority proves the whole file existed at a point in time, without naming a signer. The timestamp is appended incrementally, so signatures already in the document stay intact. The authority comes from the request or from the server's configured 'DocumentSigning:TimestampAuthority'; the request fails when neither is available. The timestamped document is stored on the server and returned as a file ID together with an independent verification of the output. This is a pure document processing operation that does not require an AI model. Returns 422 Unprocessable Entity with an ErrorResponse body if the input file cannot be processed. The 'error' field contains one of: 'password_required' (encrypted PDF), 'invalid_format' (not a valid PDF), 'unsupported_security' (unsupported encryption), 'page_error' (content error).",
        "requestBody": {
          "description": "The document timestamp request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfTimestampRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PdfTimestampRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfTimestampResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/pdf-split": {
      "post": {
        "tags": [
          "PDF Split"
        ],
        "summary": "Splits a PDF document into multiple parts by page ranges or on blank separator pages.",
        "description": "Splits a single PDF document into multiple parts based on the provided page ranges, or - with split_mode 'BlankPages' - on visually blank pages (the separator sheets of batch scans): the runs of non-blank pages become the parts and the blank pages are omitted; blank_tolerance (default 10) absorbs scanner noise, and a uniformly dark page is never blank. Blank detection is deterministic image analysis - no AI model is involved (for content-based boundaries, use the document-splitting endpoint instead). Each page range produces one output PDF stored on the server. Page ranges are 1-based and support formats such as '1-5', '3', '7-12', '2-'. Each resulting part is stored on the server and a file ID is returned. Use the file IDs to download the results or pass them to other endpoints (document-to-markdown, pdf-search, pdf-layout, pdf-merge) using the 'FileIdentifier' input format. This is a pure document processing operation that does not require an AI model. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results. Returns 422 Unprocessable Entity with an ErrorResponse body if the input file cannot be processed. The 'error' field contains one of: 'password_required' (encrypted PDF), 'invalid_format' (not a valid PDF), 'unsupported_security' (unsupported encryption), 'page_error' (content error).",
        "requestBody": {
          "description": "The PDF split request containing a source PDF and page ranges.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfSplitRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PdfSplitRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfSplitResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/pdf-sign": {
      "post": {
        "tags": [
          "PDF Signatures"
        ],
        "summary": "Signs a PDF with a digital signature (PAdES).",
        "description": "Applies a PAdES (ETSI.CAdES.detached) digital signature to a PDF using a PKCS#12 (.p12/.pfx) identity: the one carried by the request, or the server's configured signing certificate when the request carries none. Signing is fully managed and in-process; keys never enter an OS store. The signature can be invisible (no 'field') or render a visible mark whose text is composed automatically (localized via 'appearance_language'), supplied as custom lines, or drawn from an uploaded image. An RFC 3161 authority can attest the signing time (PAdES B-T), and the signature can certify the document (DocMDP). The signed document is stored on the server and returned as a file ID together with an independent verification of the output. This is a pure document processing operation that does not require an AI model. Returns 422 Unprocessable Entity with an ErrorResponse body if the input file cannot be processed. The 'error' field contains one of: 'password_required' (encrypted PDF), 'invalid_format' (not a valid PDF), 'unsupported_security' (unsupported encryption), 'page_error' (content error).",
        "requestBody": {
          "description": "The PDF signing request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfSignRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PdfSignRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfSignResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/pdf-verify-signatures": {
      "post": {
        "tags": [
          "PDF Signatures"
        ],
        "summary": "Verifies the digital signatures of a PDF.",
        "description": "Validates every digital signature and document timestamp in a PDF and reports each one's verdict on four independent axes: integrity (are the signed bytes untouched), identity (does the signer chain to a trust anchor), revocation, and timestamp. Trust anchors come from the server's configured trust directory ('DocumentSigning:TrustAnchorsDirectory'), the request's own 'trust_roots', and the OS root store when enabled. PAdES (ETSI.CAdES.detached), adbe.pkcs7.detached, and ETSI.RFC3161 document timestamps are supported. This is a pure document processing operation that does not require an AI model. Returns 422 Unprocessable Entity with an ErrorResponse body if the input file cannot be processed. The 'error' field contains one of: 'password_required' (encrypted PDF), 'invalid_format' (not a valid PDF), 'unsupported_security' (unsupported encryption), 'page_error' (content error).",
        "requestBody": {
          "description": "The signature verification request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfVerifySignaturesRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PdfVerifySignaturesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfVerifySignaturesResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/pdf-search": {
      "post": {
        "tags": [
          "PDF Search"
        ],
        "summary": "Searches text within a PDF document.",
        "description": "Performs layout-aware text search within a PDF document. Returns matching text spans with context snippets, relevance scores, page numbers, and bounding box coordinates. Supports exact text, regular expression, and fuzzy (Damerau-Levenshtein edit distance) matching. Text normalization options allow whitespace collapsing, diacritics removal, and punctuation/symbol stripping. Unlike the semantic search endpoints (which operate on pre-indexed collections), this performs direct, real-time search within a specific uploaded document. This is a pure document processing operation that does not require an AI model. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The PDF search request containing a PDF document and query.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfSearchRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PdfSearchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfSearchResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/pdf-redact": {
      "post": {
        "tags": [
          "PDF Redaction"
        ],
        "summary": "Permanently removes content from a PDF (redaction).",
        "description": "Redacts a PDF by permanently deleting the underlying content, not merely drawing a black box over it. Text glyphs are removed from content streams, image pixels are scrubbed and re-encoded, vector graphics are trimmed, intersecting annotations are deleted, and content nested inside Form XObjects is processed per instance. The removed content cannot be recovered from the output by text extraction, raw stream inspection, or rendering. Specify what to remove with 'search_terms' (every occurrence of each string is redacted), 'areas' (explicit page regions in points), and/or 'apply_existing_annotations' (apply the document's pre-existing /Redact marks). Surviving content is untouched: text is removed at glyph granularity, and shared resources are cloned before editing so only the targeted instance changes. The redacted document is stored on the server and returned as a file ID together with a report of what was removed. This is a pure document processing operation that does not require an AI model. Returns 422 Unprocessable Entity with an ErrorResponse body if the input file cannot be processed. The 'error' field contains one of: 'password_required' (encrypted PDF), 'invalid_format' (not a valid PDF), 'unsupported_security' (unsupported encryption), 'page_error' (content error).",
        "requestBody": {
          "description": "The PDF redaction request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfRedactRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PdfRedactRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfRedactResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/pdf-ocr": {
      "post": {
        "tags": [
          "PDF OCR"
        ],
        "summary": "Creates a searchable PDF from an image or PDF by overlaying invisible OCR text.",
        "description": "Performs Optical Character Recognition on the input document or image and produces a searchable PDF with invisible text overlaid on each page. Accepts any image format (PNG, JPEG, TIFF, BMP, WEBP, etc.) or an existing PDF. For PDF inputs, pages that already contain selectable text can be skipped or re-OCRed depending on text_page_handling. Supports page range selection for multi-page inputs, configurable PDF version (including PDF/A archival formats), image compression settings, and parallel processing for large documents. The output PDF is stored on the server and a file ID is returned. Use the file ID to download the result or pass it to other endpoints (pdf-search, document-to-markdown, pdf-layout) using the 'FileIdentifier' input format. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. To force immediate async processing, include the 'Prefer: respond-async' HTTP header; the endpoint will always return 202 Accepted regardless of the timeout setting. Poll GET /lmkit/v1/jobs/{job_id} for status and results. While the job is processing, the polling response includes 'progress_current' and 'progress_total' fields indicating the number of pages processed so far and the total page count. Returns 422 Unprocessable Entity with an ErrorResponse body if the input file cannot be processed. The 'error' field contains one of: 'password_required' (encrypted PDF), 'invalid_format' (not a valid PDF), 'unsupported_security' (unsupported encryption), 'page_error' (content error).",
        "requestBody": {
          "description": "The PDF OCR request containing the file to process.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfOcrRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PdfOcrRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfOcrResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/pdf-merge": {
      "post": {
        "tags": [
          "PDF Merge"
        ],
        "summary": "Merges multiple PDF documents and images into a single PDF.",
        "description": "Combines two or more PDF documents and/or images into a single merged PDF. Accepts PDF files and image formats (PNG, JPEG, TIFF, BMP, WEBP, GIF). Image sources are automatically converted to PDF pages before merging. Multi-page images (e.g. TIFF) produce one page per frame. Pages from all sources are concatenated in the order provided. The merged PDF is stored on the server and a file ID is returned. Use the file ID to download the result or pass it to other endpoints (document-to-markdown, pdf-search, pdf-layout) using the 'FileIdentifier' input format. This is a pure document processing operation that does not require an AI model. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results. Returns 422 Unprocessable Entity with an ErrorResponse body if the input file cannot be processed. The 'error' field contains one of: 'password_required' (encrypted PDF), 'invalid_format' (not a valid PDF), 'unsupported_security' (unsupported encryption), 'page_error' (content error).",
        "requestBody": {
          "description": "The PDF merge request containing two or more PDF sources.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfMergeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PdfMergeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfMergeResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/pdf-ltv": {
      "post": {
        "tags": [
          "PDF Signatures"
        ],
        "summary": "Embeds long-term validation (LTV) material into a signed PDF.",
        "description": "Embeds validation material (certificates, CRLs, OCSP responses) into the document security store (/DSS, PAdES B-LT), so signatures stay verifiable after their certificates expire or the issuing infrastructure disappears. By default the material already carried by the document's signatures is gathered automatically; the request can add more. The material is appended incrementally, so existing signatures stay intact. The extended document is stored on the server and returned as a file ID together with an independent verification of the output. This is a pure document processing operation that does not require an AI model. Returns 422 Unprocessable Entity with an ErrorResponse body if the input file cannot be processed. The 'error' field contains one of: 'password_required' (encrypted PDF), 'invalid_format' (not a valid PDF), 'unsupported_security' (unsupported encryption), 'page_error' (content error).",
        "requestBody": {
          "description": "The LTV extension request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfLtvRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PdfLtvRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfLtvResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/pdf-layout": {
      "post": {
        "tags": [
          "PDF Layout Analysis"
        ],
        "summary": "Analyzes the physical layout of a PDF document.",
        "description": "Detects paragraphs, lines, and their bounding boxes within each page of a PDF document. Returns a structured JSON map of the document's physical layout including text direction, word counts, and precise coordinates in points. This is a pure document processing operation that does not require an AI model. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The PDF layout analysis request containing a PDF document.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfLayoutRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PdfLayoutRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfLayoutResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/pdf-info": {
      "post": {
        "tags": [
          "PDF Info"
        ],
        "summary": "Returns metadata and structural information about a PDF document.",
        "description": "Returns metadata including page count, PDF version, title, author, creation date, file size, and PDF/A conformance level. This is a lightweight, fast operation that does not require an AI model. Returns 422 Unprocessable Entity with an ErrorResponse body if the input file cannot be processed. The 'error' field contains one of: 'password_required' (encrypted PDF), 'invalid_format' (not a valid PDF), 'unsupported_security' (unsupported encryption), 'page_error' (content error).",
        "requestBody": {
          "description": "The PDF info request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfInfoRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PdfInfoRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfInfoResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/pdf-edit": {
      "post": {
        "tags": [
          "PDF Edit"
        ],
        "summary": "Reorders, rotates, and removes pages from a PDF.",
        "description": "Creates a new PDF by selecting pages from the source document in the specified order, optionally applying rotation to each page. Pages not listed are excluded. This is a pure document processing operation that does not require an AI model. Returns 422 Unprocessable Entity with an ErrorResponse body if the input file cannot be processed. The 'error' field contains one of: 'password_required' (encrypted PDF), 'invalid_format' (not a valid PDF), 'unsupported_security' (unsupported encryption), 'page_error' (content error).",
        "requestBody": {
          "description": "The PDF edit request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfEditRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PdfEditRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfEditResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/extract-entities": {
      "post": {
        "tags": [
          "Named Entity Recognition"
        ],
        "summary": "Extracts named entities from the input text, PDF, HTML, EML, MBOX, MS Office document or image.",
        "description": "Analyzes the provided content to extract named entities (persons, organizations, locations, dates, monetary amounts, and more) using the specified or default model. Supports built-in entity types as well as custom labels. Returns the detected entities with label, value, positions, and confidence. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The NER request containing text, PDF, HTML, EML, MBOX, MS Office document or image with optional parameters.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NERRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/NERRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NERResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/models/running": {
      "get": {
        "tags": [
          "Model Management"
        ],
        "summary": "List running models.",
        "description": "Returns a list of all models currently loaded in memory, including their size, reference count, and last usage time.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LoadedModelResponse"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/models/load": {
      "post": {
        "tags": [
          "Model Management"
        ],
        "summary": "Load a model into memory.",
        "description": "Pre-loads a model into memory so that subsequent inference requests do not incur the initial loading latency. If the model is already loaded, the endpoint returns immediately with an \"AlreadyLoaded\" status. The model will be automatically downloaded if it is not available locally.",
        "requestBody": {
          "description": "The model to load.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoadModelRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/LoadModelRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelActionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/models/unload": {
      "post": {
        "tags": [
          "Model Management"
        ],
        "summary": "Unload a model from memory.",
        "description": "Removes a model from the in-memory cache and frees its resources. A model that is currently in use (has active inference requests) cannot be unloaded and will return a 409 Conflict status.",
        "requestBody": {
          "description": "The model to unload.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnloadModelRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UnloadModelRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelActionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/models/catalog": {
      "get": {
        "tags": [
          "Model Management"
        ],
        "summary": "List all available models in the catalog.",
        "description": "Returns the complete catalog of predefined models with their metadata, including the functional type(s) of each model, download status, and file size. Use the optional 'type' query parameter to return only models that expose a given type.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "Optional filter by model type. If provided, only models that expose the specified type are returned.",
            "schema": {
              "$ref": "#/components/schemas/ModelType"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ModelCatalogItem"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/models/pull": {
      "post": {
        "tags": [
          "Model Management"
        ],
        "summary": "Download a model.",
        "description": "Downloads a model from the remote repository to local storage. If the model is already downloaded, returns immediately with an \"AlreadyAvailable\" status. The download runs synchronously; the response is sent when the download completes.",
        "requestBody": {
          "description": "The model to download.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoadModelRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/LoadModelRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelActionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/detect-language": {
      "post": {
        "tags": [
          "Language Detection"
        ],
        "summary": "Detects the language of the input text, PDF, HTML, EML, MBOX, MS Office document or image.",
        "description": "Analyzes the provided content to determine its language using the specified or default detection model. Optionally, you can restrict detection to a subset of languages. Returns the detected language as defined in the Language enumeration. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The language detection request containing text, an optional model, and optional languages to consider.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LanguageDetectionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/LanguageDetectionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LanguageDetectionResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/extract-keywords": {
      "post": {
        "tags": [
          "Keyword Extraction"
        ],
        "summary": "Extracts keywords from the input text, PDF, HTML, EML, MBOX, MS Office document or image.",
        "description": "Analyzes the provided content to extract the most important keywords using the specified or default extraction model. Optional extraction parameters, such as desired keyword count, and text shrinking strategy, can be provided. Returns the extracted keywords as defined in the response model. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The keyword extraction request containing text, PDF, HTML, EML, MBOX, MS Office document or image with optional extraction parameters.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KeywordExtractionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/KeywordExtractionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeywordExtractionResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/jobs/{jobId}": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "summary": "Gets the status and result of a background job.",
        "description": "Returns the current status of a background job. When the job completes, the 'result' field contains the original endpoint response.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "description": "The job identifier returned in the 202 Accepted response.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Jobs"
        ],
        "summary": "Cancels a running background job.",
        "description": "Attempts to cancel a job that is still processing. Has no effect on completed jobs.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "description": "The job identifier to cancel.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/image-to-pdf": {
      "post": {
        "tags": [
          "Image to PDF"
        ],
        "summary": "Converts one or more images into a single PDF document.",
        "description": "Creates a PDF where each image occupies a full page, sized to match the image dimensions. Supports JPEG, PNG, BMP, WEBP, GIF, and TIFF formats. Optional parameters control image compression (JPEG quality, encoding method) and the output PDF version (including PDF/A conformance levels). The generated PDF is stored on the server and a file ID is returned. Use the file ID to download the result or pass it to other endpoints (document-to-markdown, pdf-search, pdf-layout) using the 'FileIdentifier' input format. This is a pure document processing operation that does not require an AI model. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results. Returns 422 Unprocessable Entity with an ErrorResponse body if the input file cannot be processed. The 'error' field contains one of: 'password_required' (encrypted PDF), 'invalid_format' (not a valid PDF), 'unsupported_security' (unsupported encryption), 'page_error' (content error).",
        "requestBody": {
          "description": "The image-to-PDF conversion request containing one or more image sources.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageToPdfRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ImageToPdfRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageToPdfResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/image-normalization": {
      "post": {
        "tags": [
          "Image Normalization"
        ],
        "summary": "Normalizes an image: rotate, auto-crop uniform borders, resize, and re-encode.",
        "description": "One pass that prepares an image for vision, OCR, or archival pipelines. The operations apply in a fixed order - 'rotate' (90/180/270), then 'auto_crop' (trims uniform borders such as scan margins or letterboxing, tuned by 'crop_margin' and 'crop_tolerance'), then a resize: 'long_side' scales proportionally so the longer side measures exactly that many pixels, while 'width'+'height' force exact dimensions. Every operation is optional; a request with none of them is a plain format conversion. The result is returned base64-encoded in 'output_format' - 'png' (default) and 'webp' keep any alpha channel, 'jpeg' is flattened over opaque white ('output_quality' drives the lossy encoders). No AI model is involved: the pass is pure image processing and runs on any server. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The normalization request containing the image to process.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageNormalizationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ImageNormalizationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageNormalizationResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/image-background-removal": {
      "post": {
        "tags": [
          "Background Removal"
        ],
        "summary": "Removes the background from an image, returning the cutout in the requested encoding.",
        "description": "Two lanes, reported in the response's 'mode'. The exact lane estimates the background color from the image border and flood-fills every border-connected pixel within the tolerance - the classic product-shot / logo / scan cutout, no AI model involved. When the border is not uniform enough (a photographic background), the segmentation lane runs the configured image-segmentation model and cuts out the salient subject instead. 'mode' selects the policy: 'auto' (default) tries exact-first-then-model; 'uniform_color' and 'segmentation' force one lane. The cutout is always produced as a 32bpp RGBA bitmap; 'output_format' decides the bytes - 'png' (default) and 'webp' keep the alpha, 'jpeg' is flattened over opaque white ('output_quality' drives the lossy encoders). When no requested lane can isolate a background the request is refused with 422 and error 'no_uniform_background' instead of guessing. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The background-removal request containing the image to process.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageBackgroundRemovalRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ImageBackgroundRemovalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageBackgroundRemovalResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/health": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Liveness probe.",
        "description": "Returns 200 OK when the server process is alive. Use this endpoint for container orchestration liveness checks (e.g. Kubernetes `livenessProbe`). This endpoint is always anonymous and does not require authentication.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/ready": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Readiness probe.",
        "description": "Returns 200 OK when the server is ready to accept inference requests, including infrastructure details (backend init state, loaded models, queue depth, active inferences). Answers 503 while the backend initializes, while configured warmup models are still loading ('warming'), and the moment a graceful shutdown begins ('draining'), so an orchestrator routes traffic only to nodes that can serve it. Requires the configured pre-shared bearer token because the response exposes internal runtime state. For Kubernetes `readinessProbe` use, configure the probe's `httpHeaders` to include the `Authorization: Bearer …` header. The queue_depth field also feeds KEDA's metrics-api scaler on Prometheus-less stacks.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadinessResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadinessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/files/upload": {
      "post": {
        "tags": [
          "Files Management"
        ],
        "summary": "Uploads a file and returns its generated file ID.",
        "description": "Accepts a multipart/form-data upload, saves the file to the configured upload directory using a GUID-based filename, writes a manifest containing the original filename, and returns the new fileId.",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ContentType": {
                    "type": "string"
                  },
                  "ContentDisposition": {
                    "type": "string"
                  },
                  "Headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "Length": {
                    "pattern": "^-?(?:0|[1-9]\\d*)$",
                    "type": [
                      "integer",
                      "string"
                    ],
                    "format": "int64"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "FileName": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/files/supported-extensions": {
      "get": {
        "tags": [
          "Files Management"
        ],
        "summary": "Lists every file extension the upload endpoints accept.",
        "description": "Returns the complete set of file extensions accepted by POST /upload and POST /from-url, lowercase, dot-prefixed, sorted, and without duplicates. 'extensions' is the full union; 'document' carries the formats the document engine ingests (text, office documents, images, emails - content that can be parsed and indexed), 'audio' the containers accepted for transcription, and 'media' the video/mixed containers accepted for metadata/stream inspection. Clients should call this once at startup (cache the result) and validate file names before uploading, instead of hardcoding an extension list that drifts from server capabilities: a name whose extension is absent from 'extensions' is guaranteed to be refused by name. Membership is the guarantee of acceptance by name, not the only path in - an upload whose name carries NO recognizable extension is still accepted when magic-byte content detection recognizes the format.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportedExtensionsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/files/from-url": {
      "post": {
        "tags": [
          "Files Management"
        ],
        "summary": "Registers a file by downloading it from a URL and returns its generated file ID.",
        "description": "Downloads the content of the supplied http(s) URL server-side and stores it exactly like a direct upload (GUID-based filename + original-name manifest), returning the new fileId. Designed for content that already lives in object storage: pass a short-lived pre-signed URL (Amazon S3, Azure Blob SAS, Google Cloud Storage, MinIO, or any S3-compatible endpoint) and the transfer happens storage-to-server, so the caller never relays the bytes (no double transfer). The same size limit and format allowlist as /upload apply; the file name (explicit file_name, or derived from the URL path) drives the format check, and when the name carries no recognizable extension the downloaded CONTENT decides (magic-byte detection) before the request is rejected. The download follows no redirects, and URLs resolving to link-local addresses (cloud metadata services) are refused; private-network and loopback sources are allowed, so self-hosted object stores work. A source that cannot be fetched (unreachable, non-success status, expired signature) returns 502 Bad Gateway.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileFromUrlRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/FileFromUrlRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/files/{fileId}": {
      "delete": {
        "tags": [
          "Files Management"
        ],
        "summary": "Deletes an uploaded file by its ID.",
        "description": "Removes the file (and its associated manifest) whose filename begins with the provided fileId from the upload directory. Returns 204 on success or 404 if not found.",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "head": {
        "tags": [
          "Files Management"
        ],
        "summary": "Checks whether a file exists by its ID.",
        "description": "Returns 200 OK if the file exists, or 404 Not Found if it does not. No file content is returned. Use this for lightweight existence checks.",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Files Management"
        ],
        "summary": "Downloads a file by its ID.",
        "description": "Returns the file content as a binary download. The response includes the original filename in the Content-Disposition header. This endpoint can be used to retrieve any server-managed file, including files produced by the AI document splitting endpoint.",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/files/{fileId}/info": {
      "get": {
        "tags": [
          "Files Management"
        ],
        "summary": "Returns file metadata (size, filename) without downloading the content.",
        "description": "Returns the file size in bytes and the original filename for the given file ID. Use this for lightweight metadata queries without transferring file content.",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/file-info": {
      "post": {
        "tags": [
          "File Info"
        ],
        "summary": "Returns identity, facts, and metadata for a file of ANY format.",
        "description": "Universal file inspection: identifies the format from its leading magic bytes and extracts its metadata - image dimensions and EXIF/GPS, video and audio stream summaries, PDF and Office document properties - into one stable envelope. This is a lightweight, fast operation that does not require an AI model: only container headers are read, media data is never decoded. Inspection never fails on content: an unrecognized format still returns the identity block with format 'unknown', and malformed files return whatever was readable plus warnings. For deep PDF analysis (PDF/A level, permissions, embedded files, raw XMP) use lmkit/v1/pdf-info.",
        "requestBody": {
          "description": "The file info request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileInfoRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/FileInfoRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileInfoResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/embeddings": {
      "post": {
        "tags": [
          "Embeddings"
        ],
        "summary": "Creates embeddings from the input text, PDF, HTML, EML, MBOX, MS Office document or image.",
        "description": "Processes the provided content to produce dense vector representations (embeddings) using the specified or default embeddings model. Optional parameters, such as model choice, can be provided. Returns an array of float vectors, one per input item, matching the dimensionality of the chosen model. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The embedding request containing text, PDF, HTML, EML, MBOX, MS Office document or image with optional model selection.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmbeddingRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/EmbeddingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/document-validation": {
      "post": {
        "tags": [
          "Document Validation"
        ],
        "summary": "Validates a document against a conformance profile (PDF/A, ISO 19005).",
        "description": "Evaluates the candidate document against the selected profile's rule catalog and returns a verdict with one finding per failed rule. The validation re-parses the bytes and judges the document's actual state, independently of whoever produced it; a file that merely declares PDF/A in its metadata is told apart from one that holds up to the rules. The 'pdfa' profile covers the B (basic) conformance of PDF/A-1, PDF/A-2 and PDF/A-3; a document declaring a level outside that coverage yields the 'undetermined' verdict, never a false one. 'flavor' selects the level to validate against, and 'auto' (default) resolves it from the document's own declared identification. The document is not modified and nothing is stored. This is a pure document processing operation that does not require an AI model. Returns 422 Unprocessable Entity with an ErrorResponse body if the input file cannot be processed. The 'error' field contains one of: 'password_required' (encrypted PDF), 'invalid_format' (not a valid PDF), 'unsupported_security' (unsupported encryption), 'page_error' (content error).",
        "requestBody": {
          "description": "The document validation request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentValidationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentValidationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentValidationResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/document-to-markdown": {
      "post": {
        "tags": [
          "Document to Markdown"
        ],
        "summary": "Converts a document or image to Markdown.",
        "description": "Transcribes documents and images into structured Markdown using one of three strategies: 'Hybrid' (default) routes each page to the fastest suitable path (embedded text layer or vision-language OCR) based on whether the page has extractable text and whether it contains embedded images; 'TextExtraction' reads only the embedded text layer and can also OCR image inputs through the server's default OCR engine when 'enable_ocr' is true; 'VlmOcr' rasterizes every page and transcribes it with a vision-language model. Multi-page documents are processed page by page and the results are concatenated. Supported document formats: PDF, DOCX, PPTX, XLSX, EML, MBOX, HTML, TXT. Supported image formats: PNG, JPEG, TIFF, BMP, GIF, WEBP, PSD, PIC, PNM, HDR, TGA. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The document-to-markdown conversion request containing a document or image.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentToMarkdownRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentToMarkdownRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentToMarkdownResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/document-thumbnail/{fileId}/page-sizes": {
      "get": {
        "tags": [
          "Document Thumbnail"
        ],
        "summary": "Returns the intrinsic size (width, height in points/pixels) of every page in a document.",
        "description": "Fast, non-rendering metadata call. Iterates the document's pages and reports their native dimensions so clients can pre-compute a viewer layout (reserved per-page heights, aspect ratios) before any page image is fetched. Works for PDFs and multi-page images (e.g. TIFF). Units are whatever the underlying format uses natively: PDF pages are in points (1pt = 1/72in), image frames are in pixels. Only the ratio matters for viewer layout.",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "description": "The file ID of a previously uploaded file.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentThumbnailController.PageSizesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentThumbnailController.PageSizesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentThumbnailController.PageSizesResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/document-thumbnail/supported-formats": {
      "get": {
        "tags": [
          "Document Thumbnail"
        ],
        "summary": "Lists file extensions the thumbnail endpoint can render.",
        "description": "Returns the union of PDF and image extensions supported by this endpoint. Clients should call this once at startup (cache the result) and use it to decide whether to route a document into a paginated viewer or fall back to a generic display. Using this endpoint avoids hard-coded extension lists drifting from server capabilities.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentThumbnailController.SupportedFormatsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentThumbnailController.SupportedFormatsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentThumbnailController.SupportedFormatsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/document-thumbnail/{fileId}": {
      "get": {
        "tags": [
          "Document Thumbnail"
        ],
        "summary": "Renders a page of a document (PDF or image) as an image.",
        "description": "Returns an image for a previously uploaded file. Supports PDF documents (any page) and image files including TIFF, BMP, PNG, JPEG, GIF, and WebP. For multi-page TIFF files, the 'page' parameter selects which frame to render. Output format is controlled by the 'format' parameter (jpeg, png, or webp; default jpeg). The response includes an 'X-Page-Count' header with the total number of pages in the document. Returns 422 Unprocessable Content if the file cannot be processed (e.g. encrypted PDF). The response includes the ProblemDetails error codes: 'password_required', 'invalid_format', 'unsupported_security', 'page_error'.",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "description": "The file ID of a previously uploaded file.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Zero-based page index (for PDFs and multi-page TIFFs). Default: 0.",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Target size in pixels for the image's LONGEST side (width or height, whichever is larger); the shorter side preserves the page's aspect ratio. A landscape page yields size x (size*h/w); a portrait page yields (size*w/h) x size. Default: 400.",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 400
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "Output format: 'jpeg' (default), 'png', or 'webp'.",
            "schema": {
              "type": "string",
              "default": "jpeg"
            }
          },
          {
            "name": "quality",
            "in": "query",
            "description": "Compression quality (1-100). Applies to 'jpeg' and 'webp'. Default: 90.",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 90
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/document-splitting": {
      "post": {
        "tags": [
          "AI Document Splitting"
        ],
        "summary": "AI-powered detection of logical document boundaries in a multi-page PDF.",
        "description": "Uses a vision-language model (VLM) to visually analyze each page of a multi-page PDF and automatically detect logical document boundaries. Unlike basic page-range splitting, this endpoint understands document types, layouts, and visual cues to identify where one document ends and another begins (e.g., an invoice followed by a contract followed by a receipt). Returns the detected segments with page ranges, labels, and a confidence score. Optionally splits the source PDF into separate files for each detected segment. When splitting is enabled, the split files are stored on the server and can be referenced by their file IDs in subsequent API calls using the 'FileIdentifier' input format. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The intelligent document splitting request containing a PDF document to analyze.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentSplittingRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentSplittingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentSplittingResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/document-search-highlight": {
      "post": {
        "tags": [
          "Document Search Highlight"
        ],
        "summary": "Searches text in a document and returns a highlighted copy.",
        "description": "Performs layout-aware text search within a PDF or image document, then produces a highlighted copy with search results visually marked. For PDF input, adds highlight annotations and saves incrementally for maximum performance. For image input, draws semi-transparent rectangles over matches and outputs PNG. Supports three search modes: exact text, regular expression, and fuzzy (edit-distance) matching. When pre-computed page layouts are provided (from a prior OCR or layout analysis pass), they are used for search instead of the document's native text extraction, enabling highlighting on raster PDFs or images. The highlighted document is stored on the server and a file ID is returned. This is a pure document processing operation that does not require an AI model. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The document search highlight request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentSearchHighlightRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentSearchHighlightRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentSearchHighlightResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/document-ocr": {
      "post": {
        "tags": [
          "Document OCR"
        ],
        "summary": "Runs OCR on a document and returns structured page layout with text.",
        "description": "Performs Optical Character Recognition on the specified pages (or all pages) of the provided document, returning detected paragraphs, lines, words, and their bounding boxes. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The document OCR request containing the file to process.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentOcrRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentOcrRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentOcrResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/chat": {
      "post": {
        "tags": [
          "Chat"
        ],
        "summary": "Generates a chat completion with the native LM-Kit contract: streaming events or one JSON result.",
        "description": "The caller carries the transcript and the server answers the trailing user message. Server skills ride as first-class fields: 'skill' pins one skill's instructions onto the system turn (its activation questions answered through 'skill_inputs'), and 'skills' offers a set to the model through function calling. 'server_tools' names built-in tools the SERVER executes mid-exchange (web search, calculation, date/time, unit conversion), governed by the server's Tools policy. 'n' generates several alternatives in one exchange, 'logprobs'/'top_logprobs' report per-token probabilities, and 'logit_bias' steers individual tokens by id or by text chunk.\n\n**Response modes:**\n\n• `stream: false` (default): one JSON object `{result, thinking?, skill_events?}` where `result` is the terminal summary below.\n\n• `stream: true`: a `text/event-stream` of named SSE events:\n\n| Event | Payload | Meaning |\n|-------|---------|---------|\n| `status` | `{phase: downloading\\|loading\\|session\\|prompt, pct?, done?, total?}` | Model preparation, narrated honestly (download progress, cold load, pool attach, prompt read) |\n| `delta` | `{t: thinking\\|text\\|tool, d, i?}` | Decode fragments by channel: reasoning, the visible answer, tool traffic; `i` names the alternative when n > 1 |\n| `skill` | `{name, status: active\\|missing\\|activated\\|resource, context?, resource?}` | Skill use as it happens |\n| `tool_call` | `{id, name, arguments}` | The model called a client-dispatched tool |\n| `tool_use` | `{name, status: running\\|done\\|error\\|denied, args?, secs?, result?, sources?}` | A server-executed tool's lifecycle; web search reports its hits as sources |\n| `done` | `{text, model, tokens, rate, prompt_tokens, prompt_secs, gen_secs, reason, ctx, ctx_max, tool_calls?, logprobs?, choices?}` | The terminal summary |\n| `error` | `{error}` | The exchange failed |\n\nAuthentication follows the server's API surface (API key, or open when anonymous access is enabled); the admin session and a public playground also pass, which is how the playground itself rides this route.",
        "requestBody": {
          "description": "The chat exchange: transcript, sampling, and skill selection.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ChatRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { },
              "text/event-stream": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/chat/skip-thinking": {
      "post": {
        "tags": [
          "Chat"
        ],
        "summary": "Ends the thinking phase of a running chat exchange; the answer continues.",
        "description": "Addresses the exchange by the request_id it was started with. The model closes its reasoning and begins the user-visible answer immediately; generation itself is not interrupted. No effect once the visible answer has started.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkipThinkingRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SkipThinkingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/chat-with-document": {
      "post": {
        "tags": [
          "Chat with Document"
        ],
        "summary": "Chat with a document using conversational question-answering.",
        "description": "Loads a document and enables multi-turn conversational Q&A powered by RAG.\n\n**Session lifecycle:**\n1. First call: provide 'input' + 'input_format' to create a session. Returns a 'session_id'.\n2. Subsequent calls: provide 'session_id' + 'question' to chat. Conversation context is maintained.\n3. DELETE /lmkit/v1/chat-with-document/{session_id} to release resources.\n\n**Response modes:**\n\n• `stream: false` (default): returns a single `ChatWithDocumentResponse` JSON object.\n\n• `stream: true`: returns a `text/event-stream` of SSE events. Each event is `data: {json}\\n\\n` containing a `ChatWithDocumentStreamChunk` object with these fields:\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `session_id` | string | The session identifier |\n| `delta` | string | Incremental text token (empty in the final chunk) |\n| `thinking` | bool | `true` if the delta is internal reasoning (chain-of-thought), `false` for the user-visible answer |\n| `done` | bool | `true` on the final chunk |\n| `response` | string? | Complete answer text (final chunk only, excludes thinking) |\n| `source_references` | array? | Retrieved document passages (final chunk only) |\n\nThe stream ends with `data: [DONE]\\n\\n`.\n\nIf document loading exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The chat with document request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatWithDocumentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ChatWithDocumentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ChatWithDocumentStreamChunk"
                }
              },
              "application/json": { }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { },
              "text/event-stream": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/chat-with-document/{sessionId}/skip-thinking": {
      "post": {
        "tags": [
          "Chat with Document"
        ],
        "summary": "Skip the model's thinking phase and start generating the answer.",
        "description": "Signals the model to immediately end its internal reasoning (chain-of-thought) and begin producing the user-visible answer. Has no effect if the model is not currently thinking.",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "description": "The session identifier.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/chat-with-document/{sessionId}/clear-history": {
      "post": {
        "tags": [
          "Chat with Document"
        ],
        "summary": "Clear the conversation history while keeping the loaded document.",
        "description": "Resets the chat history so you can start a fresh conversation without reloading the document.",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "description": "The session identifier.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/chat-with-document/{sessionId}": {
      "delete": {
        "tags": [
          "Chat with Document"
        ],
        "summary": "Delete a chat session and release its resources.",
        "description": "Removes the chat session, releases the loaded models, and frees memory.",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "description": "The session identifier to delete.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/categorize": {
      "post": {
        "tags": [
          "Categorization"
        ],
        "summary": "Determines the most relevant categories from the input text, PDF, HTML, EML, MBOX, MS Office document or image.",
        "description": "Analyzes the provided content to determine the most appropriate categories from the provided list using the specified or default model. Optional parameters, such as the desired number of top categories and additional guidance, can be provided. Returns the identified categories as defined in the response model. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.",
        "requestBody": {
          "description": "The categorization request containing text, PDF, HTML, or image along with optional categorization parameters.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CategorizationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CategorizationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategorizationResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/audio-transcription/capabilities": {
      "get": {
        "tags": [
          "Audio Transcription"
        ],
        "summary": "Reports audio-transcription decoding capabilities.",
        "description": "Returns whether ffmpeg is available on the server (so it can decode any format) and the list of file extensions it can currently decode. With ffmpeg the set includes video containers (mp4, mov, mkv, webm, avi, ...): transcription extracts and transcribes their audio track. Clients use this to decide whether to upload a recording as-is or transcode it locally first.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AudioTranscriptionCapabilitiesResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/audio-transcription": {
      "post": {
        "tags": [
          "Audio Transcription"
        ],
        "summary": "Transcribes spoken content from an audio or video file (JSON: base64 or file identifier).",
        "description": "Accepts an audio or video file as base64 (input_format 'Base64EncodedFile') or as the identifier of a previously uploaded file (input_format 'FileIdentifier'), plus an optional model identifier. 'language' pins the spoken language (ISO-639-1) instead of detecting it; 'enable_vad' controls the voice-activity pre-segmentation that skips silence (on by default), and 'vad' tunes it. Runs speech-to-text on the specified or default model and returns the full transcript and the average confidence score. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/{job_id} for status and results.\n\nVideo containers (mp4, mov, mkv, webm, avi, ... - see the capabilities route) are accepted when ffmpeg is available on the server: the audio track is extracted and transcribed. A video that declares no audio track answers 422 Unprocessable Content.\n\nLarge files: the base64 body is bounded by the configured \"Max upload size\" (default 100 MB), but base64 inflates a file by ~33%, is buffered whole in memory, and is the least efficient path. For large or long recordings prefer either (a) POST the raw file to /lmkit/v1/audio-transcription/file (multipart, streamed to disk), or (b) POST it once to /lmkit/v1/files/upload and reference the returned fileId here with input_format 'FileIdentifier'. An oversized body is rejected with 413 Payload Too Large.",
        "requestBody": {
          "description": "The audio transcription request containing an audio file and optional model identifier.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AudioTranscriptionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AudioTranscriptionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AudioTranscriptionResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/audio-transcription/file": {
      "post": {
        "tags": [
          "Audio Transcription"
        ],
        "summary": "Transcribes spoken content from an uploaded audio or video file (multipart/form-data).",
        "description": "Accepts an audio or video file as a raw multipart/form-data upload (form field 'file'), plus an optional 'model' form field. This is the recommended path for large or long recordings: the file is streamed to disk rather than buffered whole in memory, and no base64 inflation applies. The upload is bounded by the configured \"Max upload size\" (default 100 MB); an oversized file is rejected with 413 Payload Too Large. Video containers are accepted when ffmpeg is available on the server: the audio track is extracted and transcribed; a video that declares no audio track answers 422 Unprocessable Content. Behaves identically to the JSON endpoint otherwise: returns the transcript and average confidence, or 202 Accepted with a job_id when processing exceeds the configured timeout (poll GET /lmkit/v1/jobs/{job_id}).",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ContentType": {
                        "type": "string"
                      },
                      "ContentDisposition": {
                        "type": "string"
                      },
                      "Headers": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "Length": {
                        "pattern": "^-?(?:0|[1-9]\\d*)$",
                        "type": [
                          "integer",
                          "string"
                        ],
                        "format": "int64"
                      },
                      "Name": {
                        "type": "string"
                      },
                      "FileName": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "model": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "language": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "enable_vad": {
                        "type": "boolean"
                      }
                    }
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AudioTranscriptionResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/agents": {
      "get": {
        "tags": [
          "Agents"
        ],
        "summary": "Lists the agents this server defines, for use as the chat endpoints' agent field.",
        "description": "Each entry names one reusable bundle an exchange can adopt: its description, the skill it pins, the server-executed tools it brings (names and count), whether it remembers across conversations, the model it answers with (empty follows the request or the server default), its thinking mode (empty follows the model's own default), and the fixed greeting a fresh conversation opens with. Adoption semantics are the chat endpoints': the bundle fills in wherever the request stays silent, and explicit request fields win.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/messages": {
      "post": {
        "tags": [
          "Anthropic · Messages"
        ],
        "summary": "Generates a message completion using the Anthropic Messages API shape.",
        "description": "Anthropic-compatible Messages endpoint. Designed to be a drop-in target for clients that use the Anthropic SDK (including Claude Code via ANTHROPIC_BASE_URL). Supports text, vision (image content blocks), tool use, streaming (SSE) and non-streaming responses.\n\nReference: https://docs.anthropic.com/en/api/messages",
        "requestBody": {
          "description": "The Messages request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Anthropic.AnthropicMessagesRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Anthropic.AnthropicMessagesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Anthropic.AnthropicMessagesResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/Anthropic.AnthropicMessagesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": { },
              "text/event-stream": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/login": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Authenticates an operator and returns a session token.",
        "description": "Verifies an operator's username and password and, when enrolled, a TOTP second factor. On success returns an opaque session token to be sent on subsequent requests via the X-Admin-Password header. A request without a username signs in the legacy 'admin' account, kept for automation written against the shared-password era. When the credentials are correct but a second factor is required, responds 200 with requiresTotp=true and no token; resubmit including the code.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminLoginRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminLoginRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminLoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminLoginResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/sessions": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the live admin sessions (admin).",
        "description": "Every live session with the door that minted it (password or sso), who signed in when the door knows, and its timestamps. Rows are addressed by an opaque id; the bearer tokens never leave the server.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/sessions/revoke": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Revokes one admin session by its id (admin).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.SessionRevokeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.SessionRevokeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.SessionRevokeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/sessions/revoke-others": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Revokes every admin session but the caller's own (admin).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/logout": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Revokes the current admin session.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/area-ticket": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Exchanges the admin session for the web-area ticket cookie.",
        "description": "Admin-gated web areas are opened by plain page navigations, which cannot carry the session header, so the browser proves the session once here and receives an HttpOnly cookie the page gates check.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/2fa/status": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Reports the caller's second-factor state and the org policy.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwoFactorStatusResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/2fa/setup": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Begins TOTP enrollment for the caller's own account.",
        "description": "Generates a pending TOTP secret for the signed-in operator and returns it together with an otpauth:// URI for authenticator apps. The secret only becomes active after it is confirmed via /2fa/enable with a valid code, which also returns the account's single-use recovery codes.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwoFactorSetupResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/2fa/enable": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Confirms and activates TOTP enrollment.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TwoFactorCodeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TwoFactorCodeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TwoFactorCodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/2fa/disable": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Disables the TOTP second factor.",
        "description": "Requires a valid current authentication code so that a hijacked session alone cannot strip the second factor.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TwoFactorCodeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TwoFactorCodeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TwoFactorCodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/configuration": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the current server configuration.",
        "description": "Returns all configurable settings grouped by section. Includes a defaults section for reset-to-default support. Requires the X-Admin-Password header when an admin password is configured.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigurationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Administration"
        ],
        "summary": "Updates server configuration.",
        "description": "Accepts a partial configuration update. Only the supplied fields are modified. Requires the X-Admin-Password header when an admin password is configured.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigurationUpdateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigurationUpdateResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/ffmpeg/status": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Reports whether the resolved ffmpeg binary actually runs.",
        "description": "Probes the ffmpeg binary the server currently resolves (the admin 'FFmpeg Path' setting when set, else the LMKIT_FFMPEG_PATH environment variable, else the server-managed download when installed, else 'ffmpeg' on PATH) and reports the outcome: whether it is runnable, the resolved path, which layer supplied it ('setting' / 'environment' / 'managed' / 'path'), and the probed version line as proof. The probe is cached per resolved path, so this is cheap to call and a path change (saved from the config form) re-answers on the next call. Also carries the managed-install state: whether a managed binary is on disk, whether a static build is published for this platform, and the progress of an in-flight or just-finished managed download so the config form can render it. This is what the config form's FFmpeg Path status line reads: audio transcoding and video frame extraction both depend on this binary.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/ffmpeg/download": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Downloads and installs a managed ffmpeg build for this platform.",
        "description": "Starts a background download of a static ffmpeg build matching the server's OS and CPU architecture, installing it into the server-managed tools directory. Builds come from the community static-build projects (BtbN's FFmpeg-Builds GitHub releases for Windows, the ffbinaries prebuilt releases for Linux, ffmpeg.martin-riedl.de for macOS) and must pass a -version probe before activation, so a corrupt or wrong-architecture download is discarded rather than installed. Once installed, the binary is used automatically whenever neither the FFmpeg Path setting nor the LMKIT_FFMPEG_PATH environment variable points elsewhere, and audio transcoding plus video frame extraction light up without a restart. Poll 'ffmpeg/status' for progress. 409 when a download is already running, 422 when no static build is published for this platform.",
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/ffmpeg/managed": {
      "delete": {
        "tags": [
          "Administration"
        ],
        "summary": "Removes the managed ffmpeg install.",
        "description": "Deletes the binary previously installed by 'ffmpeg/download' from the server-managed tools directory, so ffmpeg resolution falls back to the system PATH (or whatever the FFmpeg Path setting and LMKIT_FFMPEG_PATH environment variable dictate). Use it when a system-wide install should take over from the managed copy. 409 while a managed download is running.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/ffmpeg/test": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Runs a functional self-test of the resolved ffmpeg binary.",
        "description": "Exercises the resolved ffmpeg end to end instead of trusting its -version banner: the binary first synthesizes a one-second audio+video clip from its built-in generators (no media asset, no network), then the clip runs through the server's two real media paths, the 16 kHz mono WAV transcode that transcription applies to every upload and the still-frame extraction behind video posters. Reports each step's outcome, duration, and artifact size; the test passes only when every step passes. Use it after pointing FFmpeg Path at a new binary or installing the managed download to prove decode and encode actually work on this host. Synchronous and cheap (a few hundred milliseconds when healthy, bounded at 30 seconds).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/inference/slot-pool-fit": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Prices a shared-slot-pool shape without allocating it",
        "description": "Reports what the given slot count and per-slot window would cost on each loaded model's device, and what the device memory ceiling (Inference Memory Budget) would actually admit. This is the difference between 'my slot count is not applying' and 'it applied and the card refused it': a shape the device cannot hold is fitted down at attach time, slots first and then the window, so a panel that echoes back only the configured numbers reports a concurrency the server will not deliver. Read-only and non-destructive: the estimate consults the configured ceiling only, and unlike the real admission path it never evicts cached contexts or trims idle pools. Omitting the parameters prices the shape the server is currently configured with. Models whose native memory simulation is unavailable are omitted rather than reported as failures.",
        "parameters": [
          {
            "name": "slots",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "slotContextSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "memoryRatio",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Prices a shared-slot-pool shape together with a pending set of per-model overrides",
        "description": "Same estimate as the GET form, with one difference: the body may carry an override set the operator has not saved yet, and every loaded model is priced at the shape that would actually govern IT once that set is applied. This is what lets an override be checked against the device before it is committed, rather than after a model refuses to open at it. Read-only and non-destructive; an omitted override list prices the saved one.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.SlotPoolFitRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.SlotPoolFitRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.SlotPoolFitRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/models/contexts": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the inference contexts (KV-caches) held in memory for a loaded model.",
        "description": "Lists every context the given model is keeping resident: the shared context of each attached parallel decoder, those actively in use, and those idle in the recycle pool. Each entry reports its token capacity, KV-cache memory footprint, residency state, and device, which is the detail behind a model's KV-cache count. A decoder's shared context additionally reports its slot shape (slot count, per-slot window, busy slots, queued requests, tracked conversations), since its capacity is a pool serving many concurrent requests rather than one session's window. Returns 404 when the model is not loaded.",
        "parameters": [
          {
            "name": "uri",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/models/hibernate": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Hibernates every in-memory inference context held by a single loaded model.",
        "description": "Schedules background hibernation of one model's live contexts, and their speculative-decoding draft siblings, serializing each context's state to disk and releasing device and host memory. This is a one-shot action, not a persisted setting, so it does not alter the saved configuration. A context that is mid-decode hibernates once it frees up, and any session rehydrates transparently on its next request. Returns the number of contexts scheduled. Requires the X-Admin-Password header when an admin password is configured.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelUnloadRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelUnloadRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ModelUnloadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/models": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns model catalog grouped by capability.",
        "description": "Returns non-legacy predefined models from the LM-Kit catalog, organized by server role. Requires the X-Admin-Password header when an admin password is configured.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelCatalogResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/devices": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns available GPU devices.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/dashboard/live": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns fast-changing dashboard metrics suitable for high-frequency polling.",
        "description": "Excludes the loaded-model details list and upload-directory stats, which are served separately by GET /admin/dashboard/snapshot. Safe to poll once per second.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/memory/diagnostics": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns a complete CPU-RAM diagnostic breakdown of the server process.",
        "description": "Aggregates the OS process view, the .NET managed heap (per-generation sizes, fragmentation, GC mode), OS-specific figures (Linux /proc/self/status and smaps_rollup, cgroup limits, the glibc allocator ledger), host physical memory, and what LM-Kit holds (model weights, KV-cache, contexts). Intended for on-demand use when the operator opens the memory panel, not high-frequency polling.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/memory/gc-collect": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Runs a blocking, compacting full garbage collection and reports what was reclaimed.",
        "description": "Forces a full Gen2 collection with a one-time large-object-heap compaction, then returns the before/after working set and managed heap so the operator can see the effect.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/memory/trim": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Asks the native allocator to return freed-but-retained memory to the OS.",
        "description": "On glibc this calls malloc_trim(0), the direct lever for the arena-retention RSS growth seen under high-concurrency churn on Linux. On Windows it empties the process working set. Reports the before/after resident set so the operator can see the effect.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/memory/clear-caches": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Clears rebuildable LM-Kit SDK caches and reports what was reclaimed.",
        "description": "Drops the idle OCR engine pool, the idle inference-context recycle pool, and per-model tokenization / embedding lookup caches, then runs a collection. Loaded model weights and in-use contexts are never touched, so it is safe on a live server; the only cost is that the next request rebuilds what was dropped.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/dashboard/snapshot": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the heavier dashboard snapshot (upload-directory stats).",
        "description": "Intended for on-demand refresh; not for high-frequency polling.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/dashboard": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns live dashboard metrics.",
        "parameters": [
          {
            "name": "logLines",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/files/cleanup": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Triggers manual file cleanup of expired uploads.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/telemetry/status": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns live OpenTelemetry instruments discovered from watched meters, including per-tag-set breakdowns and histogram bucket distributions.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/telemetry/stream": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Streams telemetry snapshots via Server-Sent Events at 1Hz. Avoids the polling round-trip the panel used to do every second.",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/alerts/history": {
      "delete": {
        "tags": [
          "Administration"
        ],
        "summary": "Clears all recorded alerts. Returns the number of entries removed. Audit-logged to ActivityLog + LogManager so operators can trace who cleared the list.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns recent alert history (up to 200 entries).",
        "parameters": [
          {
            "name": "count",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/alerts/dismiss": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Dismisses the dashboard alert banner: mutes every currently-recorded alert so the banner disappears until a NEW threshold breach fires. The alerts are not deleted - the Alerts page still lists them and GET alerts/history returns them. Returns the number of alerts muted. Audit-logged.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/diagnostics/restart-report": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the latest restart-cause report, produced when the server detects that its previous run terminated without a clean shutdown (crash, OOM kill, host reboot, ...). Includes the classified cause, confidence, recommendation, and the raw OS-level evidence lines.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/diagnostics/restart-history": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the restart history: one entry per server start (normal start, admin restart, or crash recovery), newest first. Crash recoveries carry the full restart-cause report with evidence, so past incidents stay diagnosable long after their dashboard banner was dismissed.",
        "parameters": [
          {
            "name": "count",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/diagnostics/restart-report/acknowledge": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Acknowledges (dismisses) the current restart-cause report so the dashboard banner disappears. The dismissal is persisted and audit-logged; the report itself remains retrievable from GET diagnostics/restart-report.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RestartReportAcknowledgeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RestartReportAcknowledgeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RestartReportAcknowledgeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/audit/history": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Queries the persistent audit log (admin actions, alerts, control events). Supports filtering by minimum severity, source category, and a since-timestamp, with a hard limit of 5000 entries per call. The same store backs the in-memory dashboard activity feed; this endpoint is the durable history that survives process restarts.",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minLevel",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/audit/export": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the audit log as JSON Lines (one JSON object per line) for ingestion into log aggregators (Splunk, Datadog, ELK, Sentinel). Optionally filter by a since-timestamp.",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/jsonl": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/jsonl": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/models/disk-usage": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the actual disk usage of the model storage directory by scanning the filesystem. Reports total bytes on disk, file count, and the resolved directory path. This is the authoritative figure for 'how much space do the downloaded models take'. Summing catalog-metadata sizes can mislead because it counts only models the catalog knows about and uses each model's nominal file size, not what is actually on disk.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/processes": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the top host processes by CPU usage. CPU% is computed from the delta of TotalProcessorTime between successive calls; the first call after process start returns 0% for every entry, so callers that want meaningful values should poll at a few-second cadence.",
        "parameters": [
          {
            "name": "top",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/metrics/latency": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns recent request latency percentiles (P50/P90/P95/P99).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/metrics/endpoints": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns per-endpoint aggregated stats (count / latency / error rate).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/metrics/history/reset": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Clears recorded metric history (in-memory). Charts reset to empty.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/telemetry/history": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the persisted per-instrument time-series history (up to 1 hour at 1 Hz). Used by the telemetry panel to seed its live charts so users see real history when they open the page hours after the server started.",
        "parameters": [
          {
            "name": "count",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 60
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/telemetry/series": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns one instrument's durable, downsampled time-series over a window (seconds). Backs the telemetry panel's long windows (1h .. 7d) and survives a process restart, unlike the in-memory ring which is wiped on restart.",
        "parameters": [
          {
            "name": "instrument",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "window",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 14400
            }
          },
          {
            "name": "points",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 600
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/telemetry/reset": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Resets every OpenTelemetry instrument snapshot collected by the admin panel (counts, sums, bucket counts, per-tag-set state).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/metrics/history": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns recent samples for each metric tracked by the live dashboard.",
        "parameters": [
          {
            "name": "count",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 60
            }
          },
          {
            "name": "stride",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/metrics/stats": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns accurate window statistics (avg/min/max/last) per dashboard metric, computed from the raw 1 Hz samples.",
        "parameters": [
          {
            "name": "count",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 300
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/ocr/status": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the current OCR engine status: provider, in-flight operations, and concurrency configuration.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/inferences/active": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the list of currently in-flight inference requests.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/requests/active": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the API requests currently in flight, for the dashboard 'Active requests' panel.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/queue/active": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the inferences currently waiting for a scheduler slot, for the dashboard 'Queue depth' panel.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/jobs/active": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the background jobs currently processing, for the dashboard 'Active jobs' panel.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/jobs/{id}/cancel": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Cancels one in-flight background job from the admin console (admin override, any owner).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/apikeys": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists every API key the server accepts as a bearer token. Tokens are returned redacted.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Mints a new API key. The raw token is returned ONCE in this response - it cannot be re-displayed later.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.CreateApiKeyRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.CreateApiKeyRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.CreateApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/apikeys/{id}/revoke": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Revokes (disables but retains) an API key.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/apikeys/{id}/restore": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Re-enables a previously revoked API key.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/apikeys/{id}/regenerate": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Regenerates an API key's token. The key keeps its identity and access to all its resources; the old token stops working immediately. The new token is returned ONCE.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/apikeys/{id}/rename": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Updates the display name of an API key. The token and usage statistics are preserved.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.RenameApiKeyRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.RenameApiKeyRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.RenameApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/apikeys/{id}/tool-grants": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Sets which server-executed tools a key may use in chat: null follows the server policy, an empty list locks tools off, names narrow the policy.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.ApiKeyToolGrantsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.ApiKeyToolGrantsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.ApiKeyToolGrantsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/apikeys/{id}/cluster-grants": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Sets which search clusters a key may address: null restores the open default (any cluster), an empty list locks clusters off, ids restrict to those clusters.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.ApiKeyClusterGrantsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.ApiKeyClusterGrantsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.ApiKeyClusterGrantsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/apikeys/{id}/search-access": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Reports what one API key can reach in Search: its cluster grants, every configured cluster, and the tenants granted to it in each.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/apikeys/{id}": {
      "delete": {
        "tags": [
          "Administration"
        ],
        "summary": "Permanently deletes an API key. Use revoke if you might re-enable it later.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/stream-ticket": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Mints a seconds-lived ticket that authorizes one stream or download URL.",
        "description": "EventSource connections and anchor-tag downloads cannot carry the X-Admin-Password header, and the session token itself never rides a query string (URLs persist in proxy logs and browser history). This mints a ticket bound to one purpose ('events', 'telemetry', or 'uploads') that expires within seconds; pass it as ?ticket= to the matching endpoint.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StreamTicketRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/StreamTicketRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/StreamTicketRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/events": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Server-Sent Events stream that emits dashboard, inferences, and downloads ticks every second from a single long-lived connection. Replaces the three 1Hz polling endpoints (the polling endpoints still work as fallback).",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/security/audit": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns a security-posture audit: every hardening control the server exposes, whether it is at its recommended setting, and what to change to reach optimal security.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/security/admin-password": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Sets the first operator password, or changes the caller's own. Requires an authorized admin session.",
        "description": "While no operator account exists, this creates the first one ('admin', Owner) with the given password. Once accounts exist it changes the calling operator's own password and requires the current one; the account's other sessions and remembered devices are signed out.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.ChangeAdminPasswordRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.ChangeAdminPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/security/operators": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the operator accounts (admin).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Creates a new operator account (admin).",
        "description": "Adds a named operator with its own credential. Role is one of owner, admin, or viewer (stored now, enforced once role gates ship).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.OperatorCreateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.OperatorCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/security/me": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Describes the caller's own identity and access tier.",
        "description": "Who this session belongs to and what it may do: the operator's username and role for a local sign-in, the account identity for an SSO sign-in, or the open unprovisioned surface. The panel uses it to offer only the surfaces the role can act on.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/security/operators/{id}": {
      "put": {
        "tags": [
          "Administration"
        ],
        "summary": "Updates an operator's profile and role (Owner).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.OperatorUpdateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.OperatorUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Administration"
        ],
        "summary": "Deletes an operator account (Owner).",
        "description": "Removes the account permanently and ends its sessions. Prefer disabling, which keeps the name attributable in old audit entries; deletion is for accounts created in error.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/security/operators/{id}/enabled": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Enables or disables an operator account (Owner).",
        "description": "Disabling is the preferred way to retire an operator: sign-in is refused, its sessions and remembered devices end, and its name stays attributable in the audit trail.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.OperatorEnabledRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.OperatorEnabledRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/security/operators/{id}/reset-password": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Resets an operator's password to a one-time value (Owner).",
        "description": "Assigns a temporary password the operator must replace at the next sign-in. The account's sessions and remembered devices end immediately, so only the holder of the one-time value can return.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.OperatorPasswordResetRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.OperatorPasswordResetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/tls/info": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns metadata about the TLS certificate Kestrel is currently serving with, plus an inventory of TLS protocols and cipher suites available to the host.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/tls/certificate": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Uploads a PEM or PFX certificate bundle. The file is validated, re-exported to a stable per-server path, and used on the next restart. Restart the server (or click the Restart button on the dashboard) to apply.",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ContentType": {
                        "type": "string"
                      },
                      "ContentDisposition": {
                        "type": "string"
                      },
                      "Headers": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "Length": {
                        "pattern": "^-?(?:0|[1-9]\\d*)$",
                        "type": [
                          "integer",
                          "string"
                        ],
                        "format": "int64"
                      },
                      "Name": {
                        "type": "string"
                      },
                      "FileName": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "password": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Administration"
        ],
        "summary": "Removes the admin-uploaded TLS certificate so the server reverts to the self-signed fallback on the next restart.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/tls/acme": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the current ACME (Let's Encrypt) automatic-TLS settings and whether they are active on this run.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Updates the ACME (Let's Encrypt) automatic-TLS settings. Persisted to appsettings.json; a server restart is required to apply.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcmeConfigRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AcmeConfigRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/scheduler/jobs": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists every recurring server-side maintenance task and its last run, last duration, last status, and computed next run.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/scheduler/jobs/{name}/run": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Triggers one immediate pass of a named recurring maintenance task. The next scheduled tick is unaffected.",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/inferences/cancel-all": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Requests cancellation of every in-flight inference. Returns the number of inferences that were active when the call was made.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/server/restart": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Initiates a graceful server restart. In-flight inferences are cancelled, a fresh child process is spawned with the same command-line args + environment, and the current host stops cleanly. The child waits for this process to fully exit before binding its listeners, so there is a brief window of unavailability but no port conflict.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/inferences/{id}/cancel": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Requests cancellation of an in-flight inference by aborting the underlying HTTP connection.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/activity/recent": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the most recent activity feed entries.",
        "parameters": [
          {
            "name": "count",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/logs/download": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Downloads the complete retained log history.",
        "description": "Streams every retained log file (server.log plus all rotated archives) concatenated oldest-first as a single text/plain download. The dashboard polling endpoint is capped at 500 lines for low-latency UI updates; this endpoint is the canonical way to retrieve the full on-disk history.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/logs/file": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the retained log history as JSON, with cursor pagination for scroll-back.",
        "description": "Reads every retained log file (server.log plus rotated archives) and returns a page of entries in chronological order. Without <c>beforeLine</c>: returns the most recent <c>maxLines</c> entries (the tail). With <c>beforeLine=K</c>: returns up to <c>maxLines</c> entries strictly older than line K, for scroll-up pagination. Lines are numbered 1..<c>totalLines</c> across the full retained set (1 = oldest, totalLines = newest). Response envelope: { logs, totalLines, totalBytes, truncated, fromLine, toLine, files }. <c>fromLine</c>/<c>toLine</c> bracket the returned page; pass <c>fromLine</c> back as the next <c>beforeLine</c> to walk further into history. <c>truncated=true</c> on the tail call means the full set exceeds the cap (use /logs/download for the complete archive). <c>maxLines</c> defaults to 20000 and is clamped to [100, 200000]; the UI uses 2000 per scroll batch.",
        "parameters": [
          {
            "name": "maxLines",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20000
            }
          },
          {
            "name": "beforeLine",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/logs/clear": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Clears the server log file.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/requests/clear": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Clears the request history.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/requests": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the recorded request history with filters and sorting. Use this for audit and incident investigation.",
        "description": "All filter parameters are optional and AND-combine. method: GET/POST/etc. statusClass: 2xx/3xx/4xx/5xx. statusCode: exact status code (overrides statusClass). path: case-insensitive substring of the request path. clientIp: exact match. apiKeyId: stable identifier from ApiKeyStore (exact match). apiKey: case-insensitive substring of the audit-safe display form (key name or redacted token). requestId: exact match. minMs/maxMs: duration bounds in milliseconds. keyPresence: anonymous (no key supplied) or identified (any key supplied). hasError: true => only rows with a captured error summary, false => only rows without one. sinceUtc/untilUtc: ISO-8601 inclusive bounds. limit: page size, clamped to a server-side maximum (default 200). offset: row offset for pagination (default 0, requires SQLite path). sort: newest (default), oldest, slowest, fastest, status.",
        "parameters": [
          {
            "name": "method",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statusClass",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statusCode",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "path",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pathExact",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientIp",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "apiKeyId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "apiKey",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "requestId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minMs",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          },
          {
            "name": "maxMs",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          },
          {
            "name": "keyPresence",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hasError",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sinceUtc",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "untilUtc",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 200
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "newest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/requests/timeseries": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns a bucketed request-count timeseries for the same filter shape as /requests.",
        "description": "Aggregates rows in the request audit store into fixed-width time buckets. Drives the request-volume chart on the admin Requests page. When sinceUtc is omitted the window starts at the oldest matching row, so the series covers the full filtered history. When bucketSeconds is omitted a width is auto-selected so the window spans at most ~120 buckets. The response echoes the effective sinceUtc/untilUtc/bucketSeconds used.",
        "parameters": [
          {
            "name": "method",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statusClass",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statusCode",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "path",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pathExact",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientIp",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "apiKeyId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "apiKey",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "requestId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minMs",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          },
          {
            "name": "maxMs",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          },
          {
            "name": "keyPresence",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hasError",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sinceUtc",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "untilUtc",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "bucketSeconds",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/requests/stats": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns an aggregate summary (status mix, latency percentiles, byte totals) of the rows matching the same filters as /requests.",
        "description": "Aggregates the FULL filtered result set, not one page: total row count, per-status-class counts, combined error rate, p50/p95/avg/max duration, and request/response byte totals. Drives the stats strip above the audit-log table. All filter parameters mirror /requests.",
        "parameters": [
          {
            "name": "method",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statusClass",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statusCode",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "path",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pathExact",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientIp",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "apiKeyId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "apiKey",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "requestId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minMs",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          },
          {
            "name": "maxMs",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          },
          {
            "name": "keyPresence",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hasError",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sinceUtc",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "untilUtc",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/requests/aggregate": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns top-talker aggregates (by API key or client IP) over the rows matching the same filters as /requests.",
        "description": "Groups the filtered rows by API key (by=key, default) or client IP (by=client) and returns the busiest groups first: request count, 4xx/5xx split, error rate, p50/p95 latency, and last-seen timestamp. Key buckets carry the stable ApiKeyStore id when the token resolved, so a row can be turned into an apiKeyId filter with one click. Anonymous traffic collapses into a single empty-id bucket. top caps the group count (default 25, max 100).",
        "parameters": [
          {
            "name": "by",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "key"
            }
          },
          {
            "name": "top",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 25
            }
          },
          {
            "name": "method",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statusClass",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statusCode",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "path",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pathExact",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientIp",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "apiKeyId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "apiKey",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "requestId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minMs",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          },
          {
            "name": "maxMs",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          },
          {
            "name": "keyPresence",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hasError",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sinceUtc",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "untilUtc",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/requests/export": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Exports recorded requests as CSV, with the same filters as the /requests endpoint.",
        "description": "Streams every persisted row that matches the supplied filter as CSV (one row per request). Designed for incident export and downstream analysis: open in Excel / a pandas dataframe / a BI tool. No row cap is applied: exports walk the full filtered result set, not just the current page. All filter parameters mirror /requests.",
        "parameters": [
          {
            "name": "method",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statusClass",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statusCode",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "path",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pathExact",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientIp",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "apiKeyId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "apiKey",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "requestId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minMs",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          },
          {
            "name": "maxMs",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          },
          {
            "name": "keyPresence",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hasError",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sinceUtc",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "untilUtc",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "newest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/downloads/start": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Starts a model download as a background task.",
        "description": "Schedules a background download for the supplied modelId and returns immediately. Progress is reported through GET /admin/downloads/active and the download survives client disconnects or page reloads. Cancel via POST /admin/downloads/cancel. Requires the X-Admin-Password header when an admin password is configured.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.DownloadRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.DownloadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/downloads/cancel": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Cancels an in-progress model download.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.DownloadRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.DownloadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/downloads/active": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the list of active and recently completed downloads.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/ocr/textract/test": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Tests AWS Textract connectivity with the supplied credentials.",
        "description": "Signs a minimal Textract DetectDocumentText request with SigV4 and sends it to the target region. Any field left blank (including a masked secret of ****) falls back to the stored server configuration.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TextractTestRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TextractTestRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/logs/stream": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Streams log entries in real-time via Server-Sent Events.",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/config/export": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Downloads the current appsettings.json configuration.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/config/import": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Uploads and replaces the appsettings.json configuration.",
        "description": "Replaces the whole settings file, every section included. Because that reaches the Owner-only sections (Security, SSO) the piecemeal configuration API refuses to Admin sessions, the import needs the Owner role: anything less would let an Admin write through the file what the API refuses at the boundary.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/models/unload": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Unloads a model from memory.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelUnloadRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelUnloadRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ModelUnloadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/models/load": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Loads a model into memory by model ID.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelUnloadRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelUnloadRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ModelUnloadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/models/delete": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Deletes a downloaded model file from disk.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelUnloadRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelUnloadRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ModelUnloadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/models/delete-all": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Deletes every file in the model storage directory. Unloads any in-memory models first.",
        "description": "Wipes the contents of the configured model directory. Any currently-loaded model is unloaded first so its on-disk file can be removed (unloads that fail because the model is in use leave that file skipped and counted in 'skippedInUse'). Active downloads are cancelled best-effort. Returns the aggregate count and byte total of deleted files, plus a list of files that could not be deleted.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/uploads/disk-usage": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the actual disk usage of the upload directory by scanning the filesystem. Reports total bytes on disk, file count (excluding .manifest sidecars), and the resolved directory path.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/uploads/delete-all": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Deletes every file in the upload directory.",
        "description": "Wipes the contents of the configured upload directory, including manifest sidecars. Files locked by an in-flight request are skipped and reported in 'failed'. Returns the aggregate count and byte total of deleted files.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/uploads/files": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the files in the upload directory for browsing in the admin console.",
        "description": "Returns one entry per stored file (manifest sidecars excluded), each with its path relative to the upload root, its original upload name (resolved from the manifest when present), size, last modified time, and owner bucket. Use the path with the download endpoint to fetch a single file.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/uploads/download": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Downloads a single file from the upload directory by its path relative to the upload root.",
        "description": "The path must stay inside the upload directory; any path that escapes it (\"..\" traversal or an absolute path) is rejected. The file is served as an attachment under its original upload name.",
        "parameters": [
          {
            "name": "path",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/uploads/download-all": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Downloads the entire upload directory as a single zip archive.",
        "description": "Streams a zip of every file in the upload directory (including manifest sidecars), preserving the per-owner bucket structure. Files locked by an in-flight request are skipped.",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/hibernation/disk-usage": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the actual disk usage of the context hibernation directory by scanning the filesystem. Reports total bytes on disk, file count, and the resolved directory path.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/hibernation/delete-all": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Deletes every file in the context hibernation directory.",
        "description": "Wipes the contents of the configured hibernation cache directory. Files locked by active sessions are skipped and reported in 'failed'. Returns the aggregate count and byte total of deleted files.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Creates a new Search cluster and initializes its schema.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceClusterCreateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceClusterCreateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceClusterCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/test": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Tests a Search cluster connection without saving it.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceClusterCreateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceClusterCreateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceClusterCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/test": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Tests an existing Search cluster connection. With no body it tests the cluster's stored connection; with a body it tests the supplied (edited) parameters, keeping the stored password where a field is left blank.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceClusterCreateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceClusterCreateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceClusterCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/connection": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns an existing Search cluster's connection parameters (passwords redacted) so the admin UI can pre-fill the edit form.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Administration"
        ],
        "summary": "Changes an existing Search cluster's connection parameters. Blank password fields keep the stored password. The new connection is validated and migrated before it is persisted; on failure the previous connection is restored.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceClusterCreateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceClusterCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}": {
      "delete": {
        "tags": [
          "Administration"
        ],
        "summary": "Deletes a Search cluster from configuration. Data in PostgreSQL is left intact.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/default": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Sets a Search cluster as default.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/tenants": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists every tenant in a Search cluster, across all owners.",
        "description": "The expensive per-tenant page/vector totals are served from a short-lived cache so the list renders immediately; a tenant whose totals are still being computed is flagged statsPending. Pass fresh=true to recompute every count synchronously (the explicit per-tenant Refresh action).",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fresh",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Provisions a new tenant in a Search cluster.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantCreateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantCreateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/tenants/{tenantId}/access": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists API keys and whether each one can access a tenant (per-key grant).",
        "description": "A key can reach the tenant when it has been granted that tenant. Revoked keys are omitted.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Grants or revokes one API key's access to one tenant (per-tenant grant).",
        "description": "Granting adds an access grant for this one key on this one tenant; revoking removes it. Grants are additive and per-tenant, so they never affect the key's access to any other tenant. Revoking a key that reached the tenant through ownership retires that ownership (granting the owner's other active keys first) so the revoke takes effect.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantAccessRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantAccessRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantAccessRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/health": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns operational health for a Search cluster.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/storage": {
      "put": {
        "tags": [
          "Administration"
        ],
        "summary": "Sets a Search cluster's storage-volume size for the admin disk-usage bar. Display metadata only - PostgreSQL cannot read the OS volume size on a managed instance - so it never touches the database and works even when the backend is read-only or full. Pass maxStorageGb (0 clears it).",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceStorageRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceStorageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/column-storage": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Estimates per-column on-disk storage for a Search cluster's heavy tables (sampled pg_column_size scaled by live row count). Tells apart a multi-GB column (e.g. ft_search.page_markdown) from a negligible one, to target space reclamation.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/diagnostics": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns database diagnostics for a Search cluster: server overview, per-index usage and size, and per-table access patterns.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/search/worker": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the live state of the background embedding/reindex worker (process-global): status, current phase and operation age, trailing-window throughput per cluster, inference-lane occupancy, the data-plane admission-gate queue, parked tenants, and a recent event timeline. Lightweight and pollable - reads in-process state only, no database query.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/search/metrics": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the Search live-telemetry series (query latency/throughput, connection-gate and embedding-lane occupancy, worker write/drain/backlog, and live database health: delta cache-hit ratio, disk-read rate, transaction rate, active backends, and the longest-running query) as recent per-metric sample arrays, plus a database-health headline. Reads only the in-process metric ring and the sampler's last snapshot - no database query runs on this path, so the panel can poll it freely.",
        "parameters": [
          {
            "name": "count",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 300
            }
          },
          {
            "name": "stride",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "cluster",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/search/top-queries": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the cluster's cumulative per-query statistics from pg_stat_statements, ordered by total execution time: the aggregate view of what has cost the database the most since its statistics were last reset (catching the frequent-but-fast as well as the rare-but-huge). Installs the extension on first use; reports available=false when the managed instance does not preload it. Query text of other database roles may read '<insufficient privilege>' while its timings stay real.",
        "parameters": [
          {
            "name": "cluster",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/search/slow-queries/reset": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Clears the cluster's slow-query views so they measure from a clean slate after a deploy: empties the in-memory live trace (finished entries keep their durable copy in the server log) and resets the database's cumulative pg_stat_statements ranking. statementsReset reports whether the database-side reset succeeded; a managed instance may refuse it when the admin role lacks the privilege, in which case the trace is still cleared and detail carries the database's error text.",
        "parameters": [
          {
            "name": "cluster",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/explain": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Captures the query plan for a search under a tenant's row-level-security scope, so the plan reflects a real caller's query. Mode 'fulltext' (default) explains the BM25 inverted-index scan; mode 'vector' embeds the query with the tenant's model and explains the semantic retrieval.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceExplainRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceExplainRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/analyze": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Refreshes PostgreSQL planner statistics (ANALYZE) for a Search cluster's tables so the planner uses the GIN and HNSW indexes instead of sequential and per-row scans. Autovacuum never analyzes the partitioned parent tables, so this is the supported way to keep statistics fresh. Safe to run on a live cluster.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/rebuild-fulltext-index": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Rebuilds the full-text GIN index across every ft_search partition for a Search cluster. Recovers an index left invalid (silently ignored by the planner, forcing a sequential scan); CREATE INDEX IF NOT EXISTS cannot repair an existing-but-invalid index. Holds a brief lock on ft_search while the GIN builds.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/rebuild-vector-indexes": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Rebuilds every invalid per-model vector HNSW index for a Search cluster so semantic and hybrid search use the index instead of a full scan. An invalid HNSW index is silently ignored by the planner. HNSW indexes can be large, so a rebuild can take minutes and holds a lock on its table while it builds; valid indexes are skipped.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/tenants/{tenantId}": {
      "delete": {
        "tags": [
          "Administration"
        ],
        "summary": "Deletes a tenant's indexed data from a Search cluster. With scope=collections only its collections and data are removed and the tenant is kept; otherwise the whole tenant is offboarded. Runs in the background and reports live progress through the tenant list.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/tenants/{tenantId}/cancel-delete": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Cancels an in-flight tenant deletion. The deletion's transaction is rolled back, so the tenant and all of its data are left fully intact.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/tenants/{tenantId}/whale": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Switches a tenant between dedicated vector partitions and the shared pool.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantWhaleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantWhaleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantWhaleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/tenants/{tenantId}/embedding-model": {
      "put": {
        "tags": [
          "Administration"
        ],
        "summary": "Sets a tenant's embedding model (re-embeds its semantic collections in the background).",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantModelRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantModelRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantModelRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/tenants/{tenantId}/ocr": {
      "put": {
        "tags": [
          "Administration"
        ],
        "summary": "Enables or disables OCR for a tenant (applies to newly indexed documents).",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantOcrRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantOcrRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantOcrRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/tenants/{tenantId}/search-modes": {
      "put": {
        "tags": [
          "Administration"
        ],
        "summary": "Sets a tenant's search modes (full-text / semantic), applied to all its collections.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantSearchModesRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantSearchModesRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantSearchModesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/tenants/{tenantId}/analyzer": {
      "put": {
        "tags": [
          "Administration"
        ],
        "summary": "Sets a tenant's full-text analyzer folding (case / diacritics); triggers a re-index.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantNormalizationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantNormalizationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantNormalizationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/tenants/{tenantId}/reindex-fulltext": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Rebuilds a tenant's full-text index from the stored page markdown, with no re-ingestion. Runs in the background.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/tenants/{tenantId}/reindex-semantic": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Starts a tenant-wide semantic rebuild in the background: every document's embedding stamp is cleared and every existing vector row is erased in bounded batches, then the reindex worker re-embeds the corpus from stored page text through the chunk quality gate. Returns 202 immediately; the tenant list reports live progress. Full-text search is unaffected.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/tenants/{tenantId}/cancel-reindex-semantic": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Cancels an in-flight semantic rebuild. The erase stops between batches; documents whose embedding stamp was already cleared still re-embed in the background, so the index stays consistent.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/tenants/{tenantId}/config": {
      "put": {
        "tags": [
          "Administration"
        ],
        "summary": "Updates all of a tenant's indexing settings at once: embedding model, OCR, search modes, and text normalization.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantConfigRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceTenantConfigRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/search/failed-input-capture": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Gets the Search failed-input capture diagnostics setting (server-wide).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Administration"
        ],
        "summary": "Enables or disables Search failed-input capture and sets its directory (server-wide).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceFailedCaptureRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceFailedCaptureRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/search/quality-gate": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Gets the server-wide semantic quality-gate default (mode and profile) that tenants inherit.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Administration"
        ],
        "summary": "Sets the server-wide semantic quality-gate default (mode and profile) that tenants inherit.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceQualityGateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceQualityGateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/search/reindex-parallelism": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Gets how many documents the Search reindex worker processes in parallel during embedding and full-text rebuilds (server-wide).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Administration"
        ],
        "summary": "Sets how many documents the Search reindex worker processes in parallel during embedding and full-text rebuilds (server-wide, live).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceReindexParallelismRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceReindexParallelismRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/database-advisor": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Reports a cluster's database-configuration findings: what the server raised itself, what it adapted around, and what only the platform operator can change (with recommended values).",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "refresh",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/search/ingestion-limits": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Gets the Search ingestion page-size limits (server-wide).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Administration"
        ],
        "summary": "Sets the Search ingestion page-size limits (server-wide, live).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceIngestionLimitsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceIngestionLimitsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/tenants/{tenantId}/collections": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists one page of a tenant's collections with their indexing settings and reindex progress.",
        "description": "Paged: offset/limit bound the returned rows AND the per-collection count queries, so the cost scales with the page size, not the tenant's collection count (limit <= 0 returns everything, the pre-paging behavior). q filters case-insensitively on display name and public id. totalCollections is the tenant's full count, matchingCollections the count matching q.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/models": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the embedding models available in a Search cluster.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/rerank-models": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the reranking models available for the tenant rerank-model setting.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/query-models": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the query-understanding models available for Search tenants.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/tenants/{tenantId}/collections/{collectionId}": {
      "put": {
        "tags": [
          "Administration"
        ],
        "summary": "Updates one collection's settings (display name, full-text language).",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "collectionId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceCollectionUpdateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceCollectionUpdateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceCollectionUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Administration"
        ],
        "summary": "Deletes a single collection and all of its indexed data (documents, pages, vectors) within a tenant. The tenant and its other collections are untouched. Runs in the background and reports live progress through the collection list.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "collectionId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/tenants/{tenantId}/collections/{collectionId}/rebuild": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Rebuilds a collection's search index. Semantic: every existing vector row is deleted up front (in the scheduling transaction), then documents re-embed from stored page text through the chunk quality gate. Full-text: regenerated in place, zero downtime.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "collectionId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceCollectionRebuildRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceCollectionRebuildRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SearchServiceCollectionRebuildRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/clusters/search/{clusterId}/tenants/{tenantId}/collections/{collectionId}/cancel-delete": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Cancels an in-flight collection deletion. The deletion's transaction is rolled back, so the collection and all of its data are left fully intact.",
        "parameters": [
          {
            "name": "clusterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "collectionId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/collections": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns all Search clusters with their tenant counts.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/doc/upload": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Uploads a document for the playground's document chat (admin playground).",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ContentType": {
                    "type": "string"
                  },
                  "ContentDisposition": {
                    "type": "string"
                  },
                  "Headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "Length": {
                    "pattern": "^-?(?:0|[1-9]\\d*)$",
                    "type": [
                      "integer",
                      "string"
                    ],
                    "format": "int64"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "FileName": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/doc/from-url": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Fetches a document from a web address into the playground's file store (admin playground).",
        "description": "The server downloads the document itself, applies the same format and size gates as a direct upload, and returns {fileId, name, size}. The name comes from Content-Disposition, the URL path, or the content type, in that order.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.PlaygroundDocFromUrlRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.PlaygroundDocFromUrlRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/files/{fileId}/content": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Streams a stored file's content to the playground (admin playground).",
        "description": "The playground's download path for files chat produced or received: the admin session authorizes it, so no API key is needed. Content-Disposition carries the stored filename.",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/doc/session": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Indexes an uploaded document and opens a chat session over it, narrated as SSE (admin playground).",
        "description": "Streams status events while the models prepare and the document indexes (phase: downloading/loading/embedder/indexing with page progress), then a done event with {sessionId, name, pages, tokens, mode, model}.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.PlaygroundDocSessionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.PlaygroundDocSessionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/doc/ask": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Asks the loaded document a question, streamed with page citations (admin playground).",
        "description": "SSE: status (retrieving/prompt), delta {t: thinking|text, d}, then done {text, model, tokens, rate, prompt_tokens, prompt_secs, gen_secs, reason, ctx, ctx_max, citations: [{page, excerpt, score}]}. Field names follow the native chat done contract. Citations are per page, relevance-ordered.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.PlaygroundDocAskRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.PlaygroundDocAskRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/doc/attach": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Adds another document to an open session, narrated as SSE (admin playground).",
        "description": "Indexes the file into the existing session so later questions answer across every attached document; citations name the document they came from.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.PlaygroundDocAttachRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.PlaygroundDocAttachRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/redact/apply": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Applies a reviewed redaction proposal to a stored PDF or image (admin playground).",
        "description": "The burn half of human-in-the-loop redaction: pdf_redact_preview proposed the areas, the user reviewed them as marks in the viewer, and this applies exactly those areas. No model is in the loop. PDFs burn through the same operation and stored options as pdf_redact; images burn through the same operation as document_redact, with areas in image pixels. Returns {fileId, name} of the redacted copy; the source is unchanged.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.PlaygroundRedactApplyRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.PlaygroundRedactApplyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/doc/state": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Reports whether a document session is still resident (admin playground).",
        "description": "A liveness probe for the page's warmth indicator. Does NOT refresh the session's idle clock, so asking never keeps a session alive.",
        "parameters": [
          {
            "name": "sessionId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/doc/skip-thinking": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Ends the model's thinking phase on a document exchange (admin playground).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.PlaygroundDocAskRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.PlaygroundDocAskRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/doc/session/{sessionId}": {
      "delete": {
        "tags": [
          "Administration"
        ],
        "summary": "Closes a playground document session and frees its resources (admin playground).",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/doc/file/{fileId}": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Serves an uploaded document's bytes for the playground's viewer (admin playground).",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/doc/thumb/{fileId}": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Renders one page of an uploaded document as an image (admin playground).",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Zero-based page index.",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Longest-side pixel size.",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 400
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/doc/locate": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Locates a citation's excerpt on its page and returns highlight regions (admin playground).",
        "description": "Fuzzy-matches the excerpt's lead against the page's text layout and returns {pageWidth, pageHeight, rects: [{x, y, w, h}]} in page points with a top-left origin, ready for the viewer's annotation overlay. An empty rects array means the excerpt could not be located (scanned page, heavy reflow).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.PlaygroundDocLocateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.PlaygroundDocLocateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/fs/directories": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists server-side directories for the admin panel's folder picker (host sessions only).",
        "description": "Returns {path, parent, dirs, roots} for the given directory, or the file system roots when path is blank. Directory names only, never file contents. Offered only to admin sessions on the server host itself, mirroring the panel's host-only path fields; remote sessions receive 404.",
        "parameters": [
          {
            "name": "path",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/mcp/catalog": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the Model Context Protocol tool catalog with its exposure state",
        "description": "Returns every tool the server can expose over MCP, whether or not it is currently exposed, so the panel can present the full catalog with toggles. Each entry carries the metadata the permission policy and the client's approval prompts are driven by: category, side effect, risk level, and whether the tool is read-only. The 'enabled' flag is evaluated with the same policy the running endpoint applies, so the panel cannot disagree with what clients actually see. Read-only.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/mcp/sessions": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the live Model Context Protocol sessions",
        "description": "Returns the sessions currently held by the MCP endpoint, newest activity first: the client name and version reported at initialization, the negotiated protocol version, age, idle time, and the number of tool calls served. Returns an empty list when the endpoint is disabled. Read-only.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/mcp/prompts": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the Model Context Protocol workflows this server defines",
        "description": "Returns every workflow with its arguments, the tools it runs, and whether the current tool exposure lets a client be offered it. Clients only ever see the available ones; the panel lists the rest too, naming the missing tools, so an operator can see what offering a hidden workflow would take. Read-only.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/mcp/tools/invoke": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Runs one MCP tool with the supplied arguments, for the catalog's tester (admin).",
        "description": "Executes the named tool through the same registry and policy the running endpoint applies and returns its textual content, structured payload, and duration. Only tools the policy exposes run; the call is journaled in the activity log. Trust in a tool comes from running it once.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.McpToolInvokeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.McpToolInvokeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/memory/stores": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the memory stores with their policies and live usage (admin).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/memory/stores/{store}/keys": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the memory ids filed under a store (admin).",
        "parameters": [
          {
            "name": "store",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/memory/stores/{store}/keys/{key}": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists every fact one memory holds (admin).",
        "description": "Loads the memory and enumerates its facts: text, memory type, and the data-source id a deletion targets. Requires the Memory feature (loading rides the embedding model).",
        "parameters": [
          {
            "name": "store",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Administration"
        ],
        "summary": "Forgets one whole memory (admin).",
        "parameters": [
          {
            "name": "store",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/memory/stores/{store}/keys/{key}/facts/{factId}": {
      "delete": {
        "tags": [
          "Administration"
        ],
        "summary": "Forgets one fact (admin).",
        "parameters": [
          {
            "name": "store",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "factId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/memory/stores/{store}/keys/{key}/consolidate": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Merges near-duplicate facts inside one memory (admin).",
        "description": "Runs the memory engine's consolidation with the server's default chat model: similar facts cluster and merge into consolidated entries. Returns what changed ({clustersMerged, entriesRemoved, entriesCreated, before, after}) and persists the result.",
        "parameters": [
          {
            "name": "store",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/models/import": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Imports a model as a custom model, from a server-local file or the Hugging Face hub.",
        "description": "Registers a servable custom model. With 'path', a GGUF or LMK file already on the server is inspected (architecture, context length, capabilities, embedded license), content-hashed with SHA-256, and added to the registry under the given name. With 'url' (hf.co/owner/repo[:quant]), the repository is resolved through the server's egress policy and the artifacts stream into the content-addressed blob store with hub-declared digests verified while downloading. With 'probe' true, the model is then loaded and exercised (decode, tool round-trip, embeddings) and the measured verdicts recorded; a capability measured broken is refused at request time. Custom models surface beside the catalog on every model listing, marked Unverified.",
        "requestBody": {
          "description": "The import request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelImportRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ModelImportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/models/custom/probe": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Runs the dynamic capability probe on a custom model.",
        "description": "Loads the model and measures what it actually does: a short decode, a forced tool round-trip, and an embedding pass for embedding-capable models. Verdicts persist on the record; a capability measured broken is refused at request time with the measurement as the reason. Re-run after changing the tool dialect.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "The custom model's canonical name. A query parameter because hub-imported names carry slashes.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/models/tool-dialects": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the tool-call dialects a custom model can declare.",
        "description": "The dialect names accepted by the import's toolDialect field, straight from the engine's enum so the admin UI never drifts from it.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/models/custom": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the custom models the registry serves beside the catalog.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Administration"
        ],
        "summary": "Removes a custom model from the registry.",
        "description": "Unloads the model if resident, then removes its registry record. The artifact file stays on disk: imported files are operator-owned. A model actively serving requests is refused.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "The custom model's canonical name. A query parameter because hub-imported names carry slashes.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/transcribe": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Transcribes a recorded audio clip into text (admin playground).",
        "description": "Multipart upload of a browser recording (ogg/opus preferred, webm accepted where ffmpeg is available). Runs the server's default speech-to-text model and returns {text}. First use may wait on the speech model downloading or loading.",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ContentType": {
                    "type": "string"
                  },
                  "ContentDisposition": {
                    "type": "string"
                  },
                  "Headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "Length": {
                    "pattern": "^-?(?:0|[1-9]\\d*)$",
                    "type": [
                      "integer",
                      "string"
                    ],
                    "format": "int64"
                  },
                  "Name": {
                    "type": "string"
                  },
                  "FileName": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/title": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Writes a short display title for a playground conversation (admin playground).",
        "description": "One cheap greedy completion on the (typically resident) model: at most a few words naming what the first exchange is about. Returns {title}; an empty title means the caller should keep its fallback.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaygroundTitleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PlaygroundTitleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/chat/skip-thinking": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Ends the thinking phase of a running playground exchange; the answer continues (admin playground).",
        "description": "Addresses the exchange by the request_id it was started with. Delegates to the native chat pipeline's side channel; kept beside the stream route so the playground needs no API key.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkipThinkingRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SkipThinkingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/chat/stream": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Streams a chat completion from any catalog model (admin playground).",
        "description": "The native lmkit/v1/chat pipeline behind the playground's admin session: identical event grammar (status, delta, skill, done, error), always streaming. See POST /lmkit/v1/chat for the contract.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ChatRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/setup/state": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns the live setup state: capability states, detected active uses, security posture summary, hardware, and MCP connection material.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/setup/plan": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Dry-runs a setup path: returns every configuration change it would make in plain words, with warnings, blocking issues, and restart consequences. Changes nothing.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.SetupRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.SetupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/setup/apply": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Applies a setup path. Re-plans from the submitted answers against the current configuration, refuses blocked plans, and writes through the same configuration pipeline as the admin form.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.SetupRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.SetupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/setup/verify": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Verifies a setup path against live state: every check re-reads current configuration and runtime, so the result is honest after restarts and manual edits alike.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.SetupRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.SetupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/skills": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the server's Agent Skills for the playground picker.",
        "description": "Returns {enabled, skills:[{name, description, version, mode, manualOnly, resources}]}. 'manualOnly' skills can be pinned by the user but are never offered to the model for self-activation. Reports {enabled:false} with an empty list while skills are turned off, so the picker can render its disabled state.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/skills/catalog": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the server's Agent Skills with their folders, validation issues, and load failures (admin).",
        "description": "The admin panel's skills inventory: every loaded skill with its folder and any specification issues, plus the folders whose SKILL.md failed to parse. The directory is the configured skills root, resolved to an absolute path.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/skills/skill": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns one skill's full content for the admin editor (admin).",
        "description": "The editable fields: description, the SKILL.md instruction body, and the manual-only flag, plus the read-only version and folder.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/skills/install-url": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Installs a skill from a URL: a SKILL.md, a ZIP of skill folders, or a GitHub tree URL (admin).",
        "description": "Fetches the skill, copies it into the skills directory, and registers it immediately. Existing names are never overwritten.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillUrlRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SkillUrlRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/skills/resources/add": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Adds a reference file to a skill (admin).",
        "description": "Uploads one text reference into the skill's references folder; the model loads it on demand when the skill is active. Text formats only, capped in size.",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "ContentType": {
                        "type": "string"
                      },
                      "ContentDisposition": {
                        "type": "string"
                      },
                      "Headers": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "Length": {
                        "pattern": "^-?(?:0|[1-9]\\d*)$",
                        "type": [
                          "integer",
                          "string"
                        ],
                        "format": "int64"
                      },
                      "Name": {
                        "type": "string"
                      },
                      "FileName": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/skills/resources/delete": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Removes a reference file from a skill (admin).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillResourceRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SkillResourceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/skills/create": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Creates a new skill from the admin editor (admin).",
        "description": "Writes a SKILL.md folder named after the skill into the skills directory and registers it immediately. The name must be lowercase letters, digits, and hyphens.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillEditRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SkillEditRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/skills/update": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Rewrites an existing skill from the admin editor (admin).",
        "description": "Updates the skill's SKILL.md in place, preserving version, license, and mode fields, and re-registers it immediately.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillEditRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SkillEditRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/skills/delete": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Deletes a skill's folder from the skills directory (admin).",
        "description": "Removes the folder and unregisters the skill. Refuses folders outside the configured skills directory.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillEditRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SkillEditRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/skills/draft": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Drafts a skill's instruction body with the server's default chat model (admin).",
        "description": "One completion on the default chat model turns the skill's name and description into a Markdown instruction body for the editor. First use may wait on the model downloading or loading.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillDraftRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SkillDraftRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/skills/predefined": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the predefined skill library with each entry's installed state (admin).",
        "description": "The curated skills the panel offers for one-click install: name, description, and whether a skill with that name is already registered.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/skills/install": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Installs predefined library skills into the skills directory (admin).",
        "description": "Writes each named library skill as a SKILL.md folder and registers it immediately. Names already registered are reported as skipped rather than overwritten.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillInstallRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SkillInstallRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/sso/status": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Reports whether single sign-on is offered, for the sign-in form.",
        "description": "Anonymous by design: the sign-in form must know what to render before any credential exists. Returns {enabled, provider, passwordLogin}; nothing about the provider's configuration leaks beyond its display name.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/sso/test": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Probes an identity provider's discovery document (admin).",
        "description": "Fetches <authority>/.well-known/openid-configuration for the authority in the body (falling back to the saved one), so an operator proves the provider answers BEFORE trusting it as the only door. Reports the issuer and which endpoints it names; nothing is signed in and nothing is saved.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.SsoTestRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.SsoTestRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfigurationController.SsoTestRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/sso/challenge": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Starts the single sign-on flow by redirecting to the identity provider.",
        "description": "Stores a single-use, process-local challenge (state, nonce, PKCE verifier, destination) and redirects to the provider's authorization endpoint. 'return' names the same-site path to land on afterwards; anything else falls back to the root.",
        "parameters": [
          {
            "name": "return",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Found"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/sso/callback": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Finishes the single sign-on flow and hands the session to the page.",
        "description": "The redirect URI registered at the provider. Validates the identity token against the provider's keys and the stored challenge, applies the domain and group filters, then mints the same process-local session a password sign-in gets.",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "error",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "error_description",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Found"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/tools": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the server-executed tools offered to the playground chat.",
        "description": "Returns {enabled, tools:[{name, description}]}: the curated built-in tools the server's Tools policy currently offers. Reports {enabled:false} with an empty list while tools are turned off, so the composer can render its disabled state.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/tools/enable": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Turns on named server tools from the playground (admin).",
        "description": "Allows the named tools, switching tools on server-wide when they were off entirely, and optionally adds one ingest folder for the disk-facing file tools. Returns {turnedOn, still, agents}: what the policy now offers, what still cannot run and why, and the refreshed agent list.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaygroundToolsEnableRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaygroundToolsEnableRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PlaygroundToolsEnableRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/agents/instructions": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Updates a named agent's instruction (admin).",
        "description": "Replaces the agent's system instruction and persists it. Returns {success, agents}: the refreshed agent list as the playground renders it. The instruction cannot be emptied from here; removing it entirely is an admin-panel decision.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentInstructionsUpdateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentInstructionsUpdateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AgentInstructionsUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/playground/turn-context/{id}": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Returns a recent turn's full engine transcript as plain text (playground diagnostics).",
        "description": "The engine-eye dump of one turn: every token the engine decoded, special markers kept (system prompt, chat template, tool definitions, history, generation). Fetched by the kv_id handle the turn's done event carried. Transcripts are held briefly and bounded; an expired handle returns 404.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/agents/usage": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Requests per agent over the last seven days, from the persisted audit trail.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/tools/catalog": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists the server-executed tool catalog with each tool's live enabled state (admin).",
        "description": "The admin panel's tools inventory: every tool the server exposes for server-side execution, with its description, display group, and whether the current policy offers it. Curated safe computation, web search, allowlisted HTTP, and the server's own document tools (file access limited to the configured ingest roots); nothing reaching arbitrary disk paths or processes is exposed at all.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/tools/websearch-check": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Checks whether a SearXNG instance answers the JSON API the web-search tool uses (admin).",
        "description": "Returns {state, detail}: state is ok, empty, invalid, unreachable, json-disabled, or error, and detail is the sentence the panel shows. Never throws on a bad address; an unreachable instance is a result, not an error.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebSearchCheckRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WebSearchCheckRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WebSearchCheckRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/connectors/status": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Reports every MCP connector's live status: connection outcome and discovered tools (admin).",
        "description": "Connectors are protocol servers THIS server connects to as a client; their tools join the server-executed tools chat can use, qualified as connector/tool. Probing connects the enabled ones, so this reflects reality rather than configuration.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/training/jobs": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists all training jobs, newest first (admin).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TrainingJobResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Starts a LoRA fine-tuning job (admin).",
        "requestBody": {
          "description": "The fine-tuning request: base model, dataset, and LoRA hyperparameters.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingJobRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingJobRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/training/dataset": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Uploads a dataset file for training (admin).",
        "description": "Accepts JSONL chat, ShareGPT JSON, Alpaca JSON, plain text, or a ZIP archive of these. Returns a dataset_file_id to pass to the start endpoint.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/training/jobs/{jobId}/cancel": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Requests cancellation of a training job (admin).",
        "description": "Training halts after the current batch; the partially-trained adapter is still saved.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "description": "The training job identifier.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingJobResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/training/precision": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Reports whether a catalog model publishes a full-precision variant (admin).",
        "description": "The training form offers full-precision training only when the model's repository actually carries an F16/BF16 sibling; this resolves and caches that fact.",
        "parameters": [
          {
            "name": "model",
            "in": "query",
            "description": "The catalog model ID to resolve.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/training/preflight": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Prices a training configuration against this machine (admin).",
        "description": "Coarse device-memory estimate for base weights, adapter train state, and compute buffers, so a run that cannot fit fails in the form instead of after a download.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingPreflightRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingPreflightRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/training/jobs/{jobId}/chat": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Chats with a finished training job's artifact (admin).",
        "description": "Loads the job's merged model, or a private copy of its base with the adapter applied, and answers the trailing user message. For judging a fine-tune before downloading it; the tryout model is released after idling.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "description": "The training job identifier.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingChatRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingChatRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/training/dataset/stats": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Token statistics for a training set before any run (admin).",
        "description": "Tokenizes the staged dataset with the selected base model's tokenizer (weights stay on disk) and reports sample counts, token-length extremes, and how many samples a given cutoff would skip. Requires the model to be available locally; the response says so when it is not.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingJobRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingJobRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/training/jobs/{jobId}": {
      "delete": {
        "tags": [
          "Administration"
        ],
        "summary": "Deletes a finished training job and every file it produced (admin).",
        "description": "Removes the job's record, artifact, checkpoints, and materialized dataset. A running job must be stopped first.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "description": "The training job identifier.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/training/jobs/{jobId}/checkpoints": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Lists a training job's saved checkpoints (admin).",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "description": "The training job identifier.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/training/jobs/{jobId}/checkpoints/{step}/adapter": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Downloads the adapter snapshot of one checkpoint (admin).",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "description": "The training job identifier.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "step",
            "in": "path",
            "description": "The checkpoint's optimizer step.",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/octet-stream": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/training/jobs/{jobId}/resume": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Resumes training from a job's checkpoint (admin).",
        "description": "Starts a NEW job continuing the source job's dataset and hyperparameters from the given checkpoint (or the latest when no step is passed): optimizer state and adapter weights are restored, and training continues to the original epoch target.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "description": "The source training job identifier.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "step",
            "in": "query",
            "description": "Checkpoint step to resume from; the latest checkpoint when omitted.",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int64",
              "default": 0
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/training/jobs/{jobId}/chat/stream": {
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Streams a chat completion from a finished training job's artifact (admin).",
        "description": "Server-sent events: 'delta' events carry {t: 'thinking'|'text', d: fragment} as the model decodes, then one 'done' event with the full visible answer.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "description": "The training job identifier.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingChatRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingChatRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/lmkit/v1/admin/training/jobs/{jobId}/artifact": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Downloads a training job's GGUF artifact (admin).",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "description": "The training job identifier.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/octet-stream": { }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AccessibleCollectionResponse": {
        "type": "object",
        "properties": {
          "cluster_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The cluster holding the collection."
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant holding the collection.",
            "format": "uuid"
          },
          "tenant_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The tenant's display name."
          },
          "collection_id": {
            "type": "string",
            "description": "The collection's id.",
            "format": "uuid"
          },
          "collection_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The collection's display name."
          },
          "document_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Documents currently indexed in the collection.",
            "format": "int64"
          }
        },
        "description": "One collection the caller can reach, with every identifier needed to address it. The listing is produced under the same grant checks as every read and write, so it can never name a collection the caller could not otherwise use."
      },
      "AcmeConfigRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "domainNames": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "emailAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "acceptTermsOfService": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "useStagingServer": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "AdminConfigurationController.ApiKeyClusterGrantsRequest": {
        "type": "object",
        "properties": {
          "grants": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AdminConfigurationController.ApiKeyToolGrantsRequest": {
        "type": "object",
        "properties": {
          "grants": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AdminConfigurationController.ChangeAdminPasswordRequest": {
        "type": "object",
        "properties": {
          "newPassword": {
            "type": [
              "null",
              "string"
            ]
          },
          "currentPassword": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AdminConfigurationController.CreateApiKeyRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "scope": {
            "type": [
              "null",
              "string"
            ]
          },
          "expiresInDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "clusterGrants": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "allClusters": {
            "type": "boolean"
          }
        }
      },
      "AdminConfigurationController.DownloadRequest": {
        "type": "object",
        "properties": {
          "modelId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AdminConfigurationController.McpToolInvokeRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "arguments": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AdminConfigurationController.OperatorCreateRequest": {
        "type": "object",
        "properties": {
          "username": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "role": {
            "type": [
              "null",
              "string"
            ]
          },
          "password": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AdminConfigurationController.OperatorEnabledRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "AdminConfigurationController.OperatorPasswordResetRequest": {
        "type": "object",
        "properties": {
          "newPassword": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AdminConfigurationController.OperatorUpdateRequest": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "role": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AdminConfigurationController.PlaygroundDocAskRequest": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The session id returned by the session endpoint."
          },
          "question": {
            "type": [
              "null",
              "string"
            ],
            "description": "The question to answer from the document."
          },
          "requestId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Client-generated id for this exchange, used by skip-thinking."
          }
        }
      },
      "AdminConfigurationController.PlaygroundDocAttachRequest": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The session to add the document to."
          },
          "fileId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file id returned by the upload endpoint."
          }
        }
      },
      "AdminConfigurationController.PlaygroundDocFromUrlRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "null",
              "string"
            ],
            "description": "Absolute http(s) address of the document to fetch."
          }
        }
      },
      "AdminConfigurationController.PlaygroundDocLocateRequest": {
        "type": "object",
        "properties": {
          "fileId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file id of the uploaded document."
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "1-based page number to search on.",
            "format": "int32"
          },
          "excerpt": {
            "type": [
              "null",
              "string"
            ],
            "description": "The citation excerpt to locate on the page."
          }
        }
      },
      "AdminConfigurationController.PlaygroundDocSessionRequest": {
        "type": "object",
        "properties": {
          "fileId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file id returned by the upload endpoint."
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "Chat model id; blank rides the server default."
          }
        }
      },
      "AdminConfigurationController.PlaygroundRedactApplyRequest": {
        "type": "object",
        "properties": {
          "fileId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file the reviewed proposal targets."
          },
          "areas": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PlaygroundRedactApplyRequest.Area"
            },
            "description": "The reviewed areas to burn, in page points with a top-left origin."
          }
        }
      },
      "AdminConfigurationController.RenameApiKeyRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AdminConfigurationController.SessionRevokeRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AdminConfigurationController.SetupRequest": {
        "type": "object",
        "properties": {
          "recipe": {
            "type": [
              "null",
              "string"
            ]
          },
          "answers": {
            "$ref": "#/components/schemas/SetupAnswers"
          },
          "planDigest": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AdminConfigurationController.SlotPoolFitRequest": {
        "type": "object",
        "properties": {
          "slots": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "slotContextSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "memoryRatio": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "modelOverrides": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ModelSlotPoolOverride"
            }
          }
        }
      },
      "AdminConfigurationController.SsoTestRequest": {
        "type": "object",
        "properties": {
          "authority": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AdminLoginRequest": {
        "type": "object",
        "properties": {
          "username": {
            "type": [
              "null",
              "string"
            ]
          },
          "password": {
            "type": "string"
          },
          "totpCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "newPassword": {
            "type": [
              "null",
              "string"
            ]
          },
          "remember": {
            "type": "boolean"
          }
        }
      },
      "AdminLoginResponse": {
        "type": "object",
        "properties": {
          "token": {
            "type": [
              "null",
              "string"
            ]
          },
          "requiresTotp": {
            "type": "boolean"
          },
          "requiresPasswordChange": {
            "type": "boolean"
          },
          "requiresTotpEnrollment": {
            "type": "boolean"
          },
          "totpSecret": {
            "type": [
              "null",
              "string"
            ]
          },
          "otpAuthUri": {
            "type": [
              "null",
              "string"
            ]
          },
          "recoveryCodes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "expiresInSeconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "AgentDefinition": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "system": {
            "type": [
              "null",
              "string"
            ]
          },
          "skill": {
            "type": [
              "null",
              "string"
            ]
          },
          "tools": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "memory": {
            "type": "boolean"
          },
          "memoryStore": {
            "type": [
              "null",
              "string"
            ]
          },
          "model": {
            "type": [
              "null",
              "string"
            ]
          },
          "reasoning": {
            "type": [
              "null",
              "string"
            ]
          },
          "greeting": {
            "type": [
              "null",
              "string"
            ]
          },
          "maxToolCalls": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "AgentInstructionsUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "system": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AnswerEvaluateRequest": {
        "required": [
          "tenant_id",
          "configs"
        ],
        "type": "object",
        "properties": {
          "cluster_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search cluster that holds the tenant and collections. If not provided, the default cluster is used."
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant that owns the collections.",
            "format": "uuid"
          },
          "collection_id": {
            "type": "string",
            "description": "A single collection to evaluate against. Ignored when 'collection_ids' is provided.",
            "format": "uuid"
          },
          "collection_ids": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The collections whose golden sets are evaluated together. Takes precedence over 'collection_id'."
          },
          "judge_model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model that judges the answers. Defaults to the server's default chat model. One judge across configurations is what keeps them comparable."
          },
          "max_questions": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Caps how many golden questions each configuration is evaluated on (1..500, default 50). Answer evaluation runs several judging passes per question, so this is the main cost control.",
            "format": "int32"
          },
          "unanswerable_questions": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Questions whose answer is NOT in the corpus. Each one is expected to be declined: they measure refusal recall, and together with the golden questions they measure the false-refusal rate."
          },
          "configs": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/AnswerEvaluateRequest.Config"
            },
            "description": "The answer configurations to evaluate (at most 10 per call). Configurations evaluated together share a batch id."
          }
        },
        "description": "Request body to evaluate the grounded-answer pipeline against the golden sets of the selected collections. Every golden question runs through the real answer path per configuration, and a local judge model scores the result: faithfulness of the answer to its retrieved context, recall of the reference answer from that context, whether the answer addresses the question, and whether the cited sources support it. Supply 'unanswerable_questions' to measure refusal behaviour in both directions, since a pipeline that declines everything otherwise looks perfectly safe. Aggregates are persisted beside retrieval runs, so this is the headless CI hook for answer quality."
      },
      "AnswerEvaluateRequest.Config": {
        "type": "object",
        "properties": {
          "label": {
            "type": [
              "null",
              "string"
            ],
            "description": "A short name identifying this configuration in results and history, for example 'hybrid strict' or 'semantic relaxed'."
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The chat model that answers. Defaults to the server's default chat model."
          },
          "search_type": {
            "description": "The retrieval type feeding the answer.",
            "default": "Hybrid",
            "$ref": "#/components/schemas/SearchType"
          },
          "groundedness": {
            "description": "Post-generation verification of the answer against its sources: 'Off', 'Report', or 'Refuse'.",
            "$ref": "#/components/schemas/GroundednessEnforcement"
          },
          "groundedness_threshold": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Supported-claim fraction at or above which an answer is kept under 'Refuse'.",
            "format": "double",
            "default": 1
          },
          "fusion": {
            "description": "Hybrid retrieval only: 'Convex' (default) blends normalized scores, 'Rrf' fuses the arms by rank.",
            "$ref": "#/components/schemas/HybridFusion"
          },
          "top_k": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "How many sources are retrieved and offered to the model (1..20).",
            "format": "int32",
            "default": 5
          },
          "rerank": {
            "type": "boolean",
            "description": "Whether to rerank the candidate pool before answering.",
            "default": false
          },
          "query_mode": {
            "description": "The query-understanding mode applied before retrieval.",
            "default": "Original",
            "$ref": "#/components/schemas/QueryMode"
          },
          "context_expansion": {
            "description": "How much text around each hit is given to the model.",
            "default": "Chunk",
            "$ref": "#/components/schemas/ContextExpansion"
          },
          "max_chunks_per_document": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Caps how many passages one document may contribute (1..10).",
            "format": "int32",
            "default": 3
          },
          "grounding": {
            "description": "'Strict' answers only from the retrieved sources and declines otherwise; 'Relaxed' may fall back to the model's own knowledge.",
            "default": "Strict",
            "$ref": "#/components/schemas/AnswerGrounding"
          },
          "temperature": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Generation temperature (0..2). Zero keeps the measurement reproducible.",
            "format": "double",
            "default": 0
          },
          "max_completion_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Token ceiling for one answer.",
            "format": "int32",
            "default": 1024
          }
        },
        "description": "One answer configuration under evaluation. Every knob mirrors the answer endpoint's parameter of the same name, with the same default."
      },
      "AnswerEvaluateResponse": {
        "type": "object",
        "properties": {
          "batch_id": {
            "type": "string",
            "description": "Groups the runs of this call in history: configurations evaluated together form one A/B batch.",
            "format": "uuid"
          },
          "judge_model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model that judged every configuration in this batch."
          },
          "runs": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/AnswerEvaluateResponse.Run"
            },
            "description": "One entry per evaluated configuration, in request order."
          }
        },
        "description": "The judged answer quality of each evaluated configuration."
      },
      "AnswerEvaluateResponse.Run": {
        "type": "object",
        "properties": {
          "run_id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The persisted run's id.",
            "format": "int64"
          },
          "label": {
            "type": [
              "null",
              "string"
            ],
            "description": "The configuration's label, as sent."
          },
          "answerable_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Golden questions evaluated.",
            "format": "int32"
          },
          "unanswerable_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Probe questions with no answer in the corpus.",
            "format": "int32"
          },
          "faithfulness": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Fraction of the answer's atomic statements that the retrieved context supports, averaged over questions. This is the hallucination measure: 1.0 means nothing was asserted that the sources do not carry.",
            "format": "double"
          },
          "context_recall": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Fraction of the reference answer's statements found in the retrieved context, averaged over questions that have a reference answer. Low values mean retrieval, not generation, is the bottleneck.",
            "format": "double"
          },
          "answer_relevancy": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "How well the answer addresses the question (1 answered, 0.5 on-topic without answering, 0 not addressed), averaged over questions.",
            "format": "double"
          },
          "citation_precision": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Fraction of the sources the answer cited that actually support one of its statements, averaged over answers that cited anything. Catches citations attached to the wrong source.",
            "format": "double"
          },
          "refusal_recall": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Fraction of unanswerable probe questions correctly declined. 1.0 means the pipeline never invented an answer it had no support for. Null when no probes were supplied.",
            "format": "double"
          },
          "false_refusal_rate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Fraction of answerable golden questions wrongly declined. The counterweight to refusal recall: a pipeline that declines everything scores perfect refusal recall and is useless, and this is where that shows.",
            "format": "double"
          },
          "judged": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            },
            "description": "How many questions each metric was computed over. Lower than the questions evaluated when a judgement could not be read, or when entries carry no reference answer."
          },
          "warnings": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Requested capabilities that did not run, judgements that could not be read, and measurement gaps such as missing refusal probes. Present only when something qualifies the numbers."
          }
        },
        "description": "One configuration's judged answer quality. A metric is null when nothing could be scored for it."
      },
      "AnswerGrounding": {
        "enum": [
          "Strict",
          "Relaxed"
        ],
        "description": "- `Strict`: Answer from the retrieved sources only; refuse when they do not contain the answer.\n- `Relaxed`: Prefer the sources but allow clearly-flagged general knowledge to fill gaps."
      },
      "AnswerRequest": {
        "required": [
          "tenant_id",
          "question"
        ],
        "type": "object",
        "properties": {
          "cluster_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search cluster that holds the tenant and collections. If not provided, the default cluster is used."
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant that owns the collections.",
            "format": "uuid"
          },
          "collection_id": {
            "type": "string",
            "description": "A single collection to answer from. Ignored when 'collection_ids' is provided.",
            "format": "uuid"
          },
          "collection_ids": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The set of collections to answer from in one call. Takes precedence over 'collection_id'."
          },
          "question": {
            "type": [
              "null",
              "string"
            ],
            "description": "The question to answer.",
            "default": ""
          },
          "search_type": {
            "description": "How supporting sources are retrieved: 'Hybrid' (default) combines word and meaning matching and degrades automatically to whichever mode the tenant has enabled; 'Semantic' and 'FullText' force one mode.",
            "default": "Hybrid",
            "$ref": "#/components/schemas/SearchType"
          },
          "fusion": {
            "description": "Hybrid retrieval only: how the full-text and semantic arms are combined. 'Convex' (default) blends normalized scores, preserving each arm's confidence; 'Rrf' fuses by rank.",
            "$ref": "#/components/schemas/HybridFusion"
          },
          "groundedness": {
            "description": "Verifies the generated answer against the sources it was given, which catches the case a score floor cannot: retrieval returned plausible same-topic passages that do not answer the question. 'Off' (default) skips the check; 'Report' returns the answer unchanged with its supported-claim fraction and the unsupported claims; 'Refuse' replaces an answer below 'groundedness_threshold' with the grounded refusal. The check costs additional model passes.",
            "$ref": "#/components/schemas/GroundednessEnforcement"
          },
          "groundedness_threshold": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Supported-claim fraction at or above which an answer is kept under 'Refuse'. Defaults to 1.",
            "format": "double",
            "default": 1
          },
          "top_k": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "How many sources to retrieve and ground the answer on (1..20). Defaults to 5.",
            "format": "int32",
            "default": 5
          },
          "filters": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "Optional metadata filter (equality map), as on the search endpoint. Mutually exclusive with 'filter'."
          },
          "filter": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Optional metadata filter expression with the full operator algebra, as on the search endpoint. Mutually exclusive with 'filters'.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "min_score": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Optional relevance floor for retrieved sources, as on the search endpoint. Defaults to 0.",
            "format": "double",
            "default": 0
          },
          "rerank": {
            "type": "boolean",
            "description": "When true, a cross-encoder reranking pass re-scores the retrieved sources before grounding, as on the search endpoint.",
            "default": false
          },
          "rerank_top_n": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The reranking over-fetch depth, as on the search endpoint. Defaults to 50.",
            "format": "int32",
            "default": 50
          },
          "rerank_alpha": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The rerank blend, as on the search endpoint. Defaults to 1.",
            "format": "double",
            "default": 0.5
          },
          "query_mode": {
            "description": "Query understanding, as on the search endpoint: 'Contextual' (with 'chat_history'), 'MultiQuery', or 'Hyde' (semantic/hybrid retrieval only). Defaults to 'Original'.",
            "default": "Original",
            "$ref": "#/components/schemas/QueryMode"
          },
          "chat_history": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ChatTurn"
            },
            "description": "Prior conversation turns for contextual query rewriting, as on the search endpoint."
          },
          "query_variants": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "MultiQuery variant count (1..5), as on the search endpoint. Defaults to 3.",
            "format": "int32",
            "default": 3
          },
          "context_expansion": {
            "description": "How much surrounding content each source contributes: 'Chunk' (default: the matched chunk with its neighbors; full pages for full-text matches) or 'Page' (the whole matched page).",
            "default": "Chunk",
            "$ref": "#/components/schemas/ContextExpansion"
          },
          "max_chunks_per_document": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Maximum sources drawn from one document (1..10), so one strong document does not crowd out the rest. Defaults to 3.",
            "format": "int32",
            "default": 3
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The chat model that generates the answer. Empty uses the server's default chat model."
          },
          "grounding": {
            "description": "How strictly the answer is bound to the sources. 'Strict' (default): answer from the sources only; a question the sources cannot answer is declined, and one that retrieves nothing is refused without an inference pass ('answer' is empty and 'context_found' false). 'Relaxed': general knowledge may fill gaps, flagged as such.",
            "default": "Strict",
            "$ref": "#/components/schemas/AnswerGrounding"
          },
          "prompt_template": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional custom prompt template. Must contain '@context' (replaced by the numbered source blocks) and '@question'. Empty uses the built-in grounded template."
          },
          "max_completion_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Maximum tokens the answer may generate. Defaults to 1024.",
            "format": "int32",
            "default": 1024
          },
          "temperature": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Sampling temperature. 0 (default) decodes greedily, which suits grounded answering; above 0 samples.",
            "format": "double",
            "default": 0
          },
          "max_context_characters": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Character budget for the source blocks in the prompt (sources past the budget are returned as retrieved-but-unused). Defaults to 24000.",
            "format": "int32",
            "default": 24000
          },
          "stream": {
            "type": "boolean",
            "description": "When true, the answer streams as Server-Sent Events: data frames carrying 'delta' (and 'thinking' for reasoning models), a terminal frame carrying the full answer with 'citations' and 'done': true, then the literal 'data: [DONE]'.",
            "default": false
          }
        },
        "description": "Request body for answering a question from one or more collections, with citations."
      },
      "AnswerResponse": {
        "type": "object",
        "properties": {
          "answer": {
            "type": [
              "null",
              "string"
            ],
            "description": "The generated answer, with inline [n] markers referencing 'citations'. Empty when strict grounding refused a question that retrieved no sources."
          },
          "context_found": {
            "type": "boolean",
            "description": "Whether any sources were retrieved for the question. False with strict grounding means the answer was refused without calling the model."
          },
          "citations": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/AnswerResponse.CitationResponse"
            },
            "description": "Every retrieved source in [n] numbering order, cited or not, so the grounding is fully transparent."
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The chat model that generated the answer."
          },
          "groundedness_score": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Fraction of the answer's atomic claims the sources support. Null when the check did not run or could not be read.",
            "format": "double"
          },
          "unsupported_claims": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "The answer's claims the sources do not support. Empty when every claim is supported."
          },
          "query_understanding": {
            "description": "What the query-understanding step did during retrieval. Omitted when 'query_mode' was 'Original'.",
            "$ref": "#/components/schemas/QueryUnderstandingResponse"
          }
        },
        "description": "A grounded answer with its citations."
      },
      "AnswerResponse.CitationResponse": {
        "type": "object",
        "properties": {
          "source_number": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The 1-based number the answer cites this source as, e.g. [2].",
            "format": "int32"
          },
          "document_id": {
            "type": "string",
            "description": "The source document's id.",
            "format": "uuid"
          },
          "collection_id": {
            "type": "string",
            "description": "The collection the source document belongs to.",
            "format": "uuid"
          },
          "document_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The source document's display name."
          },
          "source_uri": {
            "type": [
              "null",
              "string"
            ],
            "description": "The source document's origin location, as supplied at index time."
          },
          "page_number": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The matched page (1-based).",
            "format": "int32"
          },
          "chunk_text_offset": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The matched chunk's character offset into the page's stored Markdown (semantic and hybrid matches; null for page-level full-text matches). With 'chunk_text_length', resolves the exact supporting span.",
            "format": "int32"
          },
          "chunk_text_length": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The matched chunk's character length within the page's stored Markdown.",
            "format": "int32"
          },
          "excerpt": {
            "type": [
              "null",
              "string"
            ],
            "description": "A highlighted excerpt of the matched content."
          },
          "score": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The source's retrieval relevance score (rerank score when reranking ran).",
            "format": "double"
          },
          "cited": {
            "type": "boolean",
            "description": "Whether the answer's text actually references this source with its [n] marker."
          },
          "included_in_context": {
            "type": "boolean",
            "description": "Whether this source's text was shown to the model (false when the context character budget dropped it)."
          }
        },
        "description": "One retrieved source of the answer."
      },
      "Anthropic.AnthropicContentBlock": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "text": {
            "type": [
              "null",
              "string"
            ]
          },
          "thinking": {
            "type": [
              "null",
              "string"
            ]
          },
          "source": {
            "$ref": "#/components/schemas/Anthropic.AnthropicImageSource"
          },
          "id": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "input": { },
          "tool_use_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "content": { },
          "is_error": {
            "type": [
              "null",
              "boolean"
            ]
          }
        },
        "description": "A single content block in an Anthropic message."
      },
      "Anthropic.AnthropicImageSource": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "media_type": {
            "type": [
              "null",
              "string"
            ]
          },
          "data": {
            "type": [
              "null",
              "string"
            ]
          },
          "url": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Source for an Anthropic image content block."
      },
      "Anthropic.AnthropicMessage": {
        "type": "object",
        "properties": {
          "role": {
            "type": [
              "null",
              "string"
            ],
            "description": "\"user\" or \"assistant\"."
          },
          "content": { }
        },
        "description": "A single message in an Anthropic conversation."
      },
      "Anthropic.AnthropicMessagesRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model that will complete the prompt. When omitted or empty, the server falls back to its configured default chat model."
          },
          "messages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/Anthropic.AnthropicMessage"
            },
            "description": "Input messages. Roles alternate \"user\" and \"assistant\". Each may have string or content-block content."
          },
          "max_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Maximum number of tokens to generate before stopping.",
            "format": "int32"
          },
          "system": {
            "description": "System prompt, supplied as a string or an array of system text blocks."
          },
          "metadata": {
            "type": [
              "null",
              "object"
            ],
            "description": "Free-form request metadata. user_id is the canonical field. Stored, not interpreted."
          },
          "stop_sequences": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Custom stop sequences. Generation stops when any of these appears in the output."
          },
          "stream": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "When true, the response is sent as a server-sent event stream."
          },
          "temperature": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Sampling temperature in [0, 1]. Higher = more random.",
            "format": "double"
          },
          "top_p": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Nucleus sampling cutoff. Only sample tokens within the top_p probability mass.",
            "format": "double"
          },
          "top_k": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Only sample from the top K tokens. Currently not honored by the LM-Kit backend (use temperature/top_p).",
            "format": "int32"
          },
          "tools": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/Anthropic.AnthropicToolDef"
            },
            "description": "Tools the model may call."
          },
          "tool_choice": {
            "description": "How the model should choose tools. Accepts { \"type\": \"auto\" | \"any\" | \"none\" | \"tool\", \"name\": \"...\" }."
          },
          "service_tier": {
            "type": [
              "null",
              "string"
            ],
            "description": "Service tier hint. Accepted and stored; not interpreted."
          },
          "thinking": {
            "description": "Extended-thinking configuration: { \"type\": \"enabled\", \"budget_tokens\": N } or { \"type\": \"disabled\" }. Disabled turns reasoning off for the request; enabled keeps the model's own reasoning level (the budget rides within max_tokens).",
            "$ref": "#/components/schemas/Anthropic.AnthropicMessagesRequest.ThinkingConfig"
          }
        },
        "description": "Request body for the Anthropic Messages API. Reference: https://docs.anthropic.com/en/api/messages"
      },
      "Anthropic.AnthropicMessagesRequest.ThinkingConfig": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ],
            "description": "\"enabled\" or \"disabled\"."
          },
          "budget_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Thinking-token budget when enabled. Accepted; the engine's reasoning level governs depth.",
            "format": "int32"
          }
        },
        "description": "The extended-thinking wire object."
      },
      "Anthropic.AnthropicMessagesResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "role": {
            "type": [
              "null",
              "string"
            ]
          },
          "model": {
            "type": [
              "null",
              "string"
            ]
          },
          "content": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/Anthropic.AnthropicContentBlock"
            }
          },
          "stop_reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "stop_sequence": {
            "type": [
              "null",
              "string"
            ]
          },
          "usage": {
            "$ref": "#/components/schemas/Anthropic.AnthropicUsage"
          }
        },
        "description": "Non-streaming response from the Anthropic Messages API."
      },
      "Anthropic.AnthropicToolDef": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Tool name. Must match ^[a-zA-Z0-9_-]{1,64}$."
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "Human-readable description used by the model to decide when to call the tool."
          },
          "input_schema": {
            "description": "JSON Schema for the tool input."
          }
        },
        "description": "Tool declaration in an Anthropic Messages request."
      },
      "Anthropic.AnthropicUsage": {
        "type": "object",
        "properties": {
          "input_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "output_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "cache_creation_input_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "cache_read_input_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Token usage statistics for an Anthropic message response."
      },
      "AudioTranscriptionCapabilitiesResponse": {
        "type": "object",
        "properties": {
          "ffmpeg_available": {
            "type": "boolean",
            "description": "True when ffmpeg is installed and runnable, so the server can decode any container/codec (webm, m4a/aac, wma, amr, video containers, ...). When false, only the formats in 'supported_formats' decode, a managed decoder set that works on every platform."
          },
          "supported_formats": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Lower-cased file extensions the server can currently decode for transcription. With ffmpeg this includes video containers (mp4, mov, mkv, webm, avi, ...), whose audio track is extracted and transcribed."
          }
        },
        "description": "Reports what the audio-transcription endpoint can decode on this server, so a client can adapt (e.g. transcode audio itself when ffmpeg is absent)."
      },
      "AudioTranscriptionRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The identifier of the transcription model to use. If not provided, the default model is used.",
            "default": ""
          },
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The audio or video file to transcribe (a video's audio track is extracted). When input_format is 'Base64EncodedFile', provide a base64-encoded file payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint. Supported formats: see GET /lmkit/v1/audio-transcription/capabilities.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. 'Base64EncodedFile' expects a base64-encoded audio file. 'FileIdentifier' references a file previously uploaded via lmkit/v1/files/upload. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "language": {
            "type": [
              "null",
              "string"
            ],
            "description": "ISO-639-1 code of the spoken language (e.g. 'en', 'fr'). Omit (or pass 'auto') to detect it automatically. A code the loaded model does not support is refused with 400.",
            "default": ""
          },
          "enable_vad": {
            "type": "boolean",
            "description": "Whether to pre-segment the audio with voice activity detection, skipping silence. On (the default) is faster on real-world recordings and avoids hallucinated text in silent regions; off processes the full stream, including silence.",
            "default": true
          },
          "vad": {
            "description": "Optional voice-activity-detection tuning, applied when enable_vad is on. Omitted fields keep the engine defaults.",
            "$ref": "#/components/schemas/VadSettingsRequest"
          }
        },
        "description": "Request body for the Audio Transcription API. Contains an audio or video file (the formats the server currently decodes are listed by GET /lmkit/v1/audio-transcription/capabilities; a video's audio track is extracted and transcribed) and an optional model identifier. For large or long recordings, prefer streaming the raw file to POST /lmkit/v1/audio-transcription/file (multipart), or upload it once via /lmkit/v1/files/upload and reference the returned fileId here with input_format 'FileIdentifier'; base64 inflates the payload by ~33% and is buffered whole in memory."
      },
      "AudioTranscriptionResponse": {
        "required": [
          "text",
          "confidence",
          "segments"
        ],
        "type": "object",
        "properties": {
          "text": {
            "type": [
              "null",
              "string"
            ],
            "description": "The full transcription of the provided audio content."
          },
          "confidence": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "A floating‑point value between 0 and 1 indicating the confidence level of the transcription accuracy.",
            "format": "double"
          },
          "segments": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/AudioTranscriptionSegmentResponse"
            },
            "description": "A collection of transcription segments. Each segment includes its text, start and end times, confidence score, and language code."
          }
        },
        "description": "Model for the Audio Transcription API response. Contains the transcribed text from the audio input and an associated confidence score."
      },
      "AudioTranscriptionSegmentResponse": {
        "required": [
          "text",
          "start",
          "end",
          "confidence",
          "language"
        ],
        "type": "object",
        "properties": {
          "text": {
            "type": [
              "null",
              "string"
            ],
            "description": "The transcript text for this audio segment."
          },
          "start": {
            "pattern": "^-?(\\d+\\.)?\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,7})?$",
            "type": "string",
            "description": "The start time of this segment within the audio stream."
          },
          "end": {
            "pattern": "^-?(\\d+\\.)?\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,7})?$",
            "type": "string",
            "description": "The end time of this segment within the audio stream."
          },
          "confidence": {
            "maximum": 1,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The confidence score for the transcription, between 0.0 (lowest) and 1.0 (highest).",
            "format": "float"
          },
          "language": {
            "type": [
              "null",
              "string"
            ],
            "description": "The language code (e.g., \"en\", \"fr\") of the transcript text."
          }
        },
        "description": "Model for the Audio Transcription API segment response. Contains individual transcript segment details including text, timing, confidence, and language."
      },
      "BoundsResult": {
        "required": [
          "left",
          "top",
          "width",
          "height"
        ],
        "type": "object",
        "properties": {
          "left": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The left edge of the bounding box, in points from the page origin.",
            "format": "double"
          },
          "top": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The top edge of the bounding box, in points from the page origin.",
            "format": "double"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The width of the bounding box, in points.",
            "format": "double"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The height of the bounding box, in points.",
            "format": "double"
          }
        },
        "description": "Bounding box coordinates for a layout element, in points."
      },
      "CategorizationItemResponse": {
        "required": [
          "value"
        ],
        "type": "object",
        "properties": {
          "value": {
            "type": [
              "null",
              "string"
            ],
            "description": "The actual category that was identified."
          }
        },
        "description": "Represents a single category identified from the input content."
      },
      "CategorizationRequest": {
        "required": [
          "input",
          "categories"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The identifier of the language model to be used for categorization. If not provided, the default model is used.",
            "default": ""
          },
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input for categorization. When input_format is 'PlainText', provide raw text. When 'Base64EncodedFile', provide a base64-encoded file payload (supported: HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF). When 'FileIdentifier', provide the file ID previously returned by the api/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'PlainText', 'Base64EncodedFile', or 'FileIdentifier'. 'Base64EncodedFile' supports: HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF. 'FileIdentifier' references a file previously uploaded via api/v1/files/upload. Defaults to 'PlainText'.",
            "default": "PlainText",
            "$ref": "#/components/schemas/InputFormat"
          },
          "categories": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "A collection of predefined categories. The API will determine the best match(es) from this list."
          },
          "category_descriptions": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Optional semantic descriptions for each category. If provided, each description offers additional context or nuances that aid in categorization. The list must contain one entry per category in the 'categories' collection."
          },
          "max_categories": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The maximum number of top categories to return; defaults to 1 if not specified.",
            "format": "int32",
            "default": 1
          },
          "guidance": {
            "type": [
              "null",
              "string"
            ],
            "description": "Additional guidance text that can influence the categorization process (e.g., focusing on certain themes).",
            "default": ""
          }
        },
        "description": "Request body for the Categorization API. Contains input data as either a plain text string or a base64-encoded file, along with optional parameters to control the categorization process."
      },
      "CategorizationResponse": {
        "required": [
          "categories",
          "confidence"
        ],
        "type": "object",
        "properties": {
          "categories": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CategorizationItemResponse"
            },
            "description": "A collection of categories identified the input content. Each item represents a single category."
          },
          "confidence": {
            "maximum": 1,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The confidence level. A floating-point value between 0 and 1, where a value closer to 1 indicates higher confidence in the classification accuracy.",
            "format": "float"
          }
        },
        "description": "Model for the Categorization API response. Contains a collection of keywords extracted from the provided content."
      },
      "CharResult": {
        "required": [
          "text"
        ],
        "type": "object",
        "properties": {
          "text": {
            "type": [
              "null",
              "string"
            ],
            "description": "The character's text (one glyph; may be a multi-code-unit cluster)."
          },
          "bounds": {
            "description": "The bounding box of this character on the page, in points. Null if layout coordinates are unavailable.",
            "$ref": "#/components/schemas/BoundsResult"
          }
        },
        "description": "A single character (glyph) within a word, with its own bounding box."
      },
      "ChatRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "Catalog model ID; blank uses the server's default chat model."
          },
          "system": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional system prompt prepended to the conversation."
          },
          "messages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ChatRequest.Message"
            },
            "description": "The conversation so far, ending with the user message to answer. Roles: system, user, assistant."
          },
          "temperature": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Sampling temperature. 0 selects greedy decoding.",
            "format": "float"
          },
          "top_p": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Nucleus sampling cutoff: only tokens within this cumulative probability mass are considered. 1 disables the cutoff.",
            "format": "float"
          },
          "top_k": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Top-K sampling cutoff: only the K most likely tokens are considered. Absent keeps the sampler's default.",
            "format": "int32"
          },
          "min_p": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Minimum probability cutoff relative to the most likely token. Absent keeps the sampler's default.",
            "format": "float"
          },
          "seed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Sampling seed for reproducible generation. Absent samples freely.",
            "format": "uint32"
          },
          "max_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Upper bound on the completion length, in tokens.",
            "format": "int32"
          },
          "n": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "How many alternative completions to generate: 1 (default) to 8. Alternatives decode sequentially over one prompt read; with a seed, alternative i samples from seed + i (replay is best-effort, as for any seeded pooled decode). Not combinable with tools or model-driven skills. Streaming deltas carry the alternative's index as 'i', and the terminal summary lists every alternative under 'choices'.",
            "format": "int32"
          },
          "logprobs": {
            "type": "boolean",
            "description": "true returns the log probability of every generated token (thinking and tool channels included, in generation order) on the terminal summary."
          },
          "top_logprobs": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "0 to 20: how many of the most likely alternatives to report at each position. A positive value implies logprobs.",
            "format": "int32"
          },
          "logit_bias": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "float"
            },
            "description": "Per-token sampling bias, -100 (never) to 100 (always): keys are token ids (\"8264\") or plain text chunks (\"Paris\"), which the server maps onto the model's own vocabulary. The bias adds to the token's raw logit at every position."
          },
          "stop": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Sequences that end the completion when generated. The matched sequence is not included in the answer."
          },
          "frequency_penalty": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Penalizes tokens by how often they already appeared, reducing repetition. 0 disables.",
            "format": "float"
          },
          "presence_penalty": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Penalizes tokens that appeared at all, encouraging new topics. 0 disables.",
            "format": "float"
          },
          "repeat_penalty": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Multiplicative repetition penalty over recent tokens. Absent keeps the sampler's default.",
            "format": "float"
          },
          "reasoning": {
            "type": [
              "null",
              "string"
            ],
            "description": "Reasoning effort for models with a thinking channel: none, low, medium, or high. 'none' disables thinking; absent keeps the model's default."
          },
          "response_format": {
            "description": "Constrains the answer's shape: {type: 'text' | 'json_object'} or {type: 'json_schema', json_schema: {schema: {...}}}. JSON modes are grammar-enforced during decoding, so a non-conforming answer cannot be produced.",
            "$ref": "#/components/schemas/ChatRequest.ResponseFormatSpec"
          },
          "tools": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ChatRequest.ToolSpec"
            },
            "description": "Client-dispatched tools the model may call: name, description, and a JSON Schema for the arguments. A call ends the exchange with reason 'tool_calls'; send each result back as a 'tool' role message to continue."
          },
          "server_tools": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Server-executed built-in tools the model may use, by name (e.g. web_search, calc_arithmetic): the server runs the tool and the exchange continues with its result. Only tools the server's Tools policy enables actually run; anything else is narrated as denied. Tool use streams as tool_use events and is summarized on the result as tool_events."
          },
          "tool_choice": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "How the model may use tools: 'auto' (default), 'none', 'required', or {\"name\": \"tool-name\"} to force one tool.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "stream": {
            "type": "boolean",
            "description": "true streams server-sent events (status, delta, skill, done, error); false returns one JSON result."
          },
          "request_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional caller-generated identifier for this exchange, used to address it from side channels (e.g. skip-thinking)."
          },
          "skill": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional name of a server skill pinned for this exchange: its instructions ride the system turn."
          },
          "skills": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Server skill names the model may discover and activate on its own through function calling. Empty or absent disables model-driven skills for this exchange."
          },
          "skill_inputs": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "Answers to the pinned skill's activation questions, keyed by each question's slug. Unanswered questions fall back to their declared defaults."
          },
          "memory": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional agent-memory id: facts extracted from this exchange persist on the server under this id, and facts stored earlier under it are recalled as hidden context. Requires the server's Memory feature; when it is off the exchange proceeds without memory. Letters, digits, dash, and underscore."
          },
          "memory_store": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional name of the memory STORE the memory id lives under: a server-defined policy bundle (recall depth, capacity, eviction, decay, extraction behavior). Absent uses the agent's store when an agent rides the request, else the default store."
          },
          "agent": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional name of a server-defined agent: a reusable bundle (system prompt, skill, tools, memory intent) this exchange adopts. The bundle supplies defaults; any field the request states explicitly wins. A memory-intent bundle defaults 'memory' to the agent's own shared store, so the agent remembers across conversations unless the request scopes recall itself. An unknown name is a named refusal."
          }
        }
      },
      "ChatRequest.FileRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file id, as returned by the files API or an upload endpoint."
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Display name recorded beside the id, typically the original filename."
          }
        }
      },
      "ChatRequest.Message": {
        "type": "object",
        "properties": {
          "role": {
            "type": [
              "null",
              "string"
            ],
            "description": "system, user, assistant, or tool (a tool result being returned to the model)."
          },
          "content": {
            "type": [
              "null",
              "string"
            ],
            "description": "The turn's text; for a tool turn, the tool's result."
          },
          "images": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Images attached to a user turn, as data URLs (data:image/...;base64,...). Requires a vision-capable model."
          },
          "files": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ChatRequest.FileRef"
            },
            "description": "Documents attached to a user turn, as file ids from the files API (or an upload endpoint). The server notes each attachment's name and file_id inside the turn, so document tools can consume the id directly, with no separate registration step."
          },
          "tool_call_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "For a tool turn: the id of the call this result answers."
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "For a tool turn: the tool's name."
          },
          "tool_calls": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ChatRequest.ToolCallSpec"
            },
            "description": "For a replayed assistant turn that called tools: the calls it made."
          }
        }
      },
      "ChatRequest.ResponseFormatSpec": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ],
            "description": "text, json_object, or json_schema."
          },
          "json_schema": {
            "$ref": "#/components/schemas/ResponseFormatSpec.JsonSchemaSpec"
          }
        }
      },
      "ChatRequest.ToolCallSpec": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "arguments": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          }
        }
      },
      "ChatRequest.ToolSpec": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "input_schema": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "JSON Schema of the tool's arguments object.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          }
        }
      },
      "ChatTurn": {
        "type": "object",
        "properties": {
          "role": {
            "type": [
              "null",
              "string"
            ],
            "description": "Who spoke: 'user' or 'assistant'. Other roles are ignored."
          },
          "content": {
            "type": [
              "null",
              "string"
            ],
            "description": "The turn's text."
          }
        },
        "description": "One prior conversation turn, supplied as context for contextual query rewriting."
      },
      "ChatWithDocumentRequest": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The session identifier returned by a previous call. Omit on the first call to create a new session and load a document."
          },
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input document to load. Required when session_id is not provided. When input_format is 'Base64EncodedFile', provide a base64-encoded file payload. When 'FileIdentifier', provide the file ID previously returned by the /lmkit/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "question": {
            "type": [
              "null",
              "string"
            ],
            "description": "The user question to ask about the loaded document. Required when session_id is provided. Optional on the first call (if provided, the question is submitted immediately after loading the document).",
            "default": ""
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The identifier of the chat model to use for response generation. If not provided, the server's default chat model is used. Only used when creating a new session.",
            "default": ""
          },
          "embedding_model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The identifier of the embedding model to use for passage retrieval. If not provided, the server's default text embeddings model is used. Only used when creating a new session.",
            "default": ""
          },
          "stream": {
            "type": "boolean",
            "description": "When true, the response is streamed as server-sent events (SSE). Each event contains a JSON object with a 'delta' field for incremental text. Defaults to false.",
            "default": false
          },
          "max_completion_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The maximum number of tokens permitted for the response. Set to -1 to disable the limit. Defaults to -1 (unlimited).",
            "format": "int32",
            "default": -1
          }
        },
        "description": "Request body for the Chat with Document API."
      },
      "ChatWithDocumentStreamChunk": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The session identifier."
          },
          "delta": {
            "type": [
              "null",
              "string"
            ],
            "description": "Incremental text token generated by the model. Empty string in the final chunk."
          },
          "thinking": {
            "type": "boolean",
            "description": "When true, the delta belongs to the model's internal reasoning (chain-of-thought) and should be displayed separately from the user-visible answer. When false (default), the delta is part of the final answer.",
            "default": false
          },
          "done": {
            "type": "boolean",
            "description": "When true, generation is complete. The 'response' field contains the full answer and 'source_references' contains the retrieved passages.",
            "default": false
          },
          "response": {
            "type": [
              "null",
              "string"
            ],
            "description": "The complete response text. Only present in the final chunk (done=true)."
          },
          "source_references": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/SourceReferenceDto"
            },
            "description": "Document passages used to generate the response. Only present in the final chunk (done=true)."
          }
        },
        "description": "A server-sent event chunk emitted during streaming Chat with Document responses. Each chunk is delivered as an SSE 'data:' line. Intermediate chunks carry incremental text in 'delta'. The final chunk has 'done' set to true and includes the full response and source references. The stream ends with a 'data: [DONE]' sentinel."
      },
      "ClusterResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The cluster id. Pass it as cluster_id (path or body) to address this cluster."
          },
          "full_text_store": {
            "type": [
              "null",
              "string"
            ],
            "description": "The engine backing the cluster's full-text store (for example postgresql or sqlite)."
          },
          "is_default": {
            "type": "boolean",
            "description": "True when requests that omit cluster_id are routed to this cluster."
          }
        },
        "description": "A search cluster the caller can reach. The listing is scoped to the caller's key: clusters it holds tenant grants in, plus clusters its key was explicitly granted. It never enumerates the server's full topology."
      },
      "CollectionConfigRequest": {
        "required": [
          "tenant_id",
          "collection_id"
        ],
        "type": "object",
        "properties": {
          "cluster_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search cluster that holds the tenant and collection. If not provided, the default cluster is used."
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant that owns the collection.",
            "format": "uuid"
          },
          "collection_id": {
            "type": "string",
            "description": "The collection to configure.",
            "format": "uuid"
          },
          "display_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional human-readable name for the collection, shown in the admin console and returned with collection listings. The collection is still addressed by its id. Omit it, or send a blank value, to leave any existing name unchanged: a blank value never clears a name, so re-running create or re-sending settings cannot wipe a name a previous call set. Send a real value to set or rename it."
          },
          "languages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/Language"
            },
            "description": "Optional list of languages present in the collection's documents. It improves word-based search with language-aware stemming. A single language applies that language's text-search configuration; multiple languages, or languages without a dedicated configuration, use language-neutral matching. Omit it (or use ['Undefined']) for language-neutral matching. When updating, omitting it keeps the current value."
          },
          "bm25_b": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Full-text length normalization for this collection, from 0 (ignore document length) to 1 (fully normalize by it). Omit to inherit the server setting. Lower it for a corpus whose relevant documents are inherently long, such as arguments, legal texts or full papers: the default penalizes length, which suits short focused answers and costs recall on long ones. Ranking-only, so a change takes effect immediately with no re-indexing.",
            "format": "double"
          },
          "fusion_semantic_share": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Share of hybrid fusion given to the semantic arm for this collection, from 0 (lexical only) to 1 (semantic only). Omit to inherit the server default. Lower it for a collection whose lexical arm is the stronger one: the default favors semantic, which suits most corpora and suppresses the lexical arm on the ones it does not. Ranking-only, so a change takes effect immediately with no re-indexing.",
            "format": "double"
          }
        },
        "description": "Request body for a collection's search settings, used to create or update a collection."
      },
      "ConfigurationResponse": {
        "type": "object",
        "properties": {
          "general": {
            "$ref": "#/components/schemas/ConfigurationResponse.GeneralSettings"
          },
          "models": {
            "$ref": "#/components/schemas/ConfigurationResponse.ModelSettings"
          },
          "ocr": {
            "$ref": "#/components/schemas/ConfigurationResponse.OcrSettings"
          },
          "documentSigning": {
            "$ref": "#/components/schemas/ConfigurationResponse.DocumentSigningSettings"
          },
          "hardware": {
            "$ref": "#/components/schemas/ConfigurationResponse.HardwareSettings"
          },
          "fileManagement": {
            "$ref": "#/components/schemas/ConfigurationResponse.FileManagementSettings"
          },
          "inference": {
            "$ref": "#/components/schemas/ConfigurationResponse.InferenceSettings"
          },
          "security": {
            "$ref": "#/components/schemas/ConfigurationResponse.SecuritySettings"
          },
          "telemetry": {
            "$ref": "#/components/schemas/ConfigurationResponse.TelemetrySettings"
          },
          "mcp": {
            "$ref": "#/components/schemas/ConfigurationResponse.McpSettings"
          },
          "webAreas": {
            "$ref": "#/components/schemas/ConfigurationResponse.WebAreasSettings"
          },
          "skills": {
            "$ref": "#/components/schemas/ConfigurationResponse.SkillsSettings"
          },
          "sso": {
            "$ref": "#/components/schemas/ConfigurationResponse.SsoSettings"
          },
          "tools": {
            "$ref": "#/components/schemas/ConfigurationResponse.ToolsSettings"
          },
          "connectors": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ConnectorOptions"
            }
          },
          "memory": {
            "$ref": "#/components/schemas/ConfigurationResponse.MemorySettings"
          },
          "agents": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/AgentDefinition"
            }
          },
          "ports": {
            "$ref": "#/components/schemas/ConfigurationResponse.PortSettings"
          },
          "defaults": {
            "type": [
              "null",
              "object"
            ]
          },
          "isLocalhost": {
            "type": "boolean"
          },
          "managed": {
            "type": "boolean"
          }
        }
      },
      "ConfigurationResponse.DocumentSigningSettings": {
        "type": "object",
        "properties": {
          "certificateFile": {
            "type": [
              "null",
              "string"
            ]
          },
          "certificatePassword": {
            "type": [
              "null",
              "string"
            ]
          },
          "timestampAuthority": {
            "type": [
              "null",
              "string"
            ]
          },
          "trustAnchorsDirectory": {
            "type": [
              "null",
              "string"
            ]
          },
          "trustSystemRoots": {
            "type": "boolean"
          }
        }
      },
      "ConfigurationResponse.FileManagementSettings": {
        "type": "object",
        "properties": {
          "uploadDirectory": {
            "type": [
              "null",
              "string"
            ]
          },
          "maxFileRetention": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileScanInterval": {
            "type": [
              "null",
              "string"
            ]
          },
          "maxFileUploadSizeBytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "retainAllFiles": {
            "type": "boolean"
          }
        }
      },
      "ConfigurationResponse.GeneralSettings": {
        "type": "object",
        "properties": {
          "logLevel": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxConcurrentCompletions": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxConcurrentEmbeddings": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maximumContextLength": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "syncTimeoutSeconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxJobsPerOwner": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "corsAllowedOrigins": {
            "type": [
              "null",
              "string"
            ]
          },
          "ffmpegPath": {
            "type": [
              "null",
              "string"
            ]
          },
          "allowCustomModels": {
            "type": "boolean"
          },
          "requestHistoryCapacity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "settingsFile": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ConfigurationResponse.HardwareSettings": {
        "type": "object",
        "properties": {
          "enableCuda": {
            "type": "boolean"
          },
          "mainGpu": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "enableDistributedInference": {
            "type": "boolean"
          }
        }
      },
      "ConfigurationResponse.InferenceSettings": {
        "type": "object",
        "properties": {
          "hibernationMode": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultImageDetail": {
            "type": [
              "null",
              "string"
            ]
          },
          "contextHibernationDirectory": {
            "type": [
              "null",
              "string"
            ]
          },
          "inferenceMemoryRatio": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "enableKVCacheQuantization": {
            "type": "boolean"
          },
          "enableSpeculativeDecodingDrafts": {
            "type": "boolean"
          },
          "slotCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "slotContextSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "slotSaturationPolicy": {
            "type": [
              "null",
              "string"
            ]
          },
          "slotAllocation": {
            "type": [
              "null",
              "string"
            ]
          },
          "embeddingContextSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "embeddingMaxSequences": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "modelOverrides": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ModelSlotPoolOverride"
            }
          }
        }
      },
      "ConfigurationResponse.McpSettings": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "path": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileIngestRoots": {
            "type": [
              "null",
              "string"
            ]
          },
          "sessionIdleTimeoutMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxConcurrentSessions": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "enabledTools": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxRiskLevel": {
            "type": [
              "null",
              "string"
            ]
          },
          "inlineTextCharacters": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "renderPagesPerCall": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "renderDefaultDpi": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "renderMaxDpi": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "searchMatchesPerCall": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "ocrPagesPerCall": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "mergeSourcesPerCall": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ConfigurationResponse.MemorySettings": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "directory": {
            "type": [
              "null",
              "string"
            ]
          },
          "stores": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/MemoryStoreOptions"
            }
          }
        }
      },
      "ConfigurationResponse.ModelSettings": {
        "type": "object",
        "properties": {
          "defaultChatModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultVisionModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultVisionOcrModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultAudioModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultTextEmbeddingsModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultImageEmbeddingsModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultImageSegmentationModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultRerankingModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "modelDirectory": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ConfigurationResponse.OcrSettings": {
        "type": "object",
        "properties": {
          "provider": {
            "type": [
              "null",
              "string"
            ]
          },
          "lmkitOcr": {
            "$ref": "#/components/schemas/OcrSettings.LMKitOcrSettings"
          },
          "textract": {
            "$ref": "#/components/schemas/OcrSettings.TextractSettings"
          }
        }
      },
      "ConfigurationResponse.PortSettings": {
        "type": "object",
        "properties": {
          "httpPort": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "httpsPort": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ConfigurationResponse.SecuritySettings": {
        "type": "object",
        "properties": {
          "networkAccess": {
            "type": [
              "null",
              "string"
            ]
          },
          "anonymousAccessPermitted": {
            "type": "boolean"
          },
          "enableAnonymousAccess": {
            "type": "boolean"
          },
          "requireHttpsForAdmin": {
            "type": "boolean"
          },
          "enableHsts": {
            "type": "boolean"
          },
          "enableLoginThrottle": {
            "type": "boolean"
          },
          "requireTwoFactor": {
            "type": "boolean"
          },
          "enableHttps": {
            "type": "boolean"
          },
          "adminIpAllowlist": {
            "type": [
              "null",
              "string"
            ]
          },
          "oidc": {
            "$ref": "#/components/schemas/SecuritySettings.OidcSettings"
          }
        }
      },
      "ConfigurationResponse.SkillsSettings": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "directory": {
            "type": [
              "null",
              "string"
            ]
          },
          "allowedSkills": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ConfigurationResponse.SsoSettings": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "authority": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientSecret": {
            "type": [
              "null",
              "string"
            ]
          },
          "scopes": {
            "type": [
              "null",
              "string"
            ]
          },
          "providerName": {
            "type": [
              "null",
              "string"
            ]
          },
          "allowedEmailDomains": {
            "type": [
              "null",
              "string"
            ]
          },
          "allowedGroups": {
            "type": [
              "null",
              "string"
            ]
          },
          "allowedEmails": {
            "type": [
              "null",
              "string"
            ]
          },
          "disablePasswordLogin": {
            "type": "boolean"
          },
          "defaultRole": {
            "type": [
              "null",
              "string"
            ]
          },
          "groupRoles": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ConfigurationResponse.TelemetrySettings": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "otlpEndpoint": {
            "type": [
              "null",
              "string"
            ]
          },
          "enablePrometheus": {
            "type": "boolean"
          }
        }
      },
      "ConfigurationResponse.ToolsSettings": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "allowedTools": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "webSearchProvider": {
            "type": [
              "null",
              "string"
            ]
          },
          "webSearchApiKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "webSearchBaseUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "httpEgressMode": {
            "type": [
              "null",
              "string"
            ]
          },
          "httpAllowedHosts": {
            "type": [
              "null",
              "string"
            ]
          },
          "httpPrivateHosts": {
            "type": [
              "null",
              "string"
            ]
          },
          "options": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        }
      },
      "ConfigurationResponse.WebAreaSettings": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "access": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ConfigurationResponse.WebAreasSettings": {
        "type": "object",
        "properties": {
          "docs": {
            "$ref": "#/components/schemas/ConfigurationResponse.WebAreaSettings"
          },
          "guides": {
            "$ref": "#/components/schemas/ConfigurationResponse.WebAreaSettings"
          },
          "playground": {
            "$ref": "#/components/schemas/ConfigurationResponse.WebAreaSettings"
          },
          "training": {
            "$ref": "#/components/schemas/ConfigurationResponse.WebAreaSettings"
          },
          "mcp": {
            "$ref": "#/components/schemas/ConfigurationResponse.WebAreaSettings"
          },
          "claude": {
            "$ref": "#/components/schemas/ConfigurationResponse.WebAreaSettings"
          }
        }
      },
      "ConfigurationUpdateRequest": {
        "type": "object",
        "properties": {
          "general": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.GeneralUpdate"
              }
            ]
          },
          "models": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.ModelUpdate"
              }
            ]
          },
          "ocr": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.OcrUpdate"
              }
            ]
          },
          "documentSigning": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.DocumentSigningUpdate"
              }
            ]
          },
          "hardware": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.HardwareUpdate"
              }
            ]
          },
          "fileManagement": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.FileManagementUpdate"
              }
            ]
          },
          "inference": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.InferenceUpdate"
              }
            ]
          },
          "security": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.SecurityUpdate"
              }
            ]
          },
          "telemetry": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.TelemetryUpdate"
              }
            ]
          },
          "mcp": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.McpUpdate"
              }
            ]
          },
          "webAreas": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.WebAreasUpdate"
              }
            ]
          },
          "skills": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.SkillsUpdate"
              }
            ]
          },
          "sso": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.SsoUpdate"
              }
            ]
          },
          "tools": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.ToolsUpdate"
              }
            ]
          },
          "ports": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.PortsUpdate"
              }
            ]
          },
          "connectors": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ConnectorOptions"
            }
          },
          "memory": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.MemoryUpdate"
              }
            ]
          },
          "agents": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/AgentDefinition"
            }
          }
        }
      },
      "ConfigurationUpdateRequest.DocumentSigningUpdate": {
        "type": "object",
        "properties": {
          "certificateFile": {
            "type": [
              "null",
              "string"
            ]
          },
          "certificatePassword": {
            "type": [
              "null",
              "string"
            ]
          },
          "timestampAuthority": {
            "type": [
              "null",
              "string"
            ]
          },
          "trustAnchorsDirectory": {
            "type": [
              "null",
              "string"
            ]
          },
          "trustSystemRoots": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ConfigurationUpdateRequest.FileManagementUpdate": {
        "type": "object",
        "properties": {
          "uploadDirectory": {
            "type": [
              "null",
              "string"
            ]
          },
          "maxFileRetention": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileScanInterval": {
            "type": [
              "null",
              "string"
            ]
          },
          "maxFileUploadSizeBytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "retainAllFiles": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ConfigurationUpdateRequest.GeneralUpdate": {
        "type": "object",
        "properties": {
          "logLevel": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxConcurrentCompletions": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxConcurrentEmbeddings": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "syncTimeoutSeconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxJobsPerOwner": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "corsAllowedOrigins": {
            "type": [
              "null",
              "string"
            ]
          },
          "ffmpegPath": {
            "type": [
              "null",
              "string"
            ]
          },
          "allowCustomModels": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "requestHistoryCapacity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ConfigurationUpdateRequest.HardwareUpdate": {
        "type": "object",
        "properties": {
          "enableCuda": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "mainGpu": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "enableDistributedInference": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ConfigurationUpdateRequest.InferenceUpdate": {
        "type": "object",
        "properties": {
          "hibernationMode": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultImageDetail": {
            "type": [
              "null",
              "string"
            ]
          },
          "contextHibernationDirectory": {
            "type": [
              "null",
              "string"
            ]
          },
          "inferenceMemoryRatio": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "enableKVCacheQuantization": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "slotCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "slotContextSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "slotSaturationPolicy": {
            "type": [
              "null",
              "string"
            ]
          },
          "slotAllocation": {
            "type": [
              "null",
              "string"
            ]
          },
          "embeddingContextSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "embeddingMaxSequences": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "enableSpeculativeDecodingDrafts": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "modelOverrides": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ModelSlotPoolOverride"
            }
          }
        }
      },
      "ConfigurationUpdateRequest.McpUpdate": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "path": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileIngestRoots": {
            "type": [
              "null",
              "string"
            ]
          },
          "sessionIdleTimeoutMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxConcurrentSessions": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "enabledTools": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxRiskLevel": {
            "type": [
              "null",
              "string"
            ]
          },
          "inlineTextCharacters": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "renderPagesPerCall": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "renderDefaultDpi": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "renderMaxDpi": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "searchMatchesPerCall": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "ocrPagesPerCall": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "mergeSourcesPerCall": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ConfigurationUpdateRequest.MemoryUpdate": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "directory": {
            "type": [
              "null",
              "string"
            ]
          },
          "stores": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/MemoryStoreOptions"
            }
          }
        }
      },
      "ConfigurationUpdateRequest.ModelUpdate": {
        "type": "object",
        "properties": {
          "defaultChatModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultVisionModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultVisionOcrModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultAudioModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultTextEmbeddingsModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultImageEmbeddingsModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultImageSegmentationModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultRerankingModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "modelDirectory": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ConfigurationUpdateRequest.OcrUpdate": {
        "type": "object",
        "properties": {
          "provider": {
            "type": [
              "null",
              "string"
            ]
          },
          "lmkitOcr": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OcrUpdate.LMKitOcrUpdate"
              }
            ]
          },
          "textract": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OcrUpdate.TextractUpdate"
              }
            ]
          }
        }
      },
      "ConfigurationUpdateRequest.PortsUpdate": {
        "type": "object",
        "properties": {
          "httpPort": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "httpsPort": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ConfigurationUpdateRequest.SecurityUpdate": {
        "type": "object",
        "properties": {
          "networkAccess": {
            "type": [
              "null",
              "string"
            ]
          },
          "enableAnonymousAccess": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "requireHttpsForAdmin": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "enableHsts": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "enableLoginThrottle": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "requireTwoFactor": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "enableHttps": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "adminIpAllowlist": {
            "type": [
              "null",
              "string"
            ]
          },
          "oidc": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SecurityUpdate.OidcUpdate"
              }
            ]
          }
        }
      },
      "ConfigurationUpdateRequest.SkillsUpdate": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "directory": {
            "type": [
              "null",
              "string"
            ]
          },
          "allowedSkills": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ConfigurationUpdateRequest.SsoUpdate": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "authority": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientSecret": {
            "type": [
              "null",
              "string"
            ]
          },
          "scopes": {
            "type": [
              "null",
              "string"
            ]
          },
          "providerName": {
            "type": [
              "null",
              "string"
            ]
          },
          "allowedEmailDomains": {
            "type": [
              "null",
              "string"
            ]
          },
          "allowedGroups": {
            "type": [
              "null",
              "string"
            ]
          },
          "allowedEmails": {
            "type": [
              "null",
              "string"
            ]
          },
          "disablePasswordLogin": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "defaultRole": {
            "type": [
              "null",
              "string"
            ]
          },
          "groupRoles": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ConfigurationUpdateRequest.TelemetryUpdate": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "otlpEndpoint": {
            "type": [
              "null",
              "string"
            ]
          },
          "enablePrometheus": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ConfigurationUpdateRequest.ToolsUpdate": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "allowedTools": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "webSearchProvider": {
            "type": [
              "null",
              "string"
            ]
          },
          "webSearchApiKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "webSearchBaseUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "httpEgressMode": {
            "type": [
              "null",
              "string"
            ]
          },
          "httpAllowedHosts": {
            "type": [
              "null",
              "string"
            ]
          },
          "httpPrivateHosts": {
            "type": [
              "null",
              "string"
            ]
          },
          "options": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        }
      },
      "ConfigurationUpdateRequest.WebAreasUpdate": {
        "type": "object",
        "properties": {
          "docs": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.WebAreaUpdate"
              }
            ]
          },
          "guides": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.WebAreaUpdate"
              }
            ]
          },
          "playground": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.WebAreaUpdate"
              }
            ]
          },
          "training": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.WebAreaUpdate"
              }
            ]
          },
          "mcp": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.WebAreaUpdate"
              }
            ]
          },
          "claude": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationUpdateRequest.WebAreaUpdate"
              }
            ]
          }
        }
      },
      "ConfigurationUpdateRequest.WebAreaUpdate": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "access": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ConfigurationUpdateResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "updatedFields": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "restartRequiredFields": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "errors": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ConnectorOptions": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "transport": {
            "type": [
              "null",
              "string"
            ]
          },
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "command": {
            "type": [
              "null",
              "string"
            ]
          },
          "arguments": {
            "type": [
              "null",
              "string"
            ]
          },
          "allowedTools": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ContextExpansion": {
        "enum": [
          "None",
          "Chunk",
          "Page"
        ],
        "description": "- `None`: No context: hits carry the highlighted snippet only.\n- `Chunk`: The matched chunk plus its immediate neighbor chunks on the same page. Falls back to the full page for full-text (page-level) matches.\n- `Page`: The full stored Markdown of the matched page."
      },
      "DeleteDocumentRequest": {
        "required": [
          "tenant_id",
          "collection_id",
          "document_id"
        ],
        "type": "object",
        "properties": {
          "cluster_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search cluster that holds the tenant and collection. If not provided, the default cluster is used."
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant that owns the collection.",
            "format": "uuid"
          },
          "collection_id": {
            "type": "string",
            "description": "The collection the document belongs to.",
            "format": "uuid"
          },
          "document_id": {
            "type": "string",
            "description": "The document to delete.",
            "format": "uuid"
          }
        },
        "description": "Request body for deleting a document from a collection."
      },
      "DocumentOcrRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input document to OCR. When input_format is 'Base64EncodedFile', provide a base64-encoded file payload (supported: PDF, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF). When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. 'Base64EncodedFile' expects a base64-encoded document or image file. 'FileIdentifier' references a file previously uploaded via lmkit/v1/files/upload. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "page_range": {
            "type": [
              "null",
              "string"
            ],
            "description": "An optional page range to process (e.g. \"1-3\", \"1,3,5\", \"2-\"). When empty or not specified, all pages are processed. Page numbers are 1-based.",
            "default": ""
          }
        },
        "description": "Request body for the Document OCR API."
      },
      "DocumentOcrResponse": {
        "required": [
          "pages"
        ],
        "type": "object",
        "properties": {
          "pages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/OcrPageResult"
            },
            "description": "Per-page OCR results with layout, bounding boxes, and text in multiple formats."
          }
        },
        "description": "Response from the Document OCR API."
      },
      "DocumentPageResponse": {
        "type": "object",
        "properties": {
          "page_number": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The 1-based page number.",
            "format": "int32"
          },
          "ocr_performed": {
            "type": "boolean",
            "description": "True when OCR was performed on this page at index time (the page was recognized from pixels: an image, embedded-image text recovery, or full-page recognition of a scanned page), false when its text came from an embedded text layer."
          },
          "markdown": {
            "type": [
              "null",
              "string"
            ],
            "description": "The page content as Markdown, as extracted at index time. Omitted when include_markdown was false."
          },
          "page_layout": {
            "description": "The physical layout of the page, including paragraphs, lines, words, and bounding boxes. Omitted when include_page_layout was false or no layout was captured for the page.",
            "$ref": "#/components/schemas/PageLayout"
          }
        },
        "description": "One page of a fetched document."
      },
      "DocumentSearchHighlightRequest": {
        "required": [
          "input",
          "query"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input document to search and highlight. When input_format is 'Base64EncodedFile', provide a base64-encoded file payload (supported: PDF, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF). When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. 'Base64EncodedFile' expects a base64-encoded document or image file. 'FileIdentifier' references a file previously uploaded via lmkit/v1/files/upload. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "query": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search text or pattern. For 'Text' mode, an exact substring. For 'Regex' mode, a .NET regular expression pattern. For 'Fuzzy' mode, the approximate text to locate.",
            "default": ""
          },
          "search_mode": {
            "description": "The type of search to perform. 'Text': exact substring matching. 'Regex': regular expression matching. 'Fuzzy': approximate matching using Damerau-Levenshtein edit distance. Defaults to 'Text'.",
            "default": "Text",
            "$ref": "#/components/schemas/SearchModeOption"
          },
          "case_sensitive": {
            "type": "boolean",
            "description": "Whether the text search should be case-sensitive. Only applies to 'Text' mode. Defaults to false.",
            "default": false
          },
          "whole_word": {
            "type": "boolean",
            "description": "When true, only matches bounded by non-word characters on both sides are returned. Only applies to 'Text' mode. Defaults to false.",
            "default": false
          },
          "regex_ignore_case": {
            "type": "boolean",
            "description": "When true, the regex pattern ignores case. Only applies to 'Regex' mode. Defaults to true.",
            "default": true
          },
          "max_edit_distance": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Maximum Damerau-Levenshtein edit distance for fuzzy matching. Clamped to [1, 10]. Only applies to 'Fuzzy' mode. Defaults to 2.",
            "format": "int32",
            "default": 2
          },
          "min_score": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Minimum normalized fuzzy score in the range [0..1]. Only applies to 'Fuzzy' mode. Defaults to 0.75.",
            "format": "double",
            "default": 0.75
          },
          "token_aware": {
            "type": "boolean",
            "description": "When true, discounts whitespace substitution costs in fuzzy matching. Only applies to 'Fuzzy' mode. Defaults to true.",
            "default": true
          },
          "normalize_whitespace": {
            "type": "boolean",
            "description": "When true, collapses whitespace in document text before searching. Defaults to true.",
            "default": true
          },
          "ignore_diacritics": {
            "type": "boolean",
            "description": "When true, removes diacritical marks (accents) before searching. Defaults to true.",
            "default": true
          },
          "ignore_punctuation": {
            "type": "boolean",
            "description": "When true, strips punctuation characters before searching. Defaults to false.",
            "default": false
          },
          "ignore_symbols": {
            "type": "boolean",
            "description": "When true, strips symbol characters before searching. Defaults to false.",
            "default": false
          },
          "max_results": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Maximum number of matches to return across all pages. Clamped to [1, 5000]. Defaults to 100.",
            "format": "int32",
            "default": 100
          },
          "context_chars": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of characters of surrounding context to include in each match snippet. Clamped to [0, 1000]. Defaults to 40.",
            "format": "int32",
            "default": 40
          },
          "page_range": {
            "type": [
              "null",
              "string"
            ],
            "description": "An optional page range to search (e.g. \"1-3\", \"1,3,5\", \"2-\"). When empty or not specified, all pages are searched. Page numbers are 1-based.",
            "default": ""
          },
          "highlight_color": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            },
            "description": "The highlight fill color as an RGBA array [R, G, B, A], each in [0, 255]. Defaults to semi-transparent yellow [255, 255, 0, 80]."
          },
          "border_width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The border width for PDF highlight annotations, in points. Set to 0 for no visible border. Defaults to 0.",
            "format": "float",
            "default": 0
          },
          "render_zoom": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Zoom factor when rendering image output. Clamped to [0.25, 4.0]. Only applies to image-based documents. Defaults to 1.0.",
            "format": "double",
            "default": 1
          },
          "page_layouts": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PageLayout"
            },
            "description": "Optional pre-computed page layouts from a prior OCR or layout analysis pass. When provided, their text elements are used for search instead of the document's native text extraction. This enables highlighting on raster PDFs or images whose text was obtained externally."
          }
        },
        "description": "Request body for the Document Search Highlight API."
      },
      "DocumentSearchHighlightResponse": {
        "required": [
          "file_id",
          "output_mime_type",
          "query",
          "search_mode",
          "page_count",
          "scanned_pages",
          "total_matches",
          "limited_by_max_results",
          "matches"
        ],
        "type": "object",
        "properties": {
          "file_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file ID of the highlighted document, stored on the server. To download: GET /lmkit/v1/files/{file_id}. To use in another endpoint: pass this ID as the 'input' field with input_format set to 'FileIdentifier'. To delete: DELETE /lmkit/v1/files/{file_id}. Files are automatically deleted after the server's configured file retention period."
          },
          "output_mime_type": {
            "type": [
              "null",
              "string"
            ],
            "description": "The MIME type of the highlighted output file. Typically 'application/pdf' or 'image/png'."
          },
          "query": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search query that was executed."
          },
          "search_mode": {
            "description": "The search mode that was used (Text, Regex or Fuzzy).",
            "$ref": "#/components/schemas/SearchModeOption"
          },
          "page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The total number of pages in the source document.",
            "format": "int32"
          },
          "scanned_pages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of pages that were scanned for matches.",
            "format": "int32"
          },
          "total_matches": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The total number of matches found and highlighted.",
            "format": "int32"
          },
          "limited_by_max_results": {
            "type": "boolean",
            "description": "Whether results were capped by the max_results limit."
          },
          "matches": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/SearchMatchResult"
            },
            "description": "The search matches with text, snippets, scores, page numbers, and bounding boxes."
          }
        },
        "description": "Response from the Document Search Highlight API."
      },
      "DocumentSplittingRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The identifier of the vision language model to use for boundary detection. If not provided, the server's default vision model is used.",
            "default": ""
          },
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input PDF document to analyze. When input_format is 'Base64EncodedFile', provide a base64-encoded PDF payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. 'Base64EncodedFile' expects a base64-encoded PDF file. 'FileIdentifier' references a file previously uploaded via lmkit/v1/files/upload. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "guidance": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional guidance text to improve detection accuracy. For example: \"The file contains a mix of invoices and purchase orders.\"",
            "default": ""
          },
          "split_documents": {
            "type": "boolean",
            "description": "When true, the source PDF is physically split into separate files for each detected segment. Each segment in the response will include a 'file_id'. Download a split file: GET /lmkit/v1/files/{file_id}. Use it as input in other endpoints (document-to-markdown, summarization, search/documents): set input_format to 'FileIdentifier' and pass the file_id as input. Delete a split file: DELETE /lmkit/v1/files/{file_id}. Split files are automatically deleted after the server's configured file retention period. Defaults to false.",
            "default": false
          }
        },
        "description": "Request body for the AI Document Splitting API."
      },
      "DocumentSplittingResponse": {
        "required": [
          "segments",
          "document_count",
          "contains_multiple_documents",
          "confidence"
        ],
        "type": "object",
        "properties": {
          "segments": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/SegmentResult"
            },
            "description": "The detected document segments with their page ranges."
          },
          "document_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The total number of detected logical documents.",
            "format": "int32"
          },
          "contains_multiple_documents": {
            "type": "boolean",
            "description": "Whether the file contains more than one logical document."
          },
          "confidence": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The overall confidence score of the splitting result (0.0 to 1.0).",
            "format": "float"
          }
        },
        "description": "Response from the AI Document Splitting API."
      },
      "DocumentThumbnailController.PageSize": {
        "type": "object",
        "properties": {
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          }
        }
      },
      "DocumentThumbnailController.PageSizesResponse": {
        "type": "object",
        "properties": {
          "pageCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Total number of pages.",
            "format": "int32"
          },
          "pages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/DocumentThumbnailController.PageSize"
            },
            "description": "Per-page intrinsic sizes, ordered by page index (0-based)."
          }
        }
      },
      "DocumentThumbnailController.SupportedFormatsResponse": {
        "type": "object",
        "properties": {
          "extensions": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "All supported extensions (lower-cased, leading dot included)."
          },
          "pdf": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "PDF-family extensions (subset of Extensions)."
          },
          "image": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Image extensions (subset of Extensions). Multi-page TIFF is supported for pagination."
          }
        }
      },
      "DocumentToMarkdownRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The identifier of the vision-language model used when the conversion strategy requires one (Hybrid or VlmOcr). Ignored for the TextExtraction strategy. If not provided, the server's default vision OCR model is used.",
            "default": ""
          },
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input document or image to convert. When input_format is 'Base64EncodedFile', provide a base64-encoded file payload. Supported document formats: PDF, DOCX, PPTX, XLSX, EML, MBOX, HTML, TXT. Supported image formats: PNG, JPEG, TIFF, BMP, GIF, WEBP, PSD, PIC, PNM, HDR, TGA. When 'FileIdentifier', provide the file ID previously returned by the api/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. 'FileIdentifier' references a file previously uploaded via api/v1/files/upload. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "strategy": {
            "description": "The conversion strategy. 'Hybrid' (default) inspects each page individually: pages with a clean text layer stay on the fast text path, while pages without extractable text or containing embedded images are routed to the vision-language model. 'TextExtraction' reads only the embedded text layer (fastest, no model required); when 'enable_ocr' is true, image inputs are routed through the server's default OCR engine. 'VlmOcr' rasterizes every page and transcribes it with the vision-language model (slowest, most robust).",
            "default": 2,
            "$ref": "#/components/schemas/DocumentToMarkdownStrategy"
          },
          "enable_ocr": {
            "type": "boolean",
            "description": "When true, the server's default OCR engine is used to extract text from image inputs under the 'TextExtraction' strategy. Requires an OCR provider to be configured on the server. Ignored by the 'Hybrid' and 'VlmOcr' strategies, which always use the vision-language model. Defaults to true.",
            "default": true
          },
          "strip_image_markup": {
            "type": "boolean",
            "description": "When true, Markdown image references (e.g. `![alt](path.png)`) are removed from the output, leaving only textual content. Applies to vision-language output. Defaults to true.",
            "default": true
          },
          "max_completion_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The maximum number of tokens the vision-language model is allowed to emit per page. On average, one token corresponds to approximately 4 characters of text. Set to -1 to disable the limit. Applies to the 'Hybrid' and 'VlmOcr' strategies only. Defaults to 3072.",
            "format": "int32",
            "default": 3072
          },
          "pages": {
            "type": [
              "null",
              "string"
            ],
            "description": "An optional page range to process (e.g. \"1-3\", \"1,3,5\", \"2-\"). When empty or not specified, all pages are processed. Page numbers are 1-based.",
            "default": ""
          }
        },
        "description": "Request body for the Document to Markdown conversion API."
      },
      "DocumentToMarkdownResponse": {
        "required": [
          "markdown",
          "pages",
          "total_pages",
          "processed_pages"
        ],
        "type": "object",
        "properties": {
          "markdown": {
            "type": [
              "null",
              "string"
            ],
            "description": "The full Markdown output for the document, with all processed pages concatenated."
          },
          "pages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PageResult"
            },
            "description": "Per-page results with individual Markdown content and metadata."
          },
          "total_pages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The total number of pages in the source document.",
            "format": "int32"
          },
          "processed_pages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of pages that were actually processed.",
            "format": "int32"
          }
        },
        "description": "Response from the Document to Markdown conversion API."
      },
      "DocumentToMarkdownStrategy": {
        "enum": [
          "TextExtraction",
          "VlmOcr",
          "Hybrid"
        ],
        "description": "Specifies the strategy used by DocumentToMarkdown\r\nwhen transforming a document into Markdown.\n\n- `TextExtraction`\n- `VlmOcr`\n- `Hybrid`"
      },
      "DocumentValidationFinding": {
        "required": [
          "rule",
          "description"
        ],
        "type": "object",
        "properties": {
          "rule": {
            "type": [
              "null",
              "string"
            ],
            "description": "Stable rule identifier (e.g. 'fonts.unembedded', 'metadata.pdfa-identification-missing'). Identifiers never change once shipped."
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "Human-readable statement of the requirement that failed."
          }
        },
        "description": "A single failed validation rule."
      },
      "DocumentValidationFlavor": { },
      "DocumentValidationProfile": {
        "enum": [
          "pdfa"
        ],
        "description": "- `Pdfa`: PDF/A archival conformance (ISO 19005)."
      },
      "DocumentValidationRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The candidate document (base64 or file identifier).",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "profile": {
            "description": "The validation profile to evaluate. Default: 'pdfa'.",
            "default": "pdfa",
            "$ref": "#/components/schemas/DocumentValidationProfile"
          },
          "flavor": {
            "description": "The PDF/A flavor to validate against. Default 'auto' resolves it from the document's own declared identification.",
            "default": "auto",
            "$ref": "#/components/schemas/DocumentValidationFlavor"
          },
          "password": {
            "type": [
              "null",
              "string"
            ],
            "description": "Password used to open protected sources. A document that opens but carries encryption still fails the 'encryption.present' rule, as PDF/A prohibits encryption."
          }
        },
        "description": "Request body for the document validation API."
      },
      "DocumentValidationResponse": {
        "required": [
          "report_schema",
          "validator",
          "profile",
          "verdict",
          "rules_evaluated",
          "rules_failed",
          "page_count"
        ],
        "type": "object",
        "properties": {
          "report_schema": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Version of this report shape. Evolves additively; stored reports stay readable.",
            "format": "int32"
          },
          "validator": {
            "type": [
              "null",
              "string"
            ],
            "description": "Versioned identity of the validating engine (e.g. 'lmkit-pdfa/2026.8.1'), so stored verdicts stay attributable when newer validators exist."
          },
          "profile": {
            "description": "The validation profile that was evaluated.",
            "$ref": "#/components/schemas/DocumentValidationProfile"
          },
          "verdict": {
            "description": "Overall outcome. 'undetermined' means the document could not be judged and is never a failure.",
            "$ref": "#/components/schemas/DocumentValidationVerdict"
          },
          "flavor_declared": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The PDF/A level the document declares in its XMP identification, or null when it declares none. A declaration is a claim, not a checked fact.",
                "$ref": "#/components/schemas/PdfALevel"
              }
            ]
          },
          "flavor_validated": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The PDF/A level the rules were evaluated against, or null when the verdict is 'undetermined'.",
                "$ref": "#/components/schemas/PdfALevel"
              }
            ]
          },
          "rules_evaluated": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "How many rules this pass evaluated for the validated flavor. Reported so stored verdicts stay honest about their own coverage.",
            "format": "int32"
          },
          "rules_failed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "How many rules failed; equals the length of 'findings'.",
            "format": "int32"
          },
          "page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The document's page count, when it could be opened.",
            "format": "int32"
          },
          "findings": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/DocumentValidationFinding"
            },
            "description": "One entry per failed rule; empty when compliant."
          }
        },
        "description": "Validation report: the verdict, the flavor validated against, the document's own declared identification, and one finding per failed rule. Reports are designed to be stored as evidence; the schema evolves additively only."
      },
      "DocumentValidationVerdict": {
        "enum": [
          "compliant",
          "non_compliant",
          "undetermined"
        ],
        "description": "- `Compliant`: Every evaluated rule passed for the validated flavor.\n- `NonCompliant`: At least one evaluated rule failed; see 'findings'.\n- `Undetermined`: The document could not be evaluated; the verdict is unknown, not negative."
      },
      "ElementType": {
        "enum": [
          "Char",
          "CharArray",
          "String",
          "StringArray",
          "Integer",
          "IntegerArray",
          "UInt",
          "UIntArray",
          "Short",
          "ShortArray",
          "UShort",
          "UShortArray",
          "Long",
          "LongArray",
          "ULong",
          "ULongArray",
          "Bool",
          "BoolArray",
          "Float",
          "FloatArray",
          "Double",
          "DoubleArray",
          "Date",
          "DateArray",
          "Unknown",
          "Object",
          "ObjectArray"
        ],
        "description": "Enumerates the various data types that an element can represent, including primitive types, arrays, and complex objects.\n\n- `Char`: Represents a single Unicode character.\n- `CharArray`: Represents an array of Unicode characters.\n- `String`: Represents a sequence of characters.\n- `StringArray`: Represents an array of strings.\n- `Integer`: Represents a 32-bit signed integer.\n- `IntegerArray`: Represents an array of 32-bit signed integers.\n- `UInt`: Represents a 32-bit unsigned integer.\n- `UIntArray`: Represents an array of 32-bit unsigned integers.\n- `Short`: Represents a 16-bit signed integer.\n- `ShortArray`: Represents an array of 16-bit signed integers.\n- `UShort`: Represents a 16-bit unsigned integer.\n- `UShortArray`: Represents an array of 16-bit unsigned integers.\n- `Long`: Represents a 64-bit signed integer.\n- `LongArray`: Represents an array of 64-bit signed integers.\n- `ULong`: Represents a 64-bit unsigned integer.\n- `ULongArray`: Represents an array of 64-bit unsigned integers.\n- `Bool`: Represents a Boolean value, indicating true or false.\n- `BoolArray`: Represents an array of Boolean values.\n- `Float`: Represents a single-precision floating-point number.\n- `FloatArray`: Represents an array of single-precision floating-point numbers.\n- `Double`: Represents a double-precision floating-point number.\n- `DoubleArray`: Represents an array of double-precision floating-point numbers.\n- `Date`: Represents a date and time value.\n- `DateArray`: Represents an array of date and time values.\n- `Unknown`: Represents an unknown or unspecified data type. Intended for internal use only; should not be used directly.\n- `Object`: Represents a complex object with nested elements. Intended for internal use only; should not be used directly.\n- `ObjectArray`: Represents an array of complex objects with nested elements. Intended for internal use only; should not be used directly."
      },
      "EmbeddingMode": {
        "enum": [
          "Passage",
          "Query"
        ],
        "description": "The embedding mode, controlling whether the input is treated as a query or a passage.\n\n- `Passage`: Embeds the input as a passage (document), suitable for storage and indexing.\n- `Query`: Embeds the input as a search query. For supported models, a query instruction prefix is automatically applied to improve retrieval accuracy."
      },
      "EmbeddingRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The identifier of the language model to be used for embedding generation. If not provided, the default model is used.",
            "default": ""
          },
          "input": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "The input data for embedding generation. Can be one or more plain text strings or base64-encoded files, according to the specified input format."
          },
          "input_format": {
            "description": "The format of the input data. Acceptable values are 'PlainText' or 'Base64EncodedFile'. In 'Base64EncodedFile' mode, supported types include HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF. Defaults to 'PlainText'.",
            "default": "PlainText",
            "$ref": "#/components/schemas/InputFormat"
          },
          "embedding_mode": {
            "description": "The embedding mode. 'Passage' (default) embeds input as documents for storage and indexing. 'Query' embeds input as search queries, automatically applying a model-specific instruction prefix for models that support asymmetric embeddings (e.g., Qwen3 Embedding, Nomic Embed, BGE v1.5). Only applicable when input_format is 'PlainText'.",
            "default": "Passage",
            "$ref": "#/components/schemas/EmbeddingMode"
          }
        },
        "description": "Request body for the Embedding API. Contains input data to generate embeddings, either as plain text strings or base64-encoded files."
      },
      "EmbeddingResponse": {
        "required": [
          "embeddings"
        ],
        "type": "object",
        "properties": {
          "embeddings": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "array",
              "items": {
                "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
                "type": [
                  "number",
                  "string"
                ],
                "format": "float"
              }
            },
            "description": "A sequence of embedding vectors representing the input content. Each vector is an array of floats produced by the embedding model."
          }
        },
        "description": "Model for the Embedding API response. Contains a collection of embedding vectors generated for the provided content."
      },
      "EmotionCategory": {
        "enum": [
          "Neutral",
          "Happiness",
          "Anger",
          "Sadness",
          "Fear",
          null
        ]
      },
      "EntityKind": {
        "enum": [
          "Unknown",
          "PersonFullName",
          "GivenName",
          "MiddleName",
          "FamilyName",
          "HonorificPrefix",
          "HonorificSuffix",
          "OrganizationName",
          "Department",
          "JobTitle",
          "EmailAddress",
          "PhoneNumber",
          "FaxNumber",
          "SocialHandle",
          "Username",
          "WebsiteUri",
          "AddressFull",
          "StreetAddress",
          "HouseNumber",
          "StreetName",
          "Unit",
          "Building",
          "Floor",
          "POBox",
          "Neighborhood",
          "SubLocality",
          "City",
          "District",
          "County",
          "StateOrProvince",
          "AdministrativeArea",
          "PostalCode",
          "Country",
          "CountryIso2",
          "CountryIso3",
          "Latitude",
          "Longitude",
          "Date",
          "Time",
          "DateTime",
          "Duration",
          "Age",
          "TimeZone",
          "CurrencyAmount",
          "CurrencyCode",
          "TaxId",
          "VatNumber",
          "Iban",
          "SwiftBic",
          "BankAccountNumber",
          "RoutingNumber",
          "CreditCardNumber",
          "CreditCardExpiryMonth",
          "CreditCardExpiryYear",
          "CreditCardCvv",
          "NationalIdNumber",
          "PassportNumber",
          "DriverLicenseNumber",
          "LicensePlate",
          "SerialNumber",
          "Uuid",
          "Guid",
          "Isbn10",
          "Isbn13",
          "Issn",
          "Uri",
          "IpV4Address",
          "IpV6Address",
          "MacAddress",
          "Integer",
          "Decimal",
          "Percentage",
          "MeasurementValue",
          "MeasurementUnit",
          "Range",
          "Boolean",
          "LanguageCode",
          "Locale",
          null
        ]
      },
      "EntityTagHeaderValue": {
        "type": "object",
        "properties": {
          "tag": {
            "$ref": "#/components/schemas/StringSegment"
          },
          "isWeak": {
            "type": "boolean"
          }
        }
      },
      "EntityValidationStatus": {
        "enum": [
          "not_applicable",
          "valid",
          "repaired",
          "invalid"
        ],
        "description": "Describes the outcome of entity validation on an extracted value.\n\n- `NotApplicable`\n- `Valid`\n- `Repaired`\n- `Invalid`"
      },
      "EvalRunsResponse": {
        "type": "object",
        "properties": {
          "runs": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/EvalRunsResponse.Run"
            },
            "description": "The persisted runs."
          }
        },
        "description": "The tenant's persisted evaluation runs, newest first."
      },
      "EvalRunsResponse.Run": {
        "type": "object",
        "properties": {
          "run_id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "batch_id": {
            "type": "string",
            "description": "Runs sharing a batch id were evaluated together (one A/B call).",
            "format": "uuid"
          },
          "label": {
            "type": [
              "null",
              "string"
            ]
          },
          "question_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "config": {
            "description": "The evaluated retrieval configuration, as persisted.",
            "$ref": "#/components/schemas/JsonElement"
          },
          "metrics": {
            "description": "The aggregate metrics (recall_at, mrr, ndcg_at), as persisted.",
            "$ref": "#/components/schemas/JsonElement"
          },
          "created_at": {
            "type": "string",
            "description": "When the run executed (UTC).",
            "format": "date-time"
          }
        },
        "description": "One persisted evaluation run."
      },
      "EvaluateRequest": {
        "required": [
          "tenant_id",
          "configs"
        ],
        "type": "object",
        "properties": {
          "cluster_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search cluster that holds the tenant and collections. If not provided, the default cluster is used."
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant that owns the collections.",
            "format": "uuid"
          },
          "collection_id": {
            "type": "string",
            "description": "A single collection to evaluate against. Ignored when 'collection_ids' is provided.",
            "format": "uuid"
          },
          "collection_ids": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The collections whose golden sets are evaluated together. Takes precedence over 'collection_id'."
          },
          "ks": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            },
            "description": "The cutoffs to measure recall@k and nDCG@k at. Defaults to [1, 5, 10]; retrieval depth is the largest k."
          },
          "configs": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/EvaluateRequest.Config"
            },
            "description": "The retrieval configurations to evaluate (at most 10 per call). Configurations evaluated together share a batch id, which is how an A/B comparison is grouped."
          }
        },
        "description": "Request body to evaluate one or more retrieval configurations against the golden sets of the selected collections. Every golden question runs through the real search read path per configuration and is scored with recall@k, MRR, and nDCG@k; the aggregates are returned and persisted so configurations can be compared over time. This endpoint is the headless hook for eval-driven development: call it from CI and assert on the returned metrics."
      },
      "EvaluateRequest.Config": {
        "type": "object",
        "properties": {
          "label": {
            "type": [
              "null",
              "string"
            ],
            "description": "A short name identifying this configuration in results and history, for example 'baseline' or 'hybrid+rerank'."
          },
          "search_type": {
            "description": "The search type to evaluate.",
            "default": "FullText",
            "$ref": "#/components/schemas/SearchType"
          },
          "fusion": {
            "description": "Hybrid retrieval only: 'Convex' (default) blends normalized scores, 'Rrf' fuses the arms by rank.",
            "$ref": "#/components/schemas/HybridFusion"
          },
          "rerank": {
            "type": "boolean",
            "default": false
          },
          "rerank_top_n": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32",
            "default": 50
          },
          "rerank_alpha": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double",
            "default": 0.5
          },
          "query_mode": {
            "default": "Original",
            "$ref": "#/components/schemas/QueryMode"
          },
          "query_variants": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32",
            "default": 3
          },
          "max_chunks_per_document": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32",
            "default": 1
          },
          "recency_bias": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double",
            "default": 0
          },
          "mmr": {
            "type": "boolean",
            "default": false
          },
          "mmr_lambda": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double",
            "default": 0.5
          }
        },
        "description": "One retrieval configuration under evaluation. Every knob mirrors the search endpoint's parameter of the same name, with the same default."
      },
      "EvaluateResponse": {
        "type": "object",
        "properties": {
          "batch_id": {
            "type": "string",
            "description": "Groups the runs of this call in history: configurations evaluated together form one A/B batch.",
            "format": "uuid"
          },
          "question_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "How many golden questions each configuration was evaluated on.",
            "format": "int32"
          },
          "ks": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            },
            "description": "The cutoffs recall@k and nDCG@k were measured at."
          },
          "runs": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/EvaluateResponse.Run"
            },
            "description": "One entry per evaluated configuration, in request order."
          }
        },
        "description": "The aggregate metrics of each evaluated retrieval configuration."
      },
      "EvaluateResponse.Run": {
        "type": "object",
        "properties": {
          "run_id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The persisted run's id.",
            "format": "int64"
          },
          "label": {
            "type": [
              "null",
              "string"
            ],
            "description": "The configuration's label, as sent."
          },
          "recall_at": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            },
            "description": "Mean recall@k per measured k: the fraction of each question's expected documents found in the top k, averaged over the golden set."
          },
          "mrr": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Mean Reciprocal Rank: the average of 1/rank of the first expected document, 0 when none surfaced.",
            "format": "double"
          },
          "ndcg_at": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            },
            "description": "Mean nDCG@k per measured k (binary relevance): rewards placing expected documents near the top."
          },
          "warnings": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Requested capabilities this run could NOT apply, for example reranking with no reranking model on the tenant, or a query mode the query model did not produce a usable rewrite for. A live search degrades silently by design; a measurement must not, because an unapplied knob otherwise returns the numbers of the configuration beside it and reads as evidence that the knob does not help. Present only when something was not applied."
          }
        },
        "description": "One configuration's aggregate metrics."
      },
      "FileContentResult": {
        "type": "object",
        "properties": {
          "fileContents": {
            "type": "string",
            "format": "byte"
          },
          "contentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileDownloadName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastModified": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "entityTag": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EntityTagHeaderValue"
              }
            ]
          },
          "enableRangeProcessing": {
            "type": "boolean"
          }
        }
      },
      "FileFromUrlRequest": {
        "required": [
          "url"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "null",
              "string"
            ],
            "description": "Absolute http(s) URL of the content to download. Must be reachable from the server and remain valid for the duration of the transfer (mind short pre-signed URL expirations).",
            "default": ""
          },
          "file_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional logical file name (e.g. 'report.pdf'). Its extension drives the same format validation as a direct upload, and it is recorded as the file's original name. When omitted, the name is derived from the last segment of the URL path - pass it explicitly when the URL path is opaque (a storage key without an extension).",
            "default": ""
          }
        },
        "description": "Request body for registering a file from a URL. The server downloads the content itself (a server-to-storage transfer), so the caller never relays the bytes. Typical source: a pre-signed object-storage URL (Amazon S3, Azure Blob SAS, Google Cloud Storage, MinIO, or any S3-compatible endpoint)."
      },
      "FileInfoRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input file, of ANY format. When input_format is 'Base64EncodedFile', provide a base64-encoded payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "file_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional original file name. Used only as an identification fallback for signature-less formats; identification is otherwise driven by the file's leading magic bytes."
          }
        },
        "description": "Request body for the File Info API."
      },
      "FileInfoResponse": {
        "required": [
          "format",
          "mime_type",
          "family",
          "byte_size",
          "from_extension_only",
          "properties",
          "warnings"
        ],
        "type": "object",
        "properties": {
          "format": {
            "type": [
              "null",
              "string"
            ],
            "description": "Stable lower-case format slug identifying the container (e.g. 'jpeg', 'mp4', 'docx', 'unknown')."
          },
          "mime_type": {
            "type": [
              "null",
              "string"
            ],
            "description": "The format's canonical MIME type ('application/octet-stream' when unknown)."
          },
          "family": {
            "type": [
              "null",
              "string"
            ],
            "description": "The broad family the format belongs to: 'unknown', 'image', 'video', 'audio', 'document', or 'archive'."
          },
          "byte_size": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Total size of the inspected content in bytes.",
            "format": "int64"
          },
          "from_extension_only": {
            "type": "boolean",
            "description": "True when the format was recognized from the file name only (no magic bytes matched): a lower-confidence identification."
          },
          "image": {
            "description": "Image summary; null unless the file is an image.",
            "$ref": "#/components/schemas/FileInfoResponse.ImageInfo"
          },
          "video": {
            "description": "Video summary; null unless the file is a video.",
            "$ref": "#/components/schemas/FileInfoResponse.VideoInfo"
          },
          "audio": {
            "description": "Audio summary; null unless the file is an audio container.",
            "$ref": "#/components/schemas/FileInfoResponse.AudioInfo"
          },
          "document": {
            "description": "Document summary; null unless the file is a document.",
            "$ref": "#/components/schemas/FileInfoResponse.DocumentInfo"
          },
          "properties": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/FileInfoResponse.Property"
            },
            "description": "Every extracted metadata field, in source order, as group-qualified typed entries. Groups are lower-case namespaces such as 'exif', 'gps', 'xmp', 'icc', 'id3', 'tags', 'office', 'pdf', 'riff', or 'container'. New formats and tags only ever ADD entries here."
          },
          "warnings": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Non-fatal anomalies met while reading (truncated structures, unparseable tags). Inspection never fails on content."
          }
        },
        "description": "Response from the File Info API: one universal envelope for ANY format. The identity block is always populated; the typed facets (image / video / audio / document) are null when not applicable; 'properties' is the open bag carrying every extracted metadata field."
      },
      "FileInfoResponse.AudioInfo": {
        "type": "object",
        "properties": {
          "duration_seconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Total playback duration in seconds, when stated or exactly derivable.",
            "format": "double"
          },
          "codec": {
            "type": [
              "null",
              "string"
            ],
            "description": "Codec identifier (e.g. 'mp3', 'flac', 'pcm', 'opus')."
          },
          "sample_rate": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Samples per second (e.g. 44100).",
            "format": "int32"
          },
          "channels": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Channel count (1 = mono, 2 = stereo, ...).",
            "format": "int32"
          },
          "bitrate": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Bitrate in bits per second, when stated or derivable.",
            "format": "int64"
          },
          "title": {
            "type": [
              "null",
              "string"
            ],
            "description": "Track title from the container's tags."
          },
          "artist": {
            "type": [
              "null",
              "string"
            ],
            "description": "Artist from the container's tags."
          },
          "album": {
            "type": [
              "null",
              "string"
            ],
            "description": "Album from the container's tags."
          }
        },
        "description": "Audio facet: stream facts plus headline tags (title/artist/album); other tags land in 'properties'."
      },
      "FileInfoResponse.DocumentInfo": {
        "type": "object",
        "properties": {
          "page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Page count (PDF pages, Word pages, presentation slides), when stated.",
            "format": "int32"
          },
          "word_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Word count, when the producing application recorded it.",
            "format": "int32"
          },
          "title": {
            "type": [
              "null",
              "string"
            ],
            "description": "Document title from its own metadata (not the file name)."
          },
          "author": {
            "type": [
              "null",
              "string"
            ],
            "description": "Author / creator person."
          },
          "subject": {
            "type": [
              "null",
              "string"
            ],
            "description": "Subject / description."
          },
          "keywords": {
            "type": [
              "null",
              "string"
            ],
            "description": "Keywords, as authored (a single delimited string in most formats)."
          },
          "application": {
            "type": [
              "null",
              "string"
            ],
            "description": "The producing application (PDF Producer / Office Application)."
          },
          "created_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the document was created (no reliable time zone in most sources).",
            "format": "date-time"
          },
          "modified_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the document was last modified.",
            "format": "date-time"
          },
          "is_encrypted": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "True when the file is password-protected / encrypted."
          }
        },
        "description": "Document facet: authoring metadata. For deep PDF analysis (PDF/A level, permissions, embedded files, XMP) use lmkit/v1/pdf-info."
      },
      "FileInfoResponse.ImageInfo": {
        "type": "object",
        "properties": {
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Pixel width of the primary image.",
            "format": "int32"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Pixel height of the primary image.",
            "format": "int32"
          },
          "bit_depth": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Bits per sample/channel (e.g. 8), when the container states it.",
            "format": "int32"
          },
          "frame_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Number of frames/pages (animated GIF/APNG/WebP frames, TIFF pages, ICO entries). 1 for stills.",
            "format": "int32"
          },
          "has_alpha": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "True when the format carries an alpha channel."
          },
          "dpi_x": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Horizontal resolution in dots per inch, when stated.",
            "format": "double"
          },
          "dpi_y": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Vertical resolution in dots per inch, when stated.",
            "format": "double"
          },
          "orientation": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "EXIF orientation (1..8), when present. 1 = upright.",
            "format": "int32"
          },
          "color_space": {
            "type": [
              "null",
              "string"
            ],
            "description": "How the samples are organized in the file: 'gray', 'rgb', 'indexed', 'ycbcr', 'cmyk', 'ycck', or 'lab'. Null when the container does not state it."
          },
          "channels": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Samples per pixel as stored (e.g. 3 for RGB, 4 for RGBA, 1 for palette).",
            "format": "int32"
          },
          "has_icc_profile": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "True when the file embeds an ICC color profile."
          },
          "icc_profile_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The embedded ICC profile's description (e.g. 'Display P3', 'sRGB IEC61966-2.1'), when named."
          },
          "camera_make": {
            "type": [
              "null",
              "string"
            ],
            "description": "Camera manufacturer (EXIF Make)."
          },
          "camera_model": {
            "type": [
              "null",
              "string"
            ],
            "description": "Camera model (EXIF Model)."
          },
          "captured_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the photo was taken (EXIF DateTimeOriginal; no time zone in the source).",
            "format": "date-time"
          },
          "gps_latitude": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "GPS latitude in decimal degrees (positive = north), when geotagged.",
            "format": "double"
          },
          "gps_longitude": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "GPS longitude in decimal degrees (positive = east), when geotagged.",
            "format": "double"
          }
        },
        "description": "Image facet: dimensions, encoding facts, and camera/GPS metadata when present."
      },
      "FileInfoResponse.Property": {
        "required": [
          "group",
          "key",
          "value",
          "kind"
        ],
        "type": "object",
        "properties": {
          "group": {
            "type": [
              "null",
              "string"
            ],
            "description": "The property's namespace (e.g. 'exif', 'id3', 'office', 'container')."
          },
          "key": {
            "type": [
              "null",
              "string"
            ],
            "description": "The field name inside the group (e.g. 'Make', 'Title', 'Brand')."
          },
          "value": {
            "type": [
              "null",
              "string"
            ],
            "description": "The value rendered as an invariant-culture string; 'kind' states the underlying type."
          },
          "kind": {
            "type": [
              "null",
              "string"
            ],
            "description": "The value's underlying type: 'text', 'integer', 'real', 'boolean', or 'datetime'."
          }
        },
        "description": "One extracted metadata field: a group/key pair with a typed value."
      },
      "FileInfoResponse.VideoInfo": {
        "type": "object",
        "properties": {
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Pixel width of the primary video track.",
            "format": "int32"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Pixel height of the primary video track.",
            "format": "int32"
          },
          "duration_seconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Total playback duration in seconds, when the container states it.",
            "format": "double"
          },
          "frame_rate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Frames per second of the primary video track, when derivable.",
            "format": "double"
          },
          "video_codec": {
            "type": [
              "null",
              "string"
            ],
            "description": "Codec identifier of the primary video track, container-native form (e.g. 'avc1')."
          },
          "audio_codec": {
            "type": [
              "null",
              "string"
            ],
            "description": "Codec identifier of the primary audio track, when one exists."
          },
          "has_audio": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "True when the container carries at least one audio track."
          },
          "bitrate": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Overall bitrate in bits per second, when stated or derivable from size/duration.",
            "format": "int64"
          }
        },
        "description": "Video facet: track facts read from the container headers; media data is never decoded."
      },
      "GetDocumentRequest": {
        "required": [
          "tenant_id",
          "collection_id",
          "document_id"
        ],
        "type": "object",
        "properties": {
          "cluster_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search cluster that holds the tenant and collection. If not provided, the default cluster is used."
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant that owns the collection.",
            "format": "uuid"
          },
          "collection_id": {
            "type": "string",
            "description": "The collection the document belongs to.",
            "format": "uuid"
          },
          "document_id": {
            "type": "string",
            "description": "The id of the document to fetch, as supplied at index time.",
            "format": "uuid"
          },
          "include_pages": {
            "type": "boolean",
            "description": "Whether to include the document's per-page content at all. Defaults to true. Set to false to fetch only the document-level metadata (name, source, custom metadata, page count, timestamps) without any page bodies, the cheapest query.",
            "default": true
          },
          "include_markdown": {
            "type": "boolean",
            "description": "Whether each returned page includes its Markdown text. Defaults to true. Set to false to omit the page text (for example when only the layout is needed); the page Markdown is then not read from storage at all. Has no effect when include_pages is false.",
            "default": true
          },
          "include_page_layout": {
            "type": "boolean",
            "description": "Whether each returned page includes its layout (the text blocks and their positions captured at index time). Defaults to true. The layout is typically the largest part of the payload, so set this to false when only the Markdown is needed; the layout is then not read from storage at all. Has no effect when include_pages is false.",
            "default": true
          },
          "page_range": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional set of pages to return, as a 1-based page-range string in LM-Kit's standard syntax: a comma-separated list of single pages and ranges, for example \"1-5\", \"3\", or \"1-5, 7, 9-12\". An open bound is allowed (\"5-\" is page 5 through the end, \"-3\" is the first page through page 3), reversed ranges are normalized, and overlapping ranges never return a page twice. Omit, leave empty, or pass \"*\" to return every page; page numbers outside the document are ignored. Has no effect when include_pages is false."
          }
        },
        "description": "Request body for fetching a single indexed document by its id. By default the whole document is returned (registry metadata and every page's Markdown and layout). The include flags and the page range let a caller trim the response so the large payloads (page layout, page Markdown) are fetched only when needed, or a single page window is returned instead of the entire document."
      },
      "GetDocumentResponse": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "description": "The document's id, as supplied at index time.",
            "format": "uuid"
          },
          "collection_id": {
            "type": "string",
            "description": "The collection the document belongs to.",
            "format": "uuid"
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The document's display name, as supplied at index time."
          },
          "source_uri": {
            "type": [
              "null",
              "string"
            ],
            "description": "The document's source location, as supplied at index time."
          },
          "content_hash": {
            "type": [
              "null",
              "string"
            ],
            "description": "The content hash supplied at index time, used for change detection and de-duplication. Empty when none was recorded."
          },
          "custom_metadata": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "The free-form string key/value pairs supplied with the document at index time. Omitted when none were set."
          },
          "ft_config": {
            "type": [
              "null",
              "string"
            ],
            "description": "The full-text configuration (language) the document was indexed under."
          },
          "embedding_model": {
            "type": [
              "null",
              "string"
            ],
            "description": "Name of the embedding model the document was embedded with, or omitted when it has no semantic embedding."
          },
          "indexed_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the document was first indexed.",
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the document was last updated.",
            "format": "date-time"
          },
          "expires_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the document is scheduled to be removed by its time-to-live. Omitted when the document does not expire.",
            "format": "date-time"
          },
          "ocr_performed": {
            "type": "boolean",
            "description": "True when OCR was performed on at least one page of the document at index time (an image, embedded-image text recovery, or full-page recognition of a scanned page), false when every page was read from an embedded text layer. Each page's own flag is on the page in 'pages'."
          },
          "page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The total number of pages in the document, regardless of how many pages this response returns.",
            "format": "int32"
          },
          "returned_page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of pages included in this response. Equals page_count when the whole document was returned; smaller when a page range was requested or the response was truncated; zero when include_pages was false.",
            "format": "int32"
          },
          "truncated": {
            "type": "boolean",
            "description": "True when more pages matched the request than a single response returns, so the pages here are a prefix; fetch the remaining pages with a narrower page_range. False when the whole requested set was returned."
          },
          "pages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/DocumentPageResponse"
            },
            "description": "The document's pages in ascending page order, within the requested range. Omitted when include_pages was false."
          }
        },
        "description": "A single indexed document: its registry metadata and, when requested, its per-page content."
      },
      "GoldenSetAddRequest": {
        "required": [
          "tenant_id",
          "collection_id",
          "entries"
        ],
        "type": "object",
        "properties": {
          "cluster_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search cluster that holds the tenant and collection. If not provided, the default cluster is used."
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant that owns the collection.",
            "format": "uuid"
          },
          "collection_id": {
            "type": "string",
            "description": "The collection the golden entries belong to.",
            "format": "uuid"
          },
          "entries": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/GoldenSetAddRequest.Entry"
            },
            "description": "The golden entries to add."
          }
        },
        "description": "Request body to add golden-set entries to a collection: the reference (question, expected documents) pairs the evaluation harness scores retrieval against."
      },
      "GoldenSetAddRequest.Entry": {
        "required": [
          "question",
          "expected_document_ids"
        ],
        "type": "object",
        "properties": {
          "question": {
            "type": [
              "null",
              "string"
            ],
            "description": "The evaluation question."
          },
          "expected_document_ids": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The documents (by id) a good retrieval must surface for this question."
          },
          "reference_answer": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional reference answer, reserved for answer-quality metrics."
          }
        },
        "description": "One golden entry: a question and the documents a good retrieval must surface."
      },
      "GoldenSetDifficulty": {
        "enum": [
          "Standard",
          "Paraphrased"
        ],
        "description": "- `Standard`\n- `Paraphrased`"
      },
      "GoldenSetGenerateRequest": {
        "required": [
          "tenant_id",
          "collection_id"
        ],
        "type": "object",
        "properties": {
          "cluster_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search cluster that holds the tenant and collection. If not provided, the default cluster is used."
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant that owns the collection.",
            "format": "uuid"
          },
          "collection_id": {
            "type": "string",
            "description": "The collection to generate questions from, and to store them into.",
            "format": "uuid"
          },
          "count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "How many questions to attempt (1..200, default 20). One page is sampled per attempt, at most one page per document.",
            "format": "int32"
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The chat model that writes the questions. Defaults to the server's default chat model."
          },
          "seed": {
            "type": [
              "null",
              "string"
            ],
            "description": "Sampling seed. The same seed over an unchanged corpus samples the same pages, so a run can be repeated. Generated and reported back when omitted."
          },
          "temperature": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Generation temperature (0..2, default 0.7). At 0 the questions are reproducible for a given seed and corpus.",
            "format": "double"
          },
          "max_page_characters": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "How much of a sampled page the model is shown (500..20000, default 4000).",
            "format": "int32"
          },
          "min_page_characters": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Shortest page worth sampling (0..5000, default 200): a near-empty page yields no answerable question.",
            "format": "int32"
          },
          "max_completion_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Token ceiling for one question and answer pair (32..2048, default 256).",
            "format": "int32"
          },
          "difficulty": {
            "description": "How hard the questions are for retrieval. 'Paraphrased' (default) requires the question to ask in different words from the passage, the way a real user does, which is what leaves headroom in the resulting metric. 'Standard' allows the passage's own wording: cheap, and useful as a smoke test that indexing works, but it saturates near a perfect score and cannot tell retrieval configurations apart.",
            "$ref": "#/components/schemas/GoldenSetDifficulty"
          }
        },
        "description": "Request body to bootstrap a collection's golden set from its own content: a local chat model writes one self-contained question (and a reference answer) per sampled page, and what passes the quality gate is stored as golden entries."
      },
      "GoldenSetGenerateResponse": {
        "type": "object",
        "properties": {
          "collection_id": {
            "type": "string",
            "description": "The collection the entries were stored in.",
            "format": "uuid"
          },
          "seed": {
            "type": [
              "null",
              "string"
            ],
            "description": "The sampling seed used. Pass it back to sample the same pages again."
          },
          "pages_sampled": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Pages drawn from the collection, at most one per document.",
            "format": "int32"
          },
          "accepted_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Questions stored as golden entries.",
            "format": "int32"
          },
          "rejected": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            },
            "description": "Discarded samples per reason: unparsable, length, too_few_words, context_dependent (the question only made sense beside its passage), duplicate. A low acceptance rate is a signal about the corpus or the model, not a silent failure."
          },
          "entries": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/GoldenSetGenerateResponse.Entry"
            },
            "description": "The stored entries, in generation order."
          }
        },
        "description": "The outcome of a synthetic golden-set generation run: the entries that were stored, and how many samples each quality gate discarded."
      },
      "GoldenSetGenerateResponse.Entry": {
        "type": "object",
        "properties": {
          "entry_id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The golden-set entry id, used to delete it.",
            "format": "int64"
          },
          "question": {
            "type": [
              "null",
              "string"
            ],
            "description": "The generated question."
          },
          "reference_answer": {
            "type": [
              "null",
              "string"
            ],
            "description": "The generated reference answer, when the model produced one."
          },
          "document_id": {
            "type": "string",
            "description": "The document the question was written from, and so the expected retrieval target.",
            "format": "uuid"
          },
          "page_number": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The page the question was written from.",
            "format": "int32"
          }
        },
        "description": "One generated golden entry, with the page it was written from."
      },
      "GoldenSetResponse": {
        "type": "object",
        "properties": {
          "collection_id": {
            "type": "string",
            "description": "The collection the entries belong to.",
            "format": "uuid"
          },
          "entries": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/GoldenSetResponse.Entry"
            },
            "description": "The golden entries, oldest first."
          }
        },
        "description": "A collection's golden-set entries."
      },
      "GoldenSetResponse.Entry": {
        "type": "object",
        "properties": {
          "entry_id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The entry's id, used to delete it.",
            "format": "int64"
          },
          "question": {
            "type": [
              "null",
              "string"
            ],
            "description": "The evaluation question."
          },
          "expected_document_ids": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The documents a good retrieval must surface for this question."
          },
          "reference_answer": {
            "type": [
              "null",
              "string"
            ],
            "description": "The reference answer, when one was supplied."
          },
          "created_at": {
            "type": "string",
            "description": "When the entry was added (UTC).",
            "format": "date-time"
          }
        },
        "description": "One golden entry."
      },
      "GroundedChatRequest": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The session to continue. Omit to create a new session."
          },
          "question": {
            "type": [
              "null",
              "string"
            ],
            "description": "The question for this turn. Required with 'session_id'; ignored at session creation."
          },
          "stream": {
            "type": "boolean",
            "description": "Continuation only: when true, the turn streams as Server-Sent Events like the answer endpoint, with 'session_id' on every frame.",
            "default": false
          },
          "cluster_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "Creation: the search cluster that holds the tenant and collections. Defaults to the default cluster."
          },
          "tenant_id": {
            "type": "string",
            "description": "Creation: the tenant that owns the collections.",
            "format": "uuid"
          },
          "collection_id": {
            "type": "string",
            "description": "Creation: a single collection to chat over. Ignored when 'collection_ids' is provided.",
            "format": "uuid"
          },
          "collection_ids": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Creation: the collections this session answers from. Takes precedence over 'collection_id'."
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "Creation: the chat model for the session. Empty uses the server's default chat model."
          },
          "grounding": {
            "description": "Creation: how strictly answers bind to the sources, as on the answer endpoint. Fixed for the session's lifetime. Defaults to 'Strict'.",
            "default": "Strict",
            "$ref": "#/components/schemas/AnswerGrounding"
          },
          "prompt_template": {
            "type": [
              "null",
              "string"
            ],
            "description": "Creation: optional custom per-turn prompt template with '@context' and '@question', as on the answer endpoint."
          },
          "search_type": {
            "description": "Creation: how each turn retrieves, as on the answer endpoint (Hybrid degrades to the tenant's enabled modes). Defaults to 'Hybrid'.",
            "default": "Hybrid",
            "$ref": "#/components/schemas/SearchType"
          },
          "top_k": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Creation: sources retrieved per turn (1..20). Defaults to 5.",
            "format": "int32",
            "default": 5
          },
          "filters": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "Creation: optional metadata filter (equality map) applied to every turn's retrieval. Mutually exclusive with 'filter'."
          },
          "filter": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Creation: optional metadata filter expression applied to every turn's retrieval. Mutually exclusive with 'filters'.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "min_score": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Creation: relevance floor for retrieved sources. Defaults to 0.",
            "format": "double",
            "default": 0
          },
          "rerank": {
            "type": "boolean",
            "description": "Creation: rerank each turn's retrieved sources, as on the search endpoint.",
            "default": false
          },
          "rerank_top_n": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32",
            "default": 50
          },
          "rerank_alpha": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double",
            "default": 0.5
          },
          "context_expansion": {
            "description": "Creation: how much surrounding content each source contributes, as on the answer endpoint. Defaults to 'Chunk'.",
            "default": "Chunk",
            "$ref": "#/components/schemas/ContextExpansion"
          },
          "max_chunks_per_document": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Creation: maximum sources drawn from one document per turn (1..10). Defaults to 3.",
            "format": "int32",
            "default": 3
          },
          "max_completion_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Creation: maximum tokens each turn may generate. Defaults to 1024.",
            "format": "int32",
            "default": 1024
          },
          "temperature": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Creation: sampling temperature for the session. 0 (default) decodes greedily.",
            "format": "double",
            "default": 0
          },
          "max_context_characters": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Creation: character budget for each turn's source blocks. Defaults to 24000.",
            "format": "int32",
            "default": 24000
          }
        },
        "description": "Request body for grounded chat over collections. Without 'session_id' it creates a session (scope, model, retrieval and grounding defaults); with 'session_id' it asks the session a question."
      },
      "GroundedChatResponse": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The session to continue with."
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The session's chat model."
          },
          "collection_ids": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The collections the session answers from."
          },
          "answer": {
            "type": [
              "null",
              "string"
            ],
            "description": "Turn result: the grounded answer with inline [n] markers. Null at session creation; empty when strict grounding refused a no-source turn."
          },
          "context_found": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Turn result: whether any sources were retrieved for the turn."
          },
          "citations": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/AnswerResponse.CitationResponse"
            },
            "description": "Turn result: every retrieved source with its citation flags, as on the answer endpoint."
          },
          "effective_query": {
            "type": [
              "null",
              "string"
            ],
            "description": "Turn result: the query retrieval actually used after the default contextual rewrite of follow-up questions (equals the question when no rewrite applied)."
          }
        },
        "description": "A grounded chat session or turn result."
      },
      "GroundednessEnforcement": {
        "enum": [
          "Off",
          "Report",
          "Refuse"
        ],
        "description": "- `Off`\n- `Report`\n- `Refuse`"
      },
      "HealthResponse": {
        "required": [
          "status"
        ],
        "type": "object",
        "properties": {
          "status": {
            "description": "Always \"ok\" when the server is alive.",
            "$ref": "#/components/schemas/HealthStatus"
          }
        },
        "description": "Liveness probe response."
      },
      "HealthStatus": {
        "enum": [
          "ok"
        ],
        "description": "- `Ok`: The server process is alive."
      },
      "HybridFusion": {
        "enum": [
          "Rrf",
          "Convex"
        ],
        "description": "- `Rrf`\n- `Convex`"
      },
      "IFormFile": {
        "type": "string",
        "format": "binary"
      },
      "ImageBackgroundRemovalMode": {
        "enum": [
          "auto",
          "uniform_color",
          "segmentation"
        ],
        "description": "Background-removal lane. 'auto' (default) tries the exact uniform-color flood fill first and falls back to the segmentation model on a photographic background; 'uniform_color' forces the exact lane (refused with 422 when the border is not uniform); 'segmentation' forces the model lane. Responses report the lane that actually ran.\n\n- `Auto`\n- `UniformColor`\n- `Segmentation`"
      },
      "ImageBackgroundRemovalRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input image. When input_format is 'Base64EncodedFile', provide a base64-encoded image payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "mode": {
            "description": "Which lane to take. 'auto' (default) tries the exact uniform-color flood fill first and falls back to the segmentation model on a photographic background; 'uniform_color' forces the exact lane; 'segmentation' forces the model lane.",
            "default": "auto",
            "$ref": "#/components/schemas/ImageBackgroundRemovalMode"
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional segmentation model identifier. Defaults to the server's configured image-segmentation model. Ignored when 'mode' is 'uniform_color'.",
            "default": ""
          },
          "output_format": {
            "description": "Encoding of the returned cutout. 'png' (default, lossless) and 'webp' (lossy) keep the alpha channel; 'jpeg' cannot hold transparency and is flattened over opaque white.",
            "default": "png",
            "$ref": "#/components/schemas/ImageOutputFormat"
          },
          "output_quality": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Quality (1-100) for the lossy encodings ('webp', 'jpeg'); ignored for 'png'. Default: 80.",
            "format": "int32",
            "default": 80
          },
          "tolerance": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Uniform lane: per-channel distance (0-255) a pixel may sit from the detected background color and still be removed. Default: 24.",
            "format": "int32",
            "default": 24
          },
          "min_accuracy": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Uniform lane: minimum fraction (0-1) of border pixels that must agree on one background color. Below the bar the request falls back to segmentation ('auto'), or is refused with 422 'no_uniform_background' ('uniform_color'). Default: 0.85.",
            "format": "float",
            "default": 0.85
          }
        },
        "description": "Request body for the Image Background Removal API."
      },
      "ImageBackgroundRemovalResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": [
              "null",
              "string"
            ],
            "description": "The cutout, base64-encoded in the requested output format. PNG and WebP carry the RGBA alpha (removed background at alpha 0); JPEG is flattened over opaque white."
          },
          "mode": {
            "description": "The lane that produced the cutout: 'uniform_color' (exact flood fill) or 'segmentation' (model).",
            "$ref": "#/components/schemas/ImageBackgroundRemovalMode"
          },
          "format": {
            "description": "The encoding of 'data': 'png', 'webp', or 'jpeg'.",
            "$ref": "#/components/schemas/ImageOutputFormat"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Output width in pixels.",
            "format": "int32"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Output height in pixels.",
            "format": "int32"
          },
          "background": {
            "description": "The detected background color that was removed. Present for the 'uniform_color' lane only; the segmentation lane removes no single color.",
            "$ref": "#/components/schemas/ImageBackgroundRemovalResponse.BackgroundColor"
          }
        },
        "description": "Response body for the Image Background Removal API."
      },
      "ImageBackgroundRemovalResponse.BackgroundColor": {
        "type": "object",
        "properties": {
          "r": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "g": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "b": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "An RGB color triplet."
      },
      "ImageNormalizationRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input image. When input_format is 'Base64EncodedFile', provide a base64-encoded image payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "rotate": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Clockwise rotation in degrees: 0 (default, none), 90, 180, or 270.",
            "format": "int32",
            "default": 0
          },
          "auto_crop": {
            "type": "boolean",
            "description": "Removes uniform borders (scan margins, letterboxing) by trimming every edge whose pixels match the corner color. Default: off.",
            "default": false
          },
          "crop_margin": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Auto-crop: pixels of border kept around the detected content. Default: 0.",
            "format": "int32",
            "default": 0
          },
          "crop_tolerance": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Auto-crop: per-channel distance (0-255) a border pixel may sit from the corner color and still count as border. 0 (default) trims exact matches only; raise it for noisy scans.",
            "format": "int32",
            "default": 0
          },
          "long_side": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Aspect-preserving resize: scales the image so its longer side measures exactly this many pixels (up or down). Mutually exclusive with 'width'/'height'. Omit for no proportional resize.",
            "format": "int32"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Exact resize: target width in pixels. Requires 'height'; mutually exclusive with 'long_side'.",
            "format": "int32"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Exact resize: target height in pixels. Requires 'width'; mutually exclusive with 'long_side'.",
            "format": "int32"
          },
          "output_format": {
            "description": "Encoding of the returned image. 'png' (default, lossless) and 'webp' (lossy) keep any alpha channel; 'jpeg' cannot hold transparency and is flattened over opaque white.",
            "default": "png",
            "$ref": "#/components/schemas/ImageOutputFormat"
          },
          "output_quality": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Quality (1-100) for the lossy encodings ('webp', 'jpeg'); ignored for 'png'. Default: 80.",
            "format": "int32",
            "default": 80
          }
        },
        "description": "Request body for the Image Normalization API. The operations apply in a fixed order: rotate, then auto-crop, then resize; each is optional, and a request with none of them is a plain format conversion into 'output_format'."
      },
      "ImageNormalizationResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": [
              "null",
              "string"
            ],
            "description": "The normalized image, base64-encoded in the requested output format."
          },
          "format": {
            "description": "The encoding of 'data': 'png', 'webp', or 'jpeg'.",
            "$ref": "#/components/schemas/ImageOutputFormat"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Output width in pixels.",
            "format": "int32"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Output height in pixels.",
            "format": "int32"
          },
          "source_width": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Width of the decoded input, in pixels, before any operation.",
            "format": "int32"
          },
          "source_height": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Height of the decoded input, in pixels, before any operation.",
            "format": "int32"
          }
        },
        "description": "Response body for the Image Normalization API."
      },
      "ImageOutputFormat": {
        "enum": [
          "png",
          "webp",
          "jpeg"
        ],
        "description": "Output encoding for the returned image. 'png' (default, lossless) and 'webp' (lossy) keep the alpha channel; 'jpeg' cannot hold transparency, so transparent pixels are flattened over an opaque white background before encoding.\n\n- `Png`\n- `Webp`\n- `Jpeg`"
      },
      "ImageToPdfRequest": {
        "required": [
          "sources"
        ],
        "type": "object",
        "properties": {
          "sources": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ImageToPdfSource"
            },
            "description": "The list of images to convert into a PDF, in order. Each source can be a base64-encoded image or a file identifier. At least one source is required. Each image becomes a page in the output PDF."
          },
          "image_encoding": {
            "description": "Encoding for color and grayscale images. 'Jpeg' (default): lossy but compact. 'Deflate': lossless compression.",
            "default": 0,
            "$ref": "#/components/schemas/PdfGenerationOptions.ImageEncoding"
          },
          "binary_image_encoding": {
            "description": "Encoding for 1-bit binary images. 'CcittGroup4' (default): optimal for scanned documents. 'Deflate': lossless compression.",
            "default": 0,
            "$ref": "#/components/schemas/PdfGenerationOptions.BinaryImageEncoding"
          },
          "jpeg_quality": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "JPEG quality (1-100). Only applies when image_encoding is 'Jpeg'. Default: 70.",
            "format": "int32",
            "default": 70
          },
          "pdf_version": {
            "description": "Output PDF version. Accepted values: 'Pdf14', 'Pdf15', 'Pdf16', 'Pdf17' (default), 'PdfA1b', 'PdfA2b', 'PdfA3b'.",
            "default": 4,
            "$ref": "#/components/schemas/PdfGenerationOptions.PdfVersion"
          }
        },
        "description": "Request body for the Image-to-PDF API."
      },
      "ImageToPdfResponse": {
        "required": [
          "file_id",
          "page_count",
          "source_count"
        ],
        "type": "object",
        "properties": {
          "file_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file ID of the generated PDF, stored on the server. To download: GET /lmkit/v1/files/{file_id}. To use in another endpoint (e.g., document-to-markdown, pdf-search, pdf-layout): pass this ID as the 'input' field with input_format set to 'FileIdentifier'. To delete: DELETE /lmkit/v1/files/{file_id}. Files are automatically deleted after the server's configured file retention period."
          },
          "page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The total number of pages in the generated PDF.",
            "format": "int32"
          },
          "source_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of input images that were converted.",
            "format": "int32"
          }
        },
        "description": "Response from the Image-to-PDF API."
      },
      "ImageToPdfSource": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input image. When input_format is 'Base64EncodedFile', provide a base64-encoded image payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          }
        },
        "description": "A single image source to include in the Image-to-PDF conversion."
      },
      "IndexDocumentRequest": {
        "required": [
          "tenant_id",
          "collection_id",
          "document_id"
        ],
        "type": "object",
        "properties": {
          "cluster_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search cluster that holds the tenant and collection. If not provided, the default cluster is used."
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant that owns the collection.",
            "format": "uuid"
          },
          "collection_id": {
            "type": "string",
            "description": "The collection to index the document into.",
            "format": "uuid"
          },
          "document_id": {
            "type": "string",
            "description": "The id you assign to the document. Use it to delete the document later; it is also returned with search results.",
            "format": "uuid"
          },
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The document to index: plain text, a base64-encoded file, or an uploaded file id. Required, but validated inside the endpoint (not via model validation) so an empty input is logged and captured like any other indexing failure.",
            "default": ""
          },
          "input_format": {
            "description": "How 'input' is provided.",
            "default": "PlainText",
            "$ref": "#/components/schemas/InputFormat"
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional display name for the document. Returned with search hits."
          },
          "source_uri": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional source location, for example a URL or file path. Returned with search hits."
          },
          "content_hash": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional content hash for change detection and de-duplication. When a document with the same id and the same non-empty content hash is already indexed, the request is a no-op (it returns 'Unchanged' without re-processing)."
          },
          "ttl_seconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Optional time-to-live in seconds. When set, the document is automatically removed this many seconds after indexing. Omit for a document that never expires.",
            "format": "int32"
          },
          "custom_metadata": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "Optional free-form string key/value pairs stored with the document and returned with search hits."
          },
          "wait_for_embedding": {
            "type": "boolean",
            "description": "Whether to compute the document's semantic embedding before the request returns. Defaults to false: the document is made full-text searchable immediately and its embedding is produced in the background, so ingestion does not block on inference and write throughput scales. Set to true only when the document must be semantically searchable the instant the call returns; this makes the call wait on the embedding model. Has no effect when the tenant has semantic search off.",
            "default": false
          }
        },
        "description": "Request body for indexing a document. It carries the document and the ids that identify it; how the collection is searched is set on the collection, not per document."
      },
      "IndexDocumentResponse": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "description": "The document id that was indexed.",
            "format": "uuid"
          },
          "outcome": {
            "description": "How the request resolved: 'Created' (new document), 'Replaced' (an existing document with the same id was overwritten), or 'Unchanged' (same id and content hash already indexed, so nothing was re-processed).",
            "$ref": "#/components/schemas/IngestionOutcome"
          },
          "pages_indexed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of pages indexed from the document.",
            "format": "int32"
          },
          "chunks_indexed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of text chunks prepared for semantic search; zero when the collection is full-text only.",
            "format": "int32"
          },
          "chunks_dropped": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of chunks the semantic quality gate rejected as carrying no standalone semantic value (extraction noise, mojibake, boilerplate). Zero when embedding is deferred to the background worker, where the gate reports through the server logs and metrics instead.",
            "format": "int32"
          },
          "chunks_merged": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of chunks the semantic quality gate folded into a neighboring chunk (bare headings, tiny fragments) instead of embedding them standalone. Zero when embedding is deferred.",
            "format": "int32"
          },
          "chunks_flagged": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of chunks the semantic quality gate kept out of the index with conflicting evidence, reported for review. Zero when embedding is deferred.",
            "format": "int32"
          },
          "ocr_performed": {
            "type": "boolean",
            "description": "True when OCR was performed on at least one page while extracting this document (an image, embedded-image text recovery, or full-page recognition of a scanned page), false when every page was read from an embedded text layer. False for an 'Unchanged' outcome, where nothing was re-processed."
          },
          "embedding_model": {
            "type": [
              "null",
              "string"
            ],
            "description": "Name of the embedding model used, or null when the collection is full-text only."
          }
        },
        "description": "Result of indexing a document."
      },
      "IngestionOutcome": {
        "enum": [
          "Created",
          "Replaced",
          "Unchanged"
        ],
        "description": "- `Created`\n- `Replaced`\n- `Unchanged`"
      },
      "InputFormat": {
        "enum": [
          "PlainText",
          "Base64EncodedFile",
          "FileIdentifier"
        ],
        "description": "- `PlainText`: The input is provided as plain text.\n- `Base64EncodedFile`: The input is provided as a base64-encoded file.\n- `FileIdentifier`: The input is provided as a file identifier returned by api/v1/files/upload."
      },
      "JobAcceptedResponse": {
        "required": [
          "job_id",
          "status"
        ],
        "type": "object",
        "properties": {
          "job_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "Unique identifier for the background job. Use this to poll for status and results."
          },
          "status": {
            "description": "The job status. Always 'processing' in this response.",
            "$ref": "#/components/schemas/JobStatus"
          },
          "message": {
            "type": [
              "null",
              "string"
            ],
            "description": "Additional information about the job."
          }
        },
        "description": "Response returned when a request exceeds the synchronous processing timeout. Use the job_id to poll GET /lmkit/v1/jobs/{job_id} for the final result."
      },
      "JobResponse": {
        "required": [
          "job_id",
          "status",
          "created_at"
        ],
        "type": "object",
        "properties": {
          "job_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "Unique identifier for the job."
          },
          "status": {
            "description": "Current job status: 'processing', 'completed', 'failed', or 'cancelled'.",
            "$ref": "#/components/schemas/JobStatus"
          },
          "result": {
            "description": "The original endpoint response. Populated when status is 'completed'."
          },
          "error": {
            "type": [
              "null",
              "string"
            ],
            "description": "Error details. Populated when status is 'failed'."
          },
          "error_code": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "HTTP-equivalent status for the failure (e.g. 415 for an unsupported file type, 400 for a malformed payload). Populated when status is 'failed' and the cause maps to a specific status; absent for a generic failure.",
            "format": "int32"
          },
          "error_reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Machine-readable reason code for the failure (e.g. 'password_required' for an encrypted PDF). Populated when status is 'failed' and the cause has a specific code; absent otherwise."
          },
          "created_at": {
            "type": "string",
            "description": "UTC timestamp when the job was created.",
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "UTC timestamp when the job completed. Null while processing.",
            "format": "date-time"
          },
          "progress_current": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Current progress value (e.g. pages processed). Null when progress is not tracked.",
            "format": "int32"
          },
          "progress_total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Total expected items (e.g. total pages). Null when progress is not tracked.",
            "format": "int32"
          }
        },
        "description": "Full job status response returned when polling GET /lmkit/v1/jobs/{job_id}. The 'result' field contains the original endpoint response when the job completes."
      },
      "JobStatus": {
        "enum": [
          "processing",
          "completed",
          "failed",
          "cancelled"
        ],
        "description": "- `Processing`\n- `Completed`\n- `Failed`\n- `Cancelled`"
      },
      "JsonElement": { },
      "JsonNode": { },
      "KeywordExtractionItemResponse": {
        "required": [
          "value"
        ],
        "type": "object",
        "properties": {
          "value": {
            "type": [
              "null",
              "string"
            ],
            "description": "The actual keyword or phrase that was extracted."
          }
        },
        "description": "Represents a single keyword or phrase extracted from the input content."
      },
      "KeywordExtractionRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The identifier of the language model to be used for keyword extraction. If not provided, the default model is used.",
            "default": ""
          },
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input for keyword extraction. When input_format is 'PlainText', provide raw text. When 'Base64EncodedFile', provide a base64-encoded file payload (supported: HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF). When 'FileIdentifier', provide the file ID previously returned by the api/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'PlainText', 'Base64EncodedFile', or 'FileIdentifier'. 'Base64EncodedFile' supports: HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF. 'FileIdentifier' references a file previously uploaded via api/v1/files/upload. Defaults to 'PlainText'.",
            "default": "PlainText",
            "$ref": "#/components/schemas/InputFormat"
          },
          "text_shrinking_strategy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Specifies the method used to reduce input size when it exceeds the maximum allowable context length as determined by the model, system configuration, and available resources. Options include Auto, RemoveWords, RemoveLines, SummarizeText, TrimTop, and TrimBottom.",
                "$ref": "#/components/schemas/TextShrinkingStrategy"
              }
            ]
          },
          "keyword_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The desired number of keywords to extract. Must be between 1 and 50; defaults to 5 if not specified.",
            "format": "int32",
            "default": 5
          },
          "max_ngram_size": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The maximum n-gram size for the extracted keywords. Must be between 1 and 20; defaults to 3 if not specified.",
            "format": "int32",
            "default": 3
          },
          "guidance": {
            "type": [
              "null",
              "string"
            ],
            "description": "Additional guidance text that can influence the extraction process (e.g., focusing on certain themes).",
            "default": ""
          },
          "target_language": {
            "description": "Specifies the preferred language for the generated keywords. If set to 'Undefined', the engine attempts to automatically detect the input content language and produces the output accordingly (note: automatic detection may affect performance). When explicitly set, the engine attempts to interpret content and generate summaries in the selected language.",
            "default": "Undefined",
            "$ref": "#/components/schemas/Language"
          }
        },
        "description": "Request body for the Keyword Extraction API"
      },
      "KeywordExtractionResponse": {
        "required": [
          "keywords",
          "confidence"
        ],
        "type": "object",
        "properties": {
          "keywords": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/KeywordExtractionItemResponse"
            },
            "description": "A collection of keywords extracted from the input content. Each item represents a single keyword or phrase."
          },
          "confidence": {
            "maximum": 1,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The confidence level. A floating-point value between 0 and 1, where a value closer to 1 indicates higher confidence in the extraction accuracy.",
            "format": "float"
          }
        },
        "description": "Model for the Keyword Extraction API response. Contains a collection of keywords extracted from the provided content."
      },
      "Language": {
        "enum": [
          "Undefined",
          "Arabic",
          "Armenian",
          "Bulgarian",
          "ChineseSimplified",
          "ChineseTraditional",
          "Croatian",
          "Czech",
          "Danish",
          "Dutch",
          "English",
          "Finnish",
          "French",
          "German",
          "Hebrew",
          "Hindi",
          "Hungarian",
          "Indonesian",
          "Italian",
          "Japanese",
          "Korean",
          "ModernGreek",
          "Norwegian",
          "Persian",
          "Polish",
          "Portuguese",
          "Romanian",
          "Russian",
          "Serbian",
          "Slovak",
          "Spanish",
          "Swedish",
          "Thai",
          "Turkish",
          "Ukrainian",
          "Vietnamese"
        ],
        "description": "Defines supported languages.\n\n- `Undefined`: Represents an undefined or unspecified language.\n- `Arabic`: Arabic language, spoken in many countries in the Middle East and North Africa.\n- `Armenian`: Armenian language, official in Armenia.\n- `Bulgarian`: Bulgarian language, official in Bulgaria.\n- `ChineseSimplified`: Simplified Chinese, used primarily in the People's Republic of China and Singapore.\n- `ChineseTraditional`: Traditional Chinese, used primarily in Taiwan, Hong Kong, and Macau.\n- `Croatian`: Croatian language, official in Croatia.\n- `Czech`: Czech language, official in the Czech Republic.\n- `Danish`: Danish language, official in Denmark.\n- `Dutch`: Dutch language, spoken in the Netherlands, Belgium, and Suriname.\n- `English`: English language, a global lingua franca.\n- `Finnish`: Finnish language, official in Finland.\n- `French`: French language, spoken on all continents, particularly in France, Canada, Belgium, Switzerland, and many African countries.\n- `German`: German language, spoken in Germany, Austria, Switzerland, and other countries.\n- `Hebrew`: Hebrew language, official in Israel.\n- `Hindi`: Hindi language, widely spoken in India.\n- `Hungarian`: Hungarian language, official in Hungary.\n- `Indonesian`: Indonesian language, official in Indonesia.\n- `Italian`: Italian language, official in Italy and parts of Switzerland.\n- `Japanese`: Japanese language, official in Japan.\n- `Korean`: Korean language, spoken in both South and North Korea.\n- `ModernGreek`: Modern Greek language, official in Greece and Cyprus.\n- `Norwegian`: Norwegian language, official in Norway.\n- `Persian`: Persian (Farsi) language, official in Iran and also spoken in Afghanistan and Tajikistan.\n- `Polish`: Polish language, official in Poland.\n- `Portuguese`: Portuguese language, spoken in Portugal, Brazil, and some African countries.\n- `Romanian`: Romanian language, official in Romania and Moldova.\n- `Russian`: Russian language, widely spoken in Russia and some neighboring countries.\n- `Serbian`: Serbian language, official in Serbia, Bosnia and Herzegovina, and Montenegro.\n- `Slovak`: Slovak language, official in Slovakia.\n- `Spanish`: Spanish language, spoken in Spain, Latin America, and increasingly worldwide.\n- `Swedish`: Swedish language, official in Sweden and parts of Finland.\n- `Thai`: Thai language, official in Thailand.\n- `Turkish`: Turkish language, official in Turkey and Cyprus.\n- `Ukrainian`: Ukrainian language, official in Ukraine.\n- `Vietnamese`: Vietnamese language, official in Vietnam."
      },
      "LanguageDetectionRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The ID of the model used for language detection. If not specified, the default model will be used.",
            "default": ""
          },
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input for language detection. When input_format is 'PlainText', provide raw text. When 'Base64EncodedFile', provide a base64-encoded file payload (supported: HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF). When 'FileIdentifier', provide the file ID previously returned by the api/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'PlainText', 'Base64EncodedFile', or 'FileIdentifier'. 'Base64EncodedFile' supports: HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF. 'FileIdentifier' references a file previously uploaded via api/v1/files/upload. Defaults to 'PlainText'.",
            "default": "PlainText",
            "$ref": "#/components/schemas/InputFormat"
          },
          "languages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/Language"
            },
            "description": "A collection of languages to consider. If omitted, all supported languages will be used."
          }
        },
        "description": "Request body for the Language Detection API."
      },
      "LanguageDetectionResponse": {
        "required": [
          "language",
          "confidence"
        ],
        "type": "object",
        "properties": {
          "language": {
            "description": "The detected language as an enumeration value from the supported languages list.",
            "$ref": "#/components/schemas/Language"
          },
          "confidence": {
            "maximum": 1,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The confidence level. A floating-point value between 0 and 1, where a value closer to 1 indicates higher confidence in the detection accuracy.",
            "format": "float"
          }
        },
        "description": "Response from the Language Detection API. Returns the detected language from the input content."
      },
      "LineResult": {
        "required": [
          "text",
          "words"
        ],
        "type": "object",
        "properties": {
          "text": {
            "type": [
              "null",
              "string"
            ],
            "description": "The text content of this line."
          },
          "words": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/WordResult"
            },
            "description": "The individual words that compose this line, in reading order."
          },
          "bounds": {
            "description": "The bounding box of this line on the page, in points. Null if layout coordinates are unavailable.",
            "$ref": "#/components/schemas/BoundsResult"
          }
        },
        "description": "A single detected text line within a paragraph."
      },
      "ListDocumentsRequest": {
        "required": [
          "tenant_id",
          "collection_id"
        ],
        "type": "object",
        "properties": {
          "cluster_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search cluster that holds the tenant and collection. If not provided, the default cluster is used."
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant that owns the collection.",
            "format": "uuid"
          },
          "collection_id": {
            "type": "string",
            "description": "The collection to list documents from.",
            "format": "uuid"
          },
          "offset": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of leading documents to skip, for paging. Defaults to 0.",
            "format": "int32",
            "default": 0
          },
          "limit": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Maximum number of document ids to return in this page (clamped to 1..1000). A page shorter than the limit is the last page. Defaults to 200.",
            "format": "int32",
            "default": 200
          }
        },
        "description": "Request body for listing the document ids a collection holds, for reconciliation."
      },
      "ListDocumentsResponse": {
        "type": "object",
        "properties": {
          "document_ids": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The public document ids in this page, ordered. Fewer than the requested limit means this is the last page."
          }
        },
        "description": "One page of document ids held in a collection."
      },
      "LoadedModelResponse": {
        "required": [
          "model",
          "model_uri",
          "size_bytes",
          "ref_count",
          "last_usage",
          "is_embedding_model",
          "has_vision"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model identifier."
          },
          "model_uri": {
            "type": [
              "null",
              "string"
            ],
            "description": "The full URI of the loaded model file."
          },
          "size_bytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Size of the model file in bytes.",
            "format": "int64"
          },
          "ref_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of active references (in-flight requests using this model).",
            "format": "int32"
          },
          "last_usage": {
            "type": "string",
            "description": "Timestamp of the last time this model was used.",
            "format": "date-time"
          },
          "is_embedding_model": {
            "type": "boolean",
            "description": "Whether this is an embedding model."
          },
          "has_vision": {
            "type": "boolean",
            "description": "Whether this model supports vision (image) inputs."
          }
        },
        "description": "Information about a model currently loaded in memory."
      },
      "LoadModelRequest": {
        "required": [
          "model"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model identifier to load (e.g. \"gemma3:4b\").",
            "default": ""
          }
        },
        "description": "Request to load a model into memory."
      },
      "MemoryStoreOptions": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "maxEntries": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "evictionPolicy": {
            "type": [
              "null",
              "string"
            ]
          },
          "timeDecayHalfLifeHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "topK": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minScore": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          },
          "extractionMode": {
            "type": [
              "null",
              "string"
            ]
          },
          "maxExtractionsPerTurn": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "deduplicationThreshold": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          }
        }
      },
      "ModelActionResponse": {
        "required": [
          "status",
          "model"
        ],
        "type": "object",
        "properties": {
          "status": {
            "description": "The result status of the operation.",
            "$ref": "#/components/schemas/ModelActionStatus"
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model identifier."
          }
        },
        "description": "Response for model load/unload operations."
      },
      "ModelActionStatus": {
        "enum": [
          "Loaded",
          "LoadFailed",
          "Unloaded",
          "AlreadyLoaded",
          "NotFound",
          "NotLoaded",
          "InUse",
          "Downloaded",
          "AlreadyAvailable",
          "Error"
        ],
        "description": "- `Loaded`: The model was successfully loaded into memory.\n- `LoadFailed`: The model failed to load.\n- `Unloaded`: The model was successfully unloaded from memory.\n- `AlreadyLoaded`: The model was already loaded when the load request was made.\n- `NotFound`: The specified model was not found in the catalog.\n- `NotLoaded`: The model is not currently loaded in memory.\n- `InUse`: The model is currently in use and cannot be unloaded.\n- `Downloaded`: The model was successfully downloaded to local storage.\n- `AlreadyAvailable`: The model is already available in local storage.\n- `Error`: An unexpected error occurred during the operation."
      },
      "ModelCatalogItem": {
        "required": [
          "model",
          "name",
          "publisher",
          "types",
          "size_bytes",
          "is_locally_available"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model identifier (e.g. \"gemma3:4b\")."
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The human-readable model name."
          },
          "publisher": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model publisher."
          },
          "types": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ModelType"
            },
            "description": "The functional type(s) the model supports (for example, \"Chat\", \"Vision\", \"TextEmbedding\")."
          },
          "size_bytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "File size in bytes.",
            "format": "int64"
          },
          "is_locally_available": {
            "type": "boolean",
            "description": "Whether the model file has been downloaded to local storage."
          }
        },
        "description": "A model entry from the predefined catalog."
      },
      "ModelCatalogResponse": {
        "type": "object",
        "properties": {
          "models": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ModelCatalogResponse.ModelEntry"
            }
          },
          "device": {
            "$ref": "#/components/schemas/ModelCatalogResponse.DeviceSummary"
          },
          "defaultChatModel": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ModelCatalogResponse.DeviceSummary": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "memoryBytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "type": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ModelCatalogResponse.ModelEntry": {
        "type": "object",
        "properties": {
          "modelId": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "uri": {
            "type": [
              "null",
              "string"
            ]
          },
          "local": {
            "type": "boolean"
          },
          "sizeBytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "family": {
            "type": [
              "null",
              "string"
            ]
          },
          "vendor": {
            "type": [
              "null",
              "string"
            ]
          },
          "params": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "resident": {
            "type": "boolean"
          },
          "capabilities": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "quant": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          },
          "f16": {
            "type": "boolean"
          },
          "mteb": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "float"
          },
          "fit": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          }
        }
      },
      "ModelImportRequest": {
        "type": "object",
        "properties": {
          "path": {
            "type": [
              "null",
              "string"
            ],
            "description": "Absolute path of the model file on the server (GGUF or LMK). Mutually exclusive with 'url'."
          },
          "url": {
            "type": [
              "null",
              "string"
            ],
            "description": "Hugging Face reference to import (hf.co/owner/repo[:quant]). The download rides the server's egress policy and verifies hub-declared digests. Mutually exclusive with 'path'."
          },
          "probe": {
            "type": "boolean",
            "description": "When true, the imported model is loaded and exercised (decode, tool round-trip, embeddings) and the measured verdicts are recorded on the record."
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Name the model serves under (name[:tag]). Must not collide with a catalog model or an existing custom model."
          },
          "aliases": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Alternate names resolving to the same model."
          },
          "toolDialect": {
            "type": [
              "null",
              "string"
            ],
            "description": "Tool-call dialect override for models whose template fingerprint is unrecognized (a ToolCallingFormat name)."
          },
          "license": {
            "type": [
              "null",
              "string"
            ],
            "description": "License identifier or text recorded with the model."
          }
        },
        "description": "Request body of the admin model import: registers a server-local model file or a Hugging Face repository as a custom model."
      },
      "ModelSlotPoolOverride": {
        "type": "object",
        "properties": {
          "modelId": {
            "type": [
              "null",
              "string"
            ]
          },
          "slotCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "slotContextSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "embeddingContextSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "source": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ModelType": {
        "enum": [
          "Chat",
          "TextGeneration",
          "CodeCompletion",
          "SentimentAnalysis",
          "Math",
          "Vision",
          "TextEmbedding",
          "ImageEmbedding",
          "TextReranking",
          "SpeechToText",
          "VoiceActivityDetection",
          "ImageSegmentation",
          "Reasoning",
          "ToolsCall",
          "Ocr",
          "Translation"
        ],
        "description": "The functional type of a model.\n\n- `Chat`: A conversational model for dialogue, chat, and question answering.\n- `TextGeneration`: A model for free-form text generation, such as content creation and summarization.\n- `CodeCompletion`: A model for code generation and completion.\n- `SentimentAnalysis`: A model for sentiment and emotion analysis.\n- `Math`: A model optimized for mathematical reasoning and problem solving.\n- `Vision`: A vision-language model that understands images alongside text.\n- `TextEmbedding`: A text embedding model that produces vector representations of text.\n- `ImageEmbedding`: An image embedding model that produces vector representations of images.\n- `TextReranking`: A text reranking (cross-encoder) model that scores query-document relevance.\n- `SpeechToText`: A speech-to-text transcription model.\n- `VoiceActivityDetection`: A voice-activity-detection model that distinguishes speech from silence or background noise.\n- `ImageSegmentation`: An image segmentation model that partitions images into regions or objects.\n- `Reasoning`: A model optimized for advanced multi-step reasoning and planning.\n- `ToolsCall`: A model that can invoke external tools or functions.\n- `Ocr`: A model optimized for optical character recognition (OCR).\n- `Translation`: A model optimized for multilingual translation."
      },
      "ModelUnloadRequest": {
        "type": "object",
        "properties": {
          "modelUri": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "NamedEntityRecognition.NamedEntityType": {
        "enum": [
          "Person",
          "Location",
          "Organization",
          "Event",
          "Product",
          "WorkOfArt",
          "Language",
          "PhoneNumber",
          "EmailAddress",
          "PostalAddress",
          "Url",
          "IpAddress",
          "Date",
          "Time",
          "DateTime",
          "Number",
          "Percent",
          "Ordinal",
          "MonetaryAmount",
          "Other",
          "Custom"
        ],
        "description": "Standard set of entity types for Named-Entity Extraction/Recognition.\n\n- `Person`: A person's name (e.g. \"Sam Altman\", \"Marie Curie\").\n- `Location`: A geographical location (e.g. \"Paris\", \"Mount Everest\").\n- `Organization`: An organization or institution (e.g. \"OpenAI\", \"United Nations\").\n- `Event`: An event name (e.g. \"Oscars 2025\", \"World Cup 2026\").\n- `Product`: A product name (e.g. \"iPhone 15\", \"PlayStation 5\").\n- `WorkOfArt`: A title of a creative work (e.g. \"The Starry Night\", \"Inception\").\n- `Language`: A human language (e.g. \"English\", \"Español\").\n- `PhoneNumber`: A phone number (e.g. \"+1-650-555-1234\").\n- `EmailAddress`: An email address (e.g. \"user@example.com\").\n- `PostalAddress`: A postal or street address (e.g. \"1600 Amphitheatre Parkway, Mountain View, CA\").\n- `Url`: A URL or web address (e.g. \"https://lm-kit.com\").\n- `IpAddress`: An IP address (e.g. \"192.168.0.1\").\n- `Date`: A date expression (e.g. \"June 4, 2025\", \"2025-06-04\").\n- `Time`: A time expression (e.g. \"3:00 PM\", \"15:30\").\n- `DateTime`: A combined date and time (e.g. \"June 4, 2025 at 15:30\").\n- `Number`: A numeric literal (e.g. \"42\", \"3.14\").\n- `Percent`: A percentage (e.g. \"45%\", \"12.5 %\").\n- `Ordinal`: An ordinal number (e.g. \"1st\", \"second\").\n- `MonetaryAmount`: A monetary amount (e.g. \"$12.50\", \"€10\").\n- `Other`: Any entity not covered by the explicit types above.\n- `Custom`: A custom, user-defined entity type not included in the standard set."
      },
      "NERBoundingBox": {
        "type": "object",
        "properties": {
          "left": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "top": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        },
        "description": "Axis-aligned rectangle on a page where an entity occurred, in absolute page units (e.g., pixels or PDF points)."
      },
      "NEREntityItem": {
        "required": [
          "label",
          "entity_type",
          "value",
          "confidence"
        ],
        "type": "object",
        "properties": {
          "label": {
            "type": [
              "null",
              "string"
            ],
            "description": "Display label for the entity (e.g., 'Person', 'Organization', or a custom label)."
          },
          "entity_type": {
            "description": "The entity type (built-in enum name or 'Custom').",
            "$ref": "#/components/schemas/NamedEntityRecognition.NamedEntityType"
          },
          "value": {
            "type": [
              "null",
              "string"
            ],
            "description": "The canonical text value extracted from the original content."
          },
          "occurrences": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/NERLocation"
            },
            "description": "All locations where this entity was recognized (text offsets and/or page+bounding box)."
          },
          "confidence": {
            "maximum": 1,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Confidence score (0.0-1.0) for this entity.",
            "format": "float"
          }
        },
        "description": "One detected named entity and its occurrences within the input."
      },
      "NERLocation": {
        "type": "object",
        "properties": {
          "start_offset": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Zero-based inclusive start character offset in the original text, or -1 if not available.",
            "format": "int32",
            "default": -1
          },
          "length": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Length in characters of the matched substring, or -1 if not available.",
            "format": "int32",
            "default": -1
          },
          "page_index": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Zero-based page index for paged inputs (PDF/images), or -1 if not available.",
            "format": "int32",
            "default": -1
          },
          "bounding_box": {
            "description": "Axis-aligned bounding box in absolute page units, if available.",
            "$ref": "#/components/schemas/NERBoundingBox"
          }
        },
        "description": "One occurrence of a detected entity within the input."
      },
      "NERRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The identifier of the language model to be used for entity recognition. If not provided, the default model is used.",
            "default": ""
          },
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input for entity recognition. When input_format is 'PlainText', provide raw text. When 'Base64EncodedFile', provide a base64-encoded file payload (supported: HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF). When 'FileIdentifier', provide the file ID previously returned by the api/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'PlainText', 'Base64EncodedFile', or 'FileIdentifier'. 'Base64EncodedFile' supports: HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF. 'FileIdentifier' references a file previously uploaded via api/v1/files/upload. Defaults to 'PlainText'.",
            "default": "PlainText",
            "$ref": "#/components/schemas/InputFormat"
          },
          "enable_ocr": {
            "type": "boolean",
            "description": "Whether to use OCR for pages that contain no extractable text (e.g., scanned images). Requires an OCR provider to be configured on the server. Defaults to true.",
            "default": true
          },
          "guidance": {
            "type": [
              "null",
              "string"
            ],
            "description": "Additional guidance text that can influence the recognition process (e.g., domain hints or formatting notes).",
            "default": ""
          },
          "built_in_types": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/NamedEntityRecognition.NamedEntityType"
            },
            "description": "Optional list of built-in named entity types to detect (exclude 'Custom' and 'Other'). If omitted and no custom_labels are provided, all built-in types are considered."
          },
          "custom_labels": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Optional list of custom entity labels (e.g., 'DiseaseName', 'ProductCode'). Each item must be a non-empty string."
          },
          "include_other_type": {
            "type": "boolean",
            "description": "Whether to include the 'Other' catch-all entity category for entities that do not match any defined type. Defaults to false.",
            "default": false
          }
        },
        "description": "Request body for the Named Entity Recognition API."
      },
      "NERResponse": {
        "required": [
          "entities",
          "overall_confidence"
        ],
        "type": "object",
        "properties": {
          "entities": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/NEREntityItem"
            },
            "description": "A collection of named entities detected in the input content."
          },
          "overall_confidence": {
            "maximum": 1,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Overall confidence score for the recognition (0..1).",
            "format": "float"
          }
        },
        "description": "Named Entity Recognition API response. Contains detected entities and an overall confidence score."
      },
      "OcrPageResult": {
        "required": [
          "page_number",
          "layout",
          "text"
        ],
        "type": "object",
        "properties": {
          "page_number": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The 1-based page number.",
            "format": "int32"
          },
          "layout": {
            "description": "Physical layout with detected paragraphs, lines, words, and bounding boxes.",
            "$ref": "#/components/schemas/PageLayout"
          },
          "text": {
            "description": "Recognized text in multiple formatting modes.",
            "$ref": "#/components/schemas/OcrPageText"
          },
          "content_confidence": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Confidence, in the 0..1 range, that the recognized content is genuine text rather than recognition noise (word-shaped artifacts read off photos or textures). Below 0.35 the content should be discarded; between 0.35 and 0.60 human verification is recommended; at or above 0.60 the content can be trusted. Stays 1.0 when the server's OCR noise rejection is disabled or the engine does not support screening.",
            "format": "double"
          }
        },
        "description": "OCR result for a single page, including layout and text in multiple formats."
      },
      "OcrPageText": {
        "required": [
          "raw_lines",
          "grid_aligned",
          "paragraph_flow",
          "structured"
        ],
        "type": "object",
        "properties": {
          "raw_lines": {
            "type": [
              "null",
              "string"
            ],
            "description": "One line per detected text line. Words joined with spaces; no column alignment or paragraph grouping."
          },
          "grid_aligned": {
            "type": [
              "null",
              "string"
            ],
            "description": "Preserves approximate column alignment and indentation using spaces based on word positions."
          },
          "paragraph_flow": {
            "type": [
              "null",
              "string"
            ],
            "description": "Lines grouped into paragraphs in reading order, separated by blank lines. Best for natural reading."
          },
          "structured": {
            "type": [
              "null",
              "string"
            ],
            "description": "Maintains paragraph boundaries and tabular layouts as logical blocks. Ideal for RAG and semantic extraction."
          }
        },
        "description": "Recognized text for a single page in multiple formatting modes."
      },
      "OcrSettings.LMKitOcrSettings": {
        "type": "object",
        "properties": {
          "enableOrientationDetection": {
            "type": "boolean"
          },
          "enableAutoDeskew": {
            "type": "boolean"
          },
          "enableSmartBinarization": {
            "type": "boolean"
          },
          "enableDespeckle": {
            "type": "boolean"
          },
          "enableNoiseRejection": {
            "type": "boolean"
          },
          "defaultModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "maxConcurrentProcesses": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxConcurrentProcessesSupported": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "OcrSettings.TextractSettings": {
        "type": "object",
        "properties": {
          "awsAccessKeyId": {
            "type": [
              "null",
              "string"
            ]
          },
          "awsSecretAccessKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "awsRegion": {
            "type": [
              "null",
              "string"
            ]
          },
          "timeoutSeconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "OcrUpdate.LMKitOcrUpdate": {
        "type": "object",
        "properties": {
          "enableOrientationDetection": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "enableAutoDeskew": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "enableSmartBinarization": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "enableDespeckle": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "enableNoiseRejection": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "defaultModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "maxConcurrentProcesses": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "OcrUpdate.TextractUpdate": {
        "type": "object",
        "properties": {
          "awsAccessKeyId": {
            "type": [
              "null",
              "string"
            ]
          },
          "awsSecretAccessKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "awsRegion": {
            "type": [
              "null",
              "string"
            ]
          },
          "timeoutSeconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "Ollama.OllamaChatMessage": {
        "type": "object",
        "properties": {
          "role": {
            "type": [
              "null",
              "string"
            ],
            "description": "The message author: \"system\", \"user\", \"assistant\" or \"tool\"."
          },
          "content": {
            "type": [
              "null",
              "string"
            ],
            "description": "The text content of the message."
          },
          "thinking": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model's reasoning trace, when thinking was requested and the model separates it."
          },
          "images": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Base64-encoded images attached to the message (multimodal models)."
          },
          "tool_calls": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/Ollama.OllamaToolCall"
            },
            "description": "Tool calls requested by the assistant in this message."
          },
          "tool_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "For role \"tool\": the name of the tool this message carries the result of."
          }
        },
        "description": "One message of an Ollama chat conversation."
      },
      "Ollama.OllamaChatRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model identifier (e.g. \"gemma3:4b\"). If not specified, the server's default chat model is used."
          },
          "messages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/Ollama.OllamaChatMessage"
            },
            "description": "The messages of the conversation so far. An empty list preloads the model (or unloads it when keep_alive is 0) without generating."
          },
          "tools": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/Ollama.OllamaTool"
            },
            "description": "Tools the model may call."
          },
          "format": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Output format constraint: the string \"json\" for JSON mode, or a JSON Schema object for structured output.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "options": {
            "description": "Runtime options (temperature, num_ctx, stop, ...).",
            "$ref": "#/components/schemas/Ollama.OllamaOptions"
          },
          "stream": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether to stream the response as newline-delimited JSON. Defaults to true."
          },
          "keep_alive": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "How long the model should stay loaded after the request: a duration string (\"5m\") or seconds. Residency is managed by the server's memory-pressure policy; the explicit unload form (0 with an empty message list) is honored.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "think": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Reasoning control for thinking-capable models: false disables reasoning, true (or \"low\"/\"medium\"/\"high\") keeps or raises it.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          }
        },
        "description": "Request body for the Ollama chat API. Reference: https://docs.ollama.com/api#generate-a-chat-completion"
      },
      "Ollama.OllamaChatResponse": {
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model that produced the response."
          },
          "created_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "RFC 3339 timestamp of the response object."
          },
          "message": {
            "description": "The assistant message (a partial delta while streaming).",
            "$ref": "#/components/schemas/Ollama.OllamaChatMessage"
          },
          "done": {
            "type": "boolean",
            "description": "True on the terminal response object."
          },
          "done_reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Why generation ended: \"stop\", \"length\", \"load\" or \"unload\"."
          },
          "total_duration": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Wall time of the whole request, in nanoseconds.",
            "format": "int64"
          },
          "load_duration": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Time spent resolving and loading the model, in nanoseconds.",
            "format": "int64"
          },
          "prompt_eval_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Number of prompt tokens evaluated.",
            "format": "int32"
          },
          "prompt_eval_duration": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Time spent evaluating the prompt, in nanoseconds.",
            "format": "int64"
          },
          "eval_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Number of tokens generated.",
            "format": "int32"
          },
          "eval_duration": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Time spent generating tokens, in nanoseconds.",
            "format": "int64"
          }
        },
        "description": "One Ollama chat response object. Streaming responses emit a sequence of these as newline-delimited JSON, ending with an object whose done field is true and which carries the generation statistics."
      },
      "Ollama.OllamaCopyRequest": {
        "type": "object",
        "properties": {
          "source": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model to copy."
          },
          "destination": {
            "type": [
              "null",
              "string"
            ],
            "description": "The new model name."
          }
        },
        "description": "Request body of POST /api/copy."
      },
      "Ollama.OllamaCreateRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "Name of the model to create (name[:tag])."
          },
          "from": {
            "type": [
              "null",
              "string"
            ],
            "description": "Existing model to base the new one on: a catalog model ID or a previously created model."
          },
          "system": {
            "type": [
              "null",
              "string"
            ],
            "description": "System prompt baked into the created model."
          },
          "template": {
            "type": [
              "null",
              "string"
            ],
            "description": "Prompt template text. Stored verbatim and reported by /api/show; rendering follows the base model's own template."
          },
          "license": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "License text: a string or a list of strings.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "parameters": {
            "type": [
              "null",
              "object"
            ],
            "description": "Modelfile parameters for the created model."
          },
          "files": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "File-name to blob-digest map for file-based creation. Requires the blob store, which this server does not serve yet."
          },
          "adapters": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "Adapter-name to blob-digest map. Requires the blob store, which this server does not serve yet."
          },
          "quantize": {
            "type": [
              "null",
              "string"
            ],
            "description": "Quantization to apply while creating. Not served yet."
          },
          "stream": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "When false, a single terminal object is returned instead of NDJSON progress lines."
          }
        },
        "description": "Request body of POST /api/create."
      },
      "Ollama.OllamaDeleteRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model whose local files should be removed."
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Legacy alias of model; used when model is absent."
          }
        },
        "description": "Request body for the Ollama delete API."
      },
      "Ollama.OllamaEmbedRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The embedding model identifier. If not specified, the server's default embedding model is used."
          },
          "input": {
            "description": "Text to embed: a string or an array of strings."
          },
          "truncate": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether over-long inputs are reduced to the model's context window. This server chunks and mean-pools over-long inputs, so the flag is accepted and ignored."
          },
          "options": {
            "description": "Runtime options. Accepted for wire compatibility.",
            "$ref": "#/components/schemas/Ollama.OllamaOptions"
          },
          "keep_alive": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "How long the model should stay loaded after the request. Residency is managed by the server's memory-pressure policy.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          }
        },
        "description": "Request body for the Ollama embed API. Reference: https://docs.ollama.com/api#generate-embeddings"
      },
      "Ollama.OllamaEmbedResponse": {
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model that produced the embeddings."
          },
          "embeddings": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "array",
              "items": {
                "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
                "type": [
                  "number",
                  "string"
                ],
                "format": "float"
              }
            },
            "description": "One embedding vector per input, in input order."
          },
          "total_duration": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Wall time of the whole request, in nanoseconds.",
            "format": "int64"
          },
          "load_duration": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Time spent resolving and loading the model, in nanoseconds.",
            "format": "int64"
          }
        },
        "description": "Response of the Ollama embed API: one embedding vector per input."
      },
      "Ollama.OllamaGenerateRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model identifier (e.g. \"gemma3:4b\"). If not specified, the server's default chat model is used."
          },
          "prompt": {
            "type": [
              "null",
              "string"
            ],
            "description": "The prompt to complete. An empty prompt preloads the model (or unloads it when keep_alive is 0) without generating."
          },
          "suffix": {
            "type": [
              "null",
              "string"
            ],
            "description": "Text after the insertion point (fill-in-the-middle). Not supported by this server."
          },
          "system": {
            "type": [
              "null",
              "string"
            ],
            "description": "System message applied to the request."
          },
          "template": {
            "type": [
              "null",
              "string"
            ],
            "description": "Custom prompt template override. Not supported by this server."
          },
          "context": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int64"
            },
            "description": "Deprecated per-conversation state from a previous generate response. Not supported by this server; use /api/chat for multi-turn conversations."
          },
          "images": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Base64-encoded images attached to the prompt (multimodal models)."
          },
          "format": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Output format constraint: the string \"json\" for JSON mode, or a JSON Schema object for structured output.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "options": {
            "description": "Runtime options (temperature, num_ctx, stop, ...).",
            "$ref": "#/components/schemas/Ollama.OllamaOptions"
          },
          "stream": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether to stream the response as newline-delimited JSON. Defaults to true."
          },
          "raw": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Bypass prompt templating. Not supported by this server."
          },
          "keep_alive": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "How long the model should stay loaded after the request: a duration string (\"5m\") or seconds. Residency is managed by the server's memory-pressure policy; the explicit unload form (0 with an empty prompt) is honored.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "think": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Reasoning control for thinking-capable models: false disables reasoning, true (or \"low\"/\"medium\"/\"high\") keeps or raises it.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          }
        },
        "description": "Request body for the Ollama generate API. Reference: https://docs.ollama.com/api#generate-a-completion"
      },
      "Ollama.OllamaGenerateResponse": {
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model that produced the response."
          },
          "created_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "RFC 3339 timestamp of the response object."
          },
          "response": {
            "type": [
              "null",
              "string"
            ],
            "description": "The generated text (a partial delta while streaming; empty on the terminal object)."
          },
          "thinking": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model's reasoning trace, separated from the response, when the model reasons (a partial delta while streaming)."
          },
          "done": {
            "type": "boolean",
            "description": "True on the terminal response object."
          },
          "done_reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Why generation ended: \"stop\", \"length\", \"load\" or \"unload\"."
          },
          "total_duration": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Wall time of the whole request, in nanoseconds.",
            "format": "int64"
          },
          "load_duration": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Time spent resolving and loading the model, in nanoseconds.",
            "format": "int64"
          },
          "prompt_eval_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Number of prompt tokens evaluated.",
            "format": "int32"
          },
          "prompt_eval_duration": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Time spent evaluating the prompt, in nanoseconds.",
            "format": "int64"
          },
          "eval_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Number of tokens generated.",
            "format": "int32"
          },
          "eval_duration": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Time spent generating tokens, in nanoseconds.",
            "format": "int64"
          }
        },
        "description": "One Ollama generate response object. Streaming responses emit a sequence of these as newline-delimited JSON, ending with an object whose done field is true and which carries the generation statistics."
      },
      "Ollama.OllamaLegacyEmbeddingsRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The embedding model identifier. If not specified, the server's default embedding model is used."
          },
          "prompt": {
            "type": [
              "null",
              "string"
            ],
            "description": "Text to embed."
          },
          "options": {
            "description": "Runtime options. Accepted for wire compatibility.",
            "$ref": "#/components/schemas/Ollama.OllamaOptions"
          },
          "keep_alive": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "How long the model should stay loaded after the request. Residency is managed by the server's memory-pressure policy.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          }
        },
        "description": "Request body for the legacy Ollama embeddings API (superseded by /api/embed)."
      },
      "Ollama.OllamaLegacyEmbeddingsResponse": {
        "type": "object",
        "properties": {
          "embedding": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            },
            "description": "The embedding vector of the prompt."
          }
        },
        "description": "Response of the legacy Ollama embeddings API: a single embedding vector."
      },
      "Ollama.OllamaModelDetails": {
        "type": "object",
        "properties": {
          "parent_model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The base model this model derives from, when applicable."
          },
          "format": {
            "type": [
              "null",
              "string"
            ],
            "description": "The on-disk model format (e.g. \"gguf\")."
          },
          "family": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model architecture family (e.g. \"llama\", \"gemma3\")."
          },
          "families": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "All architecture families the model belongs to."
          },
          "parameter_size": {
            "type": [
              "null",
              "string"
            ],
            "description": "Human-readable parameter count (e.g. \"8.0B\")."
          },
          "quantization_level": {
            "type": [
              "null",
              "string"
            ],
            "description": "Quantization label derived from the model's bits per weight (e.g. \"Q4\", \"F16\")."
          }
        },
        "description": "Structural details of a model, shared by the tags, show and ps responses."
      },
      "Ollama.OllamaModelSummary": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model identifier (e.g. \"gemma3:4b\")."
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model identifier; mirrors name."
          },
          "modified_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "Timestamp of the local model file. Omitted when the model has not been downloaded yet."
          },
          "size": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Model file size in bytes.",
            "format": "int64"
          },
          "digest": {
            "type": [
              "null",
              "string"
            ],
            "description": "Stable identity digest of the model."
          },
          "details": {
            "description": "Structural details of the model.",
            "$ref": "#/components/schemas/Ollama.OllamaModelDetails"
          }
        },
        "description": "One model entry of the tags response."
      },
      "Ollama.OllamaOptions": {
        "type": "object",
        "properties": {
          "num_ctx": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Size of the context window (in tokens) used for this request. Capped by the model's own maximum window.",
            "format": "int32"
          },
          "num_predict": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Maximum number of tokens to generate. Values <= 0 mean no explicit cap.",
            "format": "int32"
          },
          "temperature": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Sampling temperature. 0 selects greedy decoding.",
            "format": "double"
          },
          "top_p": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Nucleus sampling probability mass.",
            "format": "double"
          },
          "top_k": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Top-K sampling cutoff. 0 disables the cutoff.",
            "format": "int32"
          },
          "min_p": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Minimum token probability relative to the most likely token.",
            "format": "double"
          },
          "seed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Random seed for reproducible sampling.",
            "format": "int32"
          },
          "stop": {
            "description": "Stop sequence(s) that end generation. A string or an array of strings."
          },
          "repeat_penalty": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Penalty multiplier applied to repeated tokens.",
            "format": "double"
          },
          "presence_penalty": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Penalty applied to tokens already present in the output.",
            "format": "double"
          },
          "frequency_penalty": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Penalty scaled by a token's existing output frequency.",
            "format": "double"
          }
        },
        "description": "Runtime options for an Ollama request, mirroring the Modelfile parameter vocabulary. Unknown keys are accepted and ignored."
      },
      "Ollama.OllamaPsResponse": {
        "type": "object",
        "properties": {
          "models": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/Ollama.OllamaRunningModel"
            },
            "description": "The loaded models."
          }
        },
        "description": "Response of the Ollama ps API: the models currently loaded in memory."
      },
      "Ollama.OllamaPullProgress": {
        "type": "object",
        "properties": {
          "status": {
            "type": [
              "null",
              "string"
            ],
            "description": "Human-readable phase: \"pulling manifest\", \"pulling <digest>\", \"success\", ..."
          },
          "digest": {
            "type": [
              "null",
              "string"
            ],
            "description": "Digest of the layer being downloaded."
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Total bytes of the layer.",
            "format": "int64"
          },
          "completed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Bytes downloaded so far.",
            "format": "int64"
          },
          "error": {
            "type": [
              "null",
              "string"
            ],
            "description": "Set when the download failed; terminal."
          }
        },
        "description": "One progress object of the pull stream."
      },
      "Ollama.OllamaPullRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model identifier to download."
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Legacy alias of model; used when model is absent."
          },
          "insecure": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Allow insecure registry connections. Accepted for wire compatibility; LM-Kit models are always fetched from their catalog source over HTTPS."
          },
          "stream": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether to stream progress as newline-delimited JSON. Defaults to true."
          }
        },
        "description": "Request body for the Ollama pull API."
      },
      "Ollama.OllamaRunningModel": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model identifier (e.g. \"gemma3:4b\"), or its source URI when the model is not in the catalog."
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model identifier; mirrors name."
          },
          "size": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Memory footprint of the loaded model in bytes.",
            "format": "int64"
          },
          "size_vram": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Bytes of the model resident in accelerator memory.",
            "format": "int64"
          },
          "digest": {
            "type": [
              "null",
              "string"
            ],
            "description": "Stable identity digest of the model, when the model is in the catalog."
          },
          "details": {
            "description": "Structural details of the model, when the model is in the catalog.",
            "$ref": "#/components/schemas/Ollama.OllamaModelDetails"
          },
          "expires_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "Omitted: residency is governed by memory pressure, not a keep-alive timer."
          }
        },
        "description": "One entry of the ps response: a model currently loaded in memory."
      },
      "Ollama.OllamaShowRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model identifier to describe."
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Legacy alias of model; used when model is absent."
          },
          "verbose": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Request full metadata dumps. Accepted for wire compatibility."
          }
        },
        "description": "Request body for the Ollama show API."
      },
      "Ollama.OllamaShowResponse": {
        "type": "object",
        "properties": {
          "modelfile": {
            "type": [
              "null",
              "string"
            ],
            "description": "A synthetic Modelfile describing the model's origin."
          },
          "parameters": {
            "type": [
              "null",
              "string"
            ],
            "description": "Modelfile parameter block. Empty: LM-Kit models carry no Modelfile parameters."
          },
          "template": {
            "type": [
              "null",
              "string"
            ],
            "description": "Prompt template. Empty: templating is handled by the runtime."
          },
          "license": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model's license identifier."
          },
          "details": {
            "description": "Structural details of the model.",
            "$ref": "#/components/schemas/Ollama.OllamaModelDetails"
          },
          "model_info": {
            "type": [
              "null",
              "object"
            ],
            "description": "Architecture metadata keyed in GGUF notation (general.architecture, <family>.context_length, ...)."
          },
          "capabilities": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "What the model can do: completion, tools, vision, embedding, thinking."
          },
          "modified_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "Timestamp of the local model file. Omitted when the model has not been downloaded yet."
          }
        },
        "description": "Response of the Ollama show API: metadata of one model."
      },
      "Ollama.OllamaTagsResponse": {
        "type": "object",
        "properties": {
          "models": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/Ollama.OllamaModelSummary"
            },
            "description": "The available models."
          }
        },
        "description": "Response of the Ollama tags API: the models this server can serve."
      },
      "Ollama.OllamaTool": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ],
            "description": "The tool type. Only \"function\" is supported."
          },
          "function": {
            "description": "The function declaration.",
            "$ref": "#/components/schemas/Ollama.OllamaTool.FunctionDefinition"
          }
        },
        "description": "A tool the model may call, declared in the request."
      },
      "Ollama.OllamaTool.FunctionDefinition": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Name of the function."
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "What the function does; guides the model's tool selection."
          },
          "parameters": {
            "description": "JSON Schema describing the function parameters."
          }
        },
        "description": "A callable function: name, description and JSON Schema parameters."
      },
      "Ollama.OllamaToolCall": {
        "type": "object",
        "properties": {
          "function": {
            "description": "The function being called.",
            "$ref": "#/components/schemas/Ollama.OllamaToolCall.FunctionCall"
          }
        },
        "description": "A tool call requested by the model. Unlike the OpenAI wire shape, the function arguments are a JSON object rather than an encoded string."
      },
      "Ollama.OllamaToolCall.FunctionCall": {
        "type": "object",
        "properties": {
          "index": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Position of this call within the message's tool call list.",
            "format": "int32"
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Name of the function to call."
          },
          "arguments": {
            "description": "Arguments of the call as a JSON object."
          }
        },
        "description": "The called function: its name and structured arguments."
      },
      "Ollama.OllamaVersionResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": [
              "null",
              "string"
            ],
            "description": "The LM-Kit One version."
          }
        },
        "description": "Response of the Ollama version API."
      },
      "OpenAI.ApproximateLocation": {
        "type": "object",
        "properties": {
          "country": {
            "type": [
              "null",
              "string"
            ],
            "description": "The two-letter ISO country code (e.g., \"US\", \"GB\", \"FR\")."
          },
          "region": {
            "type": [
              "null",
              "string"
            ],
            "description": "The region, state, or province name."
          },
          "city": {
            "type": [
              "null",
              "string"
            ],
            "description": "The city name."
          },
          "timezone": {
            "type": [
              "null",
              "string"
            ],
            "description": "The IANA timezone identifier (e.g., \"America/New_York\")."
          }
        },
        "description": "Approximate location with country, region, city, and timezone."
      },
      "OpenAI.AudioOutput": {
        "required": [
          "voice",
          "format"
        ],
        "type": "object",
        "properties": {
          "voice": {
            "type": [
              "null",
              "string"
            ],
            "description": "The voice the model uses to respond. Supported voices are: ash, ballad, coral, sage, and verse (also supported but not recommended: alloy, echo, shimmer)."
          },
          "format": {
            "type": [
              "null",
              "string"
            ],
            "description": "Specifies the output audio format. Must be one of: wav, mp3, flac, opus, or pcm16."
          }
        },
        "description": "Represents the audio output settings for the model response."
      },
      "OpenAI.ChatCompletionChunkChoice": {
        "type": "object",
        "properties": {
          "index": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The index of this choice in the list.",
            "format": "int32"
          },
          "delta": {
            "description": "The incremental delta for this choice.",
            "$ref": "#/components/schemas/OpenAI.ChatCompletionDelta"
          },
          "finish_reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "The reason the model stopped generating tokens for this choice. This may be null if generation is still ongoing."
          },
          "logprobs": {
            "description": "Log probability information. May be null."
          }
        },
        "description": "Represents an individual choice in a chat completion chunk."
      },
      "OpenAI.ChatCompletionChunkResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ],
            "description": "A unique identifier for the chat completion. All chunks share the same ID."
          },
          "object": {
            "type": [
              "null",
              "string"
            ],
            "description": "The object type. Always \"chat.completion.chunk\"."
          },
          "created": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The Unix timestamp (in seconds) when the chat completion was created. All chunks have the same timestamp.",
            "format": "int64"
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model used for generating the completion."
          },
          "service_tier": {
            "type": [
              "null",
              "string"
            ],
            "description": "The service tier used for processing the request."
          },
          "system_fingerprint": {
            "type": [
              "null",
              "string"
            ],
            "description": "A fingerprint representing the backend configuration that generated the response."
          },
          "usage": {
            "description": "Optional usage statistics. When using stream_options: {\"include_usage\": true}, only the final chunk will contain non-null usage details.",
            "$ref": "#/components/schemas/OpenAI.ChatUsage"
          },
          "choices": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/OpenAI.ChatCompletionChunkChoice"
            },
            "description": "A list of chat completion choices. Each choice contains a delta that represents incremental changes."
          }
        },
        "description": "Represents a streamed chunk of a chat completion response. Each chunk has the same ID, created timestamp, and model."
      },
      "OpenAI.ChatCompletionDelta": {
        "type": "object",
        "properties": {
          "role": {
            "type": [
              "null",
              "string"
            ],
            "description": "The role of the author of this message. Typically provided only in the first chunk."
          },
          "content": {
            "type": [
              "null",
              "string"
            ],
            "description": "The incremental content of the message."
          },
          "reasoning_content": {
            "type": [
              "null",
              "string"
            ],
            "description": "Incremental reasoning text, separated from the answer, while the model reasons. Follows the de-facto reasoning_content convention OpenAI-compatible servers use."
          },
          "tool_calls": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/OpenAI.ToolCall"
            },
            "description": "A list of tool calls (if the model generated any) instead of a full message."
          },
          "refusal": {
            "type": [
              "null",
              "string"
            ],
            "description": "The refusal message generated by the model."
          }
        },
        "description": "Represents the incremental content provided in a streaming chunk."
      },
      "OpenAI.ChatCompletionRequest": {
        "required": [
          "messages"
        ],
        "type": "object",
        "properties": {
          "messages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/OpenAI.ChatMessage"
            },
            "description": "A list of messages comprising the conversation so far."
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The ID of the model used for the completion. If not specified, the default model will be used."
          },
          "agent": {
            "type": [
              "null",
              "string"
            ],
            "description": "LM-Kit extension. Name of a server-defined agent: a reusable bundle (system prompt, skill, server tools, memory intent, model pin) this completion adopts. The bundle supplies defaults; any field the request states explicitly wins. An unknown name is a named 400."
          },
          "skill": {
            "type": [
              "null",
              "string"
            ],
            "description": "LM-Kit extension. Name of a server skill pinned for this completion: its instructions ride the system turn, built server-side."
          },
          "skill_inputs": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "LM-Kit extension. Answers to the pinned skill's activation questions, keyed by each question's slug; unanswered questions fall back to their declared defaults."
          },
          "server_tools": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "LM-Kit extension. Server-executed built-in tools the model may use, by name (e.g. web_search, calc_arithmetic, document_convert_to_markdown): the server runs each call and the completion continues with its result. Only tools the server's Tools policy enables actually run."
          },
          "memory": {
            "type": [
              "null",
              "string"
            ],
            "description": "LM-Kit extension. Agent-memory id: facts extracted from this completion persist on the server under this id, and facts stored earlier under it are recalled as hidden context. Requires the server's Memory feature; when it is off the completion proceeds without memory."
          },
          "memory_store": {
            "type": [
              "null",
              "string"
            ],
            "description": "LM-Kit extension. Name of the memory STORE the memory id lives under, a server-defined policy bundle. Absent uses the agent's store when an agent rides the request, else the default store."
          },
          "store": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether or not to store the output of this chat completion request for use in model distillation or evals. Defaults to false."
          },
          "reasoning_effort": {
            "type": [
              "null",
              "string"
            ],
            "description": "Constrains effort on reasoning for reasoning models. Supported values: \"none\", \"low\", \"medium\", \"high\", \"xhigh\". Defaults to \"medium\". Note: \"none\" is default for gpt-5.1, \"xhigh\" is only supported on gpt-5.1-codex-max."
          },
          "metadata": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "Set of up to 16 key-value pairs attached as metadata. Keys: max 64 characters; Values: max 512 characters."
          },
          "frequency_penalty": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency. Defaults to 0.",
            "format": "double"
          },
          "logit_bias": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            },
            "description": "Modify the likelihood of specified tokens appearing in the completion. Map of token ID (string) to bias value (-100 to 100)."
          },
          "logprobs": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether to return log probabilities of the output tokens. Defaults to false."
          },
          "top_logprobs": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "An integer between 0 and 20 specifying the number of most likely tokens to return at each token position. Must be set to true for logprobs if used.",
            "format": "int32"
          },
          "max_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "(Deprecated) The maximum number of tokens that can be generated in the chat completion. Use MaxCompletionTokens instead.",
            "format": "int32"
          },
          "max_completion_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "An upper bound for the number of tokens that can be generated for a completion, including both visible output tokens and reasoning tokens.",
            "format": "int32"
          },
          "n": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "How many chat completion choices to generate for each input message. Defaults to 1.",
            "format": "int32"
          },
          "modalities": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Output types that you would like the model to generate. For text-only output, the default is [\"text\"]."
          },
          "prediction": {
            "description": "Configuration for a Predicted Output, which can improve response times when large parts of the model response are known ahead of time. This property can be provided in one of three forms: as a PredictionStaticContent object (for static predicted output), as a simple string (for text content), or as an array of ContentPart objects (for multiple content parts)."
          },
          "audio": {
            "description": "Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"].",
            "$ref": "#/components/schemas/OpenAI.AudioOutput"
          },
          "presence_penalty": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far. Defaults to 0.",
            "format": "double"
          },
          "response_format": {
            "description": "An object specifying the format that the model must output. For example: { \"type\": \"json_schema\", \"json_schema\": { ... } } enables Structured Outputs, { \"type\": \"json_object\" } enables JSON mode.",
            "$ref": "#/components/schemas/OpenAI.ResponseFormat"
          },
          "seed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "If specified, attempts to sample deterministically.",
            "format": "int32"
          },
          "service_tier": {
            "type": [
              "null",
              "string"
            ],
            "description": "Specifies the latency tier to use for processing the request. Defaults to \"auto\"."
          },
          "stop": {
            "description": "Up to 4 sequences where the API will stop generating further tokens. Can be a string or an array of strings."
          },
          "stream": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "If set, partial message deltas will be sent as server-sent events (streaming). Defaults to false."
          },
          "stream_options": {
            "description": "Options for streaming response. Only set when Stream is true.",
            "$ref": "#/components/schemas/OpenAI.StreamOptions"
          },
          "temperature": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "What sampling temperature to use, between 0 and 2. Defaults to 1.",
            "format": "double"
          },
          "top_p": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "An alternative to sampling with temperature using nucleus sampling, where the model considers tokens with top_p probability mass. Defaults to 1.",
            "format": "double"
          },
          "tools": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/OpenAI.ToolObject"
            },
            "description": "A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for."
          },
          "tool_choice": {
            "description": "Controls which (if any) tool is called by the model. This can be either: a string (\"none\", \"auto\", or \"required\") or an object of type ToolChoiceObject to force a specific tool call."
          },
          "parallel_tool_calls": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether to enable parallel function calling during tool use. Defaults to true."
          },
          "user": {
            "type": [
              "null",
              "string"
            ],
            "description": "A unique identifier representing your end-user."
          },
          "function_call": {
            "description": "(Deprecated) Controls which (if any) function is called by the model. This can be either: a string (\"none\" means the model will not call a function and instead generates a message; \"auto\" means the model can pick between generating a message or calling a function) or an object of type FunctionCallObject to force a specific function call."
          },
          "functions": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/OpenAI.ChatFunction"
            },
            "description": "(Deprecated) A list of functions the model may generate JSON inputs for. Deprecated in favor of Tools."
          },
          "web_search_options": {
            "description": "Configuration for web search tool. This feature allows models to search the web for up-to-date information. Only applicable to search-enabled models (e.g., gpt-4o-search-preview, gpt-5-search-api).",
            "$ref": "#/components/schemas/OpenAI.WebSearchOptions"
          },
          "thinking": {
            "description": "Configuration for extended thinking. Enables the model to perform deeper reasoning before responding. Includes budget_tokens to limit thinking tokens and summary mode for reasoning output.",
            "$ref": "#/components/schemas/OpenAI.ThinkingConfig"
          },
          "include": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Specify additional output data to include in the response. Possible values include: \"usage.prompt_tokens_details\", \"usage.completion_tokens_details\"."
          },
          "instructions": {
            "type": [
              "null",
              "string"
            ],
            "description": "A system-level instruction that guides the model's behavior. This is an alternative way to provide system context, similar to using a system or developer message."
          },
          "truncation_strategy": {
            "description": "Controls how the conversation is truncated if it exceeds the context window. Specify the strategy type and optionally the number of messages to keep.",
            "$ref": "#/components/schemas/OpenAI.TruncationStrategy"
          },
          "text": {
            "description": "Configuration for structured text output format.",
            "$ref": "#/components/schemas/OpenAI.TextOutputConfig"
          }
        },
        "description": "Request body for the Chat Completions API. Reference: https://platform.openai.com/docs/api-reference/chat/create"
      },
      "OpenAI.ChatFunction": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "A description of what the function does. Used by the model to decide when and how to call the function."
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."
          },
          "parameters": {
            "description": "The parameters the function accepts, described as a JSON Schema object. Omitting parameters defines a function with an empty parameter list."
          }
        },
        "description": "Represents a function definition that the model may call. This property is deprecated in favor of ChatCompletionRequest.Tools."
      },
      "OpenAI.ChatMessage": {
        "type": "object",
        "properties": {
          "role": {
            "type": [
              "null",
              "string"
            ],
            "description": "The role of the message (e.g., \"system\", \"user\", \"assistant\", \"tool\")."
          },
          "content": {
            "description": "The content of the message."
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The name of the user or function that generated the message."
          },
          "tool_calls": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/OpenAI.ToolCall"
            },
            "description": "Tool calls generated by the assistant. Present on assistant messages when the model requested tool invocations."
          },
          "tool_call_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The ID of the tool call this message is a response to. Required for messages with role \"tool\"."
          }
        },
        "description": "A single chat message in a conversation."
      },
      "OpenAI.ChatUsage": {
        "type": "object",
        "properties": {
          "prompt_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of tokens in the prompt.",
            "format": "int32"
          },
          "completion_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of tokens in the generated completion.",
            "format": "int32"
          },
          "total_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Total number of tokens used in the request (prompt + completion).",
            "format": "int32"
          },
          "prompt_tokens_details": {
            "description": "Breakdown of tokens used in the prompt. Only included when requested via the 'include' parameter.",
            "$ref": "#/components/schemas/OpenAI.PromptTokensDetails"
          },
          "completion_tokens_details": {
            "description": "Breakdown of tokens used in the completion. Only included when requested via the 'include' parameter.",
            "$ref": "#/components/schemas/OpenAI.CompletionTokensDetails"
          }
        },
        "description": "Usage statistics for a chat completion request."
      },
      "OpenAI.CompletionChunkChoice": {
        "type": "object",
        "properties": {
          "text": {
            "type": [
              "null",
              "string"
            ],
            "description": "The generated text for this completion chunk."
          },
          "index": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The index of this completion choice.",
            "format": "int32"
          },
          "logprobs": {
            "description": "The log probabilities of tokens, if available."
          },
          "finish_reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "The reason why the text generation was completed, if applicable."
          }
        }
      },
      "OpenAI.CompletionChunkResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ],
            "description": "A unique identifier for the completion chunk."
          },
          "object": {
            "type": [
              "null",
              "string"
            ],
            "description": "The object type, which is always \"text_completion\"."
          },
          "created": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The Unix timestamp (in seconds) when the chunk was created.",
            "format": "int64"
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model used for generating this chunk of completion."
          },
          "system_fingerprint": {
            "type": [
              "null",
              "string"
            ],
            "description": "This fingerprint represents the backend configuration that the model runs with. It can be used in conjunction with the seed parameter to understand when backend changes have been made that might impact determinism."
          },
          "choices": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/OpenAI.CompletionChunkChoice"
            },
            "description": "The list of completion choices generated for this chunk."
          }
        },
        "description": "Represents a chunked completion response from the API. Note: The streamed response omits usage statistics."
      },
      "OpenAI.CompletionRequest": {
        "required": [
          "prompt"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The ID of the model used for the text completion. If not specified, the default model will be used."
          },
          "prompt": {
            "description": "The prompt(s) to generate completions for. Can be a string or an array of strings."
          },
          "suffix": {
            "type": [
              "null",
              "string"
            ],
            "description": "A suffix that comes after a completion of inserted text. This parameter is only supported for gpt-3.5-turbo-instruct."
          },
          "max_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The maximum number of tokens that can be generated in the completion. Defaults to 16.",
            "format": "int32"
          },
          "temperature": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "What sampling temperature to use, between 0 and 2. Defaults to 1.",
            "format": "double"
          },
          "top_p": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "An alternative to sampling with temperature using nucleus sampling, where the model considers the tokens with top_p probability mass. Defaults to 1.",
            "format": "double"
          },
          "n": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "How many completions to generate for each prompt. Defaults to 1.",
            "format": "int32"
          },
          "stream": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether to stream back partial progress. Defaults to false."
          },
          "stream_options": {
            "description": "Options for streaming response. Only set when Stream is true.",
            "$ref": "#/components/schemas/OpenAI.StreamOptions"
          },
          "logprobs": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Include the log probabilities on the logprobs most likely tokens, as well as the chosen tokens. Defaults to null.",
            "format": "int32"
          },
          "echo": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Echo back the prompt in addition to the completion. Defaults to false."
          },
          "stop": {
            "description": "Up to 4 sequences where the API will stop generating further tokens. Can be a string or an array of strings. Defaults to null."
          },
          "presence_penalty": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far. Defaults to 0.",
            "format": "double"
          },
          "frequency_penalty": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far. Defaults to 0.",
            "format": "double"
          },
          "best_of": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Generates best_of completions server-side and returns the 'best' (the one with the highest log probability per token). Defaults to 1.",
            "format": "int32"
          },
          "logit_bias": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            },
            "description": "Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object mapping token IDs (as strings) to bias values between -100 and 100. Defaults to null."
          },
          "user": {
            "type": [
              "null",
              "string"
            ],
            "description": "A unique identifier representing your end-user. Defaults to null."
          },
          "seed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "If specified, attempts to sample deterministically. Defaults to null.",
            "format": "int32"
          }
        },
        "description": "Request body for the OpenAI Completions API. See: https://platform.openai.com/docs/api-reference/completions/create"
      },
      "OpenAI.CompletionTokensDetails": {
        "type": "object",
        "properties": {
          "reasoning_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of tokens used for reasoning (chain-of-thought) by reasoning models.",
            "format": "int32"
          },
          "audio_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of tokens used for audio output.",
            "format": "int32"
          },
          "accepted_prediction_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of predicted tokens that were accepted when using predicted outputs.",
            "format": "int32"
          },
          "rejected_prediction_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of predicted tokens that were rejected when using predicted outputs.",
            "format": "int32"
          }
        },
        "description": "Detailed breakdown of completion token usage."
      },
      "OpenAI.EmbeddingData": {
        "type": "object",
        "properties": {
          "object": {
            "type": [
              "null",
              "string"
            ],
            "description": "The object type, which is always \"embedding\"."
          },
          "embedding": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "float"
            },
            "description": "The embedding vector, a list of floats."
          },
          "index": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The index of the embedding in the list.",
            "format": "int32"
          }
        },
        "description": "Represents an embedding vector returned by the embeddings endpoint."
      },
      "OpenAI.EmbeddingRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The IF of the model used for embeddings. If not specified, the default model will be used."
          },
          "input": {
            "description": "Input text to embed. Can be a string or an array (of strings, integers, or arrays of integers)."
          },
          "encoding_format": {
            "type": [
              "null",
              "string"
            ],
            "description": "The format to return the embeddings in. Can be either \"float\" or \"base64\". Defaults to \"float\"."
          },
          "dimensions": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.",
            "format": "int32"
          },
          "user": {
            "type": [
              "null",
              "string"
            ],
            "description": "A unique identifier representing your end-user, which can help OpenAI monitor and detect abuse."
          }
        },
        "description": "Request body for creating embeddings. See: https://api.openai.com/v1/embeddings"
      },
      "OpenAI.EmbeddingResponse": {
        "type": "object",
        "properties": {
          "object": {
            "type": [
              "null",
              "string"
            ],
            "description": "The object type, which is always \"list\"."
          },
          "data": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/OpenAI.EmbeddingData"
            },
            "description": "A list of embedding data objects."
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model used for generating the embeddings."
          },
          "usage": {
            "description": "Usage statistics for the embedding request.",
            "$ref": "#/components/schemas/OpenAI.Usage"
          }
        },
        "description": "Response from the embeddings API."
      },
      "OpenAI.FunctionCall": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The name of the function to call."
          },
          "arguments": {
            "type": [
              "null",
              "string"
            ],
            "description": "The arguments to pass to the function, as a JSON string."
          }
        },
        "description": "A function call made by the model."
      },
      "OpenAI.JsonSchemaConfig": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The name of the schema. Required."
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "A description of what the schema represents."
          },
          "schema": {
            "description": "The JSON schema object defining the structure.",
            "$ref": "#/components/schemas/JsonNode"
          },
          "strict": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether to enforce strict schema validation. Defaults to false."
          }
        },
        "description": "JSON schema configuration for structured outputs."
      },
      "OpenAI.Model": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model identifier, which can be referenced in the API endpoints."
          },
          "created": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The Unix timestamp (in seconds) when the model was created.",
            "format": "int32"
          },
          "object": {
            "type": [
              "null",
              "string"
            ],
            "description": "The object type, which is always \"model\"."
          },
          "owned_by": {
            "type": [
              "null",
              "string"
            ],
            "description": "The organization that owns the model."
          }
        },
        "description": "Describes an OpenAI model offering that can be used with the API."
      },
      "OpenAI.PromptTokensDetails": {
        "type": "object",
        "properties": {
          "cached_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of tokens that were retrieved from cache, reducing processing cost.",
            "format": "int32"
          },
          "audio_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of tokens from audio input.",
            "format": "int32"
          }
        },
        "description": "Detailed breakdown of prompt token usage."
      },
      "OpenAI.ResponseContentPart": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ],
            "description": "output_text, reasoning_text or summary_text."
          },
          "text": {
            "type": [
              "null",
              "string"
            ],
            "description": "The part's text."
          },
          "annotations": {
            "type": [
              "null",
              "array"
            ],
            "description": "Annotations on output_text parts (citations, file references)."
          }
        },
        "description": "One content part of an output item."
      },
      "OpenAI.ResponseFormat": {
        "required": [
          "type",
          "json_schema"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ],
            "description": "The type of response format being defined. Allowed values include: \"text\", \"json_object\", \"json_schema\"."
          },
          "json_schema": {
            "description": "(Required if type is \"json_schema\") The JSON Schema definition."
          }
        },
        "description": "Represents a response format definition."
      },
      "OpenAI.ResponseOutputItem": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ],
            "description": "reasoning, message or function_call."
          },
          "id": {
            "type": [
              "null",
              "string"
            ],
            "description": "Item identifier (rs_/msg_/fc_ prefixed)."
          },
          "status": {
            "type": [
              "null",
              "string"
            ],
            "description": "in_progress or completed."
          },
          "role": {
            "type": [
              "null",
              "string"
            ],
            "description": "Message items only: always \"assistant\"."
          },
          "content": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/OpenAI.ResponseContentPart"
            },
            "description": "Message items: output_text parts. Reasoning items: reasoning_text parts."
          },
          "summary": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/OpenAI.ResponseContentPart"
            },
            "description": "Reasoning items: summary_text parts, present when a summary was requested."
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Function-call items: the function name."
          },
          "call_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "Function-call items: the id the caller pairs with its function_call_output."
          },
          "arguments": {
            "type": [
              "null",
              "string"
            ],
            "description": "Function-call items: the arguments JSON."
          }
        },
        "description": "One output item of a response: a reasoning block, an assistant message, or a function call."
      },
      "OpenAI.ResponsesError": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "null",
              "string"
            ],
            "description": "Machine-readable error code."
          },
          "message": {
            "type": [
              "null",
              "string"
            ],
            "description": "Human-readable error message."
          }
        },
        "description": "Terminal error of a failed response."
      },
      "OpenAI.ResponsesIncompleteDetails": {
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "max_output_tokens or content_filter."
          }
        },
        "description": "Why a response ended incomplete."
      },
      "OpenAI.ResponsesReasoningConfig": {
        "type": "object",
        "properties": {
          "effort": {
            "type": [
              "null",
              "string"
            ],
            "description": "Reasoning effort: none, minimal, low, medium, high, xhigh or max. Mapped onto the model's reasoning level; models without adjustable effort treat any non-none value as enabled."
          },
          "summary": {
            "type": [
              "null",
              "string"
            ],
            "description": "Reasoning summary style (auto, concise, detailed). This server streams the model's actual reasoning text; the summary setting selects whether summary events are also emitted."
          }
        },
        "description": "Reasoning configuration of a Responses request."
      },
      "OpenAI.ResponsesRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "Model identifier. Empty selects the server's default chat model."
          },
          "input": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The input: a plain string (one user turn) or an array of input items (messages with input_text/input_image parts, function_call, function_call_output, reasoning).",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "instructions": {
            "type": [
              "null",
              "string"
            ],
            "description": "A system (developer) message inserted at the start of the model's context."
          },
          "tools": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/OpenAI.ResponsesTool"
            },
            "description": "Tools the model may call. Function tools use the Responses API's flat format: type, name, description, parameters, strict."
          },
          "tool_choice": {
            "description": "How the model chooses tools: \"auto\", \"none\", \"required\", or {\"type\":\"function\",\"name\":...}."
          },
          "parallel_tool_calls": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether the model may emit several tool calls in one turn."
          },
          "text": {
            "description": "Output text configuration; text.format carries the structured-output contract (json_schema is enforced with grammar-constrained decoding).",
            "$ref": "#/components/schemas/OpenAI.ResponsesTextConfig"
          },
          "reasoning": {
            "description": "Reasoning configuration for thinking models: effort (none/minimal/low/medium/high/xhigh/max) and summary.",
            "$ref": "#/components/schemas/OpenAI.ResponsesReasoningConfig"
          },
          "store": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether to persist the response for later retrieval via GET /v1/responses/{id}. Defaults to true."
          },
          "previous_response_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "Chains this request onto a stored response. Not supported yet: requests carrying it are refused rather than served with a silently truncated context."
          },
          "conversation": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Conversation object binding. Not supported yet; refused when present.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "background": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Background execution. Not supported yet; refused when true."
          },
          "include": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Extra payload includes. Unknown values are accepted and ignored."
          },
          "truncation": {
            "type": [
              "null",
              "string"
            ],
            "description": "Context overflow policy: \"disabled\" (default) or \"auto\"."
          },
          "max_output_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Upper bound on generated tokens, reasoning included.",
            "format": "int32"
          },
          "temperature": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Sampling temperature. 0 selects greedy decoding.",
            "format": "double"
          },
          "top_p": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Nucleus sampling threshold.",
            "format": "double"
          },
          "metadata": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "Caller-defined key/value pairs echoed back and stored with the response."
          },
          "stream": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "When true, the response streams as named server-sent events."
          }
        },
        "description": "Request body of the OpenAI Responses API."
      },
      "OpenAI.ResponsesResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ],
            "description": "Response identifier (resp_...)."
          },
          "object": {
            "type": [
              "null",
              "string"
            ],
            "description": "Always \"response\"."
          },
          "created_at": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Unix timestamp (seconds) of creation.",
            "format": "int64"
          },
          "status": {
            "type": [
              "null",
              "string"
            ],
            "description": "completed, failed, in_progress, cancelled, queued or incomplete."
          },
          "error": {
            "description": "Terminal error, when status is failed.",
            "$ref": "#/components/schemas/OpenAI.ResponsesError"
          },
          "incomplete_details": {
            "description": "Why the response is incomplete, when status is incomplete.",
            "$ref": "#/components/schemas/OpenAI.ResponsesIncompleteDetails"
          },
          "instructions": {
            "type": [
              "null",
              "string"
            ],
            "description": "The request's instructions, echoed."
          },
          "max_output_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The request's max_output_tokens, echoed.",
            "format": "int32"
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model that served the response."
          },
          "output": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/OpenAI.ResponseOutputItem"
            },
            "description": "Output items: reasoning, message, function_call."
          },
          "parallel_tool_calls": {
            "type": "boolean",
            "description": "Whether parallel tool calls were allowed."
          },
          "previous_response_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The chained response id, when chaining was requested."
          },
          "reasoning": {
            "description": "The request's reasoning configuration, echoed.",
            "$ref": "#/components/schemas/OpenAI.ResponsesReasoningConfig"
          },
          "store": {
            "type": "boolean",
            "description": "Whether the response was persisted for later retrieval."
          },
          "temperature": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "The request's temperature, echoed.",
            "format": "double"
          },
          "text": {
            "description": "The request's text configuration, echoed.",
            "$ref": "#/components/schemas/OpenAI.ResponsesTextConfig"
          },
          "tool_choice": {
            "description": "The effective tool choice."
          },
          "tools": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/OpenAI.ResponsesTool"
            },
            "description": "The request's tools, echoed."
          },
          "top_p": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "The request's top_p, echoed.",
            "format": "double"
          },
          "truncation": {
            "type": [
              "null",
              "string"
            ],
            "description": "The effective truncation policy."
          },
          "usage": {
            "description": "Token usage of the completed response.",
            "$ref": "#/components/schemas/OpenAI.ResponsesUsage"
          },
          "metadata": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "Caller-defined key/value pairs, echoed."
          }
        },
        "description": "A Responses API response object."
      },
      "OpenAI.ResponsesTextConfig": {
        "type": "object",
        "properties": {
          "format": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Output format: {\"type\":\"text\"}, {\"type\":\"json_object\"}, or {\"type\":\"json_schema\",\"name\":...,\"schema\":{...},\"strict\":true}. json_object and json_schema are enforced with grammar-constrained decoding.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "verbosity": {
            "type": [
              "null",
              "string"
            ],
            "description": "Requested output verbosity. Accepted and ignored."
          }
        },
        "description": "Output text configuration of a Responses request."
      },
      "OpenAI.ResponsesTool": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ],
            "description": "Tool type. \"function\" is served; built-in tool types this server does not host are refused by name."
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Function name (flat, not nested under a 'function' object)."
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "What the function does, for the model."
          },
          "parameters": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "JSON Schema of the function arguments.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "strict": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Strict schema adherence for the arguments."
          },
          "vector_store_ids": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "file_search only: the vector stores to search."
          },
          "max_num_results": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "file_search only: most results one search returns.",
            "format": "int32"
          },
          "filters": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "file_search only: metadata filter applied to the search.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "tools": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/OpenAI.ResponsesTool"
            },
            "description": "namespace only: the function tools the namespace groups."
          }
        },
        "description": "A tool definition in the Responses API's flat format."
      },
      "OpenAI.ResponsesUsage": {
        "type": "object",
        "properties": {
          "input_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Tokens in the rendered input.",
            "format": "int32"
          },
          "input_tokens_details": {
            "description": "Input token breakdown.",
            "$ref": "#/components/schemas/OpenAI.ResponsesUsage.InputDetails"
          },
          "output_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Generated tokens, reasoning included.",
            "format": "int32"
          },
          "output_tokens_details": {
            "description": "Output token breakdown.",
            "$ref": "#/components/schemas/OpenAI.ResponsesUsage.OutputDetails"
          },
          "total_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Input plus output tokens.",
            "format": "int32"
          }
        },
        "description": "Token usage of a response."
      },
      "OpenAI.ResponsesUsage.InputDetails": {
        "type": "object",
        "properties": {
          "cached_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Input tokens served from cache.",
            "format": "int32"
          }
        },
        "description": "Input token breakdown of a response."
      },
      "OpenAI.ResponsesUsage.OutputDetails": {
        "type": "object",
        "properties": {
          "reasoning_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Output tokens the model spent reasoning.",
            "format": "int32"
          }
        },
        "description": "Output token breakdown of a response."
      },
      "OpenAI.StreamOptions": {
        "type": "object",
        "properties": {
          "include_usage": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "If set, an additional chunk will be streamed before the data: [DONE] message. The usage field on this chunk shows the token usage statistics for the entire request."
          }
        },
        "description": "Options for streaming responses. Only set when ChatCompletionRequest.Stream is true."
      },
      "OpenAI.TextFormat": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ],
            "description": "The type of text format. Supported values: \"text\" (plain text), \"json_object\" (valid JSON), \"json_schema\" (JSON matching a schema)."
          },
          "json_schema": {
            "description": "When type is \"json_schema\", the JSON schema that the output must conform to.",
            "$ref": "#/components/schemas/OpenAI.JsonSchemaConfig"
          }
        },
        "description": "Specifies the text output format type."
      },
      "OpenAI.TextOutputConfig": {
        "type": "object",
        "properties": {
          "format": {
            "description": "The format configuration for text output.",
            "$ref": "#/components/schemas/OpenAI.TextFormat"
          }
        },
        "description": "Configuration for structured text output format."
      },
      "OpenAI.ThinkingConfig": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ],
            "description": "The type of thinking configuration. Use \"enabled\" to enable thinking."
          },
          "budget_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Maximum number of tokens the model can use for reasoning. Must be greater than or equal to 1024 and less than max_completion_tokens.",
            "format": "int32"
          },
          "summary": {
            "type": [
              "null",
              "string"
            ],
            "description": "Configuration for summarizing thinking output. Can be \"auto\", \"concise\", or \"detailed\"."
          }
        },
        "description": "Configuration for extended thinking. Allows the model to perform deeper reasoning before responding."
      },
      "OpenAI.ToolCall": {
        "type": "object",
        "properties": {
          "index": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The index of the tool call in the tool_calls array. Used in streaming to identify which tool call a delta belongs to.",
            "format": "int32"
          },
          "id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The unique identifier of the tool call."
          },
          "type": {
            "type": [
              "null",
              "string"
            ],
            "description": "The type of tool call. Currently only \"function\" is supported."
          },
          "function": {
            "description": "The function that the model called.",
            "$ref": "#/components/schemas/OpenAI.FunctionCall"
          }
        },
        "description": "A tool call generated by the model."
      },
      "OpenAI.ToolFunction": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "A description of what the function does, used by the model to choose when and how to call the function."
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."
          },
          "parameters": {
            "description": "The parameters the function accepts, described as a JSON Schema object. Omitting parameters defines a function with an empty parameter list."
          },
          "strict": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether to enable strict schema adherence when generating the function call. Defaults to false."
          }
        },
        "description": "Represents a tool function definition, including details such as name, description, parameters, and strict schema adherence."
      },
      "OpenAI.ToolObject": {
        "required": [
          "type"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ],
            "description": "The type of the tool: \"function\" (dispatched back to the client), or \"file_search\" (executed server-side over the vector stores named in \"vector_store_ids\")."
          },
          "function": {
            "description": "The function definition (type \"function\" only).",
            "$ref": "#/components/schemas/OpenAI.ToolFunction"
          },
          "vector_store_ids": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "file_search only: the vector stores to search (ids from the vector-stores API)."
          },
          "max_num_results": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "file_search only: how many passages a search returns (1..50). Defaults to 10.",
            "format": "int32"
          },
          "filters": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "file_search only: an attribute filter over document metadata, in the OpenAI comparison/compound filter shape.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          }
        },
        "description": "Represents a tool object that defines a tool, including the type and function definition."
      },
      "OpenAI.TruncationStrategy": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ],
            "description": "The truncation strategy type. Supported values: \"auto\" (let the model decide), \"last_messages\" (keep only the last N messages)."
          },
          "last_messages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "When type is \"last_messages\", specifies the number of most recent messages to retain. Must be greater than 0.",
            "format": "int32"
          }
        },
        "description": "Controls how the conversation is truncated if it exceeds the model's context window."
      },
      "OpenAI.Usage": {
        "type": "object",
        "properties": {
          "prompt_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of tokens used in the prompt.",
            "format": "int32"
          },
          "total_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The total number of tokens used.",
            "format": "int32"
          }
        },
        "description": "Usage statistics for an embedding request."
      },
      "OpenAI.UserLocation": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ],
            "description": "The type of location. Currently only \"approximate\" is supported."
          },
          "approximate": {
            "description": "Approximate location details.",
            "$ref": "#/components/schemas/OpenAI.ApproximateLocation"
          }
        },
        "description": "User location information for localizing web search results."
      },
      "OpenAI.WebSearchOptions": {
        "type": "object",
        "properties": {
          "search_context_size": {
            "type": [
              "null",
              "string"
            ],
            "description": "Controls how much context from search results is provided to the model. Supported values: \"low\", \"medium\", \"high\". Defaults to \"medium\"."
          },
          "user_location": {
            "description": "Approximate user location to improve search result relevance.",
            "$ref": "#/components/schemas/OpenAI.UserLocation"
          }
        },
        "description": "Configuration for web search tool. Allows the model to search the web for current information."
      },
      "OverflowResolutionStrategy": {
        "enum": [
          "Truncate",
          "RecursiveSummarize",
          "Reject",
          null
        ],
        "description": "Specifies the strategies available for handling scenarios where the combined length of the input text and anticipated completion tokens exceed MaximumContextLength."
      },
      "PageLayout": {
        "required": [
          "page_number",
          "width",
          "height",
          "paragraphs"
        ],
        "type": "object",
        "properties": {
          "page_number": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The 1-based page number.",
            "format": "int32"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The page width in points.",
            "format": "double"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The page height in points.",
            "format": "double"
          },
          "paragraphs": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ParagraphResult"
            },
            "description": "The detected paragraphs on this page, each containing lines and bounding boxes."
          }
        },
        "description": "Physical layout of a single page, including detected paragraphs, lines, words, and bounding boxes."
      },
      "PageResult": {
        "required": [
          "page_number",
          "markdown",
          "strategy_used"
        ],
        "type": "object",
        "properties": {
          "page_number": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The 1-based page number.",
            "format": "int32"
          },
          "markdown": {
            "type": [
              "null",
              "string"
            ],
            "description": "The Markdown content extracted from this page."
          },
          "strategy_used": {
            "description": "The conversion strategy that was actually applied to this page (TextExtraction or VlmOcr).",
            "$ref": "#/components/schemas/DocumentToMarkdownStrategy"
          },
          "completion_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of completion tokens generated for this page. Zero when the page was handled by the text-extraction strategy.",
            "format": "int32"
          },
          "quality_score": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Model-reported quality score for the transcription (0.0 to 1.0), if available.",
            "format": "double"
          },
          "warning": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional warning associated with this page (e.g. empty output because no OCR engine was supplied)."
          }
        },
        "description": "Markdown conversion result for a single page."
      },
      "ParagraphResult": {
        "required": [
          "text",
          "lines"
        ],
        "type": "object",
        "properties": {
          "text": {
            "type": [
              "null",
              "string"
            ],
            "description": "The full text content of this paragraph."
          },
          "lines": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/LineResult"
            },
            "description": "The individual text lines that compose this paragraph."
          },
          "bounds": {
            "description": "The bounding box of the entire paragraph on the page, in points. Null if layout coordinates are unavailable.",
            "$ref": "#/components/schemas/BoundsResult"
          },
          "text_direction": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The dominant text direction of this paragraph.",
                "$ref": "#/components/schemas/TextDirection"
              }
            ]
          }
        },
        "description": "A detected paragraph block containing one or more text lines."
      },
      "PdfALevel": {
        "enum": [
          "unknown",
          "1a",
          "1b",
          "2a",
          "2b",
          "2u",
          "3a",
          "3b",
          "3u",
          "4",
          "4e",
          "4f",
          null
        ]
      },
      "PdfEditPageEntry": {
        "required": [
          "page_index"
        ],
        "type": "object",
        "properties": {
          "page_index": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Zero-based page index from the source PDF.",
            "format": "int32"
          },
          "rotation": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Absolute rotation in degrees clockwise: 0, 90, 180, or 270. Defaults to 0 (no rotation).",
            "format": "int32",
            "default": 0
          }
        },
        "description": "Defines a single page in the output PDF."
      },
      "PdfEditRequest": {
        "required": [
          "input",
          "pages"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The source PDF document (base64 or file identifier).",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "pages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PdfEditPageEntry"
            },
            "description": "Ordered list of pages for the output PDF. Each entry specifies a source page index and optional rotation. Pages not listed are excluded. Duplicate source pages are allowed."
          }
        },
        "description": "Request body for the PDF Edit API."
      },
      "PdfEditResponse": {
        "required": [
          "file_id",
          "page_count"
        ],
        "type": "object",
        "properties": {
          "file_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file ID of the edited PDF stored on the server."
          },
          "page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The total number of pages in the output PDF.",
            "format": "int32"
          }
        },
        "description": "Response from the PDF Edit API."
      },
      "PdfEmbeddedFile": {
        "required": [
          "name",
          "size_bytes",
          "content_base64"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The embedded file's name as declared in the PDF (e.g. 'factur-x.xml')."
          },
          "mime_type": {
            "type": [
              "null",
              "string"
            ],
            "description": "The MIME type guessed from the file name (e.g. 'application/xml')."
          },
          "size_bytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The decoded content length in bytes.",
            "format": "int64"
          },
          "content_base64": {
            "type": [
              "null",
              "string"
            ],
            "description": "The embedded file's decoded content, Base64-encoded."
          }
        },
        "description": "One file embedded inside a PDF (a PDF/A-3 associated file or a document attachment)."
      },
      "PdfEncryptionMethod": {
        "enum": [
          "unknown",
          "rc4_40",
          "rc4_128",
          "aes_128",
          "aes_256",
          null
        ]
      },
      "PdfFileVersion": {
        "enum": [
          "unknown",
          "1.0",
          "1.1",
          "1.2",
          "1.3",
          "1.4",
          "1.5",
          "1.6",
          "1.7",
          "2.0"
        ],
        "description": "- `Unknown`: The file declares no recognized PDF version.\n- `Pdf10`: PDF 1.0\n- `Pdf11`: PDF 1.1\n- `Pdf12`: PDF 1.2\n- `Pdf13`: PDF 1.3\n- `Pdf14`: PDF 1.4\n- `Pdf15`: PDF 1.5\n- `Pdf16`: PDF 1.6\n- `Pdf17`: PDF 1.7 (ISO 32000-1)\n- `Pdf20`: PDF 2.0 (ISO 32000-2)"
      },
      "PdfGenerationOptions.BinaryImageEncoding": {
        "enum": [
          "CcittGroup4",
          "Deflate"
        ],
        "description": "Specifies how a 1-bit binary image is encoded when embedded in a PDF.\n\n- `CcittGroup4`\n- `Deflate`"
      },
      "PdfGenerationOptions.ImageEncoding": {
        "enum": [
          "Jpeg",
          "Deflate"
        ],
        "description": "Specifies how a color or grayscale image is encoded when embedded in a PDF.\n\n- `Jpeg`\n- `Deflate`"
      },
      "PdfGenerationOptions.PdfVersion": {
        "enum": [
          "Pdf14",
          "PdfA1b",
          "Pdf15",
          "Pdf16",
          "Pdf17",
          "PdfA2b",
          "PdfA3b"
        ],
        "description": "Specifies the PDF file format version or PDF/A conformance level.\n\n- `Pdf14`\n- `PdfA1b`\n- `Pdf15`\n- `Pdf16`\n- `Pdf17`\n- `PdfA2b`\n- `PdfA3b`"
      },
      "PdfInfoRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input PDF document. When input_format is 'Base64EncodedFile', provide a base64-encoded PDF payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          }
        },
        "description": "Request body for the PDF Info API."
      },
      "PdfInfoResponse": {
        "required": [
          "page_count",
          "page_sizes",
          "is_encrypted",
          "xmp_properties",
          "embedded_files"
        ],
        "type": "object",
        "properties": {
          "page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The total number of pages in the PDF document.",
            "format": "int32"
          },
          "pdf_version": {
            "description": "The PDF file format version. Possible values: '1.0', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7', '2.0', 'unknown'.",
            "$ref": "#/components/schemas/PdfFileVersion"
          },
          "page_sizes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PdfInfoResponse.PageSizeGroup"
            },
            "description": "Distinct page dimensions in PDF points (1pt = 1/72in), one entry per size in first-appearance order, each naming the one-based pages that carry it as compact ranges (e.g. '1-12' or '1-3, 5'). A document whose pages all share one size yields a single entry."
          },
          "title": {
            "type": [
              "null",
              "string"
            ],
            "description": "The document title, or null if not set."
          },
          "author": {
            "type": [
              "null",
              "string"
            ],
            "description": "The document author, or null if not set."
          },
          "subject": {
            "type": [
              "null",
              "string"
            ],
            "description": "The document subject, or null if not set."
          },
          "keywords": {
            "type": [
              "null",
              "string"
            ],
            "description": "The document keywords, or null if not set."
          },
          "creator": {
            "type": [
              "null",
              "string"
            ],
            "description": "The application that created the original document content."
          },
          "producer": {
            "type": [
              "null",
              "string"
            ],
            "description": "The application that produced the PDF."
          },
          "creation_date": {
            "type": [
              "null",
              "string"
            ],
            "description": "The document creation date as a raw PDF date string."
          },
          "mod_date": {
            "type": [
              "null",
              "string"
            ],
            "description": "The last modification date as a raw PDF date string."
          },
          "file_size_bytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The file size in bytes.",
            "format": "int64"
          },
          "is_pdfa": {
            "type": "boolean",
            "description": "True if the document declares PDF/A conformance in its XMP metadata."
          },
          "pdfa_level": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The PDF/A conformance level (e.g. '1b', '2b', '3a'), or null if not PDF/A.",
                "$ref": "#/components/schemas/PdfALevel"
              }
            ]
          },
          "is_encrypted": {
            "type": "boolean",
            "description": "True if the document has an encryption dictionary (owner or user password set)."
          },
          "encryption_method": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The encryption method used. Null if the document is not encrypted. Possible values: 'rc4_40' (40-bit RC4), 'rc4_128' (128-bit RC4), 'aes_128' (AES-128), 'aes_256' (AES-256), 'unknown'.",
                "$ref": "#/components/schemas/PdfEncryptionMethod"
              }
            ]
          },
          "permissions": {
            "description": "Granular permission flags for the document. Null if the document is not encrypted.",
            "$ref": "#/components/schemas/PdfPermissions"
          },
          "xmp_raw": {
            "type": [
              "null",
              "string"
            ],
            "description": "The document's raw XMP metadata packet (RDF/XML), or null if the PDF carries none. XMP is where producer-specific and custom properties live, distinct from the classic /Info dictionary fields (title, author, ...) returned above."
          },
          "xmp_properties": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/XmpProperty"
            },
            "description": "The XMP packet parsed into flat, prefix-qualified properties (e.g. 'dc:title', 'pdf:Producer', 'xmp:CreateDate', plus any custom namespaces). Empty when the PDF carries no XMP."
          },
          "embedded_files": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PdfEmbeddedFile"
            },
            "description": "Files embedded in the PDF's attachment / associated-files tree, each with its decoded content (any stream compression is already inflated). This is how a hybrid e-invoice's structured payload is retrieved: a Factur-X / ZUGFeRD PDF/A-3 carries its CII XML as an embedded file (commonly named 'factur-x.xml' or 'zugferd-invoice.xml'). Empty when the PDF carries no attachments."
          }
        },
        "description": "Response from the PDF Info API."
      },
      "PdfInfoResponse.PageSizeGroup": {
        "required": [
          "pages",
          "width",
          "height"
        ],
        "type": "object",
        "properties": {
          "pages": {
            "type": [
              "null",
              "string"
            ],
            "description": "The one-based pages of this size, as compact ranges (e.g. '1-12' or '1-3, 5')."
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The page width in PDF points.",
            "format": "double"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The page height in PDF points.",
            "format": "double"
          }
        },
        "description": "One distinct page size and the pages that carry it."
      },
      "PdfLayoutRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input PDF document to analyze. When input_format is 'Base64EncodedFile', provide a base64-encoded PDF payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. 'Base64EncodedFile' expects a base64-encoded PDF file. 'FileIdentifier' references a file previously uploaded via lmkit/v1/files/upload. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "pages": {
            "type": [
              "null",
              "string"
            ],
            "description": "An optional page range to analyze (e.g. \"1-3\", \"1,3,5\", \"2-\"). When empty or not specified, all pages are analyzed. Page numbers are 1-based.",
            "default": ""
          }
        },
        "description": "Request body for the PDF Layout Analysis API."
      },
      "PdfLayoutResponse": {
        "required": [
          "pages",
          "total_pages",
          "processed_pages"
        ],
        "type": "object",
        "properties": {
          "pages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PageLayout"
            },
            "description": "Per-page layout analysis results with detected paragraphs, lines, and bounding boxes."
          },
          "total_pages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The total number of pages in the source document.",
            "format": "int32"
          },
          "processed_pages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of pages that were actually analyzed.",
            "format": "int32"
          }
        },
        "description": "Response from the PDF Layout Analysis API."
      },
      "PdfLtvRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The signed PDF document to extend (base64 or file identifier).",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "password": {
            "type": [
              "null",
              "string"
            ],
            "description": "Password used to open the document when it is encrypted."
          },
          "certificates": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Additional certificates to embed in the document security store, base64-encoded, DER or PEM."
          },
          "crls": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Certificate revocation lists to embed, base64-encoded DER."
          },
          "ocsp_responses": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "OCSP responses to embed, base64-encoded DER."
          },
          "include_signature_material": {
            "type": "boolean",
            "description": "Whether the certificates and CRLs already carried by the document's signatures are also gathered into the security store. Default: true.",
            "default": true
          }
        },
        "description": "Request body for the PDF long-term validation (LTV) API."
      },
      "PdfLtvResponse": {
        "required": [
          "file_id"
        ],
        "type": "object",
        "properties": {
          "file_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file ID of the extended document stored on the server. Its security store (/DSS) now carries the validation material, appended incrementally so existing signatures stay intact."
          },
          "verification": {
            "description": "Independent verification of the produced output, proving the extension left every signature's integrity intact.",
            "$ref": "#/components/schemas/PdfVerifySignaturesResponse"
          }
        },
        "description": "Response from the PDF long-term validation (LTV) API."
      },
      "PdfMergeRequest": {
        "required": [
          "sources"
        ],
        "type": "object",
        "properties": {
          "sources": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PdfMergeSource"
            },
            "description": "The list of PDF documents to merge, in order. Each source can be a base64-encoded PDF or a file identifier. At least two sources are required. Pages from all sources are concatenated in the order provided."
          }
        },
        "description": "Request body for the PDF Merge API."
      },
      "PdfMergeResponse": {
        "required": [
          "file_id",
          "page_count",
          "source_count"
        ],
        "type": "object",
        "properties": {
          "file_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file ID of the merged PDF, stored on the server. To download: GET /lmkit/v1/files/{file_id}. To use in another endpoint (e.g., document-to-markdown, pdf-search, pdf-layout): pass this ID as the 'input' field with input_format set to 'FileIdentifier'. To delete: DELETE /lmkit/v1/files/{file_id}. Files are automatically deleted after the server's configured file retention period."
          },
          "page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The total number of pages in the merged PDF.",
            "format": "int32"
          },
          "source_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of input PDF documents that were merged.",
            "format": "int32"
          }
        },
        "description": "Response from the PDF Merge API."
      },
      "PdfMergeSource": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input PDF document. When input_format is 'Base64EncodedFile', provide a base64-encoded PDF payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint or by the document-splitting endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          }
        },
        "description": "A single PDF source to include in the merge operation."
      },
      "PdfOcrBinaryImageEncoding": {
        "enum": [
          "CcittGroup4",
          "Deflate"
        ],
        "description": "- `CcittGroup4`: CCITT Group 4 (T.6) fax compression, optimal for scanned documents.\n- `Deflate`: Lossless FlateDecode compression."
      },
      "PdfOcrImageEncoding": {
        "enum": [
          "Jpeg",
          "Deflate"
        ],
        "description": "- `Jpeg`: Lossy DCT (JPEG) compression for smaller file sizes.\n- `Deflate`: Lossless FlateDecode compression for maximum quality."
      },
      "PdfOcrPageResult": {
        "required": [
          "page_number",
          "ocred"
        ],
        "type": "object",
        "properties": {
          "page_number": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The 1-based page number.",
            "format": "int32"
          },
          "ocred": {
            "type": "boolean",
            "description": "True if OCR was performed on this page; false if the page was skipped (already had text)."
          }
        },
        "description": "Per-page result from the PDF OCR operation."
      },
      "PdfOcrPdfVersion": {
        "enum": [
          "Pdf14",
          "PdfA1b",
          "Pdf15",
          "Pdf16",
          "Pdf17",
          "PdfA2b",
          "PdfA3b"
        ],
        "description": "- `Pdf14`: PDF 1.4\n- `PdfA1b`: PDF/A-1b (ISO 19005-1) archival format.\n- `Pdf15`: PDF 1.5\n- `Pdf16`: PDF 1.6\n- `Pdf17`: PDF 1.7 (ISO 32000-1), the default.\n- `PdfA2b`: PDF/A-2b (ISO 19005-2) archival format.\n- `PdfA3b`: PDF/A-3b (ISO 19005-3) archival format."
      },
      "PdfOcrRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input document or image to convert into a searchable PDF. When input_format is 'Base64EncodedFile', provide a base64-encoded file payload (supported: PDF, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF). When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. 'Base64EncodedFile' expects a base64-encoded document or image file. 'FileIdentifier' references a file previously uploaded via lmkit/v1/files/upload. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "page_range": {
            "type": [
              "null",
              "string"
            ],
            "description": "An optional page range to process (e.g. \"1-3\", \"1,3,5\", \"2-\"). When empty or not specified, all pages are processed. Page numbers are 1-based. For single-image inputs this is ignored.",
            "default": ""
          },
          "text_page_handling": {
            "description": "Controls how pages that already contain selectable text are handled. 'Skip' (default) preserves existing text pages as-is and only OCRs image-only pages. 'ForceOcr' re-OCRs every page regardless of existing text content.",
            "default": "Skip",
            "$ref": "#/components/schemas/PdfOcrTextPageHandling"
          },
          "text_detection_strategy": {
            "description": "The strategy used to determine whether a page already contains text. 'TextOnly' (default) considers a page as having text only if it contains text-rendering objects. 'HasText' considers a page as having text if any extractable text content exists.",
            "default": "TextOnly",
            "$ref": "#/components/schemas/PdfOcrTextDetectionStrategy"
          },
          "pdf_version": {
            "description": "The target PDF version for the output file. 'Pdf17' (default, ISO 32000-1), 'Pdf14', 'Pdf15', 'Pdf16', 'PdfA1b' (ISO 19005-1 archival), 'PdfA2b' (ISO 19005-2 archival), 'PdfA3b' (ISO 19005-3 archival).",
            "default": "Pdf17",
            "$ref": "#/components/schemas/PdfOcrPdfVersion"
          },
          "image_encoding": {
            "description": "The compression method for color and grayscale images embedded in the output PDF. 'Jpeg' (default) uses lossy DCT compression for smaller files. 'Deflate' uses lossless FlateDecode compression for maximum quality.",
            "default": "Jpeg",
            "$ref": "#/components/schemas/PdfOcrImageEncoding"
          },
          "binary_image_encoding": {
            "description": "The compression method for binary (1-bit black and white) images in the output PDF. 'CcittGroup4' (default) uses CCITT Group 4 fax compression, optimal for scanned documents. 'Deflate' uses lossless FlateDecode compression.",
            "default": "CcittGroup4",
            "$ref": "#/components/schemas/PdfOcrBinaryImageEncoding"
          },
          "jpeg_quality": {
            "maximum": 100,
            "minimum": 1,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "JPEG compression quality (1 to 100) when image_encoding is set to 'Jpeg'. Higher values produce better image quality at the cost of larger file size. Defaults to 70.",
            "format": "int32",
            "default": 70
          },
          "save_options": {
            "description": "Controls how the output PDF is saved when the input is a PDF. 'None' (default) performs a full document rewrite. 'Incremental' appends changes, preserving digital signatures. 'RemoveSecurity' strips encryption from the output.",
            "default": "None",
            "$ref": "#/components/schemas/PdfOcrSaveOptions"
          },
          "languages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/Language"
            },
            "description": "An optional list of languages for OCR recognition. When not specified, the server's default language is used. Multiple languages can be specified for documents mixing scripts (e.g. ['English', 'French']). Supported values: Arabic, Armenian, Bulgarian, ChineseSimplified, ChineseTraditional, Croatian, Czech, Danish, Dutch, English, Finnish, French, German, Hebrew, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, ModernGreek, Norwegian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Spanish, Swedish, Thai, Turkish, Ukrainian, Vietnamese."
          },
          "detect_orientation": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether to enable automatic page orientation detection. When enabled, the engine detects if a page is rotated (90°, 180°, or 270°) and corrects it before text recognition. When not specified, the server's default setting is used."
          }
        },
        "description": "Request body for the PDF OCR API."
      },
      "PdfOcrResponse": {
        "required": [
          "file_id",
          "page_count",
          "pages_ocred",
          "pages_skipped",
          "pages"
        ],
        "type": "object",
        "properties": {
          "file_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file ID of the searchable PDF, stored on the server. To download: GET /lmkit/v1/files/{file_id}. To use in another endpoint (e.g., pdf-search, document-to-markdown, pdf-layout): pass this ID as the 'input' field with input_format set to 'FileIdentifier'. To delete: DELETE /lmkit/v1/files/{file_id}. Files are automatically deleted after the server's configured file retention period."
          },
          "page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The total number of pages in the output searchable PDF.",
            "format": "int32"
          },
          "pages_ocred": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of pages that were OCRed (had invisible text overlaid).",
            "format": "int32"
          },
          "pages_skipped": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of pages that were skipped because they already contained selectable text.",
            "format": "int32"
          },
          "pages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PdfOcrPageResult"
            },
            "description": "Per-page details for all processed pages."
          }
        },
        "description": "Response from the PDF OCR API."
      },
      "PdfOcrSaveOptions": {
        "enum": [
          "None",
          "RemoveSecurity"
        ],
        "description": "- `None`: Full document rewrite (default).\n- `RemoveSecurity`: Remove encryption and security handlers from the output."
      },
      "PdfOcrTextDetectionStrategy": {
        "enum": [
          "TextOnly",
          "HasText"
        ],
        "description": "- `TextOnly`: A page is considered text-bearing only if it contains PDF text-rendering objects.\n- `HasText`: A page is considered text-bearing if any extractable text content exists."
      },
      "PdfOcrTextPageHandling": {
        "enum": [
          "Skip",
          "ForceOcr"
        ],
        "description": "- `Skip`: Skip pages that already contain selectable text, only OCR image-only pages.\n- `ForceOcr`: Force OCR on every page, even those that already contain text."
      },
      "PdfPermissions": {
        "type": "object",
        "properties": {
          "print": {
            "type": "boolean",
            "description": "Printing is allowed."
          },
          "print_high_quality": {
            "type": "boolean",
            "description": "High-quality printing is allowed (faithful reproduction). Requires 'print' to be true."
          },
          "modify": {
            "type": "boolean",
            "description": "Modifying the document contents is allowed."
          },
          "extract_text": {
            "type": "boolean",
            "description": "Copying or extracting text and graphics is allowed."
          },
          "modify_annotations": {
            "type": "boolean",
            "description": "Adding or modifying text annotations and filling form fields is allowed."
          },
          "fill_forms": {
            "type": "boolean",
            "description": "Filling in existing form fields (including signature fields) is allowed."
          },
          "assemble_document": {
            "type": "boolean",
            "description": "Inserting, rotating, or deleting pages and creating bookmarks is allowed."
          }
        },
        "description": "Permission flags embedded in the PDF encryption dictionary."
      },
      "PdfRedactArea": {
        "required": [
          "page_index",
          "left",
          "top",
          "width",
          "height"
        ],
        "type": "object",
        "properties": {
          "page_index": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Zero-based index of the page the area belongs to.",
            "format": "int32"
          },
          "left": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Left edge in page points, measured from the left page border.",
            "format": "double"
          },
          "top": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Top edge in page points, measured from the top page border.",
            "format": "double"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Width of the area in page points. Must be greater than zero.",
            "format": "double"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Height of the area in page points. Must be greater than zero.",
            "format": "double"
          }
        },
        "description": "A rectangular region of one page whose content is permanently removed. Coordinates are in page points (1/72 inch) with the origin at the top-left corner of the page."
      },
      "PdfRedactRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The source PDF document. When input_format is 'Base64EncodedFile', provide a base64-encoded PDF payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. 'Base64EncodedFile' expects a base64-encoded PDF file. 'FileIdentifier' references a file previously uploaded via lmkit/v1/files/upload. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "search_terms": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Text strings to search for and redact. Every occurrence of each term found anywhere in the document is removed. Combine with 'areas' and 'apply_existing_annotations'; everything matched is redacted in a single pass."
          },
          "areas": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PdfRedactArea"
            },
            "description": "Explicit rectangular regions to redact, in page points (top-left origin). Use these to redact a figure, a signature, or any region regardless of its content."
          },
          "apply_existing_annotations": {
            "type": "boolean",
            "description": "When true, the document's pre-existing /Redact annotations (for example marks created in Acrobat or another tool) are applied and consumed as part of this request. Defaults to false.",
            "default": false
          },
          "case_sensitive": {
            "type": "boolean",
            "description": "Whether term matching is case-sensitive. Applies only to 'search_terms'. Defaults to false.",
            "default": false
          },
          "whole_word": {
            "type": "boolean",
            "description": "When true, a term only matches when bounded by non-word characters on both sides. Applies only to 'search_terms'. Defaults to false.",
            "default": false
          },
          "draw_fill_boxes": {
            "type": "boolean",
            "description": "When true (default), an opaque box is drawn over each redacted region after its content is removed.",
            "default": true
          },
          "fill_color": {
            "type": [
              "null",
              "string"
            ],
            "description": "Fill-box color as a hex string '#RRGGBB'. Ignored when 'draw_fill_boxes' is false. Defaults to '#000000' (black).",
            "default": "#000000"
          },
          "redact_images": {
            "type": "boolean",
            "description": "When true (default), image pixels intersecting a redacted region are scrubbed. An intersecting image that cannot be decoded is removed entirely; redacted pixel data never survives.",
            "default": true
          },
          "redact_vector_graphics": {
            "type": "boolean",
            "description": "When true (default), vector path content intersecting a redacted region is removed.",
            "default": true
          },
          "remove_annotations": {
            "type": "boolean",
            "description": "When true (default), annotations whose rectangle intersects a redacted region are removed. Annotation payloads (markup contents, link targets, form field values) often duplicate the content being redacted.",
            "default": true
          },
          "recurse_into_forms": {
            "type": "boolean",
            "description": "When true (default), redaction descends into Form XObjects. The affected form instance is cloned before editing, so the same form referenced from other pages keeps its original content.",
            "default": true
          },
          "password": {
            "type": [
              "null",
              "string"
            ],
            "description": "Password used to open the source document when it is encrypted. The output is always written unencrypted."
          }
        },
        "description": "Request body for the PDF redaction API."
      },
      "PdfRedactResponse": {
        "required": [
          "file_id",
          "page_count",
          "content_removed",
          "pages_processed",
          "search_matches",
          "removed_glyphs",
          "removed_text_objects",
          "edited_text_objects",
          "edited_images",
          "removed_images",
          "removed_paths",
          "edited_forms",
          "removed_annotations"
        ],
        "type": "object",
        "properties": {
          "file_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file ID of the redacted PDF document stored on the server."
          },
          "page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of pages in the redacted document.",
            "format": "int32"
          },
          "content_removed": {
            "type": "boolean",
            "description": "Whether the redaction removed or rewrote any content at all."
          },
          "pages_processed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of pages that received at least one redaction area.",
            "format": "int32"
          },
          "search_matches": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of text search matches that produced redaction areas.",
            "format": "int32"
          },
          "removed_glyphs": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The total number of glyphs permanently removed.",
            "format": "int32"
          },
          "removed_text_objects": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of text objects removed entirely.",
            "format": "int32"
          },
          "edited_text_objects": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of text objects rebuilt with fewer glyphs.",
            "format": "int32"
          },
          "edited_images": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of images whose pixels were scrubbed in place.",
            "format": "int32"
          },
          "removed_images": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of images removed entirely.",
            "format": "int32"
          },
          "removed_paths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of vector path objects removed or trimmed.",
            "format": "int32"
          },
          "edited_forms": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of Form XObject instances cloned and redacted.",
            "format": "int32"
          },
          "removed_annotations": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of annotations removed.",
            "format": "int32"
          }
        },
        "description": "Response from the PDF redaction API."
      },
      "PdfSearchRequest": {
        "required": [
          "input",
          "query"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input PDF document to search. When input_format is 'Base64EncodedFile', provide a base64-encoded PDF payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. 'Base64EncodedFile' expects a base64-encoded PDF file. 'FileIdentifier' references a file previously uploaded via lmkit/v1/files/upload. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "query": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search text or pattern. For 'Text' mode, an exact substring. For 'Regex' mode, a .NET regular expression pattern. For 'Fuzzy' mode, the approximate text to locate.",
            "default": ""
          },
          "search_mode": {
            "description": "The type of search to perform. 'Text': exact substring matching. 'Regex': regular expression matching. 'Fuzzy': approximate matching using Damerau-Levenshtein edit distance. Defaults to 'Text'.",
            "default": "Text",
            "$ref": "#/components/schemas/SearchModeOption"
          },
          "case_sensitive": {
            "type": "boolean",
            "description": "Whether the text search should be case-sensitive. Only applies to 'Text' mode. Defaults to false.",
            "default": false
          },
          "whole_word": {
            "type": "boolean",
            "description": "When true, only matches bounded by non-word characters on both sides are returned. Only applies to 'Text' mode. Defaults to false.",
            "default": false
          },
          "regex_ignore_case": {
            "type": "boolean",
            "description": "When true, the regex pattern ignores case. Only applies to 'Regex' mode. Defaults to true.",
            "default": true
          },
          "max_edit_distance": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Maximum Damerau-Levenshtein edit distance for fuzzy matching. Clamped to [1, 10]. Only applies to 'Fuzzy' mode. Defaults to 2.",
            "format": "int32",
            "default": 2
          },
          "min_score": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Minimum normalized fuzzy score in the range [0..1]. Only applies to 'Fuzzy' mode. Defaults to 0.75.",
            "format": "double",
            "default": 0.75
          },
          "token_aware": {
            "type": "boolean",
            "description": "When true, discounts whitespace substitution costs in fuzzy matching. Only applies to 'Fuzzy' mode. Defaults to true.",
            "default": true
          },
          "normalize_whitespace": {
            "type": "boolean",
            "description": "When true, collapses whitespace in document text before searching. Defaults to true.",
            "default": true
          },
          "ignore_diacritics": {
            "type": "boolean",
            "description": "When true, removes diacritical marks (accents) before searching. Defaults to true.",
            "default": true
          },
          "ignore_punctuation": {
            "type": "boolean",
            "description": "When true, strips punctuation characters before searching. Defaults to false.",
            "default": false
          },
          "ignore_symbols": {
            "type": "boolean",
            "description": "When true, strips symbol characters before searching. Defaults to false.",
            "default": false
          },
          "max_results": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Maximum number of matches to return across all pages. Clamped to [1, 5000]. Defaults to 100.",
            "format": "int32",
            "default": 100
          },
          "context_chars": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of characters of surrounding context to include in each match snippet. Clamped to [0, 1000]. Defaults to 40.",
            "format": "int32",
            "default": 40
          },
          "page_range": {
            "type": [
              "null",
              "string"
            ],
            "description": "An optional page range to search (e.g. \"1-3\", \"1,3,5\", \"2-\"). When empty or not specified, all pages are searched. Page numbers are 1-based.",
            "default": ""
          }
        },
        "description": "Request body for the PDF Search API."
      },
      "PdfSearchResponse": {
        "required": [
          "query",
          "search_mode",
          "total_matches",
          "page_count",
          "scanned_pages",
          "limited_by_max_results",
          "matches"
        ],
        "type": "object",
        "properties": {
          "query": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search query that was executed."
          },
          "search_mode": {
            "description": "The search mode that was used (Text, Regex or Fuzzy).",
            "$ref": "#/components/schemas/SearchModeOption"
          },
          "total_matches": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The total number of matches found.",
            "format": "int32"
          },
          "page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The total number of pages in the document.",
            "format": "int32"
          },
          "scanned_pages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of pages that were actually scanned.",
            "format": "int32"
          },
          "limited_by_max_results": {
            "type": "boolean",
            "description": "Whether the results were capped by the max_results limit."
          },
          "matches": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/SearchMatchResult"
            },
            "description": "The search matches with text, snippets, scores, page numbers, and bounding boxes."
          }
        },
        "description": "Response from the PDF Search API."
      },
      "PdfSignatureCertificateModel": {
        "type": "object",
        "properties": {
          "subject": {
            "type": [
              "null",
              "string"
            ],
            "description": "The certificate's subject distinguished name."
          },
          "issuer": {
            "type": [
              "null",
              "string"
            ],
            "description": "The issuing authority's distinguished name."
          },
          "not_before": {
            "type": "string",
            "description": "Start of the certificate's validity window (UTC, ISO 8601).",
            "format": "date-time"
          },
          "not_after": {
            "type": "string",
            "description": "End of the certificate's validity window (UTC, ISO 8601).",
            "format": "date-time"
          },
          "thumbprint": {
            "type": [
              "null",
              "string"
            ],
            "description": "SHA-1 thumbprint identifying the certificate."
          }
        },
        "description": "One certificate in a signature's chain, described by its stable facts."
      },
      "PdfSignatureFieldModel": {
        "type": "object",
        "properties": {
          "page_index": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Zero-based index of the page carrying the field. Default: 0.",
            "format": "int32",
            "default": 0
          },
          "left": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Left edge in points.",
            "format": "float"
          },
          "bottom": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Bottom edge in points.",
            "format": "float"
          },
          "right": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Right edge in points.",
            "format": "float"
          },
          "top": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Top edge in points.",
            "format": "float"
          }
        },
        "description": "Where the visible signature field sits on its page, in PDF points (origin bottom-left)."
      },
      "PdfSignatureResultModel": {
        "type": "object",
        "properties": {
          "index": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Zero-based position of the signature in the document.",
            "format": "int32"
          },
          "sub_filter": {
            "type": [
              "null",
              "string"
            ],
            "description": "The signature container format: 'ETSI.CAdES.detached' (PAdES), 'adbe.pkcs7.detached', or 'ETSI.RFC3161' for a document timestamp."
          },
          "status": {
            "type": [
              "null",
              "string"
            ],
            "description": "The combined verdict: 'Valid', 'Invalid', or 'Indeterminate'. Valid appears only when every axis that must hold does."
          },
          "integrity": {
            "type": [
              "null",
              "string"
            ],
            "description": "Whether the signed bytes are untouched: 'Valid', 'DocumentModified', 'UnsupportedSubFilter', 'MalformedSignature', or 'SignerCertificateMissing'."
          },
          "identity": {
            "type": [
              "null",
              "string"
            ],
            "description": "Whether the signer chains to a configured trust anchor: 'Trusted', 'Untrusted', or 'Unknown'."
          },
          "revocation": {
            "type": [
              "null",
              "string"
            ],
            "description": "The certificate's revocation standing: 'Good', 'Revoked', or 'NotChecked' when no usable revocation material was available."
          },
          "timestamp": {
            "type": [
              "null",
              "string"
            ],
            "description": "The cryptographic time attestation: 'Valid' (an authority proved the time), 'Untrusted', 'Invalid', or 'None' when the time is merely claimed by the signer."
          },
          "signing_time": {
            "type": [
              "null",
              "string"
            ],
            "description": "The signing time recorded in the signature (UTC, ISO 8601), or null.",
            "format": "date-time"
          },
          "timestamp_time": {
            "type": [
              "null",
              "string"
            ],
            "description": "The authority-attested time when an RFC 3161 timestamp is present (UTC, ISO 8601), or null.",
            "format": "date-time"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "The reason recorded by the signer, or null."
          },
          "certification": {
            "type": [
              "null",
              "string"
            ],
            "description": "The DocMDP certification level this signature declares: 'None', 'NoChangesAllowed', 'FormFillingAllowed', or 'FormFillingAndAnnotationsAllowed'."
          },
          "covers_entire_document": {
            "type": "boolean",
            "description": "Whether the signature's byte range reaches the end of the file. False means later revisions were appended after this signature."
          },
          "digest_algorithm": {
            "type": [
              "null",
              "string"
            ],
            "description": "The digest algorithm the signature used, e.g. 'SHA-256'."
          },
          "status_message": {
            "type": [
              "null",
              "string"
            ],
            "description": "One sentence naming the decisive fact behind the verdict."
          },
          "signer": {
            "description": "The signer certificate's facts, or null when the container carries none.",
            "$ref": "#/components/schemas/PdfSignatureCertificateModel"
          },
          "chain": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PdfSignatureCertificateModel"
            },
            "description": "The certificate chain as embedded, signer first."
          }
        },
        "description": "One signature's verdict: the four independent axes, the decisive message, and the certificate chain."
      },
      "PdfSignRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The PDF document to sign (base64 or file identifier).",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "password": {
            "type": [
              "null",
              "string"
            ],
            "description": "Password used to open the document when it is encrypted."
          },
          "certificate": {
            "type": [
              "null",
              "string"
            ],
            "description": "The signing identity as a base64-encoded PKCS#12 (.p12/.pfx) bundle carrying the certificate and its private key. Omitted, the server's configured identity signs ('DocumentSigning:CertificateFile'); the request fails when neither is available. The key is used in-process by the managed engine and never enters an OS key store."
          },
          "certificate_password": {
            "type": [
              "null",
              "string"
            ],
            "description": "Password of the PKCS#12 bundle. Applies to 'certificate' when provided, otherwise to the server-configured identity."
          },
          "reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "The reason recorded in the signature dictionary, or null for none."
          },
          "field_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Partial name of the new signature field; must be unique in the document. Default: 'Signature1'.",
            "default": "Signature1"
          },
          "field": {
            "description": "Placement of a VISIBLE signature field. The field renders who signed, when, and why (localized through 'appearance_language'), or the custom 'appearance_lines'. Omitted, the signature is invisible: cryptographically identical, no mark on any page.",
            "$ref": "#/components/schemas/PdfSignatureFieldModel"
          },
          "appearance_lines": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Custom text lines for the visible field, replacing the automatic composition. Ignored for invisible signatures."
          },
          "appearance_language": {
            "type": [
              "null",
              "string"
            ],
            "description": "Language of the automatic appearance text ('fr', 'de', 'ja', ...). Fourteen languages are built in; omitted, the server's UI culture applies. Scripts beyond the built-in Helvetica (Cyrillic, CJK, Arabic) compose in English unless 'appearance_font' supplies a font that carries them."
          },
          "appearance_image": {
            "type": [
              "null",
              "string"
            ],
            "description": "A drawn mark (a handwritten signature stroke, a stamp) as a base64-encoded image (PNG keeps its transparency). It renders beside the text, or fills the field when 'appearance_lines' is a single empty string. Ignored for invisible signatures."
          },
          "appearance_font": {
            "type": [
              "null",
              "string"
            ],
            "description": "A base64-encoded TrueType/OpenType font embedded for the appearance text, unlocking scripts beyond WinAnsi."
          },
          "certification": {
            "type": [
              "null",
              "string"
            ],
            "description": "Makes this the document's certification (author) signature, declaring which later changes stay legal: 'none' (default, an ordinary approval signature), 'no_changes', 'form_filling', or 'form_filling_and_annotations'. A document carries at most one certification signature, applied first.",
            "default": "none"
          },
          "timestamp_authority": {
            "type": [
              "null",
              "string"
            ],
            "description": "An RFC 3161 timestamp authority URL that proves the signing time (PAdES B-T) instead of the signer claiming it. Omitted, the server's configured authority applies ('DocumentSigning:TimestampAuthority'); an empty string signs without a timestamp even when one is configured."
          },
          "signature_capacity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Bytes reserved for the signature container. The default fits a typical chain with a timestamp. Range: 256-65536. Default: 8192.",
            "format": "int32",
            "default": 8192
          }
        },
        "description": "Request body for the PDF signing API."
      },
      "PdfSignResponse": {
        "required": [
          "file_id",
          "field_name",
          "visible",
          "timestamped"
        ],
        "type": "object",
        "properties": {
          "file_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file ID of the signed document stored on the server."
          },
          "field_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The signature field that was created."
          },
          "visible": {
            "type": "boolean",
            "description": "Whether the signature renders a visible mark on a page."
          },
          "timestamped": {
            "type": "boolean",
            "description": "Whether an RFC 3161 authority attested the signing time."
          },
          "verification": {
            "description": "Independent verification of the produced output: the validator re-parses the stored bytes, so 'integrity: Valid' is a checked fact rather than signer bookkeeping. Identity reflects the server's configured trust anchors.",
            "$ref": "#/components/schemas/PdfVerifySignaturesResponse"
          }
        },
        "description": "Response from the PDF signing API."
      },
      "PdfSplitMode": {
        "enum": [
          "PageRanges",
          "BlankPages"
        ],
        "description": "How the PDF is split into parts.\n\n- `PageRanges`: Split by the caller-provided 1-based page ranges (the default).\n- `BlankPages`: Split on visually blank pages - the separator sheets of batch scans. The runs of non-blank pages between separators become the parts; the blank pages themselves are omitted. No AI model is involved."
      },
      "PdfSplitRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input PDF document to split. When input_format is 'Base64EncodedFile', provide a base64-encoded PDF payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint or by another endpoint such as pdf-merge.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "page_ranges": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "A list of page range strings defining how the PDF should be split (split_mode 'PageRanges'). Each range produces one output part. Ranges are 1-based and support formats such as '1-5', '3', '7-12', '2-'. Required in 'PageRanges' mode; must be omitted in 'BlankPages' mode."
          },
          "split_mode": {
            "description": "How the PDF is split. 'PageRanges' (default) cuts along the provided page_ranges. 'BlankPages' detects visually blank pages (batch-scan separator sheets) and cuts on them: the runs of non-blank pages become the parts, the blank pages are omitted. Blank detection is deterministic image analysis - no AI model is involved.",
            "default": "PageRanges",
            "$ref": "#/components/schemas/PdfSplitMode"
          },
          "blank_tolerance": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Per-channel noise tolerance (0-255) for blank detection in 'BlankPages' mode: a page counts as blank when every pixel matches the first within this tolerance AND the page is light (a uniformly dark page is content, never a blank). The default 10 absorbs typical scanner noise; use 0 for born-digital PDFs. Ignored in 'PageRanges' mode.",
            "format": "int32",
            "default": 10
          }
        },
        "description": "Request body for the PDF Split API."
      },
      "PdfSplitResponse": {
        "required": [
          "source_page_count",
          "parts"
        ],
        "type": "object",
        "properties": {
          "source_page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The total number of pages in the original source PDF.",
            "format": "int32"
          },
          "parts": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/SplitPartResult"
            },
            "description": "The list of split parts, one per requested page range."
          }
        },
        "description": "Response from the PDF Split API."
      },
      "PdfTimestampRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The PDF document to timestamp (base64 or file identifier).",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "password": {
            "type": [
              "null",
              "string"
            ],
            "description": "Password used to open the document when it is encrypted."
          },
          "timestamp_authority": {
            "type": [
              "null",
              "string"
            ],
            "description": "The RFC 3161 timestamp authority URL. Omitted, the server's configured authority applies ('DocumentSigning:TimestampAuthority'); the request fails when neither is available."
          },
          "field_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Partial name of the new timestamp field; must be unique in the document. Default: 'DocTimeStamp1'.",
            "default": "DocTimeStamp1"
          },
          "signature_capacity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Bytes reserved for the timestamp token. Range: 256-65536. Default: 8192.",
            "format": "int32",
            "default": 8192
          }
        },
        "description": "Request body for the PDF document timestamp API."
      },
      "PdfTimestampResponse": {
        "required": [
          "file_id",
          "field_name"
        ],
        "type": "object",
        "properties": {
          "file_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file ID of the timestamped document stored on the server."
          },
          "field_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The timestamp field that was created."
          },
          "verification": {
            "description": "Independent verification of the produced output; the new timestamp appears as an 'ETSI.RFC3161' entry with its authority-attested time.",
            "$ref": "#/components/schemas/PdfVerifySignaturesResponse"
          }
        },
        "description": "Response from the PDF document timestamp API."
      },
      "PdfToImagesFormat": {
        "enum": [
          "jpeg",
          "png",
          "tiff"
        ],
        "description": "- `Jpeg`: Lossy JPEG output; compact, quality controlled by the 'quality' field.\n- `Png`: Lossless PNG output.\n- `Tiff`: Lossless LZW-compressed TIFF output. The only format that can carry every page in one file, via the 'multipage' field."
      },
      "PdfToImagesRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The source PDF document (base64 or file identifier).",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "format": {
            "description": "Output image format: 'jpeg' (default), 'png' or 'tiff'.",
            "default": "jpeg",
            "$ref": "#/components/schemas/PdfToImagesFormat"
          },
          "quality": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "JPEG quality (1-100). Only applies when format is 'jpeg'. Default: 90.",
            "format": "int32",
            "default": 90
          },
          "dpi": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Render resolution in DPI. Default: 150. Range: 72-600.",
            "format": "int32",
            "default": 150
          },
          "page_range": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional page range (e.g. '1-3', '5', '2-'). If omitted, all pages are converted."
          },
          "unwrap_single": {
            "type": "boolean",
            "description": "When true and the result contains exactly one image, the output is stored as a raw image file instead of a ZIP archive. Default: false. Ignored when 'multipage' is true, which always produces a single file.",
            "default": false
          },
          "multipage": {
            "type": "boolean",
            "description": "When true, every selected page is packed into ONE multipage TIFF file instead of a ZIP archive of per-page images. Requires format 'tiff'. Default: false.",
            "default": false
          }
        },
        "description": "Request body for the PDF to Images API."
      },
      "PdfToImagesResponse": {
        "required": [
          "file_id",
          "page_count",
          "format"
        ],
        "type": "object",
        "properties": {
          "file_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file ID of the produced output: the ZIP archive of per-page images, or a single image file when 'multipage' packed every page into one TIFF or when 'unwrap_single' collapsed a one-page result."
          },
          "page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of pages converted.",
            "format": "int32"
          },
          "format": {
            "description": "The image format used ('jpeg', 'png' or 'tiff').",
            "$ref": "#/components/schemas/PdfToImagesFormat"
          }
        },
        "description": "Response from the PDF to Images API."
      },
      "PdfToPdfAFallback": {
        "enum": [
          "Rasterize",
          "Fail",
          "ReportOnly"
        ],
        "description": "- `Rasterize`: After applying every possible repair, rebuild only the pages that still cannot conform from rendered images, with an invisible searchable text layer. Guarantees a conforming output. Default: the highest-success-rate strategy.\n- `Fail`: After applying every possible repair, reject the conversion if any content still cannot be made conforming losslessly.\n- `ReportOnly`: After applying every possible repair, keep the original content and list the remaining violations. The output may not fully conform."
      },
      "PdfToPdfALevel": {
        "enum": [
          "PdfA1b",
          "PdfA2b",
          "PdfA3b"
        ],
        "description": "- `PdfA1b`: PDF/A-1b (ISO 19005-1). Strictest, based on PDF 1.4; no transparency or layers.\n- `PdfA2b`: PDF/A-2b (ISO 19005-2). Based on PDF 1.7; allows transparency, layers and JPEG2000. Default.\n- `PdfA3b`: PDF/A-3b (ISO 19005-3). Like PDF/A-2b, but also permits arbitrary attached files."
      },
      "PdfToPdfARequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The source PDF document (base64 or file identifier).",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "level": {
            "description": "Targeted conformance level. Default: 'PdfA2b'.",
            "default": "PdfA2b",
            "$ref": "#/components/schemas/PdfToPdfALevel"
          },
          "fallback": {
            "description": "Behavior for content that still cannot be made conforming after every repair has been applied (the conversion always attempts every possible repair first). 'Rasterize' (default) rebuilds only the residual pages from rendered images with an invisible searchable text layer, guaranteeing a conforming output and the highest success rate; 'ReportOnly' keeps the original content and lists the remaining violations; 'Fail' rejects the conversion.",
            "default": "Rasterize",
            "$ref": "#/components/schemas/PdfToPdfAFallback"
          },
          "password": {
            "type": [
              "null",
              "string"
            ],
            "description": "Password used to open the source document when it is encrypted. The output is always unencrypted, as PDF/A requires."
          },
          "raster_dpi": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Rendering resolution in DPI used by the raster fallback. Range: 72-600. Default: 200.",
            "format": "int32",
            "default": 200
          },
          "raster_jpeg_quality": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "JPEG quality (1-100) for page images produced by the raster fallback. Default: 92.",
            "format": "int32",
            "default": 92
          },
          "include_text_layer": {
            "type": "boolean",
            "description": "When true (default), the raster fallback overlays the source text as invisible, searchable text on each page image.",
            "default": true
          }
        },
        "description": "Request body for the PDF to PDF/A conversion API."
      },
      "PdfToPdfAResponse": {
        "required": [
          "file_id",
          "page_count",
          "level",
          "conforms",
          "used_raster_fallback",
          "encryption_removed"
        ],
        "type": "object",
        "properties": {
          "file_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file ID of the converted PDF/A document stored on the server."
          },
          "page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of pages in the converted document.",
            "format": "int32"
          },
          "level": {
            "description": "The conformance level the conversion targeted.",
            "$ref": "#/components/schemas/PdfToPdfALevel"
          },
          "conforms": {
            "type": "boolean",
            "description": "Whether the produced document is believed to conform to the targeted level. False only under the 'ReportOnly' fallback when violations remain."
          },
          "used_raster_fallback": {
            "type": "boolean",
            "description": "Whether the output was rebuilt from rendered page images instead of rewriting the original content."
          },
          "encryption_removed": {
            "type": "boolean",
            "description": "Whether encryption was removed from the source document."
          },
          "features_detected": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Conformance-relevant features detected in the source document (e.g. 'UnembeddedFont', 'DeviceCmyk', 'Lzw', 'Transparency')."
          },
          "fixes_applied": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Modifications applied by the conversion (e.g. 'FontsEmbedded', 'DefaultCmykInstalled', 'LzwReencoded')."
          },
          "raster_triggers": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "The violations that forced the raster fallback, when it was used."
          },
          "unresolved_violations": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Violations remaining in the output. Non-empty only under the 'ReportOnly' fallback."
          },
          "validation": {
            "description": "Independent validation of the produced output: the validator re-parses the stored bytes and evaluates the PDF/A rule catalog, so its 'verdict' is a checked fact rather than converter bookkeeping.",
            "$ref": "#/components/schemas/DocumentValidationResponse"
          }
        },
        "description": "Response from the PDF to PDF/A conversion API."
      },
      "PdfUnlockRequest": {
        "required": [
          "input",
          "password"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The encrypted PDF document (base64 or file identifier)."
          },
          "input_format": {
            "description": "How the input is provided. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "password": {
            "type": [
              "null",
              "string"
            ],
            "description": "The password to unlock the PDF."
          }
        },
        "description": "Request body for the PDF Unlock API."
      },
      "PdfUnlockResponse": {
        "required": [
          "file_id",
          "page_count"
        ],
        "type": "object",
        "properties": {
          "file_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file ID of the unlocked PDF stored on the server."
          },
          "page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of pages in the unlocked PDF.",
            "format": "int32"
          }
        },
        "description": "Response from the PDF Unlock API."
      },
      "PdfVerifySignaturesRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The PDF document to verify (base64 or file identifier).",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "password": {
            "type": [
              "null",
              "string"
            ],
            "description": "Password used to open the document when it is encrypted."
          },
          "trust_roots": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Additional trust anchors for THIS verification: base64-encoded certificates, DER or PEM. They join the anchors configured on the server ('DocumentSigning:TrustAnchorsDirectory'). A signer chaining to any anchor verifies as Trusted."
          },
          "trust_system_roots": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether the operating system's root store also anchors identities. Omitted, the server's configured default applies ('DocumentSigning:TrustSystemRoots', true unless changed)."
          }
        },
        "description": "Request body for the PDF signature verification API."
      },
      "PdfVerifySignaturesResponse": {
        "required": [
          "has_signatures",
          "overall_status",
          "signatures"
        ],
        "type": "object",
        "properties": {
          "has_signatures": {
            "type": "boolean",
            "description": "Whether the document carries any digital signatures or document timestamps."
          },
          "overall_status": {
            "type": [
              "null",
              "string"
            ],
            "description": "The document-level verdict: 'Valid' only when every signature is valid; 'Invalid' when any is broken; otherwise 'Indeterminate'."
          },
          "signatures": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PdfSignatureResultModel"
            },
            "description": "One verdict per signature, in document order."
          }
        },
        "description": "Response from the PDF signature verification API: the full verdict report."
      },
      "PIIBoundingBox": {
        "type": "object",
        "properties": {
          "left": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "top": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        },
        "description": "Axis-aligned rectangle on a page where an entity occurred, in absolute page units (e.g., pixels or PDF points)."
      },
      "PIIDetectionItemResponse": {
        "required": [
          "label",
          "entity_type",
          "value",
          "confidence"
        ],
        "type": "object",
        "properties": {
          "label": {
            "type": [
              "null",
              "string"
            ],
            "description": "Display label for the entity (e.g., 'EmailAddress', 'PhoneNumber', or a custom label)."
          },
          "entity_type": {
            "description": "The entity type name (built-in enum name or 'Custom').",
            "$ref": "#/components/schemas/PiiExtraction.PiiEntityType"
          },
          "value": {
            "type": [
              "null",
              "string"
            ],
            "description": "The exact substring extracted from the original content."
          },
          "occurrences": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PIILocation"
            },
            "description": "All locations where this entity was recognized (text offsets and/or page+bounding box)."
          },
          "confidence": {
            "maximum": 1,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Confidence score (0.0–1.0) for this entity.",
            "format": "float"
          }
        },
        "description": "One detected PII entity and its occurrences within the input."
      },
      "PIIDetectionRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The identifier of the language model to be used for PII detection. If not provided, the default model is used.",
            "default": ""
          },
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input for PII detection. When input_format is 'PlainText', provide raw text. When 'Base64EncodedFile', provide a base64-encoded file payload (supported: HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF). When 'FileIdentifier', provide the file ID previously returned by the api/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'PlainText', 'Base64EncodedFile', or 'FileIdentifier'. 'Base64EncodedFile' supports: HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF. 'FileIdentifier' references a file previously uploaded via api/v1/files/upload. Defaults to 'PlainText'.",
            "default": "PlainText",
            "$ref": "#/components/schemas/InputFormat"
          },
          "enable_ocr": {
            "type": "boolean",
            "description": "Whether to use OCR for pages that contain no extractable text (e.g., scanned images). Requires an OCR provider to be configured on the server. Defaults to true.",
            "default": true
          },
          "page_range": {
            "type": [
              "null",
              "string"
            ],
            "description": "An optional page range to scan (e.g. \"1-5, 8\"). Page numbers are 1-based. When empty or not specified, all pages are scanned. Applies to document inputs only.",
            "default": ""
          },
          "guidance": {
            "type": [
              "null",
              "string"
            ],
            "description": "Additional guidance text that can influence the detection process (e.g., domain hints or formatting notes).",
            "default": ""
          },
          "built_in_types": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PiiExtraction.PiiEntityType"
            },
            "description": "Optional list of built-in PII types to detect (exclude 'Custom'). If omitted, all built-in types are considered."
          },
          "custom_labels": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Optional list of custom PII labels (e.g., 'PassportNumber'). Each item must be a non-empty string."
          }
        },
        "description": "Request body for the PII Detection API."
      },
      "PIIDetectionResponse": {
        "required": [
          "entities",
          "overall_confidence"
        ],
        "type": "object",
        "properties": {
          "entities": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PIIDetectionItemResponse"
            },
            "description": "A collection of detected PII entities from the input content."
          },
          "overall_confidence": {
            "maximum": 1,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Overall confidence score for the detection (0..1).",
            "format": "float"
          }
        },
        "description": "PII Detection API response. Contains detected entities and an overall confidence score."
      },
      "PiiExtraction.PiiEntityType": {
        "enum": [
          "Person",
          "EmailAddress",
          "PhoneNumber",
          "PostalAddress",
          "Url",
          "IpAddress",
          "DateOfBirth",
          "SocialSecurityNumber",
          "CreditCardNumber",
          "BankAccountNumber",
          "Other",
          "Custom"
        ],
        "description": "Standard set of entity types for PII Extraction/Recognition.\n\n- `Person`: A person's full name (e.g. \"Loïc Carrère\").\n- `EmailAddress`: An email address (e.g. \"user@example.com\").\n- `PhoneNumber`: A phone number (e.g. \"+1-650-555-1234\").\n- `PostalAddress`: A postal or street address (e.g. \"1600 Amphitheatre Parkway, Mountain View, CA\").\n- `Url`: A URL or web address (e.g. \"https://lm-kit.com\").\n- `IpAddress`: An IP address (e.g. \"192.168.0.1\").\n- `DateOfBirth`: A date of birth (e.g. \"01/15/1980\" or \"1980-01-15\").\n- `SocialSecurityNumber`: A U.S. Social Security Number (e.g. \"123-45-6789\").\n- `CreditCardNumber`: A credit card number (e.g. \"4111 1111 1111 1111\").\n- `BankAccountNumber`: A bank account number (e.g. \"000123456789\").\n- `Other`: Any other type of PII not covered by the existing categories.\n- `Custom`: A custom, user-defined PII type not included in the standard set."
      },
      "PIILocation": {
        "type": "object",
        "properties": {
          "start_offset": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Zero-based inclusive start character offset in the original text, or -1 if not available.",
            "format": "int32",
            "default": -1
          },
          "length": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Length in characters of the matched substring, or -1 if not available.",
            "format": "int32",
            "default": -1
          },
          "page_index": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Zero-based page index for paged inputs (PDF/images), or -1 if not available.",
            "format": "int32",
            "default": -1
          },
          "bounding_box": {
            "description": "Axis-aligned bounding box in absolute page units, if available.",
            "$ref": "#/components/schemas/PIIBoundingBox"
          }
        },
        "description": "One occurrence of a detected entity within the input."
      },
      "PlaygroundRedactApplyRequest.Area": {
        "type": "object",
        "properties": {
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "1-based page number.",
            "format": "int32"
          },
          "left": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "top": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "PlaygroundTitleRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "Catalog model ID; blank uses the server's default chat model."
          },
          "user": {
            "type": [
              "null",
              "string"
            ],
            "description": "The conversation's first user message (may be trimmed)."
          },
          "answer": {
            "type": [
              "null",
              "string"
            ],
            "description": "The first answer (may be trimmed)."
          }
        }
      },
      "PlaygroundToolsEnableRequest": {
        "type": "object",
        "properties": {
          "tools": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "ingestRoot": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProvisionTenantRequest": {
        "type": "object",
        "properties": {
          "cluster_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search cluster to create the tenant in. If not provided, the default cluster is used."
          },
          "display_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional human-readable name for the tenant.",
            "default": ""
          },
          "embedding_model": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional embedding model for the tenant: one of the cluster's model catalog, by default 'embeddinggemma-300m', 'qwen3-embedding:0.6b', 'qwen3-embedding:4b', 'qwen3-embedding:8b', or 'harrier-oss:0.6b'. The model is a tenant-wide property: every collection that enables semantic search is embedded with it. Omit to provision a full-text-only tenant; set or change it later via the embedding-model endpoint."
          },
          "enable_ocr": {
            "type": "boolean",
            "description": "Whether the tenant runs OCR while extracting scanned pages and images. Defaults to true. Tenant-wide and applied to newly indexed documents; change it later via the tenant update endpoint.",
            "default": true
          },
          "ocr_noise_rejection": {
            "type": "boolean"
          },
          "enable_full_text_search": {
            "type": "boolean",
            "description": "Whether the tenant's collections support full-text (word-based) search. Defaults to true. Tenant-wide, so every collection shares it. A tenant must keep at least one search mode enabled.",
            "default": true
          },
          "enable_semantic_search": {
            "type": "boolean",
            "description": "Whether the tenant's collections support semantic (meaning-based) search. Defaults to false. Tenant-wide; enabling it embeds documents with the tenant's embedding model. A tenant must keep at least one search mode enabled.",
            "default": false
          },
          "normalization": {
            "description": "Optional text-normalization options (case / accent / unicode / punctuation folding), applied to every collection. Omit for the defaults (case-insensitive, accent-sensitive); change it later via the tenant update endpoint.",
            "$ref": "#/components/schemas/TextNormalizationOptions"
          },
          "rerank_model": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional reranking model for the tenant, for example 'bge-m3-reranker'. The model is a tenant-wide property used by the optional second-stage reranking pass (a search request with 'rerank' set), which re-scores candidates by direct query-document relevance to lift precision in every mode. Omit to leave the tenant without a reranker; set or change it later via the tenant update endpoint."
          },
          "query_model": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional query-understanding model for the tenant: the small local LLM used by search requests with a 'query_mode' beyond Original (contextual rewriting, multi-query expansion, HyDE). A small instruct model (1B class) keeps the added latency low. Omit to leave the tenant without a query model (such requests then degrade to the original query); set or change it later via the tenant update endpoint."
          }
        },
        "description": "Request body for provisioning a Search tenant in a cluster."
      },
      "PurgeCollectionRequest": {
        "required": [
          "tenant_id",
          "collection_id"
        ],
        "type": "object",
        "properties": {
          "cluster_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search cluster that holds the tenant and collection. If not provided, the default cluster is used."
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant that owns the collection.",
            "format": "uuid"
          },
          "collection_id": {
            "type": "string",
            "description": "The collection whose documents are all removed.",
            "format": "uuid"
          }
        },
        "description": "Request body for removing every document from a collection in one call."
      },
      "QueryMode": {
        "enum": [
          "Original",
          "Contextual",
          "MultiQuery",
          "Hyde"
        ],
        "description": "- `Original`: Search with the query exactly as sent.\n- `Contextual`: Rewrite a follow-up question into a self-contained query using the supplied chat_history, then search with the rewrite.\n- `MultiQuery`: Generate alternative phrasings of the query, retrieve for each, and fuse the ranked lists (RRF).\n- `Hyde`: Generate a hypothetical answer passage and embed it in place of the query for the semantic arm (HyDE). Semantic and hybrid only."
      },
      "QueryUnderstandingResponse": {
        "type": "object",
        "properties": {
          "requested_mode": {
            "description": "The query_mode the request asked for.",
            "$ref": "#/components/schemas/QueryMode"
          },
          "applied_mode": {
            "description": "The mode that actually ran. Falls back toward 'Original' when the tenant has no query model, the model could not be loaded, or generation produced nothing usable, so callers can detect degradation. For 'MultiQuery' and 'Hyde' with chat_history, a value of 'Contextual' means the rewrite succeeded but the expansion step degraded.",
            "$ref": "#/components/schemas/QueryMode"
          },
          "effective_query": {
            "type": [
              "null",
              "string"
            ],
            "description": "The query retrieval actually used, after contextual rewriting."
          },
          "generated_queries": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "MultiQuery: the fused phrasings, effective query first. Null otherwise."
          },
          "hypothetical_passage": {
            "type": [
              "null",
              "string"
            ],
            "description": "Hyde: the generated passage embedded in place of the query for the semantic arm. Null otherwise."
          }
        },
        "description": "What the query-understanding step did for this search. Returned only when the request asked for a query_mode beyond Original."
      },
      "ReadinessResponse": {
        "required": [
          "status",
          "backend_initialized",
          "loaded_models",
          "active_inferences",
          "queue_depth"
        ],
        "type": "object",
        "properties": {
          "status": {
            "description": "\"ready\" when the server can accept requests, \"not_ready\" otherwise.",
            "$ref": "#/components/schemas/ReadinessStatus"
          },
          "backend_initialized": {
            "type": "boolean",
            "description": "Whether the LM-Kit inference backend has been initialized."
          },
          "loaded_models": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of models currently loaded in memory.",
            "format": "int32"
          },
          "active_inferences": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of inference requests currently being processed.",
            "format": "int32"
          },
          "queue_depth": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of inference requests waiting in the queue.",
            "format": "int32"
          },
          "loaded_model_names": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Identifiers of the models currently loaded in memory."
          },
          "draining": {
            "type": "boolean",
            "description": "True while the server is shutting down and finishing in-flight requests."
          },
          "warmup_pending": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Configured warmup models still loading; present only while warmup gates readiness."
          },
          "warmup_failed": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Configured warmup models that failed to load, with the reason; the node stays not-ready until fixed."
          }
        },
        "description": "Readiness probe response with server status details."
      },
      "ReadinessStatus": {
        "enum": [
          "ready",
          "not_ready",
          "warming",
          "draining"
        ],
        "description": "- `Ready`: The server can accept inference requests.\n- `NotReady`: The inference backend is not initialized yet; requests would fail.\n- `Warming`: The configured warmup models are still loading; route traffic elsewhere until they are resident.\n- `Draining`: The server is shutting down and finishing its in-flight requests; route new traffic elsewhere."
      },
      "ReindexProgressResponse": {
        "type": "object",
        "properties": {
          "active_embedding_model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The embedding model currently used for semantic search. Null when the collection is full-text only."
          },
          "target_embedding_model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The embedding model the collection is moving to. Equal to the active model when nothing is pending."
          },
          "reindex_state": {
            "description": "Whether changes are still being applied: 'idle' (nothing pending), 'vector_rebuild' (applying a semantic-search change), or 'ft_rebuild' (applying a full-text change).",
            "$ref": "#/components/schemas/ReindexState"
          },
          "total_documents": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Total number of documents in the collection.",
            "format": "int64"
          },
          "pending_semantic_documents": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of documents still being updated for semantic search.",
            "format": "int64"
          },
          "pending_fulltext_documents": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of documents still being updated for full-text search.",
            "format": "int64"
          }
        },
        "description": "Reindex progress for a collection."
      },
      "ReindexState": {
        "enum": [
          "idle",
          "vector_rebuild",
          "ft_rebuild"
        ],
        "description": "- `Idle`: Nothing pending; the index reflects the current configuration.\n- `VectorRebuild`: A semantic-search change (embedding model or chunking) is being applied.\n- `FtRebuild`: A full-text change (analyzer or language) is being applied."
      },
      "RerankedResult": {
        "required": [
          "rank",
          "content",
          "blended_score",
          "raw_similarity",
          "reranked_score"
        ],
        "type": "object",
        "properties": {
          "rank": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The rank position after reranking (1-based).",
            "format": "int32"
          },
          "content": {
            "type": [
              "null",
              "string"
            ],
            "description": "The text content of the reranked result."
          },
          "blended_score": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The final blended score: (alpha * raw_similarity) + ((1 - alpha) * reranked_score).",
            "format": "float"
          },
          "raw_similarity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The original raw similarity score from the initial search.",
            "format": "float"
          },
          "reranked_score": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The reranker model score (before alpha blending).",
            "format": "float"
          },
          "collection_identifier": {
            "type": [
              "null",
              "string"
            ],
            "description": "The collection identifier this result came from."
          },
          "section_identifier": {
            "type": [
              "null",
              "string"
            ],
            "description": "The section identifier this result came from."
          },
          "metadata": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "Additional metadata key-value pairs."
          }
        },
        "description": "A single reranked result with blended scores."
      },
      "RerankInputResult": {
        "required": [
          "content",
          "raw_similarity"
        ],
        "type": "object",
        "properties": {
          "content": {
            "type": [
              "null",
              "string"
            ],
            "description": "The text content of the search result."
          },
          "raw_similarity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The original raw similarity score from the initial search (0.0 to 1.0).",
            "format": "float"
          },
          "collection_identifier": {
            "type": [
              "null",
              "string"
            ],
            "description": "The collection identifier this result came from."
          },
          "section_identifier": {
            "type": [
              "null",
              "string"
            ],
            "description": "The section identifier this result came from."
          },
          "metadata": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "Additional metadata key-value pairs associated with this result."
          }
        },
        "description": "A search result item to be reranked."
      },
      "RerankRequest": {
        "required": [
          "query",
          "results"
        ],
        "type": "object",
        "properties": {
          "query": {
            "type": [
              "null",
              "string"
            ],
            "description": "The query text to rerank results against."
          },
          "results": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/RerankInputResult"
            },
            "description": "The search results to rerank. Each must include content and raw_similarity."
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The reranking model identifier. If not provided, the default reranking model is used."
          },
          "alpha": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Blending factor between original similarity and reranker score. 0.0 = original similarity only, 0.5 = equal blend (default), 1.0 = reranker score only.",
            "format": "float",
            "default": 0.5
          },
          "top_k": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "If specified, returns only the top K results after reranking. If not specified, returns all results.",
            "format": "int32"
          },
          "normalize": {
            "type": "boolean",
            "description": "If true, reranker scores are normalized using sigmoid before blending. Defaults to true.",
            "default": true
          }
        },
        "description": "Request body for the Rerank API. Applies alpha-blended score fusion to search results."
      },
      "RerankResponse": {
        "required": [
          "results",
          "model",
          "alpha"
        ],
        "type": "object",
        "properties": {
          "results": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/RerankedResult"
            },
            "description": "The reranked results sorted by blended score descending."
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The reranking model used."
          },
          "alpha": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The alpha blending factor used.",
            "format": "float"
          }
        },
        "description": "Response body for the Rerank API. Contains reranked results with blended scores."
      },
      "RerankScoredResult": {
        "required": [
          "index",
          "document",
          "score"
        ],
        "type": "object",
        "properties": {
          "index": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The zero-based index of the document in the original input array.",
            "format": "int32"
          },
          "document": {
            "type": [
              "null",
              "string"
            ],
            "description": "The document text that was scored."
          },
          "score": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The relevance score. When normalized, this is in [0,1] range where higher values indicate greater relevance.",
            "format": "float"
          }
        },
        "description": "A single scored result from a reranking operation."
      },
      "RerankScoreRequest": {
        "required": [
          "query",
          "documents"
        ],
        "type": "object",
        "properties": {
          "query": {
            "type": [
              "null",
              "string"
            ],
            "description": "The query text to score documents against."
          },
          "documents": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "A list of text passages to score against the query."
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The reranking model identifier. If not provided, the default reranking model is used."
          },
          "normalize": {
            "type": "boolean",
            "description": "If true, scores are normalized to [0,1] range using sigmoid. Defaults to true.",
            "default": true
          },
          "top_k": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "If specified, returns only the top K results sorted by score descending. If not specified, returns all results.",
            "format": "int32"
          }
        },
        "description": "Request body for the Rerank Score API. Scores one or more documents against a query."
      },
      "RerankScoreResponse": {
        "required": [
          "results",
          "model"
        ],
        "type": "object",
        "properties": {
          "results": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/RerankScoredResult"
            },
            "description": "The list of scored results, sorted by score descending."
          },
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The reranking model used for scoring."
          }
        },
        "description": "Response body for the Rerank Score API. Contains scored results for each document."
      },
      "ResponseFormatSpec.JsonSchemaSpec": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "schema": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          }
        }
      },
      "RestartReportAcknowledgeRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SearchHitResponse": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "description": "The matching document's id.",
            "format": "uuid"
          },
          "collection_id": {
            "type": "string",
            "description": "The collection the matching document belongs to.",
            "format": "uuid"
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The document's display name, as supplied at index time."
          },
          "source_uri": {
            "type": [
              "null",
              "string"
            ],
            "description": "The document's source location, as supplied at index time."
          },
          "snippet": {
            "type": [
              "null",
              "string"
            ],
            "description": "A highlighted excerpt of the matching page. A leading excerpt when the match was purely semantic. Null when no excerpt is available."
          },
          "context": {
            "type": [
              "null",
              "string"
            ],
            "description": "The surrounding content requested via 'context_expansion': the matched chunk with its neighbor chunks, or the matched page's full stored Markdown. Null when no expansion was requested."
          },
          "custom_metadata": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "The free-form string key/value pairs supplied with the document at index time. Omitted when none were set."
          },
          "score": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "How well the document matches the query; higher is more relevant.",
            "format": "double"
          },
          "ft_rank": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "In hybrid search, the document's rank among word-based matches (1 = best). Null when it did not match on words.",
            "format": "int32"
          },
          "vec_rank": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "In hybrid search, the document's rank among meaning-based matches (1 = best). Null when it did not match on meaning.",
            "format": "int32"
          },
          "page_number": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The page of the document that best matches the query (1-based).",
            "format": "int32"
          },
          "page_layout": {
            "description": "The matched page's physical layout, including paragraphs, lines, words, and bounding boxes, as captured at index time. Returned only when the request sets 'include_page_layout' to true; null when the layout was not requested or none was captured for the page.",
            "$ref": "#/components/schemas/PageLayout"
          },
          "indexed_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the document was last indexed.",
            "format": "date-time"
          },
          "page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Total number of pages in the document.",
            "format": "int32"
          }
        },
        "description": "A ranked document reference returned by a search, with the matching page and document metadata."
      },
      "SearchMatchResult": {
        "required": [
          "text",
          "snippet",
          "score",
          "page_number"
        ],
        "type": "object",
        "properties": {
          "text": {
            "type": [
              "null",
              "string"
            ],
            "description": "The exact matched text from the document."
          },
          "snippet": {
            "type": [
              "null",
              "string"
            ],
            "description": "A snippet of surrounding text providing context for the match."
          },
          "score": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Relevance score in the range [0..1]. 1.0 for exact matches.",
            "format": "double"
          },
          "page_number": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The 1-based page number where this match was found.",
            "format": "int32"
          },
          "bounds": {
            "description": "The bounding box of the matched text on the page, in points. Null if layout coordinates are unavailable.",
            "$ref": "#/components/schemas/BoundsResult"
          }
        },
        "description": "A single search match found within the document."
      },
      "SearchModeOption": {
        "enum": [
          "Text",
          "Regex",
          "Fuzzy"
        ],
        "description": "- `Text`: Exact substring matching.\n- `Regex`: Regular expression matching.\n- `Fuzzy`: Approximate matching using Damerau-Levenshtein edit distance."
      },
      "SearchRequest": {
        "required": [
          "tenant_id",
          "query"
        ],
        "type": "object",
        "properties": {
          "cluster_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search cluster that holds the tenant and collection. If not provided, the default cluster is used."
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant that owns the collection.",
            "format": "uuid"
          },
          "collection_id": {
            "type": "string",
            "description": "A single collection to search. Ignored when 'collection_ids' is provided.",
            "format": "uuid"
          },
          "collection_ids": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The set of collections to search in one query. Takes precedence over 'collection_id'. For semantic or hybrid search, every collection must share the same embedding model."
          },
          "query": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search query text.",
            "default": ""
          },
          "search_type": {
            "description": "How to match: 'FullText' matches on the words a document contains (always available), 'Semantic' matches on meaning, and 'Hybrid' combines both. 'Semantic' and 'Hybrid' require the collection to have semantic search enabled.",
            "default": "FullText",
            "$ref": "#/components/schemas/SearchType"
          },
          "top_k": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Maximum number of documents to return.",
            "format": "int32",
            "default": 20
          },
          "candidates": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Hybrid search only. How many candidate matches to weigh before producing the final ranking; higher can improve quality, lower is faster.",
            "format": "int32",
            "default": 100
          },
          "rerank": {
            "type": "boolean",
            "description": "When true, a cross-encoder reranking pass re-scores the top retrieved candidates by direct query-document relevance and returns them in that order. It lifts precision in every mode (full-text, semantic, hybrid) at the cost of one extra inference pass over the candidates, so it is off by default and enabled per request when quality matters more than latency.",
            "default": false
          },
          "rerank_top_n": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "How many top candidates the reranking pass re-scores when 'rerank' is true (clamped to top_k..200). This is the over-fetch: the store retrieves rerank_top_n candidates instead of top_k, the reranker re-scores them all, and the best top_k are returned, so a document the first-stage ranker placed below the top_k cut can still surface. A larger pool can find a better top result at the cost of more reranking work. Ignored when 'rerank' is false. Defaults to 50.",
            "format": "int32",
            "default": 50
          },
          "rerank_alpha": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "How much the reranker's judgment outweighs the first-stage retrieval score when 'rerank' is true, 0..1. At 1 (the default) the reranker's ordering and scores are used as-is. Below 1, both scores are min-max normalized over the candidate pool and blended as alpha*rerank + (1-alpha)*retrieval, letting strong retrieval evidence temper an overconfident cross-encoder. Defaults to 0.5: at 1 the cross-encoder replaces the retrieval ranking outright, which measured WORSE than not reranking at all on every corpus tried. Ignored when 'rerank' is false.",
            "format": "double",
            "default": 0.5
          },
          "max_chunks_per_document": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Maximum result entries per document, 1..10. The default of 1 returns each matching document once, at its best-matching page. Raising it lets a strongly matching document surface up to that many of its matched pages as separate results (same document_id, different page_number), which suits RAG context assembly; 'top_k' still caps the total result count.",
            "format": "int32",
            "default": 1
          },
          "recency_bias": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "How much freshness matters, 0..1. Folds an exponential decay on each document's indexed-at timestamp into its relevance score (score * ((1-bias) + bias * 2^(-age/half_life))), for every search type. 0 (the default) changes nothing; at 1, a document one half-life old is worth half its original score, and a document with no indexed-at decays fully. Unlike sort=Recency (a hard newest-first ordering, full-text only), this blends freshness INTO relevance; the two cannot be combined. Applied over the retrieved candidate pool, before the top_k cut.",
            "format": "double",
            "default": 0
          },
          "recency_half_life_days": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The recency decay half-life in days (how old a document must be for its freshness weight to halve). Used only when 'recency_bias' is above 0. Defaults to 30.",
            "format": "double",
            "default": 30
          },
          "recency_key": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional custom_metadata key whose ISO-8601 value dates each document for the recency decay. By default the decay reads indexed_at - but a bulk-imported archive is indexed today while its CONTENT is years old; naming the metadata key that carries the content date (e.g. 'date') makes freshness mean what the reader means. A document whose value is missing or unparseable falls back to indexed_at. Used only when 'recency_bias' is above 0."
          },
          "context_expansion": {
            "description": "How much surrounding content each hit carries in its 'context' field. 'None' (default): no context. 'Chunk': the matched chunk plus its immediate neighbor chunks on the same page (semantic and hybrid matches; full-text matches are page-level and fall back to the full page). 'Page': the matched page's full stored Markdown. Context can be large; request it when the caller assembles RAG prompts from the results.",
            "default": "None",
            "$ref": "#/components/schemas/ContextExpansion"
          },
          "mmr": {
            "type": "boolean",
            "description": "When true, re-selects the results with Maximal Marginal Relevance for diversity: each pick balances relevance against similarity to the already-picked results, so near-duplicate passages stop crowding out distinct ones. Semantic search only (400 otherwise); selection runs over the 'candidates' pool. Cannot be combined with 'rerank' or a non-zero 'offset'.",
            "default": false
          },
          "query_mode": {
            "description": "How the query is understood before retrieval. 'Original' (default): search with the query as sent. 'Contextual': rewrite a follow-up question into a self-contained query using 'chat_history'. 'MultiQuery': generate alternative phrasings ('query_variants' of them), retrieve for each, and fuse the ranked lists with Reciprocal Rank Fusion. 'Hyde': generate a hypothetical answer passage and embed it in place of the query for the semantic arm (semantic and hybrid only; opt-in, it can add latency and hurt precise queries). Every mode beyond 'Original' runs the tenant's query-understanding model ('query_model'), a small local LLM, adding one generation pass (typically tens to a few hundred milliseconds on a small model; MultiQuery additionally multiplies retrieval by the variant count). When no query model is configured or it cannot be loaded, the search degrades to the original query and 'query_understanding.applied_mode' in the response says so.",
            "default": "Original",
            "$ref": "#/components/schemas/QueryMode"
          },
          "chat_history": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ChatTurn"
            },
            "description": "Prior conversation turns (oldest first) used by 'query_mode': for 'Contextual' it is required and drives the rewrite; for 'MultiQuery' and 'Hyde' it is optional and, when present, the query is contextualized first, mirroring grounded-chat behavior."
          },
          "query_variants": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "MultiQuery only: how many alternative phrasings to generate (1..5). The original query is always searched as well. Defaults to 3.",
            "format": "int32",
            "default": 3
          },
          "mmr_lambda": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The MMR relevance/diversity balance, 0..1: 1 is pure relevance (plain top-k), 0 is pure diversity. Used only when 'mmr' is true. Defaults to 0.5.",
            "format": "double",
            "default": 0.5
          },
          "filters": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "Optional metadata filter: only documents whose custom_metadata contains all of these key/value pairs are returned. Applied during ranking, so top_k still returns the best matches that pass the filter. For operators beyond exact equality (ranges, or-composition, in/nin, exists), use 'filter' instead; the two are mutually exclusive."
          },
          "filter": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Optional metadata filter expression over custom_metadata, with typed operator algebra. A filter is a tree of comparison nodes {\"type\":op,\"key\":k,\"value\":v} with op one of eq, ne, gt, gte, lt, lte, in, nin, exists, and composite nodes {\"type\":\"and\"|\"or\",\"filters\":[...]}; the comparison shape is a superset of the OpenAI attribute-filter format. Values are typed: a JSON string compares as text (ordinal), a JSON number compares numerically, a JSON boolean compares as boolean, and a string value with \"value_type\":\"date\" compares as an ISO 8601 timestamp. Metadata values are stored as strings; a stored value that cannot be interpreted in the requested domain never matches. Every comparison except exists with value false requires the key to be present, including ne and nin. 'in'/'nin' take an array value; 'exists' takes an optional boolean value (default true). Limits: nesting depth 8, 128 conditions in total, 128 values per in/nin list. Applied during ranking, so top_k still returns the best matches that pass the filter. Mutually exclusive with 'filters'. Example: {\"type\":\"and\",\"filters\":[{\"type\":\"eq\",\"key\":\"status\",\"value\":\"published\"},{\"type\":\"gte\",\"key\":\"year\",\"value\":2024}]}",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "offset": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of leading results to skip, for pagination. Use it with top_k as the page size (offset 0, then top_k, then 2*top_k, and so on); a page shorter than top_k is the last page. Defaults to 0. For hybrid search, paging depth is bounded by 'candidates'.",
            "format": "int32",
            "default": 0
          },
          "sort": {
            "description": "Result ordering. 'Relevance' (default) ranks by match score. 'Recency' orders most-recently-indexed first and is supported for full-text search only; semantic and hybrid searches return 400 Bad Request when 'Recency' is requested, because their results are top-K by relevance.",
            "default": "Relevance",
            "$ref": "#/components/schemas/SearchSort"
          },
          "facets": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Optional custom_metadata field names to compute facet counts for: document counts per value, not just over the returned page. Full-text counts the whole match set exactly; semantic and hybrid count the ranked candidate pool (deepened when facets are requested) and 'facets_exact' on the response says whether the counts cover everything. Best for low-cardinality fields such as department, status, or type."
          },
          "include_page_layout": {
            "type": "boolean",
            "description": "When true, each result includes the matched page's stored layout (the text blocks and their positions captured at index time) in 'page_layout'. The layout is typically the largest part of a hit, so enabling it produces significantly larger responses; it is off by default, and the layout is then not read from storage at all. Enable it when the caller renders or highlights the matched page.",
            "default": false
          },
          "min_score": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Optional relevance floor: drop results scoring below this value. For full-text the score is the text rank, for semantic it is cosine similarity (0..1), and for hybrid it is the normalized Reciprocal Rank Fusion score (0..1). Defaults to 0 (no floor).",
            "format": "double",
            "default": 0
          },
          "fusion": {
            "description": "Hybrid search only. How the full-text and semantic arms are combined: 'Convex' (default: weighted combination of normalized scores, which preserves each arm's confidence) or 'Rrf' (Reciprocal Rank Fusion, rank-based). The arm weights apply to both.",
            "$ref": "#/components/schemas/HybridFusion"
          },
          "full_text_weight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Hybrid search only. Weight of the full-text arm in fusion. When omitted, the fusion mode's default applies: equal arms under Rrf, 1:9 favoring the semantic arm under Convex.",
            "format": "double"
          },
          "semantic_weight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Hybrid search only. Weight of the semantic arm in fusion. When omitted, the fusion mode's default applies: equal arms under Rrf, 1:9 favoring the semantic arm under Convex.",
            "format": "double"
          },
          "name_boost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Hybrid search only. Lifts documents whose name/title matches the query toward 1, by this fraction of the score's remaining headroom, so title hits rank above body-only hits while the fused score stays in 0..1. Range 0..1 (values outside are clamped); defaults to 0 (off). For example 0.2 closes 20% of the gap between a hit's fused score and 1.",
            "format": "double",
            "default": 0
          }
        },
        "description": "Request body for searching one or more collections."
      },
      "SearchResponse": {
        "type": "object",
        "properties": {
          "mode": {
            "description": "Which kind of search produced these results: 'fulltext', 'semantic', or 'hybrid'.",
            "$ref": "#/components/schemas/SearchType"
          },
          "results": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/SearchHitResponse"
            },
            "description": "Matching documents, most relevant first."
          },
          "facets": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "pattern": "^-?(?:0|[1-9]\\d*)$",
                "type": [
                  "integer",
                  "string"
                ],
                "format": "int32"
              }
            },
            "description": "Document counts per metadata value for each requested facet field. Full-text counts the whole match set exactly; semantic/hybrid count the ranked candidate pool (deepened when facets are requested, per distinct document). Omitted when no facets were requested."
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "How many DISTINCT documents the ranked candidate pool held, present when facets were requested (the retrieval deepens for them). With total_exact false the pool hit its depth: treat the value as a lower bound ('N+'). Omitted otherwise.",
            "format": "int64"
          },
          "total_exact": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether 'total' covers everything (the pool ran dry below its ceiling). Omitted without 'total'."
          },
          "facets_exact": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether the facet counts cover everything they claim to: true for full-text (exact over the whole match set) and for a meaning-aware candidate pool that ran dry below its ceiling; false when the pool hit its depth - render such counts as lower bounds ('n+'). Omitted without facets."
          },
          "query_understanding": {
            "description": "What the query-understanding step did (the mode that actually ran, the effective query, generated phrasings, HyDE passage). Omitted when the request used query_mode 'Original'.",
            "$ref": "#/components/schemas/QueryUnderstandingResponse"
          },
          "rerank_applied": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether the requested reranking pass actually ran. False means the tenant has no reranking model that loads, so the retrieval order was kept: search degrades rather than failing, and this is how that degradation is told apart from a reranker that changed nothing. Omitted when reranking was not requested."
          }
        },
        "description": "Search results, scoped to one tenant and collection."
      },
      "SearchServiceClusterCreateRequest": {
        "type": "object",
        "properties": {
          "clusterId": {
            "type": [
              "null",
              "string"
            ]
          },
          "isDefault": {
            "type": "boolean"
          },
          "fullTextStore": {
            "type": [
              "null",
              "string"
            ]
          },
          "vectorStore": {
            "type": [
              "null",
              "string"
            ]
          },
          "qdrantUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "qdrantApiKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "dataDirectory": {
            "type": [
              "null",
              "string"
            ]
          },
          "connectionString": {
            "type": [
              "null",
              "string"
            ]
          },
          "host": {
            "type": [
              "null",
              "string"
            ]
          },
          "port": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "database": {
            "type": [
              "null",
              "string"
            ]
          },
          "username": {
            "type": [
              "null",
              "string"
            ]
          },
          "password": {
            "type": [
              "null",
              "string"
            ]
          },
          "adminUsername": {
            "type": [
              "null",
              "string"
            ]
          },
          "adminPassword": {
            "type": [
              "null",
              "string"
            ]
          },
          "maxConnections": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "SearchServiceCollectionRebuildRequest": {
        "type": "object",
        "properties": {
          "rebuild_semantic": {
            "type": "boolean"
          },
          "rebuild_full_text": {
            "type": "boolean"
          }
        }
      },
      "SearchServiceCollectionUpdateRequest": {
        "type": "object",
        "properties": {
          "display_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "languages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SearchServiceExplainRequest": {
        "type": "object",
        "properties": {
          "tenant_id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "query": {
            "type": [
              "null",
              "string"
            ]
          },
          "ft_config": {
            "type": [
              "null",
              "string"
            ]
          },
          "mode": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SearchServiceFailedCaptureRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "directory": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SearchServiceIngestionLimitsRequest": {
        "type": "object",
        "properties": {
          "maxCharsPerPage": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxCharsPerNonPaginatedPage": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxPagesPerDocument": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "SearchServiceQualityGateRequest": {
        "type": "object",
        "properties": {
          "mode": {
            "type": [
              "null",
              "string"
            ]
          },
          "profile": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SearchServiceReindexParallelismRequest": {
        "type": "object",
        "properties": {
          "parallelism": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "SearchServiceStorageRequest": {
        "type": "object",
        "properties": {
          "maxStorageGb": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "SearchServiceTenantAccessRequest": {
        "type": "object",
        "properties": {
          "apiKeyId": {
            "type": [
              "null",
              "string"
            ]
          },
          "grant": {
            "type": "boolean"
          }
        }
      },
      "SearchServiceTenantConfigRequest": {
        "type": "object",
        "properties": {
          "embedding_model": {
            "type": [
              "null",
              "string"
            ]
          },
          "enable_full_text_search": {
            "type": "boolean"
          },
          "enable_semantic_search": {
            "type": "boolean"
          },
          "enable_ocr": {
            "type": "boolean"
          },
          "ocr_noise_rejection": {
            "type": "boolean"
          },
          "normalization": {
            "$ref": "#/components/schemas/SearchServiceTenantNormalizationRequest"
          },
          "rerank_model": {
            "type": [
              "null",
              "string"
            ]
          },
          "query_model": {
            "type": [
              "null",
              "string"
            ]
          },
          "quality_gate_mode": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SearchServiceTenantCreateRequest": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "grantKeyIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SearchServiceTenantModelRequest": {
        "type": "object",
        "properties": {
          "embedding_model": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SearchServiceTenantNormalizationRequest": {
        "type": "object",
        "properties": {
          "fold_case": {
            "type": "boolean"
          },
          "fold_diacritics": {
            "type": "boolean"
          },
          "normalize_unicode": {
            "type": "boolean"
          },
          "enable_stemming": {
            "type": "boolean"
          }
        }
      },
      "SearchServiceTenantOcrRequest": {
        "type": "object",
        "properties": {
          "enable_ocr": {
            "type": "boolean"
          }
        }
      },
      "SearchServiceTenantSearchModesRequest": {
        "type": "object",
        "properties": {
          "enable_full_text_search": {
            "type": "boolean"
          },
          "enable_semantic_search": {
            "type": "boolean"
          }
        }
      },
      "SearchServiceTenantWhaleRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "SearchSort": {
        "enum": [
          "Relevance",
          "Recency"
        ],
        "description": "- `Relevance`: Order by match relevance, best first.\n- `Recency`: Order by most recently indexed first. Full-text search only."
      },
      "SearchType": {
        "enum": [
          "FullText",
          "Semantic",
          "Hybrid"
        ],
        "description": "- `FullText`: Matches documents by the words they contain. Always available.\n- `Semantic`: Matches documents by meaning. Requires the collection to have semantic search enabled.\n- `Hybrid`: Combines word and meaning matching. Requires the collection to have semantic search enabled."
      },
      "SecuritySettings.OidcSettings": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "authority": {
            "type": [
              "null",
              "string"
            ]
          },
          "audience": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerClaim": {
            "type": [
              "null",
              "string"
            ]
          },
          "requiredScope": {
            "type": [
              "null",
              "string"
            ]
          },
          "readOnlyScope": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SecurityUpdate.OidcUpdate": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "authority": {
            "type": [
              "null",
              "string"
            ]
          },
          "audience": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerClaim": {
            "type": [
              "null",
              "string"
            ]
          },
          "requiredScope": {
            "type": [
              "null",
              "string"
            ]
          },
          "readOnlyScope": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SegmentResult": {
        "required": [
          "start_page",
          "end_page",
          "page_count",
          "label"
        ],
        "type": "object",
        "properties": {
          "start_page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The 1-based page number where this segment starts (inclusive).",
            "format": "int32"
          },
          "end_page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The 1-based page number where this segment ends (inclusive).",
            "format": "int32"
          },
          "page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of pages in this segment.",
            "format": "int32"
          },
          "label": {
            "type": [
              "null",
              "string"
            ],
            "description": "The descriptive label assigned by the model for this segment (e.g., 'Invoice', 'Contract')."
          },
          "file_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file ID of the split PDF for this segment, stored on the server. Only present when 'split_documents' is true in the request. To download: GET /lmkit/v1/files/{file_id}. To use in another endpoint (e.g., document-to-markdown, summarization, search/documents): pass this ID as the 'input' field with input_format set to 'FileIdentifier'. To delete: DELETE /lmkit/v1/files/{file_id}. Files are automatically deleted after the server's configured file retention period."
          }
        },
        "description": "A single detected document segment within the source PDF."
      },
      "SentimentAnalysisRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The identifier of the language model to be used for analysis. If not provided, the default model is used.",
            "default": ""
          },
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The text to analyze.",
            "default": ""
          },
          "enable_sentiment": {
            "type": "boolean",
            "description": "When true, performs sentiment classification (Positive, Negative, or Neutral). Defaults to true.",
            "default": true
          },
          "sentiment_neutral_support": {
            "type": "boolean",
            "description": "When true, enables 3-way sentiment classification (Positive, Negative, Neutral). When false, uses 2-way classification (Positive, Negative). Only applies when enable_sentiment is true. Defaults to false.",
            "default": false
          },
          "enable_emotion": {
            "type": "boolean",
            "description": "When true, performs emotion detection (Happiness, Anger, Sadness, Fear, Neutral). Defaults to false.",
            "default": false
          },
          "emotion_neutral_support": {
            "type": "boolean",
            "description": "When true, includes 'Neutral' in the emotion categories (5-way). When false, uses 4-way classification. Only applies when enable_emotion is true. Defaults to true.",
            "default": true
          },
          "enable_sarcasm": {
            "type": "boolean",
            "description": "When true, performs sarcasm detection. Defaults to false.",
            "default": false
          }
        },
        "description": "Request body for the Sentiment Analysis API. Performs sentiment analysis, emotion detection, and/or sarcasm detection on the input text. Each analyser can be independently enabled or disabled."
      },
      "SentimentAnalysisResponse": {
        "type": "object",
        "properties": {
          "sentiment": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The detected sentiment category. Only present when enable_sentiment is true.",
                "$ref": "#/components/schemas/SentimentCategory"
              }
            ]
          },
          "sentiment_confidence": {
            "maximum": 1,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Confidence score for the sentiment classification (0.0-1.0). Only present when enable_sentiment is true.",
            "format": "float"
          },
          "emotion": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The detected emotion category. Only present when enable_emotion is true.",
                "$ref": "#/components/schemas/EmotionCategory"
              }
            ]
          },
          "emotion_confidence": {
            "maximum": 1,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Confidence score for the emotion classification (0.0-1.0). Only present when enable_emotion is true.",
            "format": "float"
          },
          "is_sarcastic": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "True if the text is identified as sarcastic; false otherwise. Only present when enable_sarcasm is true."
          },
          "sarcasm_confidence": {
            "maximum": 1,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Confidence score for the sarcasm detection (0.0-1.0). Only present when enable_sarcasm is true.",
            "format": "float"
          }
        },
        "description": "Sentiment Analysis API response. Contains the results of the enabled analysers (sentiment, emotion, and/or sarcasm) with confidence scores. Only fields for enabled analysers are present in the response."
      },
      "SentimentCategory": {
        "enum": [
          "Neutral",
          "Negative",
          "Positive",
          null
        ]
      },
      "SetupAnswers": {
        "type": "object",
        "properties": {
          "networkAccess": {
            "type": [
              "null",
              "string"
            ]
          },
          "confirmExposure": {
            "type": "boolean"
          },
          "ssoAuthority": {
            "type": [
              "null",
              "string"
            ]
          },
          "ssoClientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "ssoClientSecret": {
            "type": [
              "null",
              "string"
            ]
          },
          "ssoProviderName": {
            "type": [
              "null",
              "string"
            ]
          },
          "ssoAllowedEmails": {
            "type": [
              "null",
              "string"
            ]
          },
          "toolPreset": {
            "type": [
              "null",
              "string"
            ]
          },
          "tools": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "fileRoots": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "modelUse": {
            "type": [
              "null",
              "string"
            ]
          },
          "modelId": {
            "type": [
              "null",
              "string"
            ]
          },
          "services": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "mcpEnabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "playgroundEnabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "trainingEnabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "docsEnabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "toolsEnabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "memoryEnabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "anonymousAccess": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "claudeShapes": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "$ref": "#/components/schemas/SetupAnswers.ClaudeShape"
            }
          }
        }
      },
      "SetupAnswers.ClaudeShape": {
        "type": "object",
        "properties": {
          "slots": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "window": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "SimilarDocumentHitResponse": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "description": "The similar document's id.",
            "format": "uuid"
          },
          "collection_id": {
            "type": "string",
            "description": "The collection the similar document belongs to.",
            "format": "uuid"
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The document's display name, as supplied at index time."
          },
          "source_uri": {
            "type": [
              "null",
              "string"
            ],
            "description": "The document's source location, as supplied at index time."
          },
          "custom_metadata": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "The free-form string key/value pairs supplied with the document at index time. Omitted when none were set."
          },
          "score": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "How similar this document's content is to the query document's, 0..1 (cosine similarity of the document vectors). Near-duplicates typically score above 0.9; byte-identical content lands just below 1 (half-precision storage), never exactly 1.",
            "format": "double"
          },
          "text_similarity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "The literal-text overlap with the query document (token-shingle containment normalized by the smaller side, 0..1), present only when the request set 'verify_text'. Near 1 = the same text re-scanned or re-exported; low despite a high 'score' = same topic or template, different document. Null when either side has no comparable text (e.g. an image with no recovered layer).",
            "format": "double"
          },
          "query_text_in_hit": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "The share of the QUERY document's text found in this hit (0..1), present only when the request set 'verify_text'. Together with 'hit_text_in_query' this carries the DIRECTION that 'text_similarity' erases: both near 1 = the same text re-scanned or re-exported; this near 1 while 'hit_text_in_query' stays low = the query document is an excerpt (e.g. one page) of this hit. Null when either side has no comparable text.",
            "format": "double"
          },
          "hit_text_in_query": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "The share of THIS document's text found in the query document (0..1), present only when the request set 'verify_text'. Near 1 while 'query_text_in_hit' stays low = this hit is an excerpt (e.g. one page) of the query document. Null when either side has no comparable text.",
            "format": "double"
          },
          "page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Total number of pages in the document.",
            "format": "int32"
          },
          "indexed_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the document was last indexed.",
            "format": "date-time"
          }
        },
        "description": "A document ranked by its similarity to the query document, with its registry metadata."
      },
      "SimilarDocumentsRequest": {
        "required": [
          "tenant_id",
          "collection_id",
          "document_id"
        ],
        "type": "object",
        "properties": {
          "cluster_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The search cluster that holds the tenant and collection. If not provided, the default cluster is used."
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant that owns the collection.",
            "format": "uuid"
          },
          "collection_id": {
            "type": "string",
            "description": "The collection the query document belongs to.",
            "format": "uuid"
          },
          "document_id": {
            "type": "string",
            "description": "The id of the document to find similar documents for, as supplied at index time.",
            "format": "uuid"
          },
          "search_collection_ids": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The collections to look for similar documents in. Omit to search the query document's own collection. Several collections can be searched in one call (a tenant's collections always share one embedding model); unknown ids are skipped. The query document itself is never returned."
          },
          "top_k": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Maximum number of documents to return (1..200).",
            "format": "int32",
            "default": 20
          },
          "min_score": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Optional similarity floor: drop results scoring below this value. The score is the cosine similarity between document vectors, 0..1 - near-duplicates typically score above 0.9, unrelated documents well below. Defaults to 0 (no floor).",
            "format": "double",
            "default": 0
          },
          "verify_text": {
            "type": "boolean",
            "description": "When true, each hit also carries 'text_similarity': the literal-text overlap (token-shingle containment, 0..1) between the two documents' stored content. The vector score says the documents TALK about the same thing; this says they ARE the same text - the check that separates a re-scanned or re-exported copy from two different documents built on the same template. Costs one stored-text read per hit; off by default. Null on a hit when either side has no comparable text.",
            "default": false
          },
          "filters": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "Optional metadata filter: only documents whose custom_metadata contains all of these key/value pairs are returned. Applied during ranking, so top_k still returns the best matches that pass the filter. For operators beyond exact equality, use 'filter' instead; the two are mutually exclusive."
          },
          "filter": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Optional metadata filter expression over custom_metadata, with the same typed operator algebra as the search endpoint (eq, ne, gt, gte, lt, lte, in, nin, exists with and/or composition). Mutually exclusive with 'filters'.",
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          }
        },
        "description": "Request body for listing the documents most similar to a given document. The query document's stored document vector is the query - no text and no inference is involved - so similarity means \"this document's content resembles that document's content\" (near-duplicates score highest). Requires the tenant to have semantic search enabled; the document must have been embedded (embedding is deferred by default - the response 'state' reports 'embedding_pending' until it lands)."
      },
      "SimilarDocumentsResponse": {
        "type": "object",
        "properties": {
          "state": {
            "description": "Whether the query document was ready to compare. 'ready': results are meaningful (and may legitimately be empty when nothing clears 'min_score'). 'embedding_pending': the document's embedding has not landed yet - transient, poll again shortly. 'no_content': the document has nothing to compare (for example an empty document) - permanent, do not retry.",
            "$ref": "#/components/schemas/SimilarDocumentsState"
          },
          "results": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/SimilarDocumentHitResponse"
            },
            "description": "The similar documents, most similar first. Empty unless 'state' is 'ready'."
          }
        },
        "description": "The documents most similar to the query document, most similar first."
      },
      "SimilarDocumentsState": {
        "enum": [
          "ready",
          "embedding_pending",
          "no_content"
        ],
        "description": "Whether the query document was ready for document-to-document similarity. 'ready': its document vector exists and the results are meaningful. 'embedding_pending': the document is indexed but its embedding has not landed yet (embedding is deferred by default, or a backfill is in progress) - transient, poll again. 'no_content': the document is embedded but produced no comparable content (no chunks, e.g. an empty document) - permanent, do not retry.\n\n- `Ready`\n- `EmbeddingPending`\n- `NoContent`"
      },
      "SkillDraftRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "audience": {
            "type": [
              "null",
              "string"
            ]
          },
          "tone": {
            "type": [
              "null",
              "string"
            ]
          },
          "format": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SkillEditRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "instructions": {
            "type": [
              "null",
              "string"
            ]
          },
          "manualOnly": {
            "type": "boolean"
          }
        }
      },
      "SkillInstallRequest": {
        "type": "object",
        "properties": {
          "names": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SkillResourceRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "path": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SkillUrlRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SkipThinkingRequest": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The request_id the exchange was started with."
          }
        }
      },
      "SourceReferenceDto": {
        "type": "object",
        "properties": {
          "document_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The name of the source document."
          },
          "page_number": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The page number where the passage was found (1-based).",
            "format": "int32"
          },
          "excerpt": {
            "type": [
              "null",
              "string"
            ],
            "description": "The text excerpt from the document."
          },
          "similarity_score": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The similarity score between the query and this passage (0.0 to 1.0).",
            "format": "float"
          }
        },
        "description": "A reference to a source passage in the document."
      },
      "SplitPartResult": {
        "required": [
          "file_id",
          "page_range",
          "page_count"
        ],
        "type": "object",
        "properties": {
          "file_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The file ID of this split part, stored on the server. To download: GET /lmkit/v1/files/{file_id}. To use in another endpoint (e.g., pdf-merge, document-to-markdown, pdf-search, pdf-layout): pass this ID as the 'input' field with input_format set to 'FileIdentifier'. To delete: DELETE /lmkit/v1/files/{file_id}. Files are automatically deleted after the server's configured file retention period."
          },
          "page_range": {
            "type": [
              "null",
              "string"
            ],
            "description": "The page range string that produced this part."
          },
          "page_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The number of pages in this split part.",
            "format": "int32"
          }
        },
        "description": "A single part produced by the PDF split operation."
      },
      "StreamTicketRequest": {
        "type": "object",
        "properties": {
          "purpose": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "StringSegment": {
        "type": "object",
        "properties": {
          "buffer": {
            "type": [
              "null",
              "string"
            ]
          },
          "offset": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "length": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "value": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasValue": {
            "type": "boolean"
          }
        }
      },
      "StructuredExtractionElementBounds": {
        "type": "object",
        "properties": {
          "x0": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "y0": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "x1": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "y1": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "x2": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "y2": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "x3": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "y3": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        },
        "description": "Quadrilateral bounds of an extracted value in page coordinates: (x0,y0) top-left, (x1,y1) top-right, (x2,y2) bottom-right, (x3,y3) bottom-left."
      },
      "StructuredExtractionElementDetail": {
        "type": "object",
        "properties": {
          "path": {
            "type": [
              "null",
              "string"
            ],
            "description": "Dotted path of the field inside the extracted JSON. Array rows use bracket syntax, e.g. \"items[0].unit_price\"."
          },
          "type": {
            "description": "The schema element type of the field (String, Integer, Double, Date, Bool, Object, arrays thereof, ...).",
            "$ref": "#/components/schemas/ElementType"
          },
          "confidence": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Per-field confidence in [0, 1], derived from token-probability analysis, or -1 when confidence data is unavailable for this field.",
            "format": "float"
          },
          "validation": {
            "description": "Entity validation status for the field value: \"valid\", \"repaired\" (auto-corrected), \"invalid\" or \"not_applicable\" (no validator exists for the detected entity kind).",
            "$ref": "#/components/schemas/EntityValidationStatus"
          },
          "entity_kind": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Auto-detected entity kind of the field (EmailAddress, Iban, PhoneNumber, ...). Omitted when no entity kind could be inferred.",
                "$ref": "#/components/schemas/EntityKind"
              }
            ]
          },
          "original_value": {
            "type": [
              "null",
              "string"
            ],
            "description": "The raw extracted value before automatic repair. Present only when validation is \"repaired\"."
          },
          "human_verification_required": {
            "type": "boolean",
            "description": "True when this field should be verified by a human: a missing value on a schema-REQUIRED field, low confidence, or a repaired/invalid value. A missing value on a non-required field is never flagged - absence of an optional value is an acceptable outcome."
          },
          "page_index": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Zero-based page index where the value was located in the source document, or -1 when the page could not be determined (e.g. plain-text input).",
            "format": "int32"
          },
          "bounds": {
            "description": "Bounding quadrilateral of the value in page coordinates (top-left, top-right, bottom-right, bottom-left). Omitted when the source location could not be resolved.",
            "$ref": "#/components/schemas/StructuredExtractionElementBounds"
          }
        },
        "description": "Per-field extraction detail: confidence, entity validation, human-verification flag and source location. Returned only when the request sets include_elements to true."
      },
      "StructuredExtractionPageInfo": {
        "required": [
          "unit"
        ],
        "type": "object",
        "properties": {
          "index": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Zero-based page index, matching each element's page_index.",
            "format": "int32"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Page width, in the bounds' coordinate space.",
            "format": "double"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Page height, in the bounds' coordinate space.",
            "format": "double"
          },
          "unit": {
            "description": "The measurement unit of width/height (and of the bounds): Pixels, DeviceIndependentPixels, Points, Inches, Millimeters or Centimeters. Informational - normalizing bounds by this page's own width/height needs no unit.",
            "$ref": "#/components/schemas/UnitMode"
          }
        },
        "description": "One source page's dimensions, in the coordinate space the extraction elements' bounds are expressed in."
      },
      "StructuredExtractionRequest": {
        "required": [
          "input",
          "jsonSchema"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The identifier of the language model to be used for structured extraction. If not provided, the default model is used.",
            "default": ""
          },
          "input": {
            "description": "Either a single string (plain text or Base64-encoded file).<br/>- If a single string: set “input_format” to PlainText or Base64EncodedFile.<br/>- If an array of strings: length must be even; each pair is “[imageFileBase64, associatedText]”<br/>&nbsp;&nbsp;• The first element of each pair is a Base64-encoded image file.<br/>&nbsp;&nbsp;• The second element is the text to associate with that image.<br/>Sending pairs of [image, text] activates multimodal extraction (image + text).",
            "default": ""
          },
          "input_format": {
            "description": "The format of the input data. Only used when “input” is a single string.<br/>Allowed: 'PlainText' or 'Base64EncodedFile'. Defaults to 'PlainText'.<br/>For 'Base64EncodedFile', supported formats include HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, and TIFF.<br/>Defaults to 'PlainText'.",
            "default": "PlainText",
            "$ref": "#/components/schemas/InputFormat"
          },
          "jsonSchema": {
            "description": "Configures the text extraction elements by parsing a JSON schema.<br/>\nThis string defines the structure, types, and optional descriptions of the extraction elements.<br/>\nThe 'type' field in the JSON must correspond to one of the supported element types.<br/>\nAllowed values are: char, string, integer, uint, short, ushort, long, ulong, bool, float, double, date, object, number, array.<br/>\nExample:<br/>\n<div class=\"json-container\">\n  <pre><code>\n{\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"title\": \"Invoice\",\n  \"description\": \"JSON schema for extracting and validating invoice data, including vendor, buyer, line items, and total amount.\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"invoice_number\": {\n      \"type\": \"string\",\n      \"trimStart\": [ \"INV/\", \"INV-\", \"INV\", \"INV#\" ]\n    },\n    \"invoice_date\": {\n      \"type\": \"string\",\n      \"format\": \"date\"\n    },\n    \"vendor\": {\n      \"type\": \"object\",\n      \"description\": \"Seller information.\",\n      \"properties\": {\n        \"name\": { \"type\": \"string\" },\n        \"tax_registration_id\": {\n          \"type\": \"string\",\n          \"trimStart\": [ \"VAT\", \"TVA\", \"GSTIN/UIN\" ]\n        },\n        \"email\": {\n          \"type\": \"string\",\n          \"format\": \"email\"\n        }\n      },\n      \"required\": [ \"name\" ]\n    },\n    \"bill_to\": {\n      \"type\": \"object\",\n      \"description\": \"Buyer information.\",\n      \"properties\": {\n        \"name\": {\n          \"type\": \"string\",\n          \"trimStart\": [ \"Monsieur \", \"Madame \", \"Prof \", \"Doctor \", \"Mrs \", \"Mr \", \"Ms \", \"Mlle \" ]\n        },\n        \"street_address\": { \"type\": \"string\" },\n        \"city\": { \"type\": \"string\" },\n        \"state\": { \"type\": \"string\" },\n        \"postal_code\": { \"type\": \"string\" },\n        \"country\": {\n          \"type\": \"string\",\n          \"description\": \"Two-letter country code.\",\n          \"enum\": [ \"DE\", \"FR\", \"US\", \"ES\", \"IN\", \"\" ]\n        },\n        \"phone\": { \"type\": \"string\" },\n        \"email\": {\n          \"type\": \"string\",\n          \"format\": \"email\"\n        },\n        \"site\": {\n          \"type\": \"string\",\n          \"format\": \"uri\"\n        }\n      },\n      \"required\": [ \"name\", \"street_address\", \"city\", \"state\", \"postal_code\", \"country\" ]\n    },\n    \"items\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"description\": { \"type\": \"string\" },\n          \"quantity\": { \"type\": \"number\" },\n          \"unit_price_net\": {\n            \"type\": \"number\",\n            \"description\": \"Unit price without tax.\"\n          },\n          \"total_price_gross\": {\n            \"type\": \"number\",\n            \"description\": \"Line total including tax.\"\n          }\n        },\n        \"required\": [ \"description\", \"quantity\", \"unit_price_net\", \"total_price_gross\" ]\n      }\n    },\n    \"total_amount\": {\n      \"type\": \"number\",\n      \"description\": \"Total invoice amount including tax.\"\n    }\n  },\n  \"required\": [ \"invoice_number\", \"invoice_date\", \"vendor\", \"bill_to\", \"items\", \"total_amount\" ]\n}\n  </code></pre>\n</div><br/>",
            "$ref": "#/components/schemas/JsonNode"
          },
          "enable_ocr": {
            "type": "boolean",
            "description": "Whether to use OCR for pages that contain no extractable text (e.g., scanned images). Requires an OCR provider to be configured on the server. Defaults to true.",
            "default": true
          },
          "guidance": {
            "type": [
              "null",
              "string"
            ],
            "description": "Additional guidance text that can influence the extraction process (e.g., focusing on certain themes).",
            "default": ""
          },
          "include_elements": {
            "type": "boolean",
            "description": "Whether to include the per-field element details (confidence, entity validation, human-verification flag, page index and bounds) in the response. Defaults to false.",
            "default": false
          }
        },
        "description": "Request body for the Structured Extraction API."
      },
      "StructuredExtractionResponse": {
        "required": [
          "json",
          "confidence"
        ],
        "type": "object",
        "properties": {
          "json": {
            "type": [
              "null",
              "string"
            ],
            "description": "The extracted structured elements as a JSON-encoded string. Call JSON.parse on this value to obtain the object tree."
          },
          "confidence": {
            "maximum": 1,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The confidence level. A floating-point value between 0 and 1, where a value closer to 1 indicates higher confidence in the extraction accuracy.",
            "format": "float"
          },
          "human_verification_required": {
            "type": "boolean",
            "description": "True when at least one extracted field should be verified by a human: a missing value on a schema-REQUIRED field, low confidence, or a repaired/invalid value. Missing values on non-required fields are never flagged."
          },
          "elements": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/StructuredExtractionElementDetail"
            },
            "description": "Per-field extraction details (confidence, entity validation, human-verification flag, page index and bounds). Present only when the request sets include_elements to true."
          },
          "pages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/StructuredExtractionPageInfo"
            },
            "description": "Per-page dimensions of the source document, in the SAME coordinate space as every element's bounds - so a client can place a bounding quadrilateral without any other layout knowledge (fractions of width/height are unit-free). Present only when the request sets include_elements to true and the input carries page layout (a document attachment; plain-text input has no pages)."
          }
        },
        "description": "Model for the Structured Extraction API response. Contains the JSON representation of the extracted structured elements."
      },
      "SummarizationIntent": {
        "enum": [
          "Classification",
          "Abstraction",
          null
        ]
      },
      "SummarizationRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The identifier of the language model to be used for summarization. If not provided, the default model is used.",
            "default": ""
          },
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input for summarization. When input_format is 'PlainText', provide raw text. When 'Base64EncodedFile', provide a base64-encoded file payload (supported: HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF). When 'FileIdentifier', provide the file ID previously returned by the api/v1/files/upload endpoint.",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'PlainText', 'Base64EncodedFile', or 'FileIdentifier'. 'Base64EncodedFile' supports: HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF. 'FileIdentifier' references a file previously uploaded via api/v1/files/upload. Defaults to 'PlainText'.",
            "default": "PlainText",
            "$ref": "#/components/schemas/InputFormat"
          },
          "max_content_words": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The maximum number of words allowed in the summarized content. Value is constrained between 0 and 2000 words. Defaults to 200.",
            "format": "int32",
            "default": 200
          },
          "generate_content": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Determines whether the summarization content should be generated. Defaults to true.",
            "default": true
          },
          "generate_title": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Determines whether the summarization title should be generated. Defaults to true.",
            "default": true
          },
          "max_title_words": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The maximum number of words allowed in the summarized title. Value is constrained between 0 and 50 words. Defaults to 10.",
            "format": "int32",
            "default": 10
          },
          "overflow_strategy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Specifies how to handle input that exceeds the maximum allowable context length determined by the model, system configuration, and available resources. Available options are defined in the OverflowResolutionStrategy enum.",
                "default": "Truncate",
                "$ref": "#/components/schemas/OverflowResolutionStrategy"
              }
            ]
          },
          "intent": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Specifies the summarization intent to apply. Use 'Classification' to identify the nature or category of the input (e.g., 'legal document'), or 'Abstraction' to generate a high-level summary capturing core ideas. Defaults to 'Classification'.",
                "$ref": "#/components/schemas/SummarizationIntent"
              }
            ]
          },
          "guidance": {
            "type": [
              "null",
              "string"
            ],
            "description": "Additional guidance text that can influence the summarization process (e.g., focusing on certain themes or tones).",
            "default": ""
          },
          "target_language": {
            "description": "Specifies the preferred language for the summarization output. If set to 'Undefined', the engine attempts to automatically detect the input content language and produces the summary accordingly (note: automatic detection may affect performance). When explicitly set, the engine attempts to interpret content and generate summaries in the selected language.",
            "default": "Undefined",
            "$ref": "#/components/schemas/Language"
          }
        },
        "description": "Request body for the Summarization API."
      },
      "SummarizationResponse": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "null",
              "string"
            ],
            "description": "The generated title of the summarized content. If no title is generated, this may be empty."
          },
          "summary": {
            "type": [
              "null",
              "string"
            ],
            "description": "The generated summarized content. If no content is generated, this may be empty."
          }
        },
        "description": "Model for the Summarization API response. Contains the generated title and summarized content."
      },
      "SupportedExtensionsResponse": {
        "type": "object",
        "properties": {
          "extensions": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Every accepted file extension - the union of 'document', 'audio', and 'media' - lowercase, dot-prefixed, sorted, without duplicates."
          },
          "document": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Extensions the document engine ingests (text, office documents, images, emails): content behind these can be parsed, indexed, and analyzed."
          },
          "audio": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Audio containers accepted for transcription."
          },
          "media": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Video and mixed media containers accepted for metadata/stream inspection (file-info), not for document ingestion."
          }
        },
        "description": "The complete set of file extensions the file upload endpoints accept by name."
      },
      "TenantResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The tenant's id. Use it when creating collections, indexing documents, and searching.",
            "format": "uuid"
          },
          "display_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Human-readable name."
          },
          "has_dedicated_capacity": {
            "type": "boolean",
            "description": "True when the tenant has reserved dedicated search capacity (see the reserve-capacity action)."
          },
          "embedding_model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The tenant's embedding model, used by every collection that enables semantic search. Null when the tenant is full-text only."
          },
          "enable_ocr": {
            "type": "boolean",
            "description": "Whether the tenant runs OCR while extracting scanned pages and images during indexing."
          },
          "ocr_noise_rejection": {
            "type": "boolean"
          },
          "enable_full_text_search": {
            "type": "boolean",
            "description": "Whether the tenant's collections support full-text (word-based) search."
          },
          "enable_semantic_search": {
            "type": "boolean",
            "description": "Whether the tenant's collections support semantic (meaning-based) search."
          },
          "normalization": {
            "description": "The tenant's text-normalization options, applied to every collection.",
            "$ref": "#/components/schemas/TextNormalizationOptions"
          },
          "rerank_model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The tenant's reranking model used by the optional second-stage reranking pass. Null when the tenant has no reranker configured."
          },
          "query_model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The tenant's query-understanding model used by search requests with a 'query_mode' beyond Original. Null when the tenant has no query model configured."
          },
          "created_at": {
            "type": "string",
            "description": "When the tenant was provisioned (UTC).",
            "format": "date-time"
          }
        },
        "description": "A provisioned Search tenant."
      },
      "TextCorrectionRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "Specifies the identifier of the text correction model to be used. If not provided, the default model will be applied.",
            "default": ""
          },
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "Specifies the original text that is to be corrected. This field is required and must contain a non-empty plain text string.",
            "default": ""
          }
        },
        "description": "Represents the request payload for the Text Correction API."
      },
      "TextCorrectionResponse": {
        "required": [
          "text"
        ],
        "type": "object",
        "properties": {
          "text": {
            "type": [
              "null",
              "string"
            ],
            "description": "The corrected content produced by the text correction engine."
          }
        },
        "description": "Response from the Text Correction API. Returns the corrected version of the input content."
      },
      "TextDirection": {
        "enum": [
          "LeftToRight",
          "RightToLeft",
          "TopToBottom",
          null
        ]
      },
      "TextNormalizationOptions": {
        "type": "object",
        "properties": {
          "fold_case": {
            "type": "boolean",
            "description": "Match regardless of letter case. Defaults to true.",
            "default": true
          },
          "fold_diacritics": {
            "type": "boolean",
            "description": "Match regardless of accents, so accented and unaccented spellings match each other. Defaults to true.",
            "default": true
          },
          "normalize_unicode": {
            "type": "boolean",
            "description": "Fold Unicode compatibility forms so visually-equal characters match: ligatures ('ﬁ' to 'fi'), full-width forms, superscripts. Defaults to true.",
            "default": true
          },
          "enable_stemming": {
            "type": "boolean",
            "description": "Match inflected word forms by reducing words to their root (so 'running' matches 'run'), for languages with a supported stemmer. Disable for identifier or code corpora where exact forms matter. Defaults to true.",
            "default": true
          }
        },
        "description": "A tenant's full-text analysis options, applied to every collection at index and query time. The same normalization is applied to indexed text and to queries, so they always line up. Changing it re-indexes the tenant's full text in the background. Every option defaults to true for the widest recall; disable individual ones for stricter, precision-oriented matching."
      },
      "TextractTestRequest": {
        "type": "object",
        "properties": {
          "awsAccessKeyId": {
            "type": [
              "null",
              "string"
            ]
          },
          "awsSecretAccessKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "awsRegion": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TextRewriter.CommunicationStyle": {
        "enum": [
          "Concise",
          "Professional",
          "Friendly"
        ],
        "description": "Defines various communication styles.\n\n- `Concise`: Communication that is clear and brief, focusing on conveying the message in the fewest words possible.\n- `Professional`: Communication that maintains a high level of professionalism, appropriate for formal and business contexts.\n- `Friendly`: Communication that is warm, approachable, and intended to create a friendly atmosphere."
      },
      "TextRewriterRequest": {
        "required": [
          "input",
          "communication_style",
          "language"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "Specifies the identifier of the text rewriting model to be used. If not provided, the default model will be applied.",
            "default": ""
          },
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "Specifies the original text that is to be rewritten. This field is required and must contain a non-empty plain text string.",
            "default": ""
          },
          "communication_style": {
            "description": "Specifies the desired communication style for the rewritten text (e.g., concise, professional, friendly).",
            "default": "Concise",
            "$ref": "#/components/schemas/TextRewriter.CommunicationStyle"
          },
          "language": {
            "description": "Specifies the target language for the rewritten text. Must be one of the supported languages.",
            "default": "English",
            "$ref": "#/components/schemas/Language"
          }
        },
        "description": "Represents the request payload for the Text Rewriter API."
      },
      "TextRewriterResponse": {
        "required": [
          "text"
        ],
        "type": "object",
        "properties": {
          "text": {
            "type": [
              "null",
              "string"
            ],
            "description": "The rewritten content produced by the text rewriter."
          }
        },
        "description": "Response from the Text Rewriter API. Returns the rewritten version of the input content."
      },
      "TextShrinkingStrategy": {
        "enum": [
          "Auto",
          "RemoveWords",
          "RemoveLines",
          "SummarizeText",
          "TrimTop",
          "TrimBottom",
          null
        ],
        "description": "Defines the strategies available for shrinking text content."
      },
      "TrainingChatRequest": {
        "type": "object",
        "properties": {
          "messages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/TrainingChatRequest.Message"
            },
            "description": "The conversation so far, ending with the user message to answer. Roles: system, user, assistant."
          },
          "max_tokens": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Upper bound on the completion length, in tokens.",
            "format": "int32"
          }
        }
      },
      "TrainingChatRequest.Message": {
        "type": "object",
        "properties": {
          "role": {
            "type": [
              "null",
              "string"
            ]
          },
          "content": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TrainingConversation": {
        "required": [
          "messages"
        ],
        "type": "object",
        "properties": {
          "messages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/TrainingMessageDto"
            },
            "description": "Ordered messages. Roles: 'system', 'user', 'assistant'."
          }
        },
        "description": "One training conversation: an ordered list of role/content messages."
      },
      "TrainingJobEvent": {
        "type": "object",
        "properties": {
          "t": {
            "type": "string",
            "format": "date-time"
          },
          "level": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TrainingJobRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "Identifier of the base model to fine-tune. If omitted, the default chat model is used.",
            "default": ""
          },
          "stage": {
            "type": [
              "null",
              "string"
            ],
            "description": "Training stage: 'sft' (default) fine-tunes on chat conversations with the chat template applied; 'pretrain' continues pre-training on raw text (assistant-only masking does not apply)."
          },
          "raw_text": {
            "type": [
              "null",
              "string"
            ],
            "description": "Raw training text for the 'pretrain' stage. Combined with any uploaded dataset file."
          },
          "dataset": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/TrainingConversation"
            },
            "description": "Inline training samples as conversations. Each item is a list of role/content messages; assistant turns are supervised. Provide this or dataset_file_id."
          },
          "dataset_file_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "File id (from /lmkit/v1/files/upload) of a dataset to train on: JSONL chat, ShareGPT, Alpaca, plain text, or a ZIP archive of these. Format is auto-detected. Provide this or dataset.",
            "default": ""
          },
          "rank": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "LoRA rank (inner dimension of the adapter). Higher adds capacity and size. Default 8.",
            "format": "int32",
            "default": 8
          },
          "alpha": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "LoRA alpha scaling factor. Effective scale is alpha/rank. Default 16.",
            "format": "float",
            "default": 16
          },
          "target_modules": {
            "type": [
              "null",
              "string"
            ],
            "description": "Which modules receive adapters: 'attention' (default), 'attention_and_feedforward', or 'all'.",
            "default": "attention"
          },
          "epochs": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of passes over the training set. Default 3.",
            "format": "int32",
            "default": 3
          },
          "learning_rate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Initial AdamW learning rate. Default 1e-4.",
            "format": "float",
            "default": 0.0001
          },
          "gradient_accumulation": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Samples accumulated per optimizer step: gradients combine across this many samples before the weights update, multiplying the effective batch size at flat memory. 1 steps on every sample.",
            "format": "int32"
          },
          "use_rslora": {
            "type": "boolean",
            "description": "Rank-stabilized LoRA: scales the adapter by alpha/sqrt(rank) instead of alpha/rank, keeping higher ranks trainable. The scaling folds into the saved artifact."
          },
          "lr_schedule": {
            "type": [
              "null",
              "string"
            ],
            "description": "Learning-rate schedule: 'cosine' (default), 'constant', 'linear', 'cosine_with_restarts', or 'polynomial'.",
            "default": "cosine"
          },
          "weight_decay": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "AdamW weight decay.",
            "format": "float"
          },
          "max_grad_norm": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Gradient clipping by global norm before each optimizer step. Default 1.0; 0 disables clipping.",
            "format": "float",
            "default": 1
          },
          "min_learning_rate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Floor the decaying schedules approach. Ignored by the constant schedule.",
            "format": "float"
          },
          "warmup_ratio": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Fraction of steps spent warming the learning rate up from zero. Default 0.",
            "format": "float",
            "default": 0
          },
          "validation_split": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Fraction of samples held out for per-epoch validation. Default 0.05.",
            "format": "float",
            "default": 0.05
          },
          "assistant_loss_only": {
            "type": "boolean",
            "description": "Compute loss only on assistant tokens (standard for instruction tuning). Default true.",
            "default": true
          },
          "sequence_packing": {
            "type": "boolean",
            "description": "Pack consecutive short samples into shared training windows. Loss never crosses a sample boundary; image samples are never packed. Default false."
          },
          "seed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Seed for reproducible adapter initialization. 0 means non-deterministic.",
            "format": "uint32",
            "default": 0
          },
          "cutoff_length": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Maximum tokens per training sequence (the training window). Samples longer than this are skipped, and every sample is padded to it during packing. 0 (the default) sizes the window to the longest sample.",
            "format": "int32"
          },
          "checkpoint_steps": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Save a training checkpoint (adapter weights + optimizer state) every N optimizer steps, enabling resume. 0 disables checkpointing.",
            "format": "int32"
          },
          "early_stopping_patience": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Stop the run after this many validation passes without improvement, keeping everything trained so far. Requires a validation split. 0 disables early stopping.",
            "format": "int32"
          },
          "artifact_from_best": {
            "type": "boolean",
            "description": "Produce the artifact from the weights at the BEST validation loss instead of the last step: the run snapshots the adapter whenever validation improves. Requires a validation split."
          },
          "micro_batch": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Tokens evaluated per training micro-batch. Smaller values cut activation memory linearly; larger values run faster when memory allows. 0 (the default) picks 512 or 256 to divide the window.",
            "format": "int32"
          },
          "lora_plus_ratio": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "LoRA+ learning-rate ratio: the zero-initialized B matrices train at this multiple of the base learning rate, which speeds convergence at unchanged memory. 16 is the common value; 0 (the default) trains both sides at the base rate.",
            "format": "float"
          },
          "neftune_alpha": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "NEFTune noise alpha: training adds uniform noise scaled by alpha over sqrt(tokens x embedding width) onto the input embeddings, a regularizer that counters overfitting on small datasets. Validation always runs without noise. 5 is the paper's default; 0 (the default) disables it.",
            "format": "float"
          },
          "first_layer": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "First transformer block that receives adapters, inclusive. 0 (the default) starts at the first block. Restricting the range cuts adapter memory and backward compute proportionally.",
            "format": "int32"
          },
          "last_layer": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Last transformer block that receives adapters, inclusive. 0 (the default) extends to the last block.",
            "format": "int32"
          },
          "full_precision": {
            "type": "boolean",
            "description": "Train from the model's full-precision (F16/BF16) variant when its repository publishes one, downloading it on first use. Ignored for custom paths and models with no published variant."
          },
          "merge_quantization": {
            "type": [
              "null",
              "string"
            ],
            "description": "For merged-model output: quantize the merged GGUF to this precision (q4_k_m, q5_k_m, or q8_0). Empty keeps the merge at the base's precision. Ignored for adapter output."
          },
          "output": {
            "type": [
              "null",
              "string"
            ],
            "description": "Artifact to produce: 'adapter' (default, a small LoRA GGUF) or 'model' (base merged with the adapter).",
            "default": "adapter"
          }
        },
        "description": "Request body to start a LoRA fine-tuning job."
      },
      "TrainingJobResponse": {
        "type": "object",
        "properties": {
          "job_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/TrainingJobStatus"
          },
          "model": {
            "type": [
              "null",
              "string"
            ]
          },
          "output": {
            "type": [
              "null",
              "string"
            ]
          },
          "epoch": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "total_epochs": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "step": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "total_steps": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loss": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "accuracy": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "validation_loss": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "learning_rate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          },
          "samples": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "created_utc": {
            "type": "string",
            "format": "date-time"
          },
          "started_utc": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "finished_utc": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "artifact_available": {
            "type": "boolean"
          },
          "checkpoint_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "resumed_from": {
            "type": [
              "null",
              "string"
            ]
          },
          "phase": {
            "type": [
              "null",
              "string"
            ]
          },
          "loss_history": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/TrainingLossPoint"
            }
          },
          "val_loss_history": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/TrainingLossPoint"
            }
          },
          "events": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/TrainingJobEvent"
            }
          },
          "telemetry": {
            "$ref": "#/components/schemas/TrainingJobTelemetry"
          }
        }
      },
      "TrainingJobStatus": {
        "enum": [
          "Queued",
          "Running",
          "Completed",
          "Cancelled",
          "Failed"
        ],
        "description": "- `Queued`\n- `Running`\n- `Completed`\n- `Cancelled`\n- `Failed`"
      },
      "TrainingJobTelemetry": {
        "type": "object",
        "properties": {
          "gpu_device": {
            "type": [
              "null",
              "string"
            ]
          },
          "gpu_utilization": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "vram_used_bytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "vram_total_bytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "host_working_set_bytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "host_total_bytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "step_duration_ms": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "tokens_per_second": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "TrainingLossPoint": {
        "type": "object",
        "properties": {
          "step": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loss": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "TrainingMessageDto": {
        "required": [
          "role",
          "content"
        ],
        "type": "object",
        "properties": {
          "role": {
            "type": [
              "null",
              "string"
            ],
            "description": "Message role: 'system', 'user', or 'assistant'."
          },
          "content": {
            "type": [
              "null",
              "string"
            ],
            "description": "Message text. May carry '<image>' markers to place the message's images; without markers the images lead the message."
          },
          "images": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Images attached to this message, each a data URI or raw base64 string. Requires a vision-capable base model; image conversations fine-tune the text decoder on the frozen vision tower's output."
          }
        },
        "description": "A single chat message in a training conversation."
      },
      "TrainingPreflightRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "Catalog model ID; blank prices the server's default chat model."
          },
          "rank": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "target_modules": {
            "type": [
              "null",
              "string"
            ]
          },
          "full_precision": {
            "type": "boolean"
          }
        }
      },
      "TranslationRequest": {
        "required": [
          "input",
          "language"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The ID of the model used for text translation. If not specified, the default model will be used."
          },
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The input data for translation. This can either be a plain text string or a base64-encoded file containing text, based on the specified input format."
          },
          "input_format": {
            "description": "The format of the input data. Acceptable values are 'PlainText' or 'Base64EncodedFile'. In the case of 'Base64EncodedFile', the supported formats are PDF, DOCX, PPTX, XLSX, EML, and MBOX. Defaults to 'PlainText' if not specified.",
            "default": "PlainText",
            "$ref": "#/components/schemas/InputFormat"
          },
          "language": {
            "description": "The target language for translation.",
            "default": "English",
            "$ref": "#/components/schemas/Language"
          },
          "guidance": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional free-text guidance steering how the content is translated (terminology, proper-name handling, register and tone, e.g. 'keep product names untranslated; use a formal register'). Applied to every chunk so terminology stays consistent across long inputs. When empty, the default translation behavior is used.",
            "default": ""
          }
        },
        "description": "Request body for the Text Translation API."
      },
      "TranslationResponse": {
        "required": [
          "text"
        ],
        "type": "object",
        "properties": {
          "text": {
            "type": [
              "null",
              "string"
            ],
            "description": "The translated content."
          }
        },
        "description": "Response from the Translation API. Returns the translation from the input content."
      },
      "TwoFactorCodeRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TwoFactorSetupResponse": {
        "type": "object",
        "properties": {
          "secret": {
            "type": [
              "null",
              "string"
            ]
          },
          "otpauthUri": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TwoFactorStatusResponse": {
        "type": "object",
        "properties": {
          "passwordSet": {
            "type": "boolean"
          },
          "totpEnabled": {
            "type": "boolean"
          },
          "localAccount": {
            "type": "boolean"
          },
          "required": {
            "type": "boolean"
          },
          "recoveryCodesLeft": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "UnitMode": {
        "enum": [
          "Pixels",
          "DeviceIndependentPixels",
          "Points",
          "Inches",
          "Millimeters",
          "Centimeters"
        ],
        "description": "Selects the measurement unit used by geometry, drawing, layout, and rendering APIs.\n\n- `Pixels`\n- `DeviceIndependentPixels`\n- `Points`\n- `Inches`\n- `Millimeters`\n- `Centimeters`"
      },
      "UnloadModelRequest": {
        "required": [
          "model"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The model identifier to unload (e.g. \"gemma3:4b\").",
            "default": ""
          }
        },
        "description": "Request to unload a model from memory."
      },
      "UpdateTenantConfigRequest": {
        "type": "object",
        "properties": {
          "embedding_model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The tenant's embedding model: one of the cluster's model catalog, by default 'embeddinggemma-300m', 'qwen3-embedding:0.6b', 'qwen3-embedding:4b', 'qwen3-embedding:8b', or 'harrier-oss:0.6b'. Null or omitted leaves the current model unchanged; the model is never cleared through this call."
          },
          "enable_ocr": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether the tenant runs OCR while extracting scanned pages and images during indexing. Null or omitted leaves it unchanged."
          },
          "ocr_noise_rejection": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "enable_full_text_search": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether the tenant's collections support full-text search. Null or omitted leaves it unchanged. A tenant must keep at least one search mode enabled."
          },
          "enable_semantic_search": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether the tenant's collections support semantic search (requires an embedding model). Null or omitted leaves it unchanged. A tenant must keep at least one search mode enabled."
          },
          "normalization": {
            "description": "Text-normalization options (case / accent / unicode / punctuation folding). Null or omitted leaves them unchanged.",
            "$ref": "#/components/schemas/TextNormalizationOptions"
          },
          "rerank_model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The tenant's reranking model (for example 'bge-m3-reranker'), used by the optional second-stage reranking pass. Null or omitted leaves it unchanged; send an empty string to clear it (the tenant then has no reranker)."
          },
          "query_model": {
            "type": [
              "null",
              "string"
            ],
            "description": "The tenant's query-understanding model: the small local LLM used by search requests with a 'query_mode' beyond Original (contextual rewriting, multi-query expansion, HyDE). Null or omitted leaves it unchanged; send an empty string to clear it (such requests then degrade to the original query)."
          }
        },
        "description": "Request body to PATCH a tenant's configuration. Every field is OPTIONAL: a null or omitted field leaves that setting unchanged, so a caller can update just the search modes without resending the model or normalization. Every field is tenant-wide and applied to all the tenant's collections; changes that affect indexed documents (model, semantic, normalization) are applied in the background and search keeps working throughout."
      },
      "VadSettingsRequest": {
        "type": "object",
        "properties": {
          "energy_threshold": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Normalized speech-probability threshold between 0 (everything is speech) and 1 (nothing is). Default: 0.1.",
            "format": "float"
          },
          "min_speech_ms": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Shortest run of speech, in milliseconds, that is kept as a segment. Default: 250.",
            "format": "int32"
          },
          "min_silence_ms": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Shortest silence, in milliseconds, that splits two segments. Default: 100.",
            "format": "int32"
          },
          "max_speech_s": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Longest single segment, in seconds; longer speech is split. Default: unlimited.",
            "format": "float"
          },
          "speech_padding_ms": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Padding, in milliseconds, added before and after each detected segment. Default: 30.",
            "format": "int32"
          },
          "sample_overlap_s": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Overlap between analysis windows, in seconds, between 0 and 1. Default: 0.1.",
            "format": "float"
          }
        },
        "description": "Voice-activity-detection tuning. Every field is optional; an omitted field keeps the engine default. The same object drives the standalone voice-activity-detection endpoint and the 'vad' field of audio transcription."
      },
      "VectorStoresController.AttachFileRequest": {
        "type": "object",
        "properties": {
          "file_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The id of an uploaded file (from POST /v1/files) to index into this store."
          }
        }
      },
      "VectorStoresController.CreateVectorStoreRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The vector store's display name."
          }
        }
      },
      "VideoFramesCapabilitiesResponse": {
        "type": "object",
        "properties": {
          "ffmpeg_available": {
            "type": "boolean",
            "description": "True when ffmpeg is installed and runnable, so frames can be extracted from any supported container. When false, the extraction endpoint refuses with 501."
          },
          "supported_formats": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Lower-cased video container extensions accepted for frame extraction (the inspection engine's media registry - the same set the files upload gate accepts)."
          },
          "output_formats": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Image formats a frame can be encoded to ('jpeg', 'png', 'webp')."
          }
        },
        "description": "Reports what the video-frames endpoint can decode on this server, so a client can adapt (e.g. render posters itself when ffmpeg is absent)."
      },
      "VoiceActivityDetectionRequest": {
        "required": [
          "input"
        ],
        "type": "object",
        "properties": {
          "input": {
            "type": [
              "null",
              "string"
            ],
            "description": "The audio or video file to analyze (a video's audio track is extracted). When input_format is 'Base64EncodedFile', provide a base64-encoded file payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint. Supported formats: see GET /lmkit/v1/audio-transcription/capabilities (the two endpoints share one decoder).",
            "default": ""
          },
          "input_format": {
            "description": "How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. 'Base64EncodedFile' expects a base64-encoded audio file. 'FileIdentifier' references a file previously uploaded via lmkit/v1/files/upload. Defaults to 'Base64EncodedFile'.",
            "default": "Base64EncodedFile",
            "$ref": "#/components/schemas/InputFormat"
          },
          "vad": {
            "description": "Optional detection tuning. Omitted fields keep the engine defaults.",
            "$ref": "#/components/schemas/VadSettingsRequest"
          }
        },
        "description": "Request body for the Voice Activity Detection API. Contains an audio or video file (a video's audio track is analyzed) and optional detection tuning. For large or long recordings, prefer streaming the raw file to POST /lmkit/v1/voice-activity-detection/file (multipart), or upload it once via /lmkit/v1/files/upload and reference the returned fileId here with input_format 'FileIdentifier'; base64 inflates the payload by ~33% and is buffered whole in memory."
      },
      "VoiceActivityDetectionResponse": {
        "required": [
          "segments",
          "speech_duration",
          "audio_duration"
        ],
        "type": "object",
        "properties": {
          "segments": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/VoiceActivityDetectionSegmentResponse"
            },
            "description": "The detected speech regions in chronological order. Empty when the audio holds no voice activity."
          },
          "speech_duration": {
            "pattern": "^-?(\\d+\\.)?\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,7})?$",
            "type": "string",
            "description": "Total detected speech time: the sum of every segment's length."
          },
          "audio_duration": {
            "pattern": "^-?(\\d+\\.)?\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,7})?$",
            "type": "string",
            "description": "Duration of the analyzed audio stream."
          }
        },
        "description": "Model for the Voice Activity Detection API response. Lists the speech regions found in the audio, with the total speech time and the audio duration for at-a-glance density."
      },
      "VoiceActivityDetectionSegmentResponse": {
        "required": [
          "start",
          "end"
        ],
        "type": "object",
        "properties": {
          "start": {
            "pattern": "^-?(\\d+\\.)?\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,7})?$",
            "type": "string",
            "description": "The start time of the speech region within the audio stream."
          },
          "end": {
            "pattern": "^-?(\\d+\\.)?\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,7})?$",
            "type": "string",
            "description": "The end time of the speech region within the audio stream."
          }
        },
        "description": "One detected speech region: where voice activity starts and ends within the audio stream."
      },
      "WebSearchCheckRequest": {
        "type": "object",
        "properties": {
          "baseUrl": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "WordResult": {
        "required": [
          "text"
        ],
        "type": "object",
        "properties": {
          "text": {
            "type": [
              "null",
              "string"
            ],
            "description": "The text content of this word."
          },
          "bounds": {
            "description": "The bounding box of this word on the page, in points. Null if layout coordinates are unavailable.",
            "$ref": "#/components/schemas/BoundsResult"
          },
          "chars": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CharResult"
            },
            "description": "The word's characters in reading order, each with its own bounding box. Empty when the source reports word boxes only (e.g. some OCR engines); consumers then fall back to the word box."
          }
        },
        "description": "A single detected word within a text line."
      },
      "XmpProperty": {
        "required": [
          "name",
          "value"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The prefix-qualified property name (e.g. 'dc:creator', 'xmp:CreateDate')."
          },
          "value": {
            "type": [
              "null",
              "string"
            ],
            "description": "The property's text value (list/array values are joined with ', ')."
          }
        },
        "description": "One XMP metadata property, prefix-qualified (e.g. 'dc:title', 'pdf:Producer')."
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "description": "Enter your API key as: Bearer {token}",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    { }
  ],
  "tags": [
    {
      "name": "Administration"
    },
    {
      "name": "Agents"
    },
    {
      "name": "AI Document Splitting"
    },
    {
      "name": "Answers"
    },
    {
      "name": "Anthropic · Messages"
    },
    {
      "name": "Audio Transcription"
    },
    {
      "name": "Background Removal"
    },
    {
      "name": "Categorization"
    },
    {
      "name": "Chat"
    },
    {
      "name": "Chat with Document"
    },
    {
      "name": "Collections"
    },
    {
      "name": "Discovery"
    },
    {
      "name": "Document OCR"
    },
    {
      "name": "Document Search Highlight"
    },
    {
      "name": "Document Thumbnail"
    },
    {
      "name": "Document to Markdown"
    },
    {
      "name": "Document Validation"
    },
    {
      "name": "Documents"
    },
    {
      "name": "Embeddings"
    },
    {
      "name": "Evaluation"
    },
    {
      "name": "File Info"
    },
    {
      "name": "Files Management"
    },
    {
      "name": "Fine-Tuning"
    },
    {
      "name": "Grounded Chat"
    },
    {
      "name": "Health"
    },
    {
      "name": "Image Normalization"
    },
    {
      "name": "Image to PDF"
    },
    {
      "name": "Jobs"
    },
    {
      "name": "Keyword Extraction"
    },
    {
      "name": "Language Detection"
    },
    {
      "name": "Model Management"
    },
    {
      "name": "Named Entity Recognition"
    },
    {
      "name": "Ollama · Chat"
    },
    {
      "name": "Ollama · Embeddings"
    },
    {
      "name": "Ollama · Generate"
    },
    {
      "name": "Ollama · Models"
    },
    {
      "name": "OpenAI · Chat"
    },
    {
      "name": "OpenAI · Completions (Legacy)"
    },
    {
      "name": "OpenAI · Embeddings"
    },
    {
      "name": "OpenAI · Files"
    },
    {
      "name": "OpenAI · Models"
    },
    {
      "name": "OpenAI · Responses"
    },
    {
      "name": "OpenAI · Vector Stores"
    },
    {
      "name": "PDF Edit"
    },
    {
      "name": "PDF Info"
    },
    {
      "name": "PDF Layout Analysis"
    },
    {
      "name": "PDF Merge"
    },
    {
      "name": "PDF OCR"
    },
    {
      "name": "PDF Redaction"
    },
    {
      "name": "PDF Search"
    },
    {
      "name": "PDF Signatures"
    },
    {
      "name": "PDF Split"
    },
    {
      "name": "PDF to Images"
    },
    {
      "name": "PDF to PDF/A"
    },
    {
      "name": "PDF Unlock"
    },
    {
      "name": "PII Detection"
    },
    {
      "name": "Query"
    },
    {
      "name": "Reranking"
    },
    {
      "name": "Sentiment Analysis"
    },
    {
      "name": "Status"
    },
    {
      "name": "Structured Extraction"
    },
    {
      "name": "Summarization"
    },
    {
      "name": "Tenants"
    },
    {
      "name": "Text Correction"
    },
    {
      "name": "Text Rewriter"
    },
    {
      "name": "Translation"
    },
    {
      "name": "Video Frames"
    },
    {
      "name": "Voice Activity Detection"
    }
  ],
  "x-tagGroups": [
    {
      "name": "AI Analysis",
      "tags": [
        "Categorization",
        "Keyword Extraction",
        "Language Detection",
        "Named Entity Recognition",
        "PII Detection",
        "Sentiment Analysis"
      ]
    },
    {
      "name": "AI Assistants",
      "tags": [
        "Chat with Document"
      ]
    },
    {
      "name": "AI Extraction",
      "tags": [
        "AI Document Splitting",
        "Document to Markdown",
        "Structured Extraction"
      ]
    },
    {
      "name": "AI Generation",
      "tags": [
        "Summarization",
        "Text Correction",
        "Text Rewriter",
        "Translation"
      ]
    },
    {
      "name": "AI Training",
      "tags": [
        "Fine-Tuning"
      ]
    },
    {
      "name": "API Compatibility",
      "tags": [
        "Anthropic · Messages",
        "Ollama · Chat",
        "Ollama · Embeddings",
        "Ollama · Generate",
        "Ollama · Models",
        "OpenAI · Chat",
        "OpenAI · Completions (Legacy)",
        "OpenAI · Embeddings",
        "OpenAI · Files",
        "OpenAI · Models",
        "OpenAI · Responses",
        "OpenAI · Vector Stores"
      ]
    },
    {
      "name": "Document Utilities",
      "tags": [
        "Document OCR",
        "Document Search Highlight",
        "Document Thumbnail",
        "Document Validation",
        "File Info",
        "Image to PDF",
        "PDF Edit",
        "PDF Info",
        "PDF Layout Analysis",
        "PDF Merge",
        "PDF OCR",
        "PDF Redaction",
        "PDF Search",
        "PDF Signatures",
        "PDF Split",
        "PDF to Images",
        "PDF to PDF/A",
        "PDF Unlock"
      ]
    },
    {
      "name": "Image Utilities",
      "tags": [
        "Background Removal",
        "Image Normalization"
      ]
    },
    {
      "name": "Inference",
      "tags": [
        "Agents",
        "Chat",
        "Embeddings",
        "Reranking"
      ]
    },
    {
      "name": "Infrastructure",
      "tags": [
        "Administration",
        "Files Management",
        "Health",
        "Jobs",
        "Model Management"
      ]
    },
    {
      "name": "Media",
      "tags": [
        "Video Frames"
      ]
    },
    {
      "name": "Search",
      "tags": [
        "Answers",
        "Collections",
        "Discovery",
        "Documents",
        "Evaluation",
        "Grounded Chat",
        "Query",
        "Status",
        "Tenants"
      ]
    },
    {
      "name": "Speech",
      "tags": [
        "Audio Transcription",
        "Voice Activity Detection"
      ]
    }
  ]
}