{
  "components": {
    "schemas": {
      "Control": {
        "properties": {
          "paused": {
            "title": "Paused",
            "type": "boolean"
          }
        },
        "required": [
          "paused"
        ],
        "title": "Control",
        "type": "object"
      },
      "EmbedImagesRequest": {
        "properties": {
          "images": {
            "items": {
              "type": "string"
            },
            "title": "Images",
            "type": "array"
          },
          "model": {
            "title": "Model",
            "type": "string"
          }
        },
        "required": [
          "model",
          "images"
        ],
        "title": "EmbedImagesRequest",
        "type": "object"
      },
      "EmbedQueriesRequest": {
        "properties": {
          "model": {
            "title": "Model",
            "type": "string"
          },
          "queries": {
            "items": {
              "type": "string"
            },
            "title": "Queries",
            "type": "array"
          }
        },
        "required": [
          "model",
          "queries"
        ],
        "title": "EmbedQueriesRequest",
        "type": "object"
      },
      "EmbedderBasicInfo": {
        "properties": {
          "description": {
            "title": "Description",
            "type": "string"
          },
          "dims_default": {
            "default": 128,
            "title": "Dims Default",
            "type": "integer"
          },
          "download_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Download Error"
          },
          "downloaded": {
            "default": false,
            "title": "Downloaded",
            "type": "boolean"
          },
          "downloaded_bytes": {
            "default": 0,
            "title": "Downloaded Bytes",
            "type": "integer"
          },
          "downloading": {
            "default": false,
            "title": "Downloading",
            "type": "boolean"
          },
          "model_id": {
            "default": "",
            "title": "Model Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "required_models": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Required Models",
            "type": "array"
          },
          "size_bytes": {
            "default": 0,
            "title": "Size Bytes",
            "type": "integer"
          },
          "supports_heatmap": {
            "default": true,
            "title": "Supports Heatmap",
            "type": "boolean"
          },
          "total_bytes": {
            "default": 0,
            "title": "Total Bytes",
            "type": "integer"
          }
        },
        "required": [
          "name",
          "description"
        ],
        "title": "EmbedderBasicInfo",
        "type": "object"
      },
      "EmbeddingsResponse": {
        "properties": {
          "embeddings": {
            "items": {
              "items": {
                "items": {
                  "type": "number"
                },
                "type": "array"
              },
              "type": "array"
            },
            "title": "Embeddings",
            "type": "array"
          }
        },
        "required": [
          "embeddings"
        ],
        "title": "EmbeddingsResponse",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "KeyCreateRequest": {
        "properties": {
          "key": {
            "title": "Key",
            "type": "string"
          },
          "label": {
            "default": "",
            "title": "Label",
            "type": "string"
          }
        },
        "required": [
          "key"
        ],
        "title": "KeyCreateRequest",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      }
    }
  },
  "info": {
    "description": "GPU service. Protected endpoints use Authorization: Bearer <key>.",
    "title": "PDFSearch Embed Server",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/document-jobs/{client_id}": {
      "delete": {
        "operationId": "delete_document_jobs__client_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "title": "Client Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete"
      },
      "get": {
        "operationId": "status_document_jobs__client_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "title": "Client Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Status"
      },
      "post": {
        "operationId": "upload_document_jobs__client_id__post",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "title": "Client Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "model",
            "required": true,
            "schema": {
              "title": "Model",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sha256",
            "required": true,
            "schema": {
              "title": "Sha256",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "dpi",
            "required": false,
            "schema": {
              "default": 150,
              "title": "Dpi",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "default": "pdf",
              "title": "Kind",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Upload"
      }
    },
    "/document-jobs/{client_id}/batches/{number}": {
      "get": {
        "operationId": "result_document_jobs__client_id__batches__number__get",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "title": "Client Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "title": "Number",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Result"
      }
    },
    "/document-jobs/{client_id}/control": {
      "post": {
        "operationId": "control_document_jobs__client_id__control_post",
        "parameters": [
          {
            "in": "path",
            "name": "client_id",
            "required": true,
            "schema": {
              "title": "Client Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Control"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Control"
      }
    },
    "/embed/images": {
      "post": {
        "operationId": "embed_images_embed_images_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmbedImagesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Embed Images"
      }
    },
    "/embed/nprefix": {
      "get": {
        "description": "Return the number of image-prefix tokens for the given model.\n\nThis is the number of chat-template tokens that appear *before* the first\n<|image_pad|> token in the model's process_images() output.  It is the same\nfor every image and is used by the backend to correctly slice visual-patch\ntokens out of raw stored embeddings (which contain the full token sequence\nincluding prefix and suffix).\n\nCPU-only — no GPU inference required.",
        "operationId": "get_n_prefix_embed_nprefix_get",
        "parameters": [
          {
            "in": "query",
            "name": "model",
            "required": true,
            "schema": {
              "title": "Model",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get N Prefix"
      }
    },
    "/embed/queries": {
      "post": {
        "operationId": "embed_queries_embed_queries_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmbedQueriesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Embed Queries"
      }
    },
    "/embedders": {
      "get": {
        "description": "List all registered embedders and their download state.",
        "operationId": "list_available_embedders_embedders_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/EmbedderBasicInfo"
                  },
                  "title": "Response List Available Embedders Embedders Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Available Embedders"
      }
    },
    "/embedders/{name}": {
      "get": {
        "description": "Return info for a single embedder.",
        "operationId": "get_embedder_info_embedders__name__get",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbedderBasicInfo"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Embedder Info"
      }
    },
    "/embedders/{name}/download": {
      "post": {
        "description": "Start downloading the model for an embedder (background thread).",
        "operationId": "download_embedder_embedders__name__download_post",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download Embedder"
      }
    },
    "/health": {
      "get": {
        "operationId": "health_health_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Health"
      }
    },
    "/keys": {
      "get": {
        "description": "Return all key labels (the actual token values are never returned).",
        "operationId": "list_keys_keys_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Keys"
      },
      "post": {
        "description": "Add a new API key.  Changes are persisted to the keys file immediately.",
        "operationId": "add_key_keys_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KeyCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Add Key"
      }
    },
    "/keys/{key}": {
      "delete": {
        "description": "Remove an API key by its token value.",
        "operationId": "delete_key_keys__key__delete",
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "title": "Key",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Key"
      }
    }
  }
}
