{
  "openapi": "3.1.0",
  "info": {
    "title": "PDF Tools API",
    "description": "Twelve PDF operations with JSON HTTPS inputs or multipart uploads. Outputs expire after one hour. No input filenames, local paths or command arguments are accepted.",
    "version": "0.1.0"
  },
  "paths": {
    "/": {
      "get": {
        "summary": "Home",
        "operationId": "home",
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "405": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "415": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "416": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "504": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "507": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "head": {
        "summary": "Home",
        "operationId": "head_home",
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "405": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "415": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "416": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "504": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "507": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/identity": {
      "get": {
        "summary": "Identity",
        "operationId": "identity",
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "405": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "415": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "416": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "504": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "507": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/version": {
      "get": {
        "summary": "Version",
        "operationId": "version",
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "405": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "415": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "416": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "504": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "507": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/health": {
      "get": {
        "summary": "Health",
        "operationId": "health",
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "405": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "415": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "416": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "504": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "507": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/self-test": {
      "post": {
        "summary": "Self Test",
        "operationId": "self_test",
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "405": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "415": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "416": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "504": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "507": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "description": "Create, serialize and reopen a one-page PDF in a disposable worker, returning a deterministic JSON status with no result files. Shares the business admission slot and returns 429 while busy.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "maxProperties": 0
              },
              "example": {}
            }
          }
        }
      }
    },
    "/v1/pdf": {
      "post": {
        "summary": "Inspect or transform PDFs",
        "operationId": "process_pdf",
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "405": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "415": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "416": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "504": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "507": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "description": "At most 500 combined input pages. One business job runs at a time; its disposable worker is killed after 60 seconds. Generated output is capped at 100,000,000 bytes per file and 100,000,000 bytes in total. All transformed PDFs are unencrypted except encrypt (AES-256). Whole-document rewrites retain forms and bookmarks when structurally possible and invalidate digital signatures. Merge, split and extract preserve interactive forms, may rename colliding fields, can carry shared field subtrees beyond selected pages, and omit document bookmarks. optimize_structure performs lossless structural storage changes without lossy image recompression or content removal; smaller output is not guaranteed. remove_metadata clears document information and XMP metadata throughout the PDF; it does not redact visible text or other embedded content. repair is best-effort structural recovery and does not guarantee rendering.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfJsonRequest"
              },
              "examples": {
                "inspect": {
                  "value": {
                    "operation": "inspect",
                    "input_urls": [
                      "https://example.com/document.pdf"
                    ],
                    "options": {}
                  }
                },
                "rotate": {
                  "value": {
                    "operation": "rotate",
                    "input_urls": [
                      "https://example.com/document.pdf"
                    ],
                    "options": {
                      "angle": 90,
                      "pages": [
                        1
                      ]
                    }
                  }
                },
                "merge": {
                  "value": {
                    "operation": "merge",
                    "input_urls": [
                      "https://example.com/a.pdf",
                      "https://example.com/b.pdf"
                    ],
                    "options": {}
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/PdfMultipartRequest"
              },
              "encoding": {
                "options": {
                  "contentType": "text/plain"
                }
              },
              "examples": {
                "split": {
                  "value": {
                    "operation": "split",
                    "file": "(PDF binary)",
                    "options": "{\"pages_per_file\":2}"
                  }
                },
                "merge": {
                  "value": {
                    "operation": "merge",
                    "files": [
                      "(PDF binary)",
                      "(PDF binary)"
                    ],
                    "options": "{}"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/results/{name}": {
      "get": {
        "summary": "Download Result",
        "operationId": "download_result",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Name"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Temporary PDF",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "422": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "400": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "405": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "415": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "416": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "504": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "507": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "head": {
        "summary": "Download Result",
        "operationId": "head_download_result",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Name"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Temporary PDF",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "422": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "400": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "405": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "415": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "416": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "504": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "507": {
            "description": "JSON error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "MergeOptions": {
        "additionalProperties": false,
        "properties": {
          "password": {
            "anyOf": [
              {
                "format": "password",
                "type": "string",
                "writeOnly": true
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Input PDF password; kept in process memory.",
            "title": "Password"
          },
          "passwords": {
            "anyOf": [
              {
                "items": {
                  "anyOf": [
                    {
                      "format": "password",
                      "type": "string",
                      "writeOnly": true
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "maxItems": 10,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Passwords"
          }
        },
        "title": "MergeOptions",
        "type": "object"
      },
      "Operation": {
        "enum": [
          "inspect",
          "check",
          "split",
          "merge",
          "extract_pages",
          "rotate",
          "linearize",
          "optimize_structure",
          "remove_metadata",
          "encrypt",
          "decrypt",
          "repair"
        ],
        "title": "Operation",
        "type": "string"
      },
      "JsonPdfRequest": {
        "additionalProperties": false,
        "properties": {
          "operation": {
            "$ref": "#/components/schemas/Operation"
          },
          "input_urls": {
            "items": {
              "maxLength": 2048,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 10,
            "minItems": 1,
            "title": "Input Urls",
            "type": "array"
          },
          "options": {
            "additionalProperties": true,
            "title": "Options",
            "type": "object"
          }
        },
        "required": [
          "operation",
          "input_urls"
        ],
        "title": "JsonPdfRequest",
        "type": "object"
      },
      "EncryptOptions": {
        "additionalProperties": false,
        "properties": {
          "password": {
            "anyOf": [
              {
                "format": "password",
                "type": "string",
                "writeOnly": true
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Input PDF password; kept in process memory.",
            "title": "Password"
          },
          "owner_password": {
            "description": "Required owner password, 8 to 127 UTF-8 bytes; AES-256 only.",
            "format": "password",
            "title": "Owner Password",
            "type": "string",
            "writeOnly": true
          },
          "user_password": {
            "description": "Required user password, 8 to 127 UTF-8 bytes; AES-256 only.",
            "format": "password",
            "title": "User Password",
            "type": "string",
            "writeOnly": true
          }
        },
        "required": [
          "owner_password",
          "user_password"
        ],
        "title": "EncryptOptions",
        "type": "object"
      },
      "ExtractOptions": {
        "additionalProperties": false,
        "properties": {
          "password": {
            "anyOf": [
              {
                "format": "password",
                "type": "string",
                "writeOnly": true
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Input PDF password; kept in process memory.",
            "title": "Password"
          },
          "pages": {
            "items": {
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            },
            "maxItems": 500,
            "minItems": 1,
            "title": "Pages",
            "type": "array",
            "uniqueItems": true
          }
        },
        "required": [
          "pages"
        ],
        "title": "ExtractOptions",
        "type": "object"
      },
      "SplitOptions": {
        "additionalProperties": false,
        "properties": {
          "password": {
            "anyOf": [
              {
                "format": "password",
                "type": "string",
                "writeOnly": true
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Input PDF password; kept in process memory.",
            "title": "Password"
          },
          "pages_per_file": {
            "default": 1,
            "maximum": 500,
            "minimum": 1,
            "title": "Pages Per File",
            "type": "integer"
          }
        },
        "title": "SplitOptions",
        "type": "object"
      },
      "RotateOptions": {
        "additionalProperties": false,
        "properties": {
          "password": {
            "anyOf": [
              {
                "format": "password",
                "type": "string",
                "writeOnly": true
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Input PDF password; kept in process memory.",
            "title": "Password"
          },
          "angle": {
            "enum": [
              90,
              180,
              270
            ],
            "title": "Angle",
            "type": "integer"
          },
          "pages": {
            "anyOf": [
              {
                "items": {
                  "maximum": 500,
                  "minimum": 1,
                  "type": "integer"
                },
                "maxItems": 500,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Pages",
            "uniqueItems": true
          }
        },
        "required": [
          "angle"
        ],
        "title": "RotateOptions",
        "type": "object"
      },
      "CommonOptions": {
        "additionalProperties": false,
        "properties": {
          "password": {
            "anyOf": [
              {
                "format": "password",
                "type": "string",
                "writeOnly": true
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Input PDF password; kept in process memory.",
            "title": "Password"
          }
        },
        "title": "CommonOptions",
        "type": "object"
      },
      "PdfJsonRequest": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "input_urls"
            ],
            "properties": {
              "operation": {
                "type": "string",
                "const": "inspect"
              },
              "input_urls": {
                "type": "array",
                "minItems": 1,
                "maxItems": 1,
                "items": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048,
                  "pattern": "^https://"
                },
                "description": "Public HTTPS on port 443 only. DNS and every redirect are checked and pinned; private networks are blocked."
              },
              "options": {
                "$ref": "#/components/schemas/CommonOptions"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "input_urls"
            ],
            "properties": {
              "operation": {
                "type": "string",
                "const": "check"
              },
              "input_urls": {
                "type": "array",
                "minItems": 1,
                "maxItems": 1,
                "items": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048,
                  "pattern": "^https://"
                },
                "description": "Public HTTPS on port 443 only. DNS and every redirect are checked and pinned; private networks are blocked."
              },
              "options": {
                "$ref": "#/components/schemas/CommonOptions"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "input_urls"
            ],
            "properties": {
              "operation": {
                "type": "string",
                "const": "split"
              },
              "input_urls": {
                "type": "array",
                "minItems": 1,
                "maxItems": 1,
                "items": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048,
                  "pattern": "^https://"
                },
                "description": "Public HTTPS on port 443 only. DNS and every redirect are checked and pinned; private networks are blocked."
              },
              "options": {
                "$ref": "#/components/schemas/SplitOptions"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "input_urls"
            ],
            "properties": {
              "operation": {
                "type": "string",
                "const": "merge"
              },
              "input_urls": {
                "type": "array",
                "minItems": 2,
                "maxItems": 10,
                "items": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048,
                  "pattern": "^https://"
                },
                "description": "Public HTTPS on port 443 only. DNS and every redirect are checked and pinned; private networks are blocked."
              },
              "options": {
                "$ref": "#/components/schemas/MergeOptions"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "input_urls",
              "options"
            ],
            "properties": {
              "operation": {
                "type": "string",
                "const": "extract_pages"
              },
              "input_urls": {
                "type": "array",
                "minItems": 1,
                "maxItems": 1,
                "items": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048,
                  "pattern": "^https://"
                },
                "description": "Public HTTPS on port 443 only. DNS and every redirect are checked and pinned; private networks are blocked."
              },
              "options": {
                "$ref": "#/components/schemas/ExtractOptions"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "input_urls",
              "options"
            ],
            "properties": {
              "operation": {
                "type": "string",
                "const": "rotate"
              },
              "input_urls": {
                "type": "array",
                "minItems": 1,
                "maxItems": 1,
                "items": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048,
                  "pattern": "^https://"
                },
                "description": "Public HTTPS on port 443 only. DNS and every redirect are checked and pinned; private networks are blocked."
              },
              "options": {
                "$ref": "#/components/schemas/RotateOptions"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "input_urls"
            ],
            "properties": {
              "operation": {
                "type": "string",
                "const": "linearize"
              },
              "input_urls": {
                "type": "array",
                "minItems": 1,
                "maxItems": 1,
                "items": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048,
                  "pattern": "^https://"
                },
                "description": "Public HTTPS on port 443 only. DNS and every redirect are checked and pinned; private networks are blocked."
              },
              "options": {
                "$ref": "#/components/schemas/CommonOptions"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "input_urls"
            ],
            "properties": {
              "operation": {
                "type": "string",
                "const": "optimize_structure"
              },
              "input_urls": {
                "type": "array",
                "minItems": 1,
                "maxItems": 1,
                "items": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048,
                  "pattern": "^https://"
                },
                "description": "Public HTTPS on port 443 only. DNS and every redirect are checked and pinned; private networks are blocked."
              },
              "options": {
                "$ref": "#/components/schemas/CommonOptions"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "input_urls"
            ],
            "properties": {
              "operation": {
                "type": "string",
                "const": "remove_metadata"
              },
              "input_urls": {
                "type": "array",
                "minItems": 1,
                "maxItems": 1,
                "items": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048,
                  "pattern": "^https://"
                },
                "description": "Public HTTPS on port 443 only. DNS and every redirect are checked and pinned; private networks are blocked."
              },
              "options": {
                "$ref": "#/components/schemas/CommonOptions"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "input_urls",
              "options"
            ],
            "properties": {
              "operation": {
                "type": "string",
                "const": "encrypt"
              },
              "input_urls": {
                "type": "array",
                "minItems": 1,
                "maxItems": 1,
                "items": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048,
                  "pattern": "^https://"
                },
                "description": "Public HTTPS on port 443 only. DNS and every redirect are checked and pinned; private networks are blocked."
              },
              "options": {
                "$ref": "#/components/schemas/EncryptOptions"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "input_urls"
            ],
            "properties": {
              "operation": {
                "type": "string",
                "const": "decrypt"
              },
              "input_urls": {
                "type": "array",
                "minItems": 1,
                "maxItems": 1,
                "items": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048,
                  "pattern": "^https://"
                },
                "description": "Public HTTPS on port 443 only. DNS and every redirect are checked and pinned; private networks are blocked."
              },
              "options": {
                "$ref": "#/components/schemas/CommonOptions"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "input_urls"
            ],
            "properties": {
              "operation": {
                "type": "string",
                "const": "repair"
              },
              "input_urls": {
                "type": "array",
                "minItems": 1,
                "maxItems": 1,
                "items": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048,
                  "pattern": "^https://"
                },
                "description": "Public HTTPS on port 443 only. DNS and every redirect are checked and pinned; private networks are blocked."
              },
              "options": {
                "$ref": "#/components/schemas/CommonOptions"
              }
            }
          }
        ],
        "discriminator": {
          "propertyName": "operation"
        }
      },
      "PdfMultipartRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "operation"
        ],
        "oneOf": [
          {
            "required": [
              "file"
            ],
            "not": {
              "required": [
                "files"
              ]
            }
          },
          {
            "required": [
              "files"
            ],
            "not": {
              "required": [
                "file"
              ]
            }
          }
        ],
        "properties": {
          "operation": {
            "type": "string",
            "enum": [
              "inspect",
              "check",
              "split",
              "merge",
              "extract_pages",
              "rotate",
              "linearize",
              "optimize_structure",
              "remove_metadata",
              "encrypt",
              "decrypt",
              "repair"
            ]
          },
          "file": {
            "type": "string",
            "format": "binary",
            "description": "One PDF, at most 50,000,000 bytes. The upload filename is ignored."
          },
          "files": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "type": "string",
              "format": "binary"
            },
            "description": "Repeat the files part. Multiple inputs are accepted by merge only; at most 100,000,000 combined bytes."
          },
          "options": {
            "type": "string",
            "maxLength": 16384,
            "default": "{}",
            "description": "A JSON object using the operation's options schema. Passwords stay in process memory; unsupported keys are rejected.",
            "examples": [
              "{\"pages_per_file\":2}",
              "{\"angle\":90,\"pages\":[1,3]}",
              "{\"pages\":[3,1]}"
            ]
          }
        }
      },
      "ApiSuccess": {
        "type": "object",
        "required": [
          "ok",
          "service"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "service": {
            "const": "pdf-tools"
          },
          "operation": {
            "type": "string"
          },
          "data": {
            "type": "object"
          },
          "outputs": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "url",
                "bytes",
                "page_count",
                "expires_at"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "pattern": "^(https://[^/]+)?/results/[0-9a-f-]+\\.pdf$"
                },
                "bytes": {
                  "type": "integer"
                },
                "page_count": {
                  "type": "integer"
                },
                "expires_at": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ApiError": {
        "type": "object",
        "required": [
          "ok",
          "service",
          "error"
        ],
        "properties": {
          "ok": {
            "const": false
          },
          "service": {
            "const": "pdf-tools"
          },
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  },
  "x-service-id": "pdf-tools",
  "x-api-id": "pdf-v1"
}
