{
  "openapi": "3.1.0",
  "info": {
    "title": "Axelered Papyrus",
    "version": "0.0.0"
  },
  "paths": {
    "/": {
      "get": {
        "tags": [
          "health"
        ],
        "summary": "Server name and version",
        "operationId": "read_root__get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HelloResponse"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "tags": [
          "health"
        ],
        "summary": "Liveness probe",
        "operationId": "health_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                }
              }
            }
          }
        }
      }
    },
    "/ready": {
      "get": {
        "tags": [
          "health"
        ],
        "summary": "Readiness probe",
        "operationId": "ready_ready_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable: `not_ready`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/markdown": {
      "post": {
        "tags": [
          "markdown"
        ],
        "summary": "Extract markdown from a document",
        "operationId": "markdown_v1_markdown_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarkdownRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "metadata": {
                    "$ref": "#/components/schemas/MarkdownRequest",
                    "description": "The request as JSON; source defaults to file://file"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The source document"
                  }
                },
                "type": "object"
              },
              "encoding": {
                "metadata": {
                  "contentType": "application/json"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The JSON envelope (light with a destination), or the op file for `output=file`",
            "headers": {
              "Content-Disposition": {
                "description": "File name, for `output=file`",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarkdownResponse"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Content Too Large: `image_too_large`, `payload_too_large`, `source_too_large`, `too_many_pages`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type: `unsupported_format`, `unsupported_media_type`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content: `ocr_not_configured`, `unknown_connector`, `unsupported_uri`, `validation_error`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway: `destination_failed`, `ocr_failed`, `source_fetch_failed`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable: `ocr_rate_limited`, `queue_full`",
            "headers": {
              "Retry-After": {
                "description": "For example `30`",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "4XX": {
            "description": "Any other client error: fix the request, see the Error codes guide",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "5XX": {
            "description": "Any other server error: retry or report it, see the Error codes guide",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/thumbnail": {
      "post": {
        "tags": [
          "render"
        ],
        "summary": "Render a page or image into a fixed size box",
        "operationId": "thumbnail_v1_thumbnail_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThumbnailRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "metadata": {
                    "$ref": "#/components/schemas/ThumbnailRequest",
                    "description": "The request as JSON; source defaults to file://file"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The source document"
                  }
                },
                "type": "object"
              },
              "encoding": {
                "metadata": {
                  "contentType": "application/json"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The JSON envelope (light with a destination), or the op file for `output=file`",
            "headers": {
              "Content-Disposition": {
                "description": "File name, for `output=file`",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThumbnailResponse"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "413": {
            "description": "Content Too Large: `image_too_large`, `payload_too_large`, `source_too_large`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type: `unsupported_format`, `unsupported_media_type`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content: `page_out_of_range`, `unknown_connector`, `unsupported_uri`, `validation_error`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "4XX": {
            "description": "Any other client error: fix the request, see the Error codes guide",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "5XX": {
            "description": "Any other server error: retry or report it, see the Error codes guide",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/render": {
      "post": {
        "tags": [
          "render"
        ],
        "summary": "Render a page or image by width, height or dpi",
        "operationId": "render_v1_render_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenderRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "metadata": {
                    "$ref": "#/components/schemas/RenderRequest",
                    "description": "The request as JSON; source defaults to file://file"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The source document"
                  }
                },
                "type": "object"
              },
              "encoding": {
                "metadata": {
                  "contentType": "application/json"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The JSON envelope (light with a destination), or the op file for `output=file`",
            "headers": {
              "Content-Disposition": {
                "description": "File name, for `output=file`",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RenderResponse"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "413": {
            "description": "Content Too Large: `image_too_large`, `payload_too_large`, `source_too_large`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type: `unsupported_format`, `unsupported_media_type`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content: `page_out_of_range`, `unknown_connector`, `unsupported_uri`, `validation_error`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "4XX": {
            "description": "Any other client error: fix the request, see the Error codes guide",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "5XX": {
            "description": "Any other server error: retry or report it, see the Error codes guide",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/screenshot": {
      "post": {
        "tags": [
          "screenshot"
        ],
        "summary": "Screenshot a web page in headless Chromium",
        "operationId": "screenshot_v1_screenshot_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenshotRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "metadata": {
                    "$ref": "#/components/schemas/ScreenshotRequest",
                    "description": "The request as JSON; source defaults to file://file"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The source document"
                  }
                },
                "type": "object"
              },
              "encoding": {
                "metadata": {
                  "contentType": "application/json"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The JSON envelope (light with a destination), or the op file for `output=file`",
            "headers": {
              "Content-Disposition": {
                "description": "File name, for `output=file`",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenshotResponse"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "4XX": {
            "description": "Any other client error: fix the request, see the Error codes guide",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "5XX": {
            "description": "Any other server error: retry or report it, see the Error codes guide",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/inspect": {
      "post": {
        "tags": [
          "inspect"
        ],
        "summary": "Detect the format of a source and check it",
        "description": "Materialize and detect only, no worker; every format is inspectable (adr/inspect.md)",
        "operationId": "inspect_v1_inspect_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InspectRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "metadata": {
                    "$ref": "#/components/schemas/InspectRequest",
                    "description": "The request as JSON; source defaults to file://file"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The source document"
                  }
                },
                "type": "object"
              },
              "encoding": {
                "metadata": {
                  "contentType": "application/json"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Source facts and checks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InspectResponse"
                }
              }
            }
          },
          "4XX": {
            "description": "Any other client error: fix the request, see the Error codes guide",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "5XX": {
            "description": "Any other server error: retry or report it, see the Error codes guide",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Chunk": {
        "properties": {
          "index": {
            "type": "integer",
            "title": "Index",
            "description": "Position in the document, from 0"
          },
          "kind": {
            "$ref": "#/components/schemas/ChunkKind",
            "description": "`text` prose, `table` rows with the header repeated, `code` a fenced block"
          },
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Markdown of the chunk, with the overlap appended for prose"
          },
          "language": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CodeLanguage"
              },
              {
                "type": "null"
              }
            ],
            "description": "Code chunks only, omitted if not curated"
          },
          "headings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Headings",
            "description": "Headings the chunk sits under, outermost first"
          },
          "slide": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slide",
            "description": "pptx, and every presentation read with `ocr`"
          },
          "page": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page",
            "description": "Page the chunk starts on, read with `ocr`, not presentations"
          },
          "start": {
            "type": "integer",
            "title": "Start",
            "description": "Offset of the chunk span in `result.content` (overlap not included)"
          },
          "end": {
            "type": "integer",
            "title": "End",
            "description": "End offset of the chunk span in `result.content`, exclusive"
          },
          "tokens": {
            "type": "integer",
            "title": "Tokens",
            "description": "Tokens in `text`, counted with the requested tokenizer"
          }
        },
        "type": "object",
        "required": [
          "index",
          "kind",
          "text",
          "headings",
          "start",
          "end",
          "tokens"
        ],
        "title": "Chunk"
      },
      "ChunkKind": {
        "type": "string",
        "enum": [
          "text",
          "table",
          "code"
        ],
        "title": "ChunkKind"
      },
      "ChunkingOptions": {
        "additionalProperties": false,
        "properties": {
          "maxTokens": {
            "default": 512,
            "description": "Token budget of every chunk",
            "maximum": 8192,
            "minimum": 64,
            "title": "Maxtokens",
            "type": "integer"
          },
          "overlap": {
            "default": 0,
            "description": "Tokens of the next prose chunk appended to each prose chunk",
            "minimum": 0,
            "title": "Overlap",
            "type": "integer"
          },
          "tokenizer": {
            "$ref": "#/components/schemas/Tokenizer",
            "default": "o200k_base",
            "description": "Token counting: `o200k_base` (GPT-4o and later), `cl100k_base` (GPT-4), `word` or `character`"
          }
        },
        "title": "ChunkingOptions",
        "type": "object"
      },
      "CodeLanguage": {
        "type": "string",
        "enum": [
          "python",
          "javascript",
          "typescript",
          "tsx",
          "java",
          "kotlin",
          "go",
          "rust",
          "c",
          "cpp",
          "csharp",
          "php",
          "ruby",
          "swift",
          "scala",
          "bash",
          "powershell",
          "sql",
          "yaml",
          "toml",
          "json",
          "html",
          "css",
          "dockerfile",
          "hcl"
        ],
        "title": "CodeLanguage",
        "description": "Curated tree-sitter grammars baked into the image; values are tree-sitter language names"
      },
      "Encoding": {
        "type": "string",
        "enum": [
          "utf-8",
          "base64"
        ],
        "title": "Encoding",
        "description": "How `result.content` carries the artifact"
      },
      "Fetch": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Final URL after redirects"
          },
          "status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status",
            "description": "HTTP status of the document, omitted when none was sent"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "Fetch"
      },
      "Fit": {
        "description": "How a page fills the thumbnail box",
        "enum": [
          "contain",
          "cover"
        ],
        "title": "Fit",
        "type": "string"
      },
      "FormatGroup": {
        "type": "string",
        "enum": [
          "document",
          "spreadsheet",
          "presentation",
          "email",
          "archive",
          "markup",
          "data",
          "code",
          "text",
          "image",
          "unknown"
        ],
        "title": "FormatGroup"
      },
      "HelloResponse": {
        "properties": {
          "status": {
            "type": "string",
            "const": "ok",
            "title": "Status",
            "description": "Always `ok`",
            "default": "ok"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Product name",
            "default": "Axelered Papyrus"
          },
          "version": {
            "type": "string",
            "title": "Version",
            "description": "Release version, `0.0.0` in local development"
          },
          "watermark": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Watermark",
            "description": "Build stamp with version, commit and date; omitted locally"
          }
        },
        "type": "object",
        "required": [
          "version"
        ],
        "title": "HelloResponse"
      },
      "ImageFormat": {
        "description": "Raster outputs shared by image producing operations",
        "enum": [
          "png",
          "jpeg",
          "webp"
        ],
        "title": "ImageFormat",
        "type": "string"
      },
      "InspectChecks": {
        "properties": {
          "extensionMatch": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extensionmatch",
            "description": "The name extension declares the detected format or a generic parent of it; omitted without an extension. For http(s) URLs without one, the extension comes from the response `Content-Type`"
          }
        },
        "type": "object",
        "title": "InspectChecks",
        "description": "Every check is `true` when passed, `false` when failed and omitted when it does not apply"
      },
      "InspectOptions": {
        "additionalProperties": false,
        "description": "No options yet; kept so later checks can add switches without changing the shape",
        "properties": {},
        "title": "InspectOptions",
        "type": "object"
      },
      "InspectResponse": {
        "properties": {
          "source": {
            "$ref": "#/components/schemas/Source",
            "description": "The input document"
          },
          "options": {
            "$ref": "#/components/schemas/InspectOptions",
            "description": "The request options with defaults applied"
          },
          "checks": {
            "$ref": "#/components/schemas/InspectChecks",
            "description": "Checks run on the source"
          }
        },
        "type": "object",
        "required": [
          "source",
          "options",
          "checks"
        ],
        "title": "InspectResponse",
        "description": "No artifact is produced, so there is no `result` (adr/inspect.md)"
      },
      "MarkdownOptions": {
        "additionalProperties": false,
        "properties": {
          "readMode": {
            "$ref": "#/components/schemas/ReadMode",
            "default": "auto",
            "description": "`text` extracts the text stored in the file, `ocr` reads page images with a vision model, `auto` uses `ocr` for images, presentations and documents whose text cannot be extracted, `text` otherwise. Formats without pages fall back to `text`; the response reports the mode used"
          },
          "chunking": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ChunkingOptions"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Structure-aware chunks; the file and destination output become the JSON document"
          }
        },
        "title": "MarkdownOptions",
        "type": "object"
      },
      "MarkdownResponse": {
        "properties": {
          "source": {
            "$ref": "#/components/schemas/Source",
            "description": "The input document"
          },
          "result": {
            "$ref": "#/components/schemas/Result",
            "description": "The primary artifact"
          },
          "options": {
            "$ref": "#/components/schemas/MarkdownOptions",
            "description": "The request options with defaults applied"
          },
          "chunks": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/Chunk"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chunks",
            "description": "Present when options.chunking is set, omitted with a destination"
          }
        },
        "type": "object",
        "required": [
          "source",
          "result",
          "options"
        ],
        "title": "MarkdownResponse"
      },
      "ReadMode": {
        "enum": [
          "text",
          "auto",
          "ocr"
        ],
        "title": "ReadMode",
        "type": "string"
      },
      "RenderOptions": {
        "additionalProperties": false,
        "properties": {
          "page": {
            "default": 1,
            "description": "Page, or frame of an animated or multi-page image",
            "minimum": 1,
            "title": "Page",
            "type": "integer"
          },
          "width": {
            "anyOf": [
              {
                "maximum": 4096,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Width in pixels",
            "title": "Width"
          },
          "height": {
            "anyOf": [
              {
                "maximum": 4096,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Height in pixels",
            "title": "Height"
          },
          "dpi": {
            "anyOf": [
              {
                "maximum": 600,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Resolution of document pages, 150 when no size is set; images ignore it",
            "title": "Dpi"
          },
          "format": {
            "$ref": "#/components/schemas/ImageFormat",
            "default": "png",
            "description": "Output image format"
          }
        },
        "title": "RenderOptions",
        "type": "object"
      },
      "RenderResponse": {
        "properties": {
          "source": {
            "$ref": "#/components/schemas/Source",
            "description": "The input document"
          },
          "result": {
            "$ref": "#/components/schemas/Result",
            "description": "The primary artifact"
          },
          "options": {
            "$ref": "#/components/schemas/RenderOptions",
            "description": "The request options with defaults applied"
          }
        },
        "type": "object",
        "required": [
          "source",
          "result",
          "options"
        ],
        "title": "RenderResponse"
      },
      "Result": {
        "properties": {
          "uri": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Uri",
            "description": "Source URI, or the destination the result was written to"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "File name"
          },
          "size": {
            "type": "integer",
            "title": "Size",
            "description": "Bytes"
          },
          "mimeType": {
            "type": "string",
            "title": "Mimetype",
            "description": "Explicit format MIME or the MIME magika reports for derived formats"
          },
          "extension": {
            "type": "string",
            "title": "Extension",
            "description": "File extension of the format, without the dot"
          },
          "label": {
            "type": "string",
            "title": "Label",
            "description": "Papyrus format label or magika content type label; the language for code"
          },
          "group": {
            "$ref": "#/components/schemas/FormatGroup",
            "description": "Format family, e.g. `document` or `image`"
          },
          "pageCount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pagecount",
            "description": "Pages or frames, when the operation knows it"
          },
          "width": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Width",
            "description": "Pixels, raster images only"
          },
          "height": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Height",
            "description": "Pixels, raster images only"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title",
            "description": "Document title, when extracted"
          },
          "encoding": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Encoding"
              },
              {
                "type": "null"
              }
            ],
            "description": "Encoding of `content`, omitted with a destination"
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content",
            "description": "The artifact as utf-8 text or base64, omitted with a destination"
          }
        },
        "type": "object",
        "required": [
          "name",
          "size",
          "mimeType",
          "extension",
          "label",
          "group"
        ],
        "title": "Result",
        "description": "The primary artifact; `content` is inline unless a destination is set"
      },
      "ScreenshotOptions": {
        "additionalProperties": false,
        "properties": {
          "width": {
            "default": 1280,
            "description": "Viewport width in CSS pixels",
            "maximum": 3840,
            "minimum": 320,
            "title": "Width",
            "type": "integer"
          },
          "height": {
            "default": 800,
            "description": "Viewport height in CSS pixels",
            "maximum": 2160,
            "minimum": 200,
            "title": "Height",
            "type": "integer"
          },
          "fullPage": {
            "default": false,
            "description": "Capture the whole page, cut at 4096 px height",
            "title": "Fullpage",
            "type": "boolean"
          },
          "scale": {
            "default": 1,
            "description": "Device scale factor, multiplies the output pixels",
            "maximum": 3,
            "minimum": 1,
            "title": "Scale",
            "type": "integer"
          },
          "waitUntil": {
            "$ref": "#/components/schemas/WaitUntil",
            "default": "load",
            "description": "Page event awaited before the capture: `load`, `domcontentloaded` or `networkidle`"
          },
          "delay": {
            "default": 0,
            "description": "Milliseconds to wait after `wait_until`",
            "maximum": 10000,
            "minimum": 0,
            "title": "Delay",
            "type": "integer"
          },
          "format": {
            "$ref": "#/components/schemas/ImageFormat",
            "default": "png",
            "description": "Output image format"
          }
        },
        "title": "ScreenshotOptions",
        "type": "object"
      },
      "ScreenshotResponse": {
        "properties": {
          "source": {
            "$ref": "#/components/schemas/Source",
            "description": "The input document"
          },
          "result": {
            "$ref": "#/components/schemas/Result",
            "description": "The primary artifact"
          },
          "options": {
            "$ref": "#/components/schemas/ScreenshotOptions",
            "description": "The request options with defaults applied"
          }
        },
        "type": "object",
        "required": [
          "source",
          "result",
          "options"
        ],
        "title": "ScreenshotResponse"
      },
      "Source": {
        "properties": {
          "uri": {
            "type": "string",
            "title": "Uri",
            "description": "The request `source`"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "File name"
          },
          "size": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Size",
            "description": "Bytes"
          },
          "mimeType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mimetype",
            "description": "Explicit format MIME or the MIME magika reports for derived formats"
          },
          "extension": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extension",
            "description": "File extension of the format, without the dot"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label",
            "description": "Papyrus format label or magika content type label; the language for code"
          },
          "group": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FormatGroup"
              },
              {
                "type": "null"
              }
            ],
            "description": "Format family, e.g. `document` or `image`"
          },
          "pageCount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pagecount",
            "description": "Pages or frames, when the operation knows it"
          },
          "width": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Width",
            "description": "Pixels, raster images only"
          },
          "height": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Height",
            "description": "Pixels, raster images only"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title",
            "description": "Document title, when extracted"
          },
          "fetch": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Fetch"
              },
              {
                "type": "null"
              }
            ],
            "description": "Present for http(s) sources"
          }
        },
        "type": "object",
        "required": [
          "uri"
        ],
        "title": "Source",
        "description": "The input document; file fields are omitted for navigated pages, which have no file"
      },
      "StatusResponse": {
        "properties": {
          "status": {
            "type": "string",
            "const": "ok",
            "title": "Status",
            "description": "Always `ok`",
            "default": "ok"
          }
        },
        "type": "object",
        "title": "StatusResponse"
      },
      "ThumbnailOptions": {
        "additionalProperties": false,
        "properties": {
          "page": {
            "default": 1,
            "description": "Page, or frame of an animated or multi-page image",
            "minimum": 1,
            "title": "Page",
            "type": "integer"
          },
          "width": {
            "default": 256,
            "description": "Box width in pixels",
            "maximum": 4096,
            "minimum": 1,
            "title": "Width",
            "type": "integer"
          },
          "height": {
            "default": 256,
            "description": "Box height in pixels",
            "maximum": 4096,
            "minimum": 1,
            "title": "Height",
            "type": "integer"
          },
          "fit": {
            "$ref": "#/components/schemas/Fit",
            "default": "contain",
            "description": "`cover` fills the box and center crops"
          },
          "format": {
            "$ref": "#/components/schemas/ImageFormat",
            "default": "webp",
            "description": "Output image format"
          }
        },
        "title": "ThumbnailOptions",
        "type": "object"
      },
      "ThumbnailResponse": {
        "properties": {
          "source": {
            "$ref": "#/components/schemas/Source",
            "description": "The input document"
          },
          "result": {
            "$ref": "#/components/schemas/Result",
            "description": "The primary artifact"
          },
          "options": {
            "$ref": "#/components/schemas/ThumbnailOptions",
            "description": "The request options with defaults applied"
          }
        },
        "type": "object",
        "required": [
          "source",
          "result",
          "options"
        ],
        "title": "ThumbnailResponse"
      },
      "Tokenizer": {
        "enum": [
          "o200k_base",
          "cl100k_base",
          "word",
          "character"
        ],
        "title": "Tokenizer",
        "type": "string"
      },
      "WaitUntil": {
        "description": "Navigation milestone awaited before the capture; values are Playwright wait states",
        "enum": [
          "load",
          "domcontentloaded",
          "networkidle"
        ],
        "title": "WaitUntil",
        "type": "string"
      },
      "InspectRequest": {
        "additionalProperties": false,
        "properties": {
          "source": {
            "description": "file://<part>, http(s):// URL or <protocol>://<connector>/<path>",
            "title": "Source",
            "type": "string"
          },
          "options": {
            "$ref": "#/components/schemas/InspectOptions",
            "description": "Operation options, omitted fields take their defaults"
          }
        },
        "required": [
          "source"
        ],
        "title": "InspectRequest",
        "type": "object"
      },
      "MarkdownRequest": {
        "additionalProperties": false,
        "properties": {
          "source": {
            "description": "file://<part>, http(s):// URL or <protocol>://<connector>/<path>",
            "title": "Source",
            "type": "string"
          },
          "destination": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Connector URI to write the result to",
            "title": "Destination"
          },
          "output": {
            "$ref": "#/components/schemas/OutputMode",
            "default": "json",
            "description": "`json` returns the envelope with the artifact inline, `file` returns the artifact as the response body; with a destination the response is always the light JSON envelope"
          },
          "options": {
            "$ref": "#/components/schemas/MarkdownOptions",
            "description": "Operation options, omitted fields take their defaults"
          }
        },
        "required": [
          "source"
        ],
        "title": "MarkdownRequest",
        "type": "object"
      },
      "OutputMode": {
        "enum": [
          "file",
          "json"
        ],
        "title": "OutputMode",
        "type": "string"
      },
      "Problem": {
        "description": "RFC 9457 problem details with the stable `code` extension",
        "properties": {
          "type": {
            "default": "about:blank",
            "description": "Always `about:blank`, `code` tells errors apart",
            "title": "Type",
            "type": "string"
          },
          "title": {
            "description": "HTTP status phrase",
            "title": "Title",
            "type": "string"
          },
          "status": {
            "description": "HTTP status code",
            "title": "Status",
            "type": "integer"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Human readable explanation, not stable: do not parse it",
            "title": "Detail"
          },
          "code": {
            "description": "Stable machine readable error code, part of the public contract",
            "enum": [
              "bad_request",
              "deadline_exceeded",
              "destination_failed",
              "http_error",
              "image_too_large",
              "internal_error",
              "method_not_allowed",
              "not_found",
              "not_ready",
              "ocr_failed",
              "ocr_not_configured",
              "ocr_rate_limited",
              "page_out_of_range",
              "payload_too_large",
              "processing_failed",
              "processing_timeout",
              "queue_full",
              "source_fetch_failed",
              "source_forbidden",
              "source_not_found",
              "source_too_large",
              "too_many_pages",
              "unauthorized",
              "unknown_connector",
              "unsupported_format",
              "unsupported_media_type",
              "unsupported_uri",
              "validation_error"
            ],
            "title": "Code",
            "type": "string"
          },
          "errors": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ProblemIssue"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Present for `validation_error`",
            "title": "Errors"
          }
        },
        "required": [
          "title",
          "status",
          "code"
        ],
        "title": "Problem",
        "type": "object"
      },
      "ProblemIssue": {
        "properties": {
          "loc": {
            "description": "Path of the invalid field in the request, camelCase",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Loc",
            "type": "array"
          },
          "msg": {
            "description": "Human readable message",
            "title": "Msg",
            "type": "string"
          },
          "type": {
            "description": "Validation error type, e.g. `extra_forbidden`",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ProblemIssue",
        "type": "object"
      },
      "RenderRequest": {
        "additionalProperties": false,
        "properties": {
          "source": {
            "description": "file://<part>, http(s):// URL or <protocol>://<connector>/<path>",
            "title": "Source",
            "type": "string"
          },
          "destination": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Connector URI to write the result to",
            "title": "Destination"
          },
          "output": {
            "$ref": "#/components/schemas/OutputMode",
            "default": "file",
            "description": "`json` returns the envelope with the artifact inline, `file` returns the artifact as the response body; with a destination the response is always the light JSON envelope"
          },
          "options": {
            "$ref": "#/components/schemas/RenderOptions",
            "description": "Operation options, omitted fields take their defaults"
          }
        },
        "required": [
          "source"
        ],
        "title": "RenderRequest",
        "type": "object"
      },
      "ScreenshotRequest": {
        "additionalProperties": false,
        "properties": {
          "source": {
            "description": "http(s):// URL of the page, navigated by the browser",
            "title": "Source",
            "type": "string"
          },
          "destination": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Connector URI to write the result to",
            "title": "Destination"
          },
          "output": {
            "$ref": "#/components/schemas/OutputMode",
            "default": "file",
            "description": "`json` returns the envelope with the artifact inline, `file` returns the artifact as the response body; with a destination the response is always the light JSON envelope"
          },
          "options": {
            "$ref": "#/components/schemas/ScreenshotOptions",
            "description": "Operation options, omitted fields take their defaults"
          }
        },
        "required": [
          "source"
        ],
        "title": "ScreenshotRequest",
        "type": "object"
      },
      "ThumbnailRequest": {
        "additionalProperties": false,
        "properties": {
          "source": {
            "description": "file://<part>, http(s):// URL or <protocol>://<connector>/<path>",
            "title": "Source",
            "type": "string"
          },
          "destination": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Connector URI to write the result to",
            "title": "Destination"
          },
          "output": {
            "$ref": "#/components/schemas/OutputMode",
            "default": "file",
            "description": "`json` returns the envelope with the artifact inline, `file` returns the artifact as the response body; with a destination the response is always the light JSON envelope"
          },
          "options": {
            "$ref": "#/components/schemas/ThumbnailOptions",
            "description": "Operation options, omitted fields take their defaults"
          }
        },
        "required": [
          "source"
        ],
        "title": "ThumbnailRequest",
        "type": "object"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "description": "Static API key from PAPYRUS_API_KEY",
        "scheme": "bearer"
      }
    }
  }
}