{
  "openapi": "3.1.0",
  "info": {
    "title": "Unsiloed Parser API — v2",
    "description": "Direct upload API. The client uploads the file directly using a presigned URL — the server is never in the file transfer path. Use GET /parse/{job_id} (v1 endpoint) to poll job status.",
    "contact": {
      "name": "Unsiloed",
      "url": "https://unsiloed.ai",
      "email": "hello@unsiloed.com"
    },
    "license": {
      "name": ""
    },
    "version": "2.0.0"
  },
  "servers": [
    {
      "url": "https://prod.visionapi.unsiloed.ai",
      "description": "Production"
    }
  ],
  "paths": {
    "/v2/parse/upload": {
      "post": {
        "tags": [
          "Parse v2 (Presigned Upload)"
        ],
        "summary": "POST /v2/parse/upload",
        "description": "Creates a parse job and returns a presigned S3 PUT URL.\nThe client uploads the file directly to S3 (server not involved in the transfer).\nOnce the upload completes, the system enqueues the job automatically via S3 event notification.\nPoll GET /parse/{job_id} to track progress.",
        "operationId": "create_presigned_upload",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PresignedUploadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Upload URL created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PresignedUploadResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid file_name or unsupported file type"
          },
          "401": {
            "description": "Unauthorized"
          },
          "402": {
            "description": "Insufficient quota — not enough page credits remaining."
          },
          "403": {
            "description": "Forbidden — access has been revoked."
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "500": {
            "description": "Internal server error."
          },
          "503": {
            "description": "Service unavailable — job queue is at capacity. Retry after the duration indicated in the `Retry-After` header."
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/v2/parse/{job_id}": {
      "get": {
        "tags": [
          "Parse v2 (Presigned Upload)"
        ],
        "summary": "GET /v2/parse/{job_id}",
        "description": "Retrieves the status and results of a parse job submitted via\n`POST /v2/parse/upload`. Functionally identical to `GET /parse/{job_id}` (v1) —\nsame request shape, same response body, same query/header behavior — and routed\nto the same handler internally. This path exists so v2 clients can keep a\nconsistent `/v2/...` URL prefix for both job creation and polling.",
        "operationId": "get_parse_task_v2",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Job ID returned by `POST /v2/parse/upload`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_chunks",
            "in": "query",
            "description": "Include the `chunks` array in the response. Defaults to `true`.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "base64_urls",
            "in": "query",
            "description": "Return segment images as base64-encoded data URIs instead of S3 presigned URLs.\nDefaults to `false`.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "output_file",
            "in": "query",
            "description": "Return a presigned S3 URL to the raw output JSON file instead of inlining the\nfull response body. Also accepted as the `output-file` request header.\nDefaults to `false`.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "enhanced_table",
            "in": "query",
            "description": "Apply enhanced table post-processing when assembling the response — improves\ncell-merge accuracy and structure recovery for complex tables, at the cost\nof extra latency. Also accepted as the `enhanced-table` request header.\nDefaults to `false`.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "merge_tables",
            "in": "query",
            "description": "Apply the cross-page table-merge post-processing pass when assembling the\nresponse. Has no effect unless the job was parsed with `merge_tables=true`\n(the merge work runs at parse time). Defaults to `false`.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_url",
            "in": "query",
            "description": "Include file URLs (`pdf_url`, `file_url`, segment images, exports,\n`configuration.input_file_url`) in the response. When `false` (default),\nevery URL-bearing field is nulled so the response — and any log of it —\ndoes not leak the storage bucket/region/path. Also accepted as the\n`include-url` request header.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job status and results. Output fields (`chunks`, `total_chunks`, `page_count`, `pdf_url`) are present only when status is `Succeeded`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ParseGetResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden — you don't have permission to access this task."
          },
          "404": {
            "description": "Job not found.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded."
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AutoGenerationConfig": {
        "type": "object",
        "properties": {
          "content_source": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ContentSource",
                "description": "Controls which source is used to populate the `content` field"
              }
            ],
            "default": "OCR"
          },
          "crop_image": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CroppingStrategy"
              }
            ],
            "default": "Auto"
          },
          "embed_sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmbedSource"
            },
            "default": "[Markdown]"
          },
          "extended_context": {
            "type": "boolean",
            "description": "Use the full page image as context for VLM generation",
            "default": false
          },
          "html": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/GenerationStrategy"
              }
            ],
            "default": "Auto"
          },
          "markdown": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/GenerationStrategy"
              }
            ],
            "default": "Auto"
          },
          "translation": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TranslationConfig",
                "description": "Optional translation configuration for this segment type"
              }
            ]
          },
          "vlm": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "BoundingBox": {
        "type": "object",
        "description": "Bounding box for an item. It is used for chunks, segments and OCR results.",
        "required": [
          "left",
          "top",
          "width",
          "height"
        ],
        "properties": {
          "height": {
            "type": "number",
            "format": "float",
            "description": "The height of the bounding box."
          },
          "left": {
            "type": "number",
            "format": "float",
            "description": "The left coordinate of the bounding box."
          },
          "top": {
            "type": "number",
            "format": "float",
            "description": "The top coordinate of the bounding box."
          },
          "width": {
            "type": "number",
            "format": "float",
            "description": "The width of the bounding box."
          }
        }
      },
      "Chunk": {
        "type": "object",
        "required": [
          "chunk_length",
          "segments"
        ],
        "properties": {
          "chunk_id": {
            "type": "string",
            "description": "The unique identifier for the chunk."
          },
          "chunk_length": {
            "type": "integer",
            "format": "int32",
            "description": "The total number of tokens in the chunk. Calculated by the `tokenizer`.",
            "minimum": 0
          },
          "embed": {
            "type": [
              "string",
              "null"
            ],
            "description": "Suggested text to be embedded for the chunk. This text is generated by combining the embed content\nfrom each segment according to the configured embed sources (HTML, Markdown, LLM, or Content).\nCan be configured using `embed_sources` in the `SegmentProcessing` configuration."
          },
          "segments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Segment"
            },
            "description": "Collection of document segments that form this chunk.\nWhen `target_chunk_length` > 0, contains the maximum number of segments\nthat fit within that length (segments remain intact).\nOtherwise, contains exactly one segment."
          }
        }
      },
      "ChunkProcessing": {
        "type": "object",
        "description": "Controls the setting for the chunking and post-processing of each chunk.",
        "properties": {
          "ignore_headers_and_footers": {
            "type": "boolean",
            "description": "Whether to ignore headers and footers in the chunking process.",
            "default": false
          },
          "target_length": {
            "type": "integer",
            "format": "int32",
            "description": "The target number of words in each chunk. If 0, each chunk will contain a single segment.",
            "default": 512,
            "minimum": 0
          },
          "tokenizer": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/TokenizerType",
                "description": "The tokenizer to use for the chunking process."
              }
            ],
            "default": "Word"
          }
        }
      },
      "Configuration": {
        "type": "object",
        "required": [
          "chunk_processing",
          "high_resolution",
          "ocr_strategy",
          "ocr_engine",
          "segment_analysis",
          "layout_analysis",
          "segment_type_naming",
          "error_handling"
        ],
        "properties": {
          "agentic_ocr": {
            "type": [
              "string",
              "null"
            ],
            "description": "Agentic OCR engine to use. None = disabled. Some(\"standard\") or Some(\"advanced\")."
          },
          "chunk_processing": {
            "$ref": "#/components/schemas/ChunkProcessing"
          },
          "detect_pii": {
            "type": "boolean",
            "description": "When true, run a PII detection pass before parsing. If PII is found at\nor above `pii_block_severity`, the task is rejected and no parsing occurs."
          },
          "enhance_reading_order": {
            "type": "boolean",
            "description": "Reorder detected segments to follow the document's natural reading order.\nUseful for multi-column layouts (newspapers, two- or three-column papers).\nHas no effect when `layout_analysis=\"page_by_page\"`. Defaults to `false`."
          },
          "error_handling": {
            "$ref": "#/components/schemas/ErrorHandlingStrategy"
          },
          "excel_config": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ExcelConfiguration",
                "description": "Excel-specific config, set only for tasks created via `POST /parse/excel`.\n`None` for every PDF/image/office task. Forwarded to the Excel pipeline service."
              }
            ]
          },
          "expires_in": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "The number of seconds until task is deleted.\nExpired tasks can **not** be updated, polled or accessed via web interface."
          },
          "export_format": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/ExportFormat"
            },
            "description": "Export format(s) requested for this task. When present, the pipeline generates\nexport files after processing. Currently supported: `[\"docx\"]`."
          },
          "extract_colors": {
            "type": "boolean",
            "description": "Whether to extract and apply color information from PDF text layer to OCR results.\nWhen enabled, text color (RGB/hex) from the PDF is transferred to matching OCR words.\nDefault: false"
          },
          "extract_links": {
            "type": "boolean",
            "description": "Whether to extract and apply hyperlink annotations from PDF to OCR results.\nWhen enabled, link URLs from PDF annotations are attached to matching OCR words.\nDefault: false"
          },
          "extract_strikethrough": {
            "type": "boolean",
            "description": "Preserve strikethrough formatting in HTML/Markdown output. Default: false."
          },
          "high_resolution": {
            "type": "boolean",
            "description": "Whether to use high-resolution images for cropping and post-processing."
          },
          "input_file_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The presigned URL of the input file."
          },
          "json_schema": {
            "deprecated": true
          },
          "layout_analysis": {
            "$ref": "#/components/schemas/SegmentationStrategy"
          },
          "segmentation_version": {
            "$ref": "#/components/schemas/SegmentationVersion"
          },
          "merge_batch_size": {
            "type": "integer",
            "format": "int32",
            "description": "Maximum number of tables allowed in a single merge group.\nGroups larger than this are split into sub-groups of this size.\nDefaults to 20. Helps avoid Gemini rate limits on very large documents."
          },
          "merge_tables": {
            "type": "boolean",
            "description": "Whether to merge adjacent tables using VLM"
          },
          "model": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Model"
              }
            ]
          },
          "ocr_engine": {
            "$ref": "#/components/schemas/OcrEngine"
          },
          "ocr_strategy": {
            "$ref": "#/components/schemas/OcrStrategy"
          },
          "output_fields": {
            "$ref": "#/components/schemas/OutputFieldsConfig",
            "description": "Configuration for controlling which output fields are included in responses.\nAllows selective inclusion/exclusion of HTML, Markdown, OCR, images, etc.\nSkipped from the echo when it's the all-true default so a Slim response\ndoesn't carry a misleading \"everything on\" block."
          },
          "page_numbers": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Explicit mapping of array indices to actual page numbers (1-based).\nUsed when parsing selective pages (e.g., [4, 5, 8, 9, 10, 11, 12]).\nPopulated from the page_range parameter."
          },
          "page_range": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional page range to process (e.g., \"1-5,8,10-12\"). If None, all pages are processed."
          },
          "pii_block_severity": {
            "$ref": "#/components/schemas/PiiBlockSeverity",
            "description": "Severity threshold at which to block parsing. Ignored if `detect_pii` is false."
          },
          "pii_engine": {
            "$ref": "#/components/schemas/PiiEngine",
            "description": "Which PII detector engine to use. Ignored if `detect_pii` is false."
          },
          "response_profile": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ResponseProfile",
                "description": "Optional high-level response shape selector.\n`None` (default) preserves the legacy behavior driven entirely by\n`output_fields`. `Some(Slim)` returns a minimal payload; `Some(Full)`\nforces every field on; `Some(Custom)` honors `output_fields` verbatim."
              }
            ]
          },
          "segment_analysis": {
            "$ref": "#/components/schemas/SegmentProcessing"
          },
          "segment_filter": {
            "type": "string",
            "description": "Segment filter: comma-separated segment types to keep, or \"all\".\nReplaces the old metadata-based keep_segment_types storage."
          },
          "segment_type_naming": {
            "$ref": "#/components/schemas/SegmentTypeNamingConvention",
            "description": "Controls the naming convention for segment types in the output"
          },
          "target_chunk_length": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "The target number of words in each chunk. If 0, each chunk will contain a single segment.",
            "deprecated": true,
            "minimum": 0
          },
          "validate_segments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SegmentType"
            }
          },
          "xml_citation": {
            "type": "boolean",
            "description": "Whether to extract structured citation data"
          }
        }
      },
      "ContentSource": {
        "type": "string",
        "description": "Controls which source is used to populate the `content` field in the segment output",
        "enum": [
          "OCR",
          "HTML",
          "Markdown",
          "VLM"
        ]
      },
      "CroppingStrategy": {
        "type": "string",
        "description": "- `All` crops all images and includes URLs in response\n- `Auto` crops images if needed for VLM processing and includes URLs in response\n- `None` crops images if needed for VLM processing but does NOT include URLs in response",
        "enum": [
          "All",
          "Auto",
          "None"
        ]
      },
      "EmbedSource": {
        "type": "string",
        "enum": [
          "HTML",
          "Markdown",
          "VLM",
          "Content"
        ]
      },
      "ErrorHandlingStrategy": {
        "type": "string",
        "description": "Controls how errors are handled during processing:\n- `Fail`: Stops processing and fails the task when any error occurs\n- `Continue`: Attempts to continue processing despite non-critical errors (eg. LLM refusals etc.)",
        "enum": [
          "Fail",
          "Continue"
        ]
      },
      "ExcelConfiguration": {
        "type": "object",
        "description": "Excel-specific parsing configuration, forwarded verbatim to the Excel pipeline\nservice (`services/Excel_pipeline` `POST /parse`). These are the ONLY knobs the\nExcel pipeline honors — none of the PDF parsing fields (OCR, layout, segments)\napply. Defaults mirror the service's own `SpreadsheetConfig` defaults so an\nomitted value behaves identically to not setting it. Set on a task via the\ndedicated `POST /parse/excel` endpoint; `None` for every non-Excel task.",
        "properties": {
          "cell_colors": {
            "type": "boolean",
            "description": "Include cell background/font colors (only when `cell_metadata`). Default true."
          },
          "cell_metadata": {
            "type": "boolean",
            "description": "Include cell color, formula, and dropdown metadata in the output. Default false."
          },
          "dropdowns": {
            "type": "boolean",
            "description": "Include data-validation dropdown options (only when `cell_metadata`). Default true."
          },
          "exclude_hidden": {
            "type": "boolean",
            "description": "Drop hidden sheets/rows/cols/styling from the output. Default false."
          },
          "exclude_hidden_cols": {
            "type": "boolean",
            "description": "When excluding hidden content, also drop hidden columns. Default true."
          },
          "exclude_hidden_rows": {
            "type": "boolean",
            "description": "When excluding hidden content, also drop hidden rows. Default true."
          },
          "exclude_hidden_sheets": {
            "type": "boolean",
            "description": "When excluding hidden content, also drop hidden sheets. Default true."
          },
          "exclude_images": {
            "type": "boolean",
            "description": "When excluding hidden content, also drop embedded/pasted images. Default false."
          },
          "exclude_styling": {
            "type": "boolean",
            "description": "When excluding hidden content, also drop styling. Default true."
          },
          "formulas": {
            "type": "boolean",
            "description": "Include cell formulas (only when `cell_metadata`). Default true."
          },
          "max_rows_per_segment": {
            "type": "integer",
            "format": "int32",
            "description": "Max rows per split segment when `split_large_tables`. Default 50."
          },
          "split_large_tables": {
            "type": "boolean",
            "description": "Split large tables into smaller segments. Default true."
          },
          "table_clustering": {
            "type": "string",
            "description": "Table clustering effort: `accurate` (default), `fast`, or `off`."
          }
        }
      },
      "ExportFormat": {
        "type": "string",
        "description": "File format for exporting parsed results. When specified in a parse request,\nthe pipeline generates the requested export file after processing completes.\nThe exported file is available via the `exports` field in the task response.",
        "enum": [
          "docx",
          "markdown",
          "json"
        ]
      },
      "FallbackStrategy": {
        "oneOf": [
          {
            "type": "string",
            "description": "No fallback will be used",
            "enum": [
              "None"
            ]
          },
          {
            "type": "string",
            "description": "Use the system default fallback model",
            "enum": [
              "Default"
            ]
          },
          {
            "type": "object",
            "description": "Use a specific model as fallback",
            "required": [
              "Model"
            ],
            "properties": {
              "Model": {
                "type": "string",
                "description": "Use a specific model as fallback"
              }
            }
          }
        ],
        "description": "Specifies the fallback strategy for LLM processing\n\nThis can be:\n1. None - No fallback will be used\n2. Default - The system default fallback model will be used\n3. Model - A specific model ID will be used as fallback (check the documentation for the models.)"
      },
      "GenerationStrategy": {
        "type": "string",
        "enum": [
          "VLM",
          "Auto"
        ]
      },
      "LlmGenerationConfig": {
        "type": "object",
        "properties": {
          "content_source": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ContentSource",
                "description": "Controls which source is used to populate the `content` field (default: OCR)"
              }
            ],
            "default": "OCR"
          },
          "crop_image": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CroppingStrategy"
              }
            ],
            "default": "Auto"
          },
          "embed_sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmbedSource"
            },
            "default": "[Markdown]"
          },
          "extended_context": {
            "type": "boolean",
            "description": "Use the full page image as context for VLM generation",
            "default": false
          },
          "html": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/GenerationStrategy"
              }
            ],
            "default": "VLM"
          },
          "markdown": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/GenerationStrategy"
              }
            ],
            "default": "VLM"
          },
          "model_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Model ID for VLM generation"
          },
          "translation": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TranslationConfig",
                "description": "Optional translation configuration for this segment type"
              }
            ]
          },
          "use_table_ocr": {
            "type": "boolean",
            "description": "Use dedicated OCR for table processing to provide structured context to VLM (default: false)",
            "default": false
          },
          "vlm": {
            "type": [
              "string",
              "null"
            ],
            "description": "Prompt for the VLM model"
          }
        }
      },
      "LlmProcessing": {
        "type": "object",
        "description": "Controls the LLM used for the task.",
        "properties": {
          "fallback_strategy": {
            "$ref": "#/components/schemas/FallbackStrategy",
            "description": "The fallback strategy to use for the LLMs in the task."
          },
          "max_completion_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "The maximum number of tokens to generate.",
            "minimum": 0
          },
          "model_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The ID of the model to use for the task. If not provided, the default model will be used.\nPlease check the documentation for the model you want to use."
          },
          "temperature": {
            "type": "number",
            "format": "float",
            "description": "The temperature to use for the LLM."
          }
        }
      },
      "Model": {
        "type": "string",
        "enum": [
          "Fast",
          "HighQuality"
        ],
        "deprecated": true
      },
      "OCRResult": {
        "type": "object",
        "description": "OCR results for a segment",
        "required": [
          "bbox",
          "text"
        ],
        "properties": {
          "bbox": {
            "$ref": "#/components/schemas/BoundingBox"
          },
          "color": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TextColor",
                "description": "Optional text color (RGB) provided by OCR engine"
              }
            ]
          },
          "confidence": {
            "type": [
              "number",
              "null"
            ],
            "format": "float",
            "description": "The confidence score of the recognized text."
          },
          "link": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional link URL associated with this OCR result (from PDF annotations)"
          },
          "text": {
            "type": "string",
            "description": "The recognized text of the OCR result."
          }
        }
      },
      "OcrEngine": {
        "type": "string",
        "description": "Controls which OCR engine to use for text recognition:\n- `UnsiloedStorm`: Enterprise-grade accuracy, optimized for 50+ languages\n- `UnsiloedHawk`: Higher accuracy, better for complex layouts [DEFAULT]\n- `UnsiloedBeta`: Handles irregular bounding boxes, rotated/warped text",
        "enum": [
          "UnsiloedStorm",
          "UnsiloedHawk",
          "UnsiloedBeta"
        ]
      },
      "OcrStrategy": {
        "type": "string",
        "description": "Controls the Optical Character Recognition (OCR) strategy.\n- `All`: Processes all pages with OCR. (Latency penalty: ~0.5 seconds per page)\n- `Auto`: Selectively applies OCR only to pages with missing or low-quality text. When text layer is present the bounding boxes from the text layer are used.",
        "enum": [
          "force_ocr",
          "auto_detection"
        ]
      },
      "OutputFieldsConfig": {
        "type": "object",
        "description": "Per-field include/exclude filter for the response. Each field defaults to\n`true`; set a field to `false` to drop it. Honored when `response_profile`\nis omitted or set to `custom`. Ignored when `response_profile` is `slim`\nor `full` (the profile wins).",
        "properties": {
          "bbox": {
            "type": "boolean",
            "description": "Include bounding box information in segment responses"
          },
          "chart_data": {
            "type": "boolean",
            "description": "Include extracted chart data for Picture segments identified as charts"
          },
          "confidence": {
            "type": "boolean",
            "description": "Include confidence scores in segment responses"
          },
          "content": {
            "type": "boolean",
            "description": "Include text content in segment responses"
          },
          "embed": {
            "type": "boolean",
            "description": "Include embed text in chunk responses"
          },
          "html": {
            "type": "boolean",
            "description": "Include HTML representation in segment responses"
          },
          "image": {
            "type": "boolean",
            "description": "Include images (cropped segment images) in segment responses"
          },
          "markdown": {
            "type": "boolean",
            "description": "Include Markdown representation in segment responses"
          },
          "ocr": {
            "type": "boolean",
            "description": "Include OCR results in segment responses"
          }
        }
      },
      "OutputResponse": {
        "type": "object",
        "description": "The processed results of a document analysis task",
        "required": [
          "chunks"
        ],
        "properties": {
          "chunks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Chunk"
            },
            "description": "Collection of document chunks, where each chunk contains one or more segments"
          },
          "exports": {
            "type": [
              "object",
              "null"
            ],
            "description": "Presigned download URLs for exported file formats.\nOnly present when `export_format` was specified in the parse request and the task has succeeded.\nKeys are format names (e.g. `\"docx\"`), values are presigned S3 URLs valid for 1 hour.\nExample: `{\"docx\": \"https://s3.amazonaws.com/...\"}`",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "extracted_json": {
            "description": "The extracted JSON from the document.",
            "deprecated": true
          },
          "file_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name of the file."
          },
          "metadata": {
            "description": "Citation metadata (when xml_citation is enabled)"
          },
          "output_file_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The presigned URL of the output JSON file stored in S3 (when output_file=true)"
          },
          "page_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "The number of pages in the file.",
            "minimum": 0
          },
          "pdf_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The presigned URL of the PDF file."
          }
        }
      },
      "PageBBox": {
        "type": "object",
        "description": "Bbox and page info for one page of a merged multi-page table.",
        "required": [
          "page_number",
          "page_height",
          "page_width",
          "bbox"
        ],
        "properties": {
          "bbox": {
            "$ref": "#/components/schemas/BoundingBox"
          },
          "page_height": {
            "type": "number",
            "format": "float"
          },
          "page_number": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "page_width": {
            "type": "number",
            "format": "float"
          }
        }
      },
      "ParseCreateRequest": {
        "type": "object",
        "description": "Request body for `POST /parse` (multipart/form-data).\n\nProvide either `file` (binary upload) or `url` (presigned/public URL) — not both.",
        "required": [
          "file"
        ],
        "properties": {
          "agentic_ocr": {
            "type": [
              "string",
              "null"
            ],
            "description": "Enable per-segment agentic OCR for higher accuracy. Pass `\"standard\"` or `\"advanced\"`."
          },
          "chunk_processing": {
            "type": [
              "string",
              "null"
            ],
            "description": "JSON object for chunk processing configuration."
          },
          "detect_pii": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Run a PII pre-check before parsing. When enabled, the document is scanned\nfor personally identifiable information before any extraction work happens.\nIf PII is found at or above `pii_block_severity`, the task is rejected and\nno parsing occurs (the job ends in a failed state with a PII reason).\nDefaults to `false`.",
            "default": false
          },
          "enhance_reading_order": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Reorder detected segments to follow the document's natural reading order.\nUseful for multi-column layouts (newspapers, two- or three-column papers).\nHas no effect when `layout_analysis=\"page_by_page\"`. Defaults to `false`.",
            "default": false
          },
          "error_handling": {
            "type": [
              "string",
              "null"
            ],
            "description": "Error handling strategy for non-critical processing errors.\n`Continue` (default) — proceed despite errors (e.g., LLM refusals).\n`Fail` — stop and fail the task on any error.",
            "default": "Continue"
          },
          "expires_in": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Reserved field. Persisted in the task configuration but currently has no\neffect on retention for this endpoint — `POST /parse` (multipart and JSON/Form)\ndoes not set the task's `expires_at` column, and the cleanup job only deletes\n`AwaitingUpload` rows past their `expires_at`. To get a presigned-upload TTL,\nuse `POST /v2/parse/upload` instead, where `expires_in` controls the upload\nURL's validity."
          },
          "export_format": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/ExportFormat"
            },
            "description": "Export format(s) to generate after processing.\nWhen set, the pipeline generates the requested export files after parsing completes.\nThe exported files are available as presigned URLs in the `exports` field of the response.\nSupported: `[\"docx\", \"markdown\", \"json\"]`.",
            "example": [
              "docx",
              "markdown",
              "json"
            ]
          },
          "extract_colors": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Transfer text color from the PDF text layer to OCR results. Defaults to `false`.",
            "default": false
          },
          "extract_links": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Attach hyperlink URLs from PDF annotations to OCR results. Defaults to `false`.",
            "default": false
          },
          "extract_strikethrough": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Preserve strikethrough formatting in HTML/Markdown output. Defaults to `false`.",
            "default": false
          },
          "file": {
            "type": "string",
            "format": "binary",
            "description": "Document file to process. Required if `url` is not provided.\nSupported formats: PDF, PNG, JPEG, TIFF, PPT, PPTX, DOC, DOCX, XLS, XLSX."
          },
          "layout_analysis": {
            "type": [
              "string",
              "null"
            ],
            "description": "Layout analysis strategy.\n`smart_layout_detection` (default) — detects layout elements using bounding boxes.\n`page_by_page` — treats each page as a single segment; faster for simple documents.\n`advanced_layout_detection` — higher-accuracy layout detection for complex pages\n(multi-column layouts, dense tables/figures); slower than `smart_layout_detection`.",
            "default": "smart_layout_detection"
          },
          "segmentation_version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Segmentation model version: `v1` (default) or `v2`.\n`v2` is form-aware and additionally returns `KeyValuePair`, `Signature`, and `Seal`\nsegments. Unrecognized values fall back to `v1`.",
            "enum": [
              "v1",
              "v2",
              null
            ]
          },
          "llm_processing": {
            "type": [
              "string",
              "null"
            ],
            "description": "JSON object for LLM processing configuration."
          },
          "merge_batch_size": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Maximum number of tables per merge group when `merge_tables` is enabled.\nGroups larger than this are split into separate merges. Defaults to `20`.",
            "default": 20
          },
          "merge_tables": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Merge tables that span multiple pages into a single unified structure. Defaults to `false`.",
            "default": false
          },
          "ocr_engine": {
            "type": [
              "string",
              "null"
            ],
            "description": "OCR engine to use for text recognition.\n`UnsiloedBeta` (default) — handles irregular bounding boxes, rotated/warped text.\n`UnsiloedHawk` — higher accuracy, better for complex layouts.\n`UnsiloedStorm` — enterprise-grade accuracy, optimized for 50+ languages.",
            "default": "UnsiloedBeta"
          },
          "ocr_strategy": {
            "type": [
              "string",
              "null"
            ],
            "description": "OCR strategy.\n`auto_detection` (default) — applies OCR only where needed.\n`force_ocr` — applies OCR to all content regardless of existing text layer.",
            "default": "auto_detection"
          },
          "output_fields": {
            "type": [
              "string",
              "null"
            ],
            "description": "JSON object filtering which fields appear on each segment / chunk.\nEach key defaults to `true`; set a key to `false` to drop the field.\nKeys: `bbox`, `chart_data`, `confidence`, `content`, `embed`, `html`,\n`image`, `markdown`, `ocr`. Example: `{\"html\": false, \"ocr\": false}`.\nIgnored when `response_profile` is `slim` or `full`."
          },
          "page_range": {
            "type": [
              "string",
              "null"
            ],
            "description": "Page range to process. Formats: `\"1-5\"`, `\"2,4,6\"`, `\"[1,3,5]\"`. Defaults to all pages."
          },
          "pii_block_severity": {
            "type": [
              "string",
              "null"
            ],
            "description": "Severity threshold at which a detected PII finding blocks the task.\nIgnored when `detect_pii` is `false`. Findings strictly below the threshold\nare allowed through; findings at or above it reject the task.\n- `any` (default) — block on any detection, regardless of severity.\n- `low` — block on low, medium, or high severity findings.\n- `medium` — block on medium or high severity findings.\n- `high` — block only on high severity findings.",
            "default": "any"
          },
          "pii_engine": {
            "type": [
              "string",
              "null"
            ],
            "description": "PII detector engine to use when `detect_pii` is `true`. Ignored otherwise.\n- `standard` (default) — fast pattern-based detector; low latency,\n  well-suited to bulk pre-screening.\n- `advanced` — model-based detector; slower but catches contextual\n  cases that pattern matching misses (e.g. handwritten names,\n  partially redacted IDs, document-style references to a person).",
            "default": "standard"
          },
          "response_profile": {
            "type": [
              "string",
              "null"
            ],
            "description": "Response shape selector: `slim`, `full`, or `custom`.\n- `slim`: chunk `embed` + bbox + page_number + segment_id +\n  segment_type + HTML for tables / Markdown for everything else.\n  Drops `content`, `image`, `ocr`, `confidence`, `chart_data`,\n  `page_height`, `page_width`.\n- `full`: every field returned (equivalent to omitting this param).\n- `custom`: honor `output_fields` verbatim.\n\nPrecedence: when both `response_profile` and `output_fields` are\nprovided, the profile wins (`output_fields` only matters for `custom`\nor when the profile is omitted).\n\nApplies to inline JSON responses only — `GET /parse/{job_id}?output_file=true`\nreturns a presigned URL to the stored full-shape output file.",
            "example": "slim"
          },
          "segment_analysis": {
            "type": [
              "string",
              "null"
            ],
            "description": "JSON object controlling HTML/Markdown generation strategy and AI model per segment type.\nExample: `{\"Table\": {\"html\": \"LLM\", \"markdown\": \"LLM\", \"model_id\": \"us_table_v2\"}}`."
          },
          "segment_filter": {
            "type": [
              "string",
              "null"
            ],
            "description": "Content filter: comma-separated segment types to keep.\nExample: `\"table,picture\"`. Use `\"all\"` to include everything. Defaults to `\"all\"`.",
            "default": "all"
          },
          "segment_processing": {
            "type": [
              "string",
              "null"
            ],
            "description": "Alias for `segment_analysis` (Core Parser name). If both are provided, this takes precedence."
          },
          "segment_type_naming": {
            "type": [
              "string",
              "null"
            ],
            "description": "Segment type naming convention.\n`Unsiloed` (default) — e.g., `PageHeader`, `ListItem`, `Picture`.\n`Other` — alternative names e.g., `Header`, `List Item`, `Figure`.",
            "default": "Unsiloed"
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Presigned or public URL of the document to fetch and process.\nRequired if `file` is not provided."
          },
          "use_high_resolution": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Use high-resolution images for cropping and post-processing.\nLatency penalty: ~2–3 s per page. Defaults to `true`.",
            "default": true
          },
          "validate_segments": {
            "type": [
              "string",
              "null"
            ],
            "description": "JSON array string of segment types to validate with VLM.\nExample: `[\"Table\", \"Formula\", \"Picture\"]`. Defaults to `[]`."
          },
          "validate_table_segments": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Legacy: validate table segment classifications using VLM.\nPrefer `validate_segments: [\"Table\"]` instead. Defaults to `false`.",
            "default": false
          },
          "xml_citation": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Extract and hyperlink bibliography citations in the markdown output. PDFs only.\nDefaults to `false`.",
            "default": false
          }
        }
      },
      "ParseCreateResponse": {
        "type": "object",
        "description": "Response body for a successful `POST /parse` call.",
        "required": [
          "job_id",
          "status",
          "file_name",
          "created_at",
          "message",
          "credit_used",
          "quota_remaining",
          "merge_tables"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "description": "ISO 8601 timestamp when the job was created."
          },
          "credit_used": {
            "type": "integer",
            "format": "int32",
            "description": "Number of pages deducted from your quota for this job."
          },
          "file_name": {
            "type": "string",
            "description": "Name of the uploaded file or `\"unknown\"` when a URL was provided."
          },
          "job_id": {
            "type": "string",
            "description": "Job identifier — pass this to `GET /parse/{job_id}` to poll for results."
          },
          "merge_tables": {
            "type": "boolean",
            "description": "Whether table merging is enabled for this job (reflects the submitted `merge_tables` value)."
          },
          "message": {
            "type": "string",
            "description": "Human-readable status message with a polling hint."
          },
          "quota_remaining": {
            "type": "integer",
            "format": "int64",
            "description": "Remaining page quota after this job was deducted."
          },
          "status": {
            "type": "string",
            "description": "Initial job status. Always `\"Starting\"` on creation."
          }
        }
      },
      "ParseGetResponse": {
        "type": "object",
        "description": "Response body for `GET /parse/{job_id}`.\n\nFields marked as optional appear only when the job has reached the relevant status.",
        "required": [
          "job_id",
          "status",
          "created_at",
          "metadata"
        ],
        "properties": {
          "chunks": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/Chunk"
            },
            "description": "Array of document chunks with segments and extracted content. Present when status is `Succeeded`."
          },
          "configuration": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Configuration",
                "description": "Configuration used for this job (mirrors the parameters submitted at creation time).\nThe effective `merge_tables` value lives at `configuration.merge_tables`."
              }
            ]
          },
          "created_at": {
            "type": "string",
            "description": "ISO 8601 timestamp when the job was created."
          },
          "credit_used": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Credits used for this job."
          },
          "exports": {
            "type": [
              "object",
              "null"
            ],
            "description": "Presigned download URLs for exported file formats.\nOnly present when `export_format` was specified in the parse request and the export has completed.\nKeys are format names (e.g. `\"docx\"`), values are presigned S3 URLs valid for 1 hour.\nExample: `{\"docx\": \"https://s3.amazonaws.com/...\"}`.\nIf export failed, contains `{\"docx_error\": \"...\"}` instead.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "file_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Original file name from the job record."
          },
          "file_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "MIME type of the uploaded file."
          },
          "file_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "S3 URL of the original uploaded file."
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 8601 timestamp when processing completed. Present when status is `Succeeded` or `Failed`."
          },
          "job_id": {
            "type": "string",
            "description": "Job identifier."
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Error or status detail message. Present when status is `Failed`."
          },
          "metadata": {
            "type": "object",
            "description": "Citation or job metadata. Populated when `xml_citation` is enabled or from the job record."
          },
          "page_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Number of pages in the document. Present when status is `Succeeded`."
          },
          "pdf_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Presigned S3 URL to the generated PDF. Present when status is `Succeeded`."
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 8601 timestamp when processing started. Present when status is not `Starting`."
          },
          "status": {
            "type": "string",
            "description": "Current job status: `Starting`, `Processing`, `Succeeded`, `Failed`, or `Cancelled`."
          },
          "total_chunks": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Total number of document chunks. Present when status is `Succeeded`."
          }
        }
      },
      "PictureCroppingStrategy": {
        "type": "string",
        "description": "Controls the cropping strategy for an item (e.g. segment, chunk, etc.)\n- `All` crops all images and includes URLs in response\n- `Auto` crops images if needed for VLM processing and includes URLs in response\n- `None` crops images if needed for VLM processing but does NOT include URLs in response",
        "enum": [
          "All",
          "Auto",
          "None"
        ]
      },
      "PictureGenerationConfig": {
        "type": "object",
        "properties": {
          "content_source": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ContentSource",
                "description": "Controls which source is used to populate the `content` field (default: OCR)"
              }
            ],
            "default": "OCR"
          },
          "crop_image": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PictureCroppingStrategy"
              }
            ],
            "default": "All"
          },
          "embed_sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmbedSource"
            },
            "default": "[Markdown]"
          },
          "extended_context": {
            "type": "boolean",
            "description": "Use the full page image as context for VLM generation",
            "default": false
          },
          "html": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/GenerationStrategy"
              }
            ],
            "default": "Auto"
          },
          "markdown": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/GenerationStrategy"
              }
            ],
            "default": "Auto"
          },
          "model_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Model ID for VLM generation"
          },
          "transcribe_text": {
            "type": "boolean",
            "description": "When true, text-bearing pictures (forms, handwritten pages, scanned\ndocuments, screenshots of text) are transcribed verbatim by the VLM\ninstead of described/summarized. Only takes effect for segments that\nactually contain OCR text — true figures (photos, charts, diagrams with\nlittle text) still get the standard description. Default: false.",
            "default": false
          },
          "translation": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TranslationConfig",
                "description": "Optional translation configuration for this segment type"
              }
            ]
          },
          "vlm": {
            "type": [
              "string",
              "null"
            ],
            "description": "Prompt for the VLM model"
          }
        }
      },
      "PiiBlockSeverity": {
        "type": "string",
        "description": "Severity threshold at which the task is rejected for PII.\n- `Any`: block on any PII found (strictest).\n- `Low`: block on quasi-identifiers (names, dates, locations) or higher.\n- `Medium`: block on contact PII (email, phone) or higher.\n- `High`: block only on direct identifiers (SSN, passport, credit card, etc.).",
        "enum": [
          "any",
          "low",
          "medium",
          "high"
        ]
      },
      "PiiEngine": {
        "type": "string",
        "description": "Engine used by the PII detector service.\n- `Standard`: regex + spaCy NER.\n- `Advanced`: VLM-based judgment via OpenAI-compatible API. Higher precision, costs per call.",
        "enum": [
          "standard",
          "advanced"
        ]
      },
      "PresignedUploadRequest": {
        "type": "object",
        "description": "Request body for POST /v2/parse/upload.\nConfiguration fields mirror the existing /parse multipart form fields.",
        "required": [
          "file_name"
        ],
        "properties": {
          "agentic_ocr": {
            "type": [
              "string",
              "null"
            ],
            "description": "Enable per-segment agentic OCR for higher accuracy. Pass `\"standard\"` or `\"advanced\"`."
          },
          "chunk_processing": {
            "description": "JSON object for chunk processing configuration."
          },
          "detect_pii": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Run a PII pre-check before parsing. When enabled, the document is scanned\nfor personally identifiable information before any extraction work happens.\nIf PII is found at or above `pii_block_severity`, the task is rejected and\nno parsing occurs (the job ends in a failed state with a PII reason).\nDefaults to `false`.",
            "default": false
          },
          "enhance_reading_order": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Reorder detected segments to follow the document's natural reading order.\nUseful for multi-column layouts (newspapers, two- or three-column papers).\nHas no effect when `layout_analysis=\"page_by_page\"`. Defaults to `false`."
          },
          "error_handling": {
            "type": [
              "string",
              "null"
            ],
            "description": "Error handling strategy: `Continue` (default) or `Fail`."
          },
          "expires_in": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Seconds the returned presigned upload URL stays valid. Defaults to the\n`PRESIGNED_UPLOAD_EXPIRY_SECS` env value (typically 900 / 15 min). Once\nthe client uploads the file, the task's `expires_at` is cleared and the\ntask lifetime is no longer bounded by this value."
          },
          "export_format": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/ExportFormat"
            },
            "description": "Export format(s) to generate after processing. Supported: `[\"docx\", \"markdown\", \"json\"]`."
          },
          "extract_colors": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Transfer text color from the PDF text layer to OCR results. Defaults to `false`."
          },
          "extract_links": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Attach hyperlink URLs from PDF annotations to OCR results. Defaults to `false`."
          },
          "extract_strikethrough": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Preserve strikethrough formatting in HTML/Markdown output. Defaults to `false`."
          },
          "file_name": {
            "type": "string",
            "description": "File name with extension. Required. Determines content-type."
          },
          "layout_analysis": {
            "type": [
              "string",
              "null"
            ],
            "description": "Layout analysis strategy: `smart_layout_detection` (default), `page_by_page`,\nor `advanced_layout_detection` (higher-accuracy layout detection for complex\npages — multi-column layouts, dense tables/figures; slower than the default)."
          },
          "segmentation_version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Segmentation model version: `v1` (default) or `v2`.\n`v2` is form-aware and additionally returns `KeyValuePair`, `Signature`, and `Seal`\nsegments. Unrecognized values fall back to `v1`.",
            "enum": [
              "v1",
              "v2",
              null
            ]
          },
          "llm_processing": {
            "description": "JSON object for LLM processing configuration."
          },
          "merge_batch_size": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Maximum number of tables per merge group. Groups larger than this are split. Defaults to 20."
          },
          "merge_tables": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Merge tables that span multiple pages into a single unified structure. Defaults to `false`."
          },
          "ocr_engine": {
            "type": [
              "string",
              "null"
            ],
            "description": "OCR engine: `UnsiloedHawk` (default, recommended), `UnsiloedBeta`, or `UnsiloedStorm`."
          },
          "ocr_strategy": {
            "type": [
              "string",
              "null"
            ],
            "description": "OCR strategy: `auto_detection` (default) or `force_ocr`."
          },
          "output_fields": {
            "description": "JSON object filtering which fields appear on each segment / chunk.\nEach key defaults to `true`; set a key to `false` to drop the field.\nKeys: `bbox`, `chart_data`, `confidence`, `content`, `embed`, `html`,\n`image`, `markdown`, `ocr`. Ignored when `response_profile` is `slim`\nor `full`."
          },
          "page_range": {
            "type": [
              "string",
              "null"
            ],
            "description": "Page range to process. Formats: `\"1-5\"`, `\"2,4,6\"`, `\"[1,3,5]\"`. Defaults to all pages."
          },
          "pii_block_severity": {
            "type": [
              "string",
              "null"
            ],
            "description": "Severity threshold at which a detected PII finding blocks the task.\nIgnored when `detect_pii` is `false`. Findings strictly below the threshold\nare allowed through; findings at or above it reject the task.\n- `any` (default) — block on any detection, regardless of severity.\n- `low` — block on low, medium, or high severity findings.\n- `medium` — block on medium or high severity findings.\n- `high` — block only on high severity findings.",
            "default": "any"
          },
          "pii_engine": {
            "type": [
              "string",
              "null"
            ],
            "description": "PII detector engine to use when `detect_pii` is `true`. Ignored otherwise.\n- `standard` (default) — fast pattern-based detector; low latency,\n  well-suited to bulk pre-screening.\n- `advanced` — model-based detector; slower but catches contextual\n  cases that pattern matching misses (e.g. handwritten names,\n  partially redacted IDs, document-style references to a person).",
            "default": "standard"
          },
          "response_profile": {
            "type": [
              "string",
              "null"
            ],
            "description": "Response shape selector: `slim`, `full`, or `custom`.\n- `slim`: chunk `embed` + bbox + page_number + segment_id +\n  segment_type + HTML for tables / Markdown otherwise. Drops\n  content/image/ocr/confidence/chart_data/page_height/page_width.\n- `full`: every field returned (equivalent to omitting this param).\n- `custom`: honor `output_fields` verbatim.\n\nWhen both `response_profile` and `output_fields` are provided, the\nprofile wins.",
            "example": "slim"
          },
          "segment_filter": {
            "type": [
              "string",
              "null"
            ],
            "description": "Segment filter: comma-separated segment types to keep, or \"all\". Defaults to `\"all\"`."
          },
          "segment_processing": {
            "description": "JSON object for segment processing/analysis configuration."
          },
          "segment_type_naming": {
            "type": [
              "string",
              "null"
            ],
            "description": "Segment type naming convention: `Unsiloed` (default) or `Other`."
          },
          "use_high_resolution": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Use high-resolution images for cropping and post-processing. Defaults to `true`."
          },
          "validate_segments": {
            "description": "JSON array of segment types to validate with VLM. Example: `[\"Table\",\"Formula\"]`."
          },
          "validate_table_segments": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Legacy: validate table segments using VLM. Prefer `validate_segments` instead."
          },
          "xml_citation": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Extract and hyperlink bibliography citations in the markdown output. Defaults to `false`."
          }
        }
      },
      "PresignedUploadResponse": {
        "type": "object",
        "description": "Response from POST /v2/parse/upload.",
        "required": [
          "job_id",
          "upload_url",
          "expires_at",
          "upload_method",
          "upload_headers",
          "credit_used",
          "quota_remaining"
        ],
        "properties": {
          "credit_used": {
            "type": "integer",
            "format": "int32",
            "description": "Number of page credits deducted (initial reservation, reconciled on upload)."
          },
          "expires_at": {
            "type": "string",
            "description": "RFC 3339 timestamp when upload_url expires."
          },
          "job_id": {
            "type": "string",
            "description": "Use this ID to poll GET /parse/{job_id} for status."
          },
          "quota_remaining": {
            "type": "integer",
            "format": "int32",
            "description": "Remaining page credits after deduction."
          },
          "upload_headers": {
            "type": "object",
            "description": "Headers the client MUST include in the PUT request.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "upload_method": {
            "type": "string",
            "description": "Always \"PUT\"."
          },
          "upload_url": {
            "type": "string",
            "description": "S3 presigned PUT URL. Valid until expires_at."
          }
        }
      },
      "ResponseProfile": {
        "type": "string",
        "description": "High-level response shape selector. Optional. When set, it overrides\n`OutputFieldsConfig` (the profile wins).\n\n- `Slim`: chunk `embed` + bbox + `segment_id` + `segment_type` +\n  `page_number` + one representation per segment (HTML for `Table`,\n  Markdown otherwise). Drops `content`, `image`, `ocr`, `confidence`,\n  `chart_data`, `page_height`, `page_width`, and null `references`.\n- `Full`: every field returned. `output_fields` is ignored.\n- `Custom`: honor the caller's `OutputFieldsConfig` verbatim.",
        "enum": [
          "slim",
          "full",
          "custom"
        ],
        "example": "slim"
      },
      "Segment": {
        "type": "object",
        "required": [
          "content",
          "html",
          "markdown",
          "page_height",
          "page_width",
          "page_number",
          "segment_id",
          "segment_type"
        ],
        "properties": {
          "bbox": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/BoundingBox"
              }
            ]
          },
          "cell_references": {
            "type": [
              "array",
              "null"
            ],
            "items": {},
            "description": "Spreadsheet cell-range references ({ sheet, address, ref }) for Excel\nsegments. Distinct from `references` (GROBID citations) so the two\nconcepts never collide in the output or on the frontend."
          },
          "chart_data": {
            "description": "Extracted chart data for Picture segments identified as charts.\nContains structured data including chart_type, data series, labels, and legend."
          },
          "confidence": {
            "type": [
              "number",
              "null"
            ],
            "format": "float",
            "description": "Confidence score of the layout analysis model"
          },
          "content": {
            "type": "string",
            "description": "Text content of the segment. By default, this contains OCR-extracted text.\nThe source can be configured via the `content_source` field in segment processing configuration\nto use HTML, Markdown, or LLM representation instead."
          },
          "html": {
            "type": "string",
            "description": "HTML representation of the segment."
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "description": "Presigned URL to the image of the segment."
          },
          "markdown": {
            "type": "string",
            "description": "Markdown representation of the segment."
          },
          "merged_page_bboxes": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/PageBBox"
            },
            "description": "Per-page bbox info for all pages of a merged multi-page table.\nOnly present on merged table segments (segment_id ends with \"_merged\")."
          },
          "ocr": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/OCRResult"
            },
            "description": "OCR results for the segment."
          },
          "page_height": {
            "type": "number",
            "format": "float",
            "description": "Height of the page containing the segment."
          },
          "page_number": {
            "type": "integer",
            "format": "int32",
            "description": "Page number of the segment.",
            "minimum": 0
          },
          "page_width": {
            "type": "number",
            "format": "float",
            "description": "Width of the page containing the segment."
          },
          "references": {
            "type": [
              "array",
              "null"
            ],
            "items": {},
            "description": "GROBID research-paper citations attached to this segment."
          },
          "segment_id": {
            "type": "string",
            "description": "Unique identifier for the segment."
          },
          "segment_type": {
            "$ref": "#/components/schemas/SegmentType"
          },
          "segment_type_display": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display name for the segment type (used for serialization based on naming convention)"
          }
        }
      },
      "SegmentProcessing": {
        "type": "object",
        "properties": {
          "Caption": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AutoGenerationConfig"
              }
            ]
          },
          "Footnote": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AutoGenerationConfig"
              }
            ]
          },
          "Formula": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LlmGenerationConfig"
              }
            ]
          },
          "ListItem": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AutoGenerationConfig"
              }
            ]
          },
          "Page": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LlmGenerationConfig"
              }
            ]
          },
          "PageFooter": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AutoGenerationConfig"
              }
            ]
          },
          "PageHeader": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AutoGenerationConfig"
              }
            ]
          },
          "Picture": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PictureGenerationConfig"
              }
            ]
          },
          "SectionHeader": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AutoGenerationConfig"
              }
            ]
          },
          "Table": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LlmGenerationConfig"
              }
            ]
          },
          "Text": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AutoGenerationConfig"
              }
            ]
          },
          "Title": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AutoGenerationConfig"
              }
            ]
          }
        }
      },
      "SegmentType": {
        "type": "string",
        "description": "All the possible types for a segment.\nNote: Different configurations will produce different types.\nPlease refer to the documentation for more information.",
        "enum": [
          "Caption",
          "Footnote",
          "Formula",
          "KeyValuePair",
          "ListItem",
          "Page",
          "PageFooter",
          "PageHeader",
          "Picture",
          "Seal",
          "SectionHeader",
          "Signature",
          "Table",
          "Text",
          "Title"
        ]
      },
      "SegmentTypeNamingConvention": {
        "type": "string",
        "description": "Controls the naming convention for segment types in the output:\n- `Unsiloed`: Uses Unsiloed naming convention (e.g., `PageHeader`, `PageFooter`, `SectionHeader`, `ListItem`, `Picture`)\n- `Other`: Uses alternative naming convention (e.g., `Header`, `Footer`, `Section Header`, `List Item`, `Figure`)",
        "enum": [
          "Unsiloed",
          "Other"
        ]
      },
      "SegmentationStrategy": {
        "type": "string",
        "description": "Controls the segmentation strategy:\n- `LayoutAnalysis` (wire value `smart_layout_detection`): Analyzes pages for layout\n  elements (e.g., `Table`, `Picture`, `Formula`, etc.) using bounding boxes. Provides\n  fine-grained segmentation and better chunking. (Latency penalty: ~TBD seconds per page).\n- `Page` (wire value `page_by_page`): Treats each page as a single segment. Faster\n  processing, but without layout element detection and only simple chunking.\n- `AdvancedLayoutAnalysis` (wire value `advanced_layout_detection`): Higher-accuracy\n  layout detection for complex pages (multi-column layouts, dense tables/figures);\n  slower than `LayoutAnalysis`.",
        "enum": [
          "smart_layout_detection",
          "page_by_page",
          "advanced_layout_detection"
        ]
      },
      "SegmentationVersion": {
        "type": "string",
        "description": "Segmentation model version selected per request.\n- `v1` (default): the standard layout model (11 core element types).\n- `v2`: a form-aware layout model that additionally returns `KeyValuePair`,\n  `Signature`, and `Seal` segments.\n\nUnrecognized values fall back to `v1`.",
        "enum": [
          "v1",
          "v2"
        ],
        "default": "v1"
      },
      "Status": {
        "type": "string",
        "description": "The status of the task.",
        "enum": [
          "Starting",
          "AwaitingUpload",
          "Queued",
          "Processing",
          "Succeeded",
          "Failed",
          "Cancelled"
        ]
      },
      "TaskResponse": {
        "type": "object",
        "required": [
          "configuration",
          "created_at",
          "message",
          "status",
          "task_id"
        ],
        "properties": {
          "configuration": {
            "$ref": "#/components/schemas/Configuration"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "The date and time when the task was created and queued."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The date and time when the task will expire."
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The date and time when the task was finished."
          },
          "message": {
            "type": "string",
            "description": "A message describing the task's status or any errors that occurred."
          },
          "output": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OutputResponse"
              }
            ]
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The date and time when the task was started."
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          },
          "task_id": {
            "type": "string",
            "description": "The unique identifier for the task."
          },
          "task_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The presigned URL of the task."
          }
        }
      },
      "TextColor": {
        "type": "object",
        "description": "Text color in RGB format",
        "required": [
          "r",
          "g",
          "b",
          "hex"
        ],
        "properties": {
          "b": {
            "type": "integer",
            "format": "int32"
          },
          "g": {
            "type": "integer",
            "format": "int32"
          },
          "hex": {
            "type": "string"
          },
          "r": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "Tokenizer": {
        "type": "string",
        "description": "Common tokenizers used for text processing.",
        "enum": [
          "Word",
          "Cl100kBase",
          "XlmRobertaBase",
          "BertBaseUncased"
        ]
      },
      "TokenizerType": {
        "oneOf": [
          {
            "type": "object",
            "description": "Use one of the predefined tokenizer types",
            "required": [
              "Enum"
            ],
            "properties": {
              "Enum": {
                "$ref": "#/components/schemas/Tokenizer",
                "description": "Use one of the predefined tokenizer types"
              }
            }
          },
          {
            "type": "object",
            "description": "Use a custom tokenizer by specifying its model ID",
            "required": [
              "String"
            ],
            "properties": {
              "String": {
                "type": "string",
                "description": "Use a custom tokenizer by specifying its model ID"
              }
            }
          }
        ],
        "description": "Specifies which tokenizer to use for the chunking process.\n\nThis type supports two ways of specifying a tokenizer:\n1. Using a predefined tokenizer from the `Tokenizer` enum\n2. Using a custom tokenizer by providing its model ID as a string"
      },
      "TranslationConfig": {
        "type": "object",
        "required": [
          "target_language",
          "provider"
        ],
        "properties": {
          "model_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional model ID for VLM/LLM provider. If not specified, uses the default model."
          },
          "prompt": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional custom prompt for VLM/LLM provider. Appended to the system prompt\nto give the model additional translation instructions."
          },
          "provider": {
            "$ref": "#/components/schemas/TranslationProvider",
            "description": "Translation provider: \"Auto\" (or legacy \"Google\") for fast machine translation,\n\"VLM\" or \"LLM\" for LLM/VLM-based translation."
          },
          "target_language": {
            "type": "string",
            "description": "Target language code (ISO 639-1, e.g. \"en\", \"es\", \"fr\", \"ko\").\nUse \"auto\" to auto-detect source language and translate to English."
          }
        }
      },
      "TranslationProvider": {
        "type": "string",
        "enum": [
          "Auto",
          "VLM"
        ]
      }
    },
    "securitySchemes": {
      "api_key": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key for authentication. Use 'Bearer <your_api_key>'"
      }
    }
  },
  "tags": [
    {
      "name": "Parse v2 (Presigned Upload)",
      "description": "Direct upload — no server buffering"
    }
  ]
}
